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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 | 451 |
452 if (slot_count <= FastNewFunctionContextStub::kMaximumSlots) { | 452 if (slot_count <= FastNewFunctionContextStub::kMaximumSlots) { |
453 Callable callable = CodeFactory::FastNewFunctionContext(isolate()); | 453 Callable callable = CodeFactory::FastNewFunctionContext(isolate()); |
454 node->InsertInput(zone(), 1, jsgraph()->Int32Constant(slot_count)); | 454 node->InsertInput(zone(), 1, jsgraph()->Int32Constant(slot_count)); |
455 ReplaceWithStubCall(node, callable, flags); | 455 ReplaceWithStubCall(node, callable, flags); |
456 } else { | 456 } else { |
457 ReplaceWithRuntimeCall(node, Runtime::kNewFunctionContext); | 457 ReplaceWithRuntimeCall(node, Runtime::kNewFunctionContext); |
458 } | 458 } |
459 } | 459 } |
460 | 460 |
| 461 void JSGenericLowering::LowerJSCreateEvalContext(Node* node) { |
| 462 int const slot_count = OpParameter<int>(node->op()); |
| 463 CallDescriptor::Flags flags = FrameStateFlagForCall(node); |
| 464 |
| 465 if (slot_count <= FastNewFunctionContextStub::kMaximumSlots) { |
| 466 Callable callable = CodeFactory::FastNewEvalContext(isolate()); |
| 467 node->InsertInput(zone(), 1, jsgraph()->Int32Constant(slot_count)); |
| 468 ReplaceWithStubCall(node, callable, flags); |
| 469 } else { |
| 470 ReplaceWithRuntimeCall(node, Runtime::kNewEvalContext); |
| 471 } |
| 472 } |
461 | 473 |
462 void JSGenericLowering::LowerJSCreateIterResultObject(Node* node) { | 474 void JSGenericLowering::LowerJSCreateIterResultObject(Node* node) { |
463 ReplaceWithRuntimeCall(node, Runtime::kCreateIterResultObject); | 475 ReplaceWithRuntimeCall(node, Runtime::kCreateIterResultObject); |
464 } | 476 } |
465 | 477 |
466 | 478 |
467 void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) { | 479 void JSGenericLowering::LowerJSCreateLiteralArray(Node* node) { |
468 CreateLiteralParameters const& p = CreateLiteralParametersOf(node->op()); | 480 CreateLiteralParameters const& p = CreateLiteralParametersOf(node->op()); |
469 CallDescriptor::Flags flags = FrameStateFlagForCall(node); | 481 CallDescriptor::Flags flags = FrameStateFlagForCall(node); |
470 node->InsertInput(zone(), 1, jsgraph()->SmiConstant(p.index())); | 482 node->InsertInput(zone(), 1, jsgraph()->SmiConstant(p.index())); |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 } | 714 } |
703 | 715 |
704 | 716 |
705 MachineOperatorBuilder* JSGenericLowering::machine() const { | 717 MachineOperatorBuilder* JSGenericLowering::machine() const { |
706 return jsgraph()->machine(); | 718 return jsgraph()->machine(); |
707 } | 719 } |
708 | 720 |
709 } // namespace compiler | 721 } // namespace compiler |
710 } // namespace internal | 722 } // namespace internal |
711 } // namespace v8 | 723 } // namespace v8 |
OLD | NEW |