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

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

Issue 2459513002: [ignition] Add bytecodes for loads/stores in the current context (Closed)
Patch Set: 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
Index: src/compiler/bytecode-graph-builder.cc
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc
index 93a2971ed16837801609c32d5dbed6aee2bc28bd..9ad681c3139697ebac2f6e746cdf28177315cb83 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::BuildLoadLocalContextSlot() {
+ // 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::VisitLdaLocalContextSlot() {
+ Node* node = BuildLoadLocalContextSlot();
+ environment()->BindAccumulator(node);
+}
+
void BytecodeGraphBuilder::VisitLdrContextSlot() {
Node* node = BuildLoadContextSlot();
environment()->BindRegister(bytecode_iterator().GetRegisterOperand(3), node);
}
+void BytecodeGraphBuilder::VisitLdrLocalContextSlot() {
+ Node* node = BuildLoadLocalContextSlot();
+ 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::VisitStaLocalContextSlot() {
+ 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 =

Powered by Google App Engine
This is Rietveld 408576698