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

Unified Diff: src/ast/variables.h

Issue 2460233003: [modules] Assign cell indices at validation time. (Closed)
Patch Set: Rebase Created 4 years, 1 month 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
« no previous file with comments | « src/ast/scopes.cc ('k') | src/debug/debug-scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/variables.h
diff --git a/src/ast/variables.h b/src/ast/variables.h
index afde9c507c3263e8991a5891a18ece1762fb5051..723cde874de6e62afae3534c7ddcc2e652f554c7 100644
--- a/src/ast/variables.h
+++ b/src/ast/variables.h
@@ -100,19 +100,16 @@ class Variable final : public ZoneObject {
int index() const { return index_; }
- // Sentinel index values for module exports and imports.
- enum { kModuleExportIndex, kModuleImportIndex };
-
bool IsExport() const {
- DCHECK(location() == VariableLocation::MODULE);
- return index() == kModuleExportIndex;
+ DCHECK_EQ(location(), VariableLocation::MODULE);
+ DCHECK_NE(index(), 0);
+ return index() > 0;
}
void AllocateTo(VariableLocation location, int index) {
DCHECK(IsUnallocated() ||
(this->location() == location && this->index() == index));
- DCHECK_IMPLIES(location == VariableLocation::MODULE,
- index == kModuleExportIndex || index == kModuleImportIndex);
+ DCHECK_IMPLIES(location == VariableLocation::MODULE, index != 0);
bit_field_ = LocationField::update(bit_field_, location);
DCHECK_EQ(location, this->location());
index_ = index;
« no previous file with comments | « src/ast/scopes.cc ('k') | src/debug/debug-scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698