Chromium Code Reviews| Index: src/compiler/js-generic-lowering.cc |
| diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc |
| index 94b1c4e9da9be2950ffd5099ddc0d33a79e7a730..58e08b1f8237b995a9168531b599a709f0c304a9 100644 |
| --- a/src/compiler/js-generic-lowering.cc |
| +++ b/src/compiler/js-generic-lowering.cc |
| @@ -308,23 +308,11 @@ void JSGenericLowering::LowerJSLoadNamed(Node* node) { |
| void JSGenericLowering::LowerJSLoadGlobal(Node* node) { |
| CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
| const LoadGlobalParameters& p = LoadGlobalParametersOf(node->op()); |
| - if (p.slot_index() >= 0) { |
| - Callable callable = CodeFactory::LoadGlobalViaContext(isolate(), 0); |
| - Node* script_context = node->InputAt(0); |
| - node->ReplaceInput(0, jsgraph()->Int32Constant(p.slot_index())); |
| - node->ReplaceInput(1, script_context); // Set new context... |
| - node->RemoveInput(2); |
| - node->RemoveInput(2); // ...instead of old one. |
| - ReplaceWithStubCall(node, callable, flags); |
| - |
| - } else { |
| - Callable callable = CodeFactory::LoadICInOptimizedCode( |
| - isolate(), p.typeof_mode(), SLOPPY, UNINITIALIZED); |
| - node->RemoveInput(0); // script context |
| - node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); |
| - node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); |
| - ReplaceWithStubCall(node, callable, flags); |
| - } |
| + Callable callable = CodeFactory::LoadICInOptimizedCode( |
| + isolate(), p.typeof_mode(), SLOPPY, UNINITIALIZED); |
| + node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); |
| + node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); |
| + ReplaceWithStubCall(node, callable, flags); |
|
Benedikt Meurer
2015/10/22 05:03:52
Insert the global object here, loading it from the
Igor Sheludko
2015/10/22 08:49:52
Done.
|
| } |
| @@ -365,33 +353,17 @@ void JSGenericLowering::LowerJSStoreNamed(Node* node) { |
| void JSGenericLowering::LowerJSStoreGlobal(Node* node) { |
| CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
| const StoreGlobalParameters& p = StoreGlobalParametersOf(node->op()); |
| - if (p.slot_index() >= 0) { |
| - Callable callable = |
| - CodeFactory::StoreGlobalViaContext(isolate(), 0, p.language_mode()); |
| - Node* script_context = node->InputAt(0); |
| - Node* value = node->InputAt(2); |
| - node->ReplaceInput(0, jsgraph()->Int32Constant(p.slot_index())); |
| - node->ReplaceInput(1, value); |
| - node->ReplaceInput(2, script_context); // Set new context... |
| - node->RemoveInput(3); |
| - node->RemoveInput(3); // ...instead of old one. |
| - ReplaceWithStubCall(node, callable, flags); |
| - |
| + Callable callable = CodeFactory::StoreICInOptimizedCode( |
| + isolate(), p.language_mode(), UNINITIALIZED); |
| + node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); |
|
Benedikt Meurer
2015/10/22 05:03:52
Insert the global object here, loading it from the
Igor Sheludko
2015/10/22 08:49:52
Done.
|
| + if (FLAG_vector_stores) { |
| + DCHECK(p.feedback().index() != -1); |
| + node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.feedback().index())); |
| } else { |
| - Callable callable = CodeFactory::StoreICInOptimizedCode( |
| - isolate(), p.language_mode(), UNINITIALIZED); |
| - node->RemoveInput(0); // script context |
| - node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); |
| - if (FLAG_vector_stores) { |
| - DCHECK(p.feedback().index() != -1); |
| - node->InsertInput(zone(), 3, |
| - jsgraph()->SmiConstant(p.feedback().index())); |
| - } else { |
| - node->RemoveInput(3); |
| - } |
| - ReplaceWithStubCall(node, callable, |
| - CallDescriptor::kPatchableCallSite | flags); |
| + node->RemoveInput(3); |
| } |
| + ReplaceWithStubCall(node, callable, |
| + CallDescriptor::kPatchableCallSite | flags); |
| } |