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

Unified Diff: src/compiler/bytecode-graph-builder.cc

Issue 2471033004: [ignition,modules] Introduce bytecodes for loading/storing module variables. (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/bailout-reason.h ('k') | src/interpreter/bytecode-array-builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/bytecode-graph-builder.cc
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc
index ab7db8079b69fd99590931e62890f12226094a6f..60ecd99af19ba3f5b1241fbffd13bada3b4abf80 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -1138,6 +1138,25 @@ void BytecodeGraphBuilder::VisitStaKeyedPropertyStrict() {
BuildKeyedStore(LanguageMode::STRICT);
}
+void BytecodeGraphBuilder::VisitLdaModuleVariable() {
+ // TODO(neis): Don't call the runtime.
+ PrepareEagerCheckpoint();
+ Node* index = jsgraph()->Constant(bytecode_iterator().GetImmediateOperand(0));
+ const Operator* op = javascript()->CallRuntime(Runtime::kLoadModuleVariable);
+ Node* value = NewNode(op, index);
+ environment()->BindAccumulator(value, Environment::kAttachFrameState);
+}
+
+void BytecodeGraphBuilder::VisitStaModuleVariable() {
+ // TODO(neis): Don't call the runtime.
+ PrepareEagerCheckpoint();
+ Node* index = jsgraph()->Constant(bytecode_iterator().GetImmediateOperand(0));
+ Node* value = environment()->LookupAccumulator();
+ const Operator* op = javascript()->CallRuntime(Runtime::kStoreModuleVariable);
+ Node* store = NewNode(op, index, value);
+ environment()->RecordAfterState(store, Environment::kAttachFrameState);
+}
+
void BytecodeGraphBuilder::VisitPushContext() {
Node* new_context = environment()->LookupAccumulator();
environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0),
« no previous file with comments | « src/bailout-reason.h ('k') | src/interpreter/bytecode-array-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698