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