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 74120095a4f71b73b406133c6cccaa18fd5c143d..6ff5e69a4275ff704f4e5273fac58cd11cb06f32 100644 |
| --- a/src/compiler/bytecode-graph-builder.cc |
| +++ b/src/compiler/bytecode-graph-builder.cc |
| @@ -586,6 +586,11 @@ void BytecodeGraphBuilder::VisitLdaUndefined() { |
| environment()->BindAccumulator(node); |
| } |
| +void BytecodeGraphBuilder::VisitLdrUndefined() { |
| + Node* node = jsgraph()->UndefinedConstant(); |
| + environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0), node); |
| +} |
| + |
| void BytecodeGraphBuilder::VisitLdaNull() { |
| Node* node = jsgraph()->NullConstant(); |
| environment()->BindAccumulator(node); |
| @@ -623,25 +628,32 @@ void BytecodeGraphBuilder::VisitMov() { |
| environment()->BindRegister(bytecode_iterator().GetRegisterOperand(1), value); |
| } |
| -void BytecodeGraphBuilder::BuildLoadGlobal( |
| - TypeofMode typeof_mode) { |
| - FrameStateBeforeAndAfter states(this); |
| +Node* BytecodeGraphBuilder::BuildLoadGlobal(TypeofMode typeof_mode) { |
| Handle<Name> name = |
| Handle<Name>::cast(bytecode_iterator().GetConstantForIndexOperand(0)); |
| VectorSlotPair feedback = |
| CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(1)); |
| - |
| const Operator* op = javascript()->LoadGlobal(name, feedback, typeof_mode); |
| - Node* node = NewNode(op, GetFunctionClosure()); |
| - environment()->BindAccumulator(node, &states); |
| + return NewNode(op, GetFunctionClosure()); |
| } |
| void BytecodeGraphBuilder::VisitLdaGlobal() { |
| - BuildLoadGlobal(TypeofMode::NOT_INSIDE_TYPEOF); |
| + FrameStateBeforeAndAfter states(this); |
| + Node* node = BuildLoadGlobal(TypeofMode::NOT_INSIDE_TYPEOF); |
| + environment()->BindAccumulator(node, &states); |
| } |
| void BytecodeGraphBuilder::VisitLdaGlobalInsideTypeof() { |
| - BuildLoadGlobal(TypeofMode::INSIDE_TYPEOF); |
| + FrameStateBeforeAndAfter states(this); |
| + Node* node = BuildLoadGlobal(TypeofMode::INSIDE_TYPEOF); |
| + environment()->BindAccumulator(node, &states); |
| +} |
| + |
| +void BytecodeGraphBuilder::VisitLdrGlobal() { |
|
rmcilroy
2016/05/24 10:53:56
nit - move below VisitLdaGlobal
oth
2016/05/24 13:37:12
Done.
|
| + FrameStateBeforeAndAfter states(this); |
| + Node* node = BuildLoadGlobal(TypeofMode::INSIDE_TYPEOF); |
|
rmcilroy
2016/05/24 10:53:56
This should be NOT_INSIDE_OF_TYPEOF.
oth
2016/05/24 13:37:12
Done. Ouch, thanks!
|
| + environment()->BindRegister(bytecode_iterator().GetRegisterOperand(2), node, |
| + &states); |
| } |
| void BytecodeGraphBuilder::BuildStoreGlobal(LanguageMode language_mode) { |
| @@ -665,7 +677,7 @@ void BytecodeGraphBuilder::VisitStaGlobalStrict() { |
| BuildStoreGlobal(LanguageMode::STRICT); |
| } |
| -void BytecodeGraphBuilder::VisitLdaContextSlot() { |
| +Node* BytecodeGraphBuilder::BuildLoadContextSlot() { |
| // 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. |
| @@ -676,10 +688,19 @@ void BytecodeGraphBuilder::VisitLdaContextSlot() { |
| 0, bytecode_iterator().GetIndexOperand(1), false); |
| Node* context = |
| environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
| - Node* node = NewNode(op, context); |
| + return NewNode(op, context); |
| +} |
| + |
| +void BytecodeGraphBuilder::VisitLdaContextSlot() { |
| + Node* node = BuildLoadContextSlot(); |
| environment()->BindAccumulator(node); |
| } |
| +void BytecodeGraphBuilder::VisitLdrContextSlot() { |
| + Node* node = BuildLoadContextSlot(); |
| + environment()->BindRegister(bytecode_iterator().GetRegisterOperand(2), node); |
| +} |
| + |
| void BytecodeGraphBuilder::VisitStaContextSlot() { |
| // TODO(mythria): LoadContextSlots are unrolled by the required depth when |
| // generating bytecode. Hence the value of depth is always 0. Update this |
| @@ -732,8 +753,7 @@ void BytecodeGraphBuilder::VisitStaLookupSlotStrict() { |
| BuildStaLookupSlot(LanguageMode::STRICT); |
| } |
| -void BytecodeGraphBuilder::BuildNamedLoad() { |
| - FrameStateBeforeAndAfter states(this); |
| +Node* BytecodeGraphBuilder::BuildNamedLoad() { |
| Node* object = |
| environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
| Handle<Name> name = |
| @@ -742,14 +762,23 @@ void BytecodeGraphBuilder::BuildNamedLoad() { |
| CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(2)); |
| const Operator* op = javascript()->LoadNamed(name, feedback); |
| - Node* node = NewNode(op, object, GetFunctionClosure()); |
| - environment()->BindAccumulator(node, &states); |
| + return NewNode(op, object, GetFunctionClosure()); |
| } |
| -void BytecodeGraphBuilder::VisitLoadIC() { BuildNamedLoad(); } |
| +void BytecodeGraphBuilder::VisitLoadIC() { |
| + FrameStateBeforeAndAfter states(this); |
| + Node* node = BuildNamedLoad(); |
| + environment()->BindAccumulator(node, &states); |
| +} |
| -void BytecodeGraphBuilder::BuildKeyedLoad() { |
| +void BytecodeGraphBuilder::VisitLdrNamedProperty() { |
| FrameStateBeforeAndAfter states(this); |
| + Node* node = BuildNamedLoad(); |
| + environment()->BindRegister(bytecode_iterator().GetRegisterOperand(3), node, |
| + &states); |
| +} |
| + |
| +Node* BytecodeGraphBuilder::BuildKeyedLoad() { |
| Node* key = environment()->LookupAccumulator(); |
| Node* object = |
| environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
| @@ -757,11 +786,21 @@ void BytecodeGraphBuilder::BuildKeyedLoad() { |
| CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(1)); |
| const Operator* op = javascript()->LoadProperty(feedback); |
| - Node* node = NewNode(op, object, key, GetFunctionClosure()); |
| + return NewNode(op, object, key, GetFunctionClosure()); |
| +} |
| + |
| +void BytecodeGraphBuilder::VisitKeyedLoadIC() { |
| + FrameStateBeforeAndAfter states(this); |
| + Node* node = BuildKeyedLoad(); |
| environment()->BindAccumulator(node, &states); |
| } |
| -void BytecodeGraphBuilder::VisitKeyedLoadIC() { BuildKeyedLoad(); } |
| +void BytecodeGraphBuilder::VisitLdrKeyedProperty() { |
| + FrameStateBeforeAndAfter states(this); |
| + Node* node = BuildKeyedLoad(); |
| + environment()->BindRegister(bytecode_iterator().GetRegisterOperand(2), node, |
| + &states); |
| +} |
| void BytecodeGraphBuilder::BuildNamedStore(LanguageMode language_mode) { |
| FrameStateBeforeAndAfter states(this); |