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

Unified Diff: src/ast/scopeinfo.cc

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/modules.cc ('k') | src/ast/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopeinfo.cc
diff --git a/src/ast/scopeinfo.cc b/src/ast/scopeinfo.cc
index b010ab462e7a067b304bb2442ac6fff52d548508..17a4b50366895fb46fd5d768b1c18199ad70d9af 100644
--- a/src/ast/scopeinfo.cc
+++ b/src/ast/scopeinfo.cc
@@ -651,7 +651,7 @@ int ScopeInfo::ModuleIndex(Handle<String> name, VariableMode* mode,
entry += kModuleVariableEntryLength;
}
- return -1;
+ return 0;
}
int ScopeInfo::ContextSlotIndex(Handle<ScopeInfo> scope_info,
@@ -803,6 +803,7 @@ void ScopeInfo::ModuleVariable(int i, String** name, int* index,
}
if (index != nullptr) {
*index = Smi::cast(get(entry + kModuleVariableIndexOffset))->value();
+ DCHECK_NE(*index, 0);
}
if (mode != nullptr) {
*mode = VariableModeField::decode(properties);
@@ -864,13 +865,14 @@ Handle<ModuleInfoEntry> ModuleInfoEntry::New(Isolate* isolate,
Handle<Object> export_name,
Handle<Object> local_name,
Handle<Object> import_name,
- Handle<Object> module_request,
+ int module_request, int cell_index,
int beg_pos, int end_pos) {
Handle<ModuleInfoEntry> result = isolate->factory()->NewModuleInfoEntry();
result->set(kExportNameIndex, *export_name);
result->set(kLocalNameIndex, *local_name);
result->set(kImportNameIndex, *import_name);
- result->set(kModuleRequestIndex, *module_request);
+ result->set(kModuleRequestIndex, Smi::FromInt(module_request));
+ result->set(kCellIndexIndex, Smi::FromInt(cell_index));
result->set(kBegPosIndex, Smi::FromInt(beg_pos));
result->set(kEndPosIndex, Smi::FromInt(end_pos));
return result;
« no previous file with comments | « src/ast/modules.cc ('k') | src/ast/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698