| 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/compiler/js-generic-lowering.h" | 5 #include "src/compiler/js-generic-lowering.h" |
| 6 | 6 |
| 7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/compiler/common-operator.h" | 10 #include "src/compiler/common-operator.h" |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 ? Runtime::kNewClosure_Tenured | 434 ? Runtime::kNewClosure_Tenured |
| 435 : Runtime::kNewClosure); | 435 : Runtime::kNewClosure); |
| 436 } | 436 } |
| 437 } | 437 } |
| 438 | 438 |
| 439 | 439 |
| 440 void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) { | 440 void JSGenericLowering::LowerJSCreateFunctionContext(Node* node) { |
| 441 int const slot_count = OpParameter<int>(node->op()); | 441 int const slot_count = OpParameter<int>(node->op()); |
| 442 CallDescriptor::Flags flags = FrameStateFlagForCall(node); | 442 CallDescriptor::Flags flags = FrameStateFlagForCall(node); |
| 443 | 443 |
| 444 Callable callable = CodeFactory::FastNewFunctionContext(isolate()); | 444 if (slot_count <= FastNewFunctionContextStub::kMaximumSlots) { |
| 445 node->InsertInput(zone(), 1, jsgraph()->Int32Constant(slot_count)); | 445 Callable callable = CodeFactory::FastNewFunctionContext(isolate()); |
| 446 ReplaceWithStubCall(node, callable, flags); | 446 node->InsertInput(zone(), 1, jsgraph()->Int32Constant(slot_count)); |
| 447 ReplaceWithStubCall(node, callable, flags); |
| 448 } else { |
| 449 ReplaceWithRuntimeCall(node, Runtime::kNewFunctionContext); |
| 450 } |
| 447 } | 451 } |
| 448 | 452 |
| 449 | 453 |
| 450 void JSGenericLowering::LowerJSCreateIterResultObject(Node* node) { | 454 void JSGenericLowering::LowerJSCreateIterResultObject(Node* node) { |
| 451 ReplaceWithRuntimeCall(node, Runtime::kCreateIterResultObject); | 455 ReplaceWithRuntimeCall(node, Runtime::kCreateIterResultObject); |
| 452 } | 456 } |
| 453 | 457 |
| 454 | 458 |
| 455 void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) { | 459 void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) { |
| 456 CreateLiteralParameters const& p = CreateLiteralParametersOf(node->op()); | 460 CreateLiteralParameters const& p = CreateLiteralParametersOf(node->op()); |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 } | 686 } |
| 683 | 687 |
| 684 | 688 |
| 685 MachineOperatorBuilder* JSGenericLowering::machine() const { | 689 MachineOperatorBuilder* JSGenericLowering::machine() const { |
| 686 return jsgraph()->machine(); | 690 return jsgraph()->machine(); |
| 687 } | 691 } |
| 688 | 692 |
| 689 } // namespace compiler | 693 } // namespace compiler |
| 690 } // namespace internal | 694 } // namespace internal |
| 691 } // namespace v8 | 695 } // namespace v8 |
| OLD | NEW |