OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/code-assembler.h" | 5 #include "src/compiler/code-assembler.h" |
6 | 6 |
7 #include <ostream> | 7 #include <ostream> |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 return CallN(call_descriptor, target, args); | 592 return CallN(call_descriptor, target, args); |
593 } | 593 } |
594 | 594 |
595 Node* CodeAssembler::TailCallStub(Callable const& callable, Node* context, | 595 Node* CodeAssembler::TailCallStub(Callable const& callable, Node* context, |
596 Node* arg1, Node* arg2, size_t result_size) { | 596 Node* arg1, Node* arg2, size_t result_size) { |
597 Node* target = HeapConstant(callable.code()); | 597 Node* target = HeapConstant(callable.code()); |
598 return TailCallStub(callable.descriptor(), target, context, arg1, arg2, | 598 return TailCallStub(callable.descriptor(), target, context, arg1, arg2, |
599 result_size); | 599 result_size); |
600 } | 600 } |
601 | 601 |
| 602 Node* CodeAssembler::TailCallStub(Callable const& callable, Node* context, |
| 603 Node* arg1, Node* arg2, Node* arg3, |
| 604 size_t result_size) { |
| 605 Node* target = HeapConstant(callable.code()); |
| 606 return TailCallStub(callable.descriptor(), target, context, arg1, arg2, arg3, |
| 607 result_size); |
| 608 } |
| 609 |
602 Node* CodeAssembler::TailCallStub(const CallInterfaceDescriptor& descriptor, | 610 Node* CodeAssembler::TailCallStub(const CallInterfaceDescriptor& descriptor, |
603 Node* target, Node* context, Node* arg1, | 611 Node* target, Node* context, Node* arg1, |
604 Node* arg2, size_t result_size) { | 612 Node* arg2, size_t result_size) { |
605 CallDescriptor* call_descriptor = Linkage::GetStubCallDescriptor( | 613 CallDescriptor* call_descriptor = Linkage::GetStubCallDescriptor( |
606 isolate(), zone(), descriptor, descriptor.GetStackParameterCount(), | 614 isolate(), zone(), descriptor, descriptor.GetStackParameterCount(), |
607 CallDescriptor::kSupportsTailCalls, Operator::kNoProperties, | 615 CallDescriptor::kSupportsTailCalls, Operator::kNoProperties, |
608 MachineType::AnyTagged(), result_size); | 616 MachineType::AnyTagged(), result_size); |
609 | 617 |
610 Node** args = zone()->NewArray<Node*>(3); | 618 Node** args = zone()->NewArray<Node*>(3); |
611 args[0] = arg1; | 619 args[0] = arg1; |
612 args[1] = arg2; | 620 args[1] = arg2; |
613 args[2] = context; | 621 args[2] = context; |
614 | 622 |
615 return raw_assembler_->TailCallN(call_descriptor, target, args); | 623 return raw_assembler_->TailCallN(call_descriptor, target, args); |
616 } | 624 } |
617 | 625 |
| 626 Node* CodeAssembler::TailCallStub(const CallInterfaceDescriptor& descriptor, |
| 627 Node* target, Node* context, Node* arg1, |
| 628 Node* arg2, Node* arg3, size_t result_size) { |
| 629 CallDescriptor* call_descriptor = Linkage::GetStubCallDescriptor( |
| 630 isolate(), zone(), descriptor, descriptor.GetStackParameterCount(), |
| 631 CallDescriptor::kSupportsTailCalls, Operator::kNoProperties, |
| 632 MachineType::AnyTagged(), result_size); |
| 633 |
| 634 Node** args = zone()->NewArray<Node*>(4); |
| 635 args[0] = arg1; |
| 636 args[1] = arg2; |
| 637 args[2] = arg3; |
| 638 args[3] = context; |
| 639 |
| 640 return raw_assembler_->TailCallN(call_descriptor, target, args); |
| 641 } |
| 642 |
618 Node* CodeAssembler::TailCallBytecodeDispatch( | 643 Node* CodeAssembler::TailCallBytecodeDispatch( |
619 const CallInterfaceDescriptor& interface_descriptor, | 644 const CallInterfaceDescriptor& interface_descriptor, |
620 Node* code_target_address, Node** args) { | 645 Node* code_target_address, Node** args) { |
621 CallDescriptor* descriptor = Linkage::GetBytecodeDispatchCallDescriptor( | 646 CallDescriptor* descriptor = Linkage::GetBytecodeDispatchCallDescriptor( |
622 isolate(), zone(), interface_descriptor, | 647 isolate(), zone(), interface_descriptor, |
623 interface_descriptor.GetStackParameterCount()); | 648 interface_descriptor.GetStackParameterCount()); |
624 return raw_assembler_->TailCallN(descriptor, code_target_address, args); | 649 return raw_assembler_->TailCallN(descriptor, code_target_address, args); |
625 } | 650 } |
626 | 651 |
627 void CodeAssembler::Goto(CodeAssembler::Label* label) { | 652 void CodeAssembler::Goto(CodeAssembler::Label* label) { |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 } | 841 } |
817 } | 842 } |
818 } | 843 } |
819 | 844 |
820 bound_ = true; | 845 bound_ = true; |
821 } | 846 } |
822 | 847 |
823 } // namespace compiler | 848 } // namespace compiler |
824 } // namespace internal | 849 } // namespace internal |
825 } // namespace v8 | 850 } // namespace v8 |
OLD | NEW |