Index: src/compiler/bytecode-graph-builder.cc |
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc |
index d9f52a61b76ad03a381b3fbab4645ef6013da33c..4b2abad3dd3d23c579541519cb08314355494451 100644 |
--- a/src/compiler/bytecode-graph-builder.cc |
+++ b/src/compiler/bytecode-graph-builder.cc |
@@ -770,9 +770,6 @@ void BytecodeGraphBuilder::VisitStaDataPropertyInLiteral() { |
} |
void BytecodeGraphBuilder::VisitLdaContextSlot() { |
- // 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( |
bytecode_iterator().GetUnsignedImmediateOperand(2), |
bytecode_iterator().GetIndexOperand(1), false); |
@@ -783,16 +780,31 @@ void BytecodeGraphBuilder::VisitLdaContextSlot() { |
environment()->BindAccumulator(node); |
} |
+void BytecodeGraphBuilder::VisitLdaImmutableContextSlot() { |
+ const Operator* op = javascript()->LoadContext( |
+ bytecode_iterator().GetUnsignedImmediateOperand(2), |
+ bytecode_iterator().GetIndexOperand(1), true); |
+ Node* node = NewNode(op); |
+ Node* context = |
+ environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
+ NodeProperties::ReplaceContextInput(node, context); |
+ environment()->BindAccumulator(node); |
+} |
+ |
void BytecodeGraphBuilder::VisitLdaCurrentContextSlot() { |
- // 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* node = NewNode(op); |
environment()->BindAccumulator(node); |
} |
+void BytecodeGraphBuilder::VisitLdaImmutableCurrentContextSlot() { |
+ const Operator* op = javascript()->LoadContext( |
+ 0, bytecode_iterator().GetIndexOperand(0), true); |
+ Node* node = NewNode(op); |
+ environment()->BindAccumulator(node); |
+} |
+ |
void BytecodeGraphBuilder::VisitStaContextSlot() { |
const Operator* op = javascript()->StoreContext( |
bytecode_iterator().GetUnsignedImmediateOperand(2), |