Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: src/ast/variables.h

Issue 2263523002: Add some scope-related DCHECKs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/ast/variables.h
diff --git a/src/ast/variables.h b/src/ast/variables.h
index e1ac44616e85e01de42025a18e754fabda9f373a..f1f63b8a14cb8f9bf151dc3e2c7f9db248995486 100644
--- a/src/ast/variables.h
+++ b/src/ast/variables.h
@@ -43,6 +43,7 @@ class Variable final : public ZoneObject {
return force_context_allocation_;
}
void ForceContextAllocation() {
+ DCHECK(IsUnallocated() || IsContextSlot());
Toon Verwaest 2016/08/19 12:48:52 This is surprising. I'd hope we wouldn't call Forc
force_context_allocation_ = true;
}
bool is_used() { return is_used_; }
@@ -96,6 +97,7 @@ class Variable final : public ZoneObject {
}
void AllocateTo(VariableLocation location, int index) {
+ DCHECK(IsUnallocated() || (location_ == location && index_ == index));
Toon Verwaest 2016/08/19 12:48:52 Same here...
location_ = location;
index_ = index;
}

Powered by Google App Engine
This is Rietveld 408576698