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/builtins/builtins-constructor.h" | 8 #include "src/builtins/builtins-constructor.h" |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 } | 541 } |
542 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | 542 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
543 isolate(), zone(), callable.descriptor(), arg_count + 1, flags); | 543 isolate(), zone(), callable.descriptor(), arg_count + 1, flags); |
544 Node* stub_code = jsgraph()->HeapConstant(callable.code()); | 544 Node* stub_code = jsgraph()->HeapConstant(callable.code()); |
545 Node* stub_arity = jsgraph()->Int32Constant(arg_count); | 545 Node* stub_arity = jsgraph()->Int32Constant(arg_count); |
546 node->InsertInput(zone(), 0, stub_code); | 546 node->InsertInput(zone(), 0, stub_code); |
547 node->InsertInput(zone(), 2, stub_arity); | 547 node->InsertInput(zone(), 2, stub_arity); |
548 NodeProperties::ChangeOp(node, common()->Call(desc)); | 548 NodeProperties::ChangeOp(node, common()->Call(desc)); |
549 } | 549 } |
550 | 550 |
| 551 void JSGenericLowering::LowerJSCallFunctionWithSpread(Node* node) { |
| 552 CallFunctionWithSpreadParameters const& p = |
| 553 CallFunctionWithSpreadParametersOf(node->op()); |
| 554 ReplaceWithRuntimeCall(node, Runtime::kCallWithSpread, |
| 555 static_cast<int>(p.arity())); |
| 556 } |
551 | 557 |
552 void JSGenericLowering::LowerJSCallRuntime(Node* node) { | 558 void JSGenericLowering::LowerJSCallRuntime(Node* node) { |
553 const CallRuntimeParameters& p = CallRuntimeParametersOf(node->op()); | 559 const CallRuntimeParameters& p = CallRuntimeParametersOf(node->op()); |
554 ReplaceWithRuntimeCall(node, p.id(), static_cast<int>(p.arity())); | 560 ReplaceWithRuntimeCall(node, p.id(), static_cast<int>(p.arity())); |
555 } | 561 } |
556 | 562 |
557 void JSGenericLowering::LowerJSConvertReceiver(Node* node) { | 563 void JSGenericLowering::LowerJSConvertReceiver(Node* node) { |
558 ReplaceWithRuntimeCall(node, Runtime::kConvertReceiver); | 564 ReplaceWithRuntimeCall(node, Runtime::kConvertReceiver); |
559 } | 565 } |
560 | 566 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 } | 659 } |
654 | 660 |
655 | 661 |
656 MachineOperatorBuilder* JSGenericLowering::machine() const { | 662 MachineOperatorBuilder* JSGenericLowering::machine() const { |
657 return jsgraph()->machine(); | 663 return jsgraph()->machine(); |
658 } | 664 } |
659 | 665 |
660 } // namespace compiler | 666 } // namespace compiler |
661 } // namespace internal | 667 } // namespace internal |
662 } // namespace v8 | 668 } // namespace v8 |
OLD | NEW |