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 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1812 } | 1812 } |
1813 } | 1813 } |
1814 | 1814 |
1815 | 1815 |
1816 Reduction JSTypedLowering::ReduceJSCreateClosure(Node* node) { | 1816 Reduction JSTypedLowering::ReduceJSCreateClosure(Node* node) { |
1817 DCHECK_EQ(IrOpcode::kJSCreateClosure, node->opcode()); | 1817 DCHECK_EQ(IrOpcode::kJSCreateClosure, node->opcode()); |
1818 CreateClosureParameters const& p = CreateClosureParametersOf(node->op()); | 1818 CreateClosureParameters const& p = CreateClosureParametersOf(node->op()); |
1819 Handle<SharedFunctionInfo> shared = p.shared_info(); | 1819 Handle<SharedFunctionInfo> shared = p.shared_info(); |
1820 | 1820 |
1821 // Use the FastNewClosureStub that allocates in new space only for nested | 1821 // Use the FastNewClosureStub that allocates in new space only for nested |
1822 // functions that don't need literals cloning. | 1822 // functions that don't need pretenuring. |
1823 if (p.pretenure() == NOT_TENURED && shared->num_literals() == 0) { | 1823 if (p.pretenure() == NOT_TENURED) { |
1824 Isolate* isolate = jsgraph()->isolate(); | 1824 Isolate* isolate = jsgraph()->isolate(); |
1825 Callable callable = CodeFactory::FastNewClosure( | 1825 Callable callable = CodeFactory::FastNewClosure( |
1826 isolate, shared->language_mode(), shared->kind()); | 1826 isolate, shared->language_mode(), shared->kind()); |
1827 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | 1827 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
1828 isolate, graph()->zone(), callable.descriptor(), 0, | 1828 isolate, graph()->zone(), callable.descriptor(), 0, |
1829 CallDescriptor::kNoFlags); | 1829 CallDescriptor::kNoFlags); |
1830 const Operator* new_op = common()->Call(desc); | 1830 const Operator* new_op = common()->Call(desc); |
1831 Node* stub_code = jsgraph()->HeapConstant(callable.code()); | 1831 Node* stub_code = jsgraph()->HeapConstant(callable.code()); |
1832 node->InsertInput(graph()->zone(), 0, stub_code); | 1832 node->InsertInput(graph()->zone(), 0, stub_code); |
1833 node->InsertInput(graph()->zone(), 1, jsgraph()->HeapConstant(shared)); | 1833 node->InsertInput(graph()->zone(), 1, jsgraph()->HeapConstant(shared)); |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2671 } | 2671 } |
2672 | 2672 |
2673 | 2673 |
2674 CompilationDependencies* JSTypedLowering::dependencies() const { | 2674 CompilationDependencies* JSTypedLowering::dependencies() const { |
2675 return dependencies_; | 2675 return dependencies_; |
2676 } | 2676 } |
2677 | 2677 |
2678 } // namespace compiler | 2678 } // namespace compiler |
2679 } // namespace internal | 2679 } // namespace internal |
2680 } // namespace v8 | 2680 } // namespace v8 |
OLD | NEW |