| 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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 ? Runtime::kNewClosure_Tenured | 437 ? Runtime::kNewClosure_Tenured |
| 438 : Runtime::kNewClosure); | 438 : Runtime::kNewClosure); |
| 439 } | 439 } |
| 440 } | 440 } |
| 441 | 441 |
| 442 | 442 |
| 443 void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) { | 443 void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) { |
| 444 int const slot_count = OpParameter<int>(node->op()); | 444 int const slot_count = OpParameter<int>(node->op()); |
| 445 CallDescriptor::Flags flags = FrameStateFlagForCall(node); | 445 CallDescriptor::Flags flags = FrameStateFlagForCall(node); |
| 446 | 446 |
| 447 Callable callable = CodeFactory::FastNewFunctionContext(isolate()); | 447 if (slot_count <= FastNewFunctionContextStub::kMaximumSlots) { |
| 448 node->InsertInput(zone(), 1, jsgraph()->Int32Constant(slot_count)); | 448 Callable callable = CodeFactory::FastNewFunctionContext(isolate()); |
| 449 ReplaceWithStubCall(node, callable, flags); | 449 node->InsertInput(zone(), 1, jsgraph()->Int32Constant(slot_count)); |
| 450 ReplaceWithStubCall(node, callable, flags); |
| 451 } else { |
| 452 ReplaceWithRuntimeCall(node, Runtime::kNewFunctionContext); |
| 453 } |
| 450 } | 454 } |
| 451 | 455 |
| 452 | 456 |
| 453 void JSGenericLowering::LowerJSCreateIterResultObject(Node* node) { | 457 void JSGenericLowering::LowerJSCreateIterResultObject(Node* node) { |
| 454 ReplaceWithRuntimeCall(node, Runtime::kCreateIterResultObject); | 458 ReplaceWithRuntimeCall(node, Runtime::kCreateIterResultObject); |
| 455 } | 459 } |
| 456 | 460 |
| 457 | 461 |
| 458 void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) { | 462 void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) { |
| 459 CreateLiteralParameters const& p = CreateLiteralParametersOf(node->op()); | 463 CreateLiteralParameters const& p = CreateLiteralParametersOf(node->op()); |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 } | 688 } |
| 685 | 689 |
| 686 | 690 |
| 687 MachineOperatorBuilder* JSGenericLowering::machine() const { | 691 MachineOperatorBuilder* JSGenericLowering::machine() const { |
| 688 return jsgraph()->machine(); | 692 return jsgraph()->machine(); |
| 689 } | 693 } |
| 690 | 694 |
| 691 } // namespace compiler | 695 } // namespace compiler |
| 692 } // namespace internal | 696 } // namespace internal |
| 693 } // namespace v8 | 697 } // namespace v8 |
| OLD | NEW |