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