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

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

Issue 2459513002: [ignition] Add bytecodes for loads/stores in the current context (Closed)
Patch Set: s/LocalContext/CurrentContext/g 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 | « src/compiler/bytecode-graph-builder.h ('k') | src/interpreter/bytecode-array-builder.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 865de43e4b214cd2223885937f02fe8556058f2d..6f7b374a7599eae1e15008d684b5c0b6fd0f02af 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -809,16 +809,36 @@ Node* BytecodeGraphBuilder::BuildLoadContextSlot() {
return NewNode(op, context);
}
+Node* BytecodeGraphBuilder::BuildLoadCurrentContextSlot() {
+ // TODO(mythria): immutable flag is also set to false. This information is not
+ // available in bytecode array. update this code when the implementation
+ // changes.
+ const Operator* op = javascript()->LoadContext(
+ 0, bytecode_iterator().GetIndexOperand(0), false);
+ Node* context = environment()->Context();
+ return NewNode(op, context);
+}
+
void BytecodeGraphBuilder::VisitLdaContextSlot() {
Node* node = BuildLoadContextSlot();
environment()->BindAccumulator(node);
}
+void BytecodeGraphBuilder::VisitLdaCurrentContextSlot() {
+ Node* node = BuildLoadCurrentContextSlot();
+ environment()->BindAccumulator(node);
+}
+
void BytecodeGraphBuilder::VisitLdrContextSlot() {
Node* node = BuildLoadContextSlot();
environment()->BindRegister(bytecode_iterator().GetRegisterOperand(3), node);
}
+void BytecodeGraphBuilder::VisitLdrCurrentContextSlot() {
+ Node* node = BuildLoadCurrentContextSlot();
+ environment()->BindRegister(bytecode_iterator().GetRegisterOperand(1), node);
+}
+
void BytecodeGraphBuilder::VisitStaContextSlot() {
const Operator* op = javascript()->StoreContext(
bytecode_iterator().GetUnsignedImmediateOperand(2),
@@ -829,6 +849,14 @@ void BytecodeGraphBuilder::VisitStaContextSlot() {
NewNode(op, context, value);
}
+void BytecodeGraphBuilder::VisitStaCurrentContextSlot() {
+ const Operator* op =
+ javascript()->StoreContext(0, bytecode_iterator().GetIndexOperand(0));
+ Node* context = environment()->Context();
+ Node* value = environment()->LookupAccumulator();
+ NewNode(op, context, value);
+}
+
void BytecodeGraphBuilder::BuildLdaLookupSlot(TypeofMode typeof_mode) {
PrepareEagerCheckpoint();
Node* name =
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/interpreter/bytecode-array-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698