Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/compiler/js-create-lowering.h" | 5 #include "src/compiler/js-create-lowering.h" |
| 6 | 6 |
| 7 #include "src/allocation-site-scopes.h" | 7 #include "src/allocation-site-scopes.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/compilation-dependencies.h" | 9 #include "src/compilation-dependencies.h" |
| 10 #include "src/compiler/access-builder.h" | 10 #include "src/compiler/access-builder.h" |
| (...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 808 RelaxControls(node); | 808 RelaxControls(node); |
| 809 a.FinishAndChange(node); | 809 a.FinishAndChange(node); |
| 810 return Changed(node); | 810 return Changed(node); |
| 811 } | 811 } |
| 812 | 812 |
| 813 return NoChange(); | 813 return NoChange(); |
| 814 } | 814 } |
| 815 | 815 |
| 816 Reduction JSCreateLowering::ReduceJSCreateWithContext(Node* node) { | 816 Reduction JSCreateLowering::ReduceJSCreateWithContext(Node* node) { |
| 817 DCHECK_EQ(IrOpcode::kJSCreateWithContext, node->opcode()); | 817 DCHECK_EQ(IrOpcode::kJSCreateWithContext, node->opcode()); |
| 818 Handle<ScopeInfo> scope_info = OpParameter<Handle<ScopeInfo>>(node); | |
| 818 Node* object = NodeProperties::GetValueInput(node, 0); | 819 Node* object = NodeProperties::GetValueInput(node, 0); |
| 819 Node* closure = NodeProperties::GetValueInput(node, 1); | 820 Node* closure = NodeProperties::GetValueInput(node, 1); |
| 820 Node* effect = NodeProperties::GetEffectInput(node); | 821 Node* effect = NodeProperties::GetEffectInput(node); |
| 821 Node* control = NodeProperties::GetControlInput(node); | 822 Node* control = NodeProperties::GetControlInput(node); |
| 822 Node* context = NodeProperties::GetContextInput(node); | 823 Node* context = NodeProperties::GetContextInput(node); |
| 823 Node* native_context = effect = graph()->NewNode( | 824 Node* native_context = effect = graph()->NewNode( |
| 824 javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true), | 825 javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true), |
| 825 context, context, effect); | 826 context, context, effect); |
| 826 AllocationBuilder a(jsgraph(), effect, control); | 827 AllocationBuilder aa(jsgraph(), effect, control); |
|
Michael Starzinger
2016/09/05 12:10:39
nit: Empty newline before the first AllocationBuil
| |
| 828 aa.Allocate(ContextExtension::kSize); | |
| 829 aa.Store(AccessBuilder::ForMap(), factory()->context_extension_map()); | |
| 830 aa.Store(AccessBuilder::ForContextExtensionScopeInfo(), scope_info); | |
| 831 aa.Store(AccessBuilder::ForContextExtensionExtension(), object); | |
| 832 Node* extension = aa.Finish(); | |
| 833 | |
| 834 AllocationBuilder a(jsgraph(), extension, control); | |
| 827 STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == 4); // Ensure fully covered. | 835 STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == 4); // Ensure fully covered. |
| 828 a.AllocateArray(Context::MIN_CONTEXT_SLOTS, factory()->with_context_map()); | 836 a.AllocateArray(Context::MIN_CONTEXT_SLOTS, factory()->with_context_map()); |
| 829 a.Store(AccessBuilder::ForContextSlot(Context::CLOSURE_INDEX), closure); | 837 a.Store(AccessBuilder::ForContextSlot(Context::CLOSURE_INDEX), closure); |
| 830 a.Store(AccessBuilder::ForContextSlot(Context::PREVIOUS_INDEX), context); | 838 a.Store(AccessBuilder::ForContextSlot(Context::PREVIOUS_INDEX), context); |
| 831 a.Store(AccessBuilder::ForContextSlot(Context::EXTENSION_INDEX), object); | 839 a.Store(AccessBuilder::ForContextSlot(Context::EXTENSION_INDEX), extension); |
| 832 a.Store(AccessBuilder::ForContextSlot(Context::NATIVE_CONTEXT_INDEX), | 840 a.Store(AccessBuilder::ForContextSlot(Context::NATIVE_CONTEXT_INDEX), |
| 833 native_context); | 841 native_context); |
| 834 RelaxControls(node); | 842 RelaxControls(node); |
| 835 a.FinishAndChange(node); | 843 a.FinishAndChange(node); |
| 836 return Changed(node); | 844 return Changed(node); |
| 837 } | 845 } |
| 838 | 846 |
| 839 Reduction JSCreateLowering::ReduceJSCreateCatchContext(Node* node) { | 847 Reduction JSCreateLowering::ReduceJSCreateCatchContext(Node* node) { |
| 840 DCHECK_EQ(IrOpcode::kJSCreateCatchContext, node->opcode()); | 848 DCHECK_EQ(IrOpcode::kJSCreateCatchContext, node->opcode()); |
| 841 const CreateCatchContextParameters& parameters = | 849 const CreateCatchContextParameters& parameters = |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1280 return jsgraph()->simplified(); | 1288 return jsgraph()->simplified(); |
| 1281 } | 1289 } |
| 1282 | 1290 |
| 1283 MachineOperatorBuilder* JSCreateLowering::machine() const { | 1291 MachineOperatorBuilder* JSCreateLowering::machine() const { |
| 1284 return jsgraph()->machine(); | 1292 return jsgraph()->machine(); |
| 1285 } | 1293 } |
| 1286 | 1294 |
| 1287 } // namespace compiler | 1295 } // namespace compiler |
| 1288 } // namespace internal | 1296 } // namespace internal |
| 1289 } // namespace v8 | 1297 } // namespace v8 |
| OLD | NEW |