Chromium Code Reviews| Index: src/compiler/bytecode-graph-builder.cc | 
| diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc | 
| index 2c2ec998d72dacb93c13b79a3eb29d5fc5b0ab8b..76c3d8c1032ff9b055c99b5db3fe48a4aa42fb94 100644 | 
| --- a/src/compiler/bytecode-graph-builder.cc | 
| +++ b/src/compiler/bytecode-graph-builder.cc | 
| @@ -732,7 +732,7 @@ void BytecodeGraphBuilder::VisitStaLookupSlotStrict() { | 
| BuildStaLookupSlot(LanguageMode::STRICT); | 
| } | 
| -void BytecodeGraphBuilder::BuildNamedLoad() { | 
| +void BytecodeGraphBuilder::VisitLdaNamedProperty() { | 
| FrameStateBeforeAndAfter states(this); | 
| Node* object = | 
| environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | 
| @@ -746,9 +746,7 @@ void BytecodeGraphBuilder::BuildNamedLoad() { | 
| environment()->BindAccumulator(node, &states); | 
| } | 
| -void BytecodeGraphBuilder::VisitLoadIC() { BuildNamedLoad(); } | 
| - | 
| -void BytecodeGraphBuilder::BuildKeyedLoad() { | 
| +void BytecodeGraphBuilder::VisitLdaKeyedProperty() { | 
| FrameStateBeforeAndAfter states(this); | 
| Node* key = environment()->LookupAccumulator(); | 
| Node* object = | 
| @@ -761,8 +759,6 @@ void BytecodeGraphBuilder::BuildKeyedLoad() { | 
| environment()->BindAccumulator(node, &states); | 
| } | 
| -void BytecodeGraphBuilder::VisitKeyedLoadIC() { BuildKeyedLoad(); } | 
| - | 
| void BytecodeGraphBuilder::BuildNamedStore(LanguageMode language_mode) { | 
| FrameStateBeforeAndAfter states(this); | 
| Node* value = environment()->LookupAccumulator(); | 
| @@ -778,11 +774,11 @@ void BytecodeGraphBuilder::BuildNamedStore(LanguageMode language_mode) { | 
| environment()->RecordAfterState(node, &states); | 
| } | 
| -void BytecodeGraphBuilder::VisitStoreICSloppy() { | 
| +void BytecodeGraphBuilder::VisitStaNamedPropertySloppy() { | 
| BuildNamedStore(LanguageMode::SLOPPY); | 
| } | 
| -void BytecodeGraphBuilder::VisitStoreICStrict() { | 
| +void BytecodeGraphBuilder::VisitStaNamedPropertyStrict() { | 
| BuildNamedStore(LanguageMode::STRICT); | 
| } | 
| @@ -801,11 +797,11 @@ void BytecodeGraphBuilder::BuildKeyedStore(LanguageMode language_mode) { | 
| environment()->RecordAfterState(node, &states); | 
| } | 
| -void BytecodeGraphBuilder::VisitKeyedStoreICSloppy() { | 
| +void BytecodeGraphBuilder::VisitStaKeyedPropertySloppy() { | 
| BuildKeyedStore(LanguageMode::SLOPPY); | 
| } | 
| -void BytecodeGraphBuilder::VisitKeyedStoreICStrict() { | 
| +void BytecodeGraphBuilder::VisitStaKeyedPropertyStrict() { | 
| BuildKeyedStore(LanguageMode::STRICT); | 
| } | 
| @@ -1425,6 +1421,69 @@ void BytecodeGraphBuilder::VisitIllegal() { | 
| void BytecodeGraphBuilder::VisitNop() {} | 
| +void BytecodeGraphBuilder::VisitLdrUndefined() { | 
| + Node* node = jsgraph()->UndefinedConstant(); | 
| + environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0), node); | 
| +} | 
| + | 
| +void BytecodeGraphBuilder::VisitLdrContextSlot() { | 
| + // TODO(mythria): LoadContextSlots are unrolled by the required depth when | 
| + // generating bytecode. Hence the value of depth is always 0. Update this | 
| + // code, when the implementation changes. | 
| + // 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(1), false); | 
| + Node* context = | 
| + environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | 
| + Node* node = NewNode(op, context); | 
| 
 
rmcilroy
2016/05/17 15:49:33
Could we factor out the common code to a BuildXXX(
 
oth
2016/05/18 20:22:24
Done.
 
 | 
| + environment()->BindRegister(bytecode_iterator().GetRegisterOperand(2), node); | 
| +} | 
| + | 
| +void BytecodeGraphBuilder::VisitLdrGlobal() { | 
| + FrameStateBeforeAndAfter states(this); | 
| + Handle<Name> name = | 
| + Handle<Name>::cast(bytecode_iterator().GetConstantForIndexOperand(0)); | 
| + VectorSlotPair feedback = | 
| + CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(1)); | 
| + | 
| + const Operator* op = | 
| + javascript()->LoadGlobal(name, feedback, TypeofMode::NOT_INSIDE_TYPEOF); | 
| + Node* node = NewNode(op, GetFunctionClosure()); | 
| + environment()->BindRegister(bytecode_iterator().GetRegisterOperand(2), node, | 
| + &states); | 
| +} | 
| + | 
| +void BytecodeGraphBuilder::VisitLdrNamedProperty() { | 
| + FrameStateBeforeAndAfter states(this); | 
| + Node* object = | 
| + environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | 
| + Handle<Name> name = | 
| + Handle<Name>::cast(bytecode_iterator().GetConstantForIndexOperand(1)); | 
| + VectorSlotPair feedback = | 
| + CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(2)); | 
| + | 
| + const Operator* op = javascript()->LoadNamed(name, feedback); | 
| + Node* node = NewNode(op, object, GetFunctionClosure()); | 
| + environment()->BindRegister(bytecode_iterator().GetRegisterOperand(3), node, | 
| + &states); | 
| +} | 
| + | 
| +void BytecodeGraphBuilder::VisitLdrKeyedProperty() { | 
| + FrameStateBeforeAndAfter states(this); | 
| + Node* key = environment()->LookupAccumulator(); | 
| + Node* object = | 
| + environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | 
| + VectorSlotPair feedback = | 
| + CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(1)); | 
| + | 
| + const Operator* op = javascript()->LoadProperty(feedback); | 
| + Node* node = NewNode(op, object, key, GetFunctionClosure()); | 
| + environment()->BindRegister(bytecode_iterator().GetRegisterOperand(2), node, | 
| + &states); | 
| +} | 
| + | 
| void BytecodeGraphBuilder::SwitchToMergeEnvironment(int current_offset) { | 
| if (merge_environments_[current_offset] != nullptr) { | 
| if (environment() != nullptr) { |