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

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 2438653003: [modules] Fix bugs in assignments to exported variables. (Closed)
Patch Set: Rebase. Created 4 years, 2 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
« no previous file with comments | « no previous file | test/mjsunit/modules-init3.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index 7844d217830d7c3e6492cd84203802cb8124baf3..84d8f8149330ceaf7814eafaad0e3502b99f6c2d 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -2042,8 +2042,14 @@ void BytecodeGenerator::BuildVariableAssignment(Variable* variable,
builder()
->StoreAccumulatorInRegister(args[1])
.LoadLiteral(it->second->export_name->string())
- .StoreAccumulatorInRegister(args[0])
- .CallRuntime(Runtime::kStoreModuleExport, args);
+ .StoreAccumulatorInRegister(args[0]);
+ if (needs_hole_check) {
+ builder()->CallRuntime(Runtime::kLoadModuleExport, args[0]);
+ BuildHoleCheckForVariableAssignment(variable, op);
+ }
+ builder()
+ ->CallRuntime(Runtime::kStoreModuleExport, args)
+ .LoadAccumulatorWithRegister(args[1]);
break;
}
}
« no previous file with comments | « no previous file | test/mjsunit/modules-init3.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698