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

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

Issue 2489863003: [compiler,modules] Introduce JS operators for module loads and stores. (Closed)
Patch Set: Remove unused variable. 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/compiler/access-builder.cc ('k') | src/compiler/js-generic-lowering.cc » ('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 b5b077e6ed7491c25091d1638ce1d0ed132748c2..d4e6c1d0d8cace59fdb14b0d45b5175f6f2b82a1 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -1117,22 +1117,23 @@ void BytecodeGraphBuilder::VisitStaKeyedPropertyStrict() {
}
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);
+ int32_t cell_index = bytecode_iterator().GetImmediateOperand(0);
+ uint32_t depth = bytecode_iterator().GetUnsignedImmediateOperand(1);
+ Node* module =
+ NewNode(javascript()->LoadContext(depth, Context::EXTENSION_INDEX, false),
+ environment()->Context());
+ Node* value = NewNode(javascript()->LoadModule(cell_index), module);
+ environment()->BindAccumulator(value);
}
void BytecodeGraphBuilder::VisitStaModuleVariable() {
- // TODO(neis): Don't call the runtime.
- PrepareEagerCheckpoint();
- Node* index = jsgraph()->Constant(bytecode_iterator().GetImmediateOperand(0));
+ int32_t cell_index = bytecode_iterator().GetImmediateOperand(0);
+ uint32_t depth = bytecode_iterator().GetUnsignedImmediateOperand(1);
+ Node* module =
+ NewNode(javascript()->LoadContext(depth, Context::EXTENSION_INDEX, false),
+ environment()->Context());
Node* value = environment()->LookupAccumulator();
- const Operator* op = javascript()->CallRuntime(Runtime::kStoreModuleVariable);
- Node* store = NewNode(op, index, value);
- environment()->RecordAfterState(store, Environment::kAttachFrameState);
+ NewNode(javascript()->StoreModule(cell_index), module, value);
}
void BytecodeGraphBuilder::VisitPushContext() {
« no previous file with comments | « src/compiler/access-builder.cc ('k') | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698