OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/code-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/compilation-dependencies.h" | 6 #include "src/compilation-dependencies.h" |
7 #include "src/compiler/access-builder.h" | 7 #include "src/compiler/access-builder.h" |
8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
9 #include "src/compiler/js-typed-lowering.h" | 9 #include "src/compiler/js-typed-lowering.h" |
10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
(...skipping 1819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1830 DCHECK_EQ(IrOpcode::kJSCreateFunctionContext, node->opcode()); | 1830 DCHECK_EQ(IrOpcode::kJSCreateFunctionContext, node->opcode()); |
1831 int slot_count = OpParameter<int>(node->op()); | 1831 int slot_count = OpParameter<int>(node->op()); |
1832 Node* const closure = NodeProperties::GetValueInput(node, 0); | 1832 Node* const closure = NodeProperties::GetValueInput(node, 0); |
1833 | 1833 |
1834 // Use inline allocation for function contexts up to a size limit. | 1834 // Use inline allocation for function contexts up to a size limit. |
1835 if (slot_count < kFunctionContextAllocationLimit) { | 1835 if (slot_count < kFunctionContextAllocationLimit) { |
1836 // JSCreateFunctionContext[slot_count < limit]](fun) | 1836 // JSCreateFunctionContext[slot_count < limit]](fun) |
1837 Node* effect = NodeProperties::GetEffectInput(node); | 1837 Node* effect = NodeProperties::GetEffectInput(node); |
1838 Node* control = NodeProperties::GetControlInput(node); | 1838 Node* control = NodeProperties::GetControlInput(node); |
1839 Node* context = NodeProperties::GetContextInput(node); | 1839 Node* context = NodeProperties::GetContextInput(node); |
1840 Node* extension = jsgraph()->ZeroConstant(); | 1840 Node* extension = jsgraph()->TheHoleConstant(); |
1841 Node* native_context = effect = graph()->NewNode( | 1841 Node* native_context = effect = graph()->NewNode( |
1842 javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true), | 1842 javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true), |
1843 context, context, effect); | 1843 context, context, effect); |
1844 AllocationBuilder a(jsgraph(), effect, control); | 1844 AllocationBuilder a(jsgraph(), effect, control); |
1845 STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == 4); // Ensure fully covered. | 1845 STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == 4); // Ensure fully covered. |
1846 int context_length = slot_count + Context::MIN_CONTEXT_SLOTS; | 1846 int context_length = slot_count + Context::MIN_CONTEXT_SLOTS; |
1847 a.AllocateArray(context_length, factory()->function_context_map()); | 1847 a.AllocateArray(context_length, factory()->function_context_map()); |
1848 a.Store(AccessBuilder::ForContextSlot(Context::CLOSURE_INDEX), closure); | 1848 a.Store(AccessBuilder::ForContextSlot(Context::CLOSURE_INDEX), closure); |
1849 a.Store(AccessBuilder::ForContextSlot(Context::PREVIOUS_INDEX), context); | 1849 a.Store(AccessBuilder::ForContextSlot(Context::PREVIOUS_INDEX), context); |
1850 a.Store(AccessBuilder::ForContextSlot(Context::EXTENSION_INDEX), extension); | 1850 a.Store(AccessBuilder::ForContextSlot(Context::EXTENSION_INDEX), extension); |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2589 } | 2589 } |
2590 | 2590 |
2591 | 2591 |
2592 CompilationDependencies* JSTypedLowering::dependencies() const { | 2592 CompilationDependencies* JSTypedLowering::dependencies() const { |
2593 return dependencies_; | 2593 return dependencies_; |
2594 } | 2594 } |
2595 | 2595 |
2596 } // namespace compiler | 2596 } // namespace compiler |
2597 } // namespace internal | 2597 } // namespace internal |
2598 } // namespace v8 | 2598 } // namespace v8 |
OLD | NEW |