| 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/code-stubs.h" | 6 #include "src/code-stubs.h" |
| 7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
| 8 #include "src/compiler/js-generic-lowering.h" | 8 #include "src/compiler/js-generic-lowering.h" |
| 9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
| 10 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 | 472 |
| 473 | 473 |
| 474 void JSGenericLowering::LowerJSCreateClosure(Node* node) { | 474 void JSGenericLowering::LowerJSCreateClosure(Node* node) { |
| 475 CreateClosureParameters const& p = CreateClosureParametersOf(node->op()); | 475 CreateClosureParameters const& p = CreateClosureParametersOf(node->op()); |
| 476 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); | 476 CallDescriptor::Flags flags = AdjustFrameStatesForCall(node); |
| 477 Handle<SharedFunctionInfo> const shared_info = p.shared_info(); | 477 Handle<SharedFunctionInfo> const shared_info = p.shared_info(); |
| 478 node->InsertInput(zone(), 0, jsgraph()->HeapConstant(shared_info)); | 478 node->InsertInput(zone(), 0, jsgraph()->HeapConstant(shared_info)); |
| 479 | 479 |
| 480 // Use the FastNewClosureStub only for functions allocated in new space. | 480 // Use the FastNewClosureStub only for functions allocated in new space. |
| 481 if (p.pretenure() == NOT_TENURED) { | 481 if (p.pretenure() == NOT_TENURED) { |
| 482 Callable callable = CodeFactory::FastNewClosure( | 482 Callable callable = CodeFactory::FastNewClosure(isolate()); |
| 483 isolate(), shared_info->language_mode(), shared_info->kind()); | |
| 484 ReplaceWithStubCall(node, callable, flags); | 483 ReplaceWithStubCall(node, callable, flags); |
| 485 } else { | 484 } else { |
| 486 ReplaceWithRuntimeCall(node, (p.pretenure() == TENURED) | 485 ReplaceWithRuntimeCall(node, (p.pretenure() == TENURED) |
| 487 ? Runtime::kNewClosure_Tenured | 486 ? Runtime::kNewClosure_Tenured |
| 488 : Runtime::kNewClosure); | 487 : Runtime::kNewClosure); |
| 489 } | 488 } |
| 490 } | 489 } |
| 491 | 490 |
| 492 | 491 |
| 493 void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) { | 492 void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) { |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 } | 738 } |
| 740 | 739 |
| 741 | 740 |
| 742 MachineOperatorBuilder* JSGenericLowering::machine() const { | 741 MachineOperatorBuilder* JSGenericLowering::machine() const { |
| 743 return jsgraph()->machine(); | 742 return jsgraph()->machine(); |
| 744 } | 743 } |
| 745 | 744 |
| 746 } // namespace compiler | 745 } // namespace compiler |
| 747 } // namespace internal | 746 } // namespace internal |
| 748 } // namespace v8 | 747 } // namespace v8 |
| OLD | NEW |