Skip to content

Commit b47c163

Browse files
GeorgNeisCommit Bot
authored and
Commit Bot
committed
[codegen] Add two DCHECKs
Change-Id: Id2192cb62d6e0920420a3e988593759f5892a0b7 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2254026 Auto-Submit: Georg Neis <[email protected]> Commit-Queue: Nico Hartmann <[email protected]> Reviewed-by: Nico Hartmann <[email protected]> Cr-Commit-Position: refs/heads/master@{#68466}
1 parent 7527169 commit b47c163

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/codegen/assembler.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,16 @@ class JumpOptimizationInfo {
7878
public:
7979
bool is_collecting() const { return stage_ == kCollection; }
8080
bool is_optimizing() const { return stage_ == kOptimization; }
81-
void set_optimizing() { stage_ = kOptimization; }
81+
void set_optimizing() {
82+
DCHECK(is_optimizable());
83+
stage_ = kOptimization;
84+
}
8285

8386
bool is_optimizable() const { return optimizable_; }
84-
void set_optimizable() { optimizable_ = true; }
87+
void set_optimizable() {
88+
DCHECK(is_collecting());
89+
optimizable_ = true;
90+
}
8591

8692
// Used to verify the instruction sequence is always the same in two stages.
8793
size_t hash_code() const { return hash_code_; }

0 commit comments

Comments
 (0)