| 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 #ifndef V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 5 #ifndef V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
| 6 #define V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 6 #define V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
| 7 | 7 |
| 8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
| 9 #include "src/compiler/common-operator.h" | 9 #include "src/compiler/common-operator.h" |
| 10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 } | 536 } |
| 537 Node* StringConstant(const char* string) { | 537 Node* StringConstant(const char* string) { |
| 538 return HeapConstant(isolate()->factory()->InternalizeUtf8String(string)); | 538 return HeapConstant(isolate()->factory()->InternalizeUtf8String(string)); |
| 539 } | 539 } |
| 540 | 540 |
| 541 // Call a given call descriptor and the given arguments. | 541 // Call a given call descriptor and the given arguments. |
| 542 Node* CallN(CallDescriptor* desc, Node* function, Node** args); | 542 Node* CallN(CallDescriptor* desc, Node* function, Node** args); |
| 543 // Call a given call descriptor and the given arguments and frame-state. | 543 // Call a given call descriptor and the given arguments and frame-state. |
| 544 Node* CallNWithFrameState(CallDescriptor* desc, Node* function, Node** args, | 544 Node* CallNWithFrameState(CallDescriptor* desc, Node* function, Node** args, |
| 545 Node* frame_state); | 545 Node* frame_state); |
| 546 // Tail call the given call descriptor and the given arguments. | |
| 547 Node* TailCallN(CallDescriptor* call_descriptor, Node* function, Node** args); | |
| 548 // Call to a runtime function with one arguments. | 546 // Call to a runtime function with one arguments. |
| 549 Node* CallRuntime1(Runtime::FunctionId function, Node* arg0, Node* context); | 547 Node* CallRuntime1(Runtime::FunctionId function, Node* arg0, Node* context); |
| 550 // Call to a runtime function with two arguments. | 548 // Call to a runtime function with two arguments. |
| 551 Node* CallRuntime2(Runtime::FunctionId function, Node* arg1, Node* arg2, | 549 Node* CallRuntime2(Runtime::FunctionId function, Node* arg1, Node* arg2, |
| 552 Node* context); | 550 Node* context); |
| 553 // Call to a runtime function with four arguments. | 551 // Call to a runtime function with four arguments. |
| 554 Node* CallRuntime4(Runtime::FunctionId function, Node* arg1, Node* arg2, | 552 Node* CallRuntime4(Runtime::FunctionId function, Node* arg1, Node* arg2, |
| 555 Node* arg3, Node* arg4, Node* context); | 553 Node* arg3, Node* arg4, Node* context); |
| 556 // Call to a C function with zero arguments. | 554 // Call to a C function with zero arguments. |
| 557 Node* CallCFunction0(MachineType return_type, Node* function); | 555 Node* CallCFunction0(MachineType return_type, Node* function); |
| 558 // Call to a C function with one parameter. | 556 // Call to a C function with one parameter. |
| 559 Node* CallCFunction1(MachineType return_type, MachineType arg0_type, | 557 Node* CallCFunction1(MachineType return_type, MachineType arg0_type, |
| 560 Node* function, Node* arg0); | 558 Node* function, Node* arg0); |
| 561 // Call to a C function with two arguments. | 559 // Call to a C function with two arguments. |
| 562 Node* CallCFunction2(MachineType return_type, MachineType arg0_type, | 560 Node* CallCFunction2(MachineType return_type, MachineType arg0_type, |
| 563 MachineType arg1_type, Node* function, Node* arg0, | 561 MachineType arg1_type, Node* function, Node* arg0, |
| 564 Node* arg1); | 562 Node* arg1); |
| 565 // Call to a C function with eight arguments. | 563 // Call to a C function with eight arguments. |
| 566 Node* CallCFunction8(MachineType return_type, MachineType arg0_type, | 564 Node* CallCFunction8(MachineType return_type, MachineType arg0_type, |
| 567 MachineType arg1_type, MachineType arg2_type, | 565 MachineType arg1_type, MachineType arg2_type, |
| 568 MachineType arg3_type, MachineType arg4_type, | 566 MachineType arg3_type, MachineType arg4_type, |
| 569 MachineType arg5_type, MachineType arg6_type, | 567 MachineType arg5_type, MachineType arg6_type, |
| 570 MachineType arg7_type, Node* function, Node* arg0, | 568 MachineType arg7_type, Node* function, Node* arg0, |
| 571 Node* arg1, Node* arg2, Node* arg3, Node* arg4, | 569 Node* arg1, Node* arg2, Node* arg3, Node* arg4, |
| 572 Node* arg5, Node* arg6, Node* arg7); | 570 Node* arg5, Node* arg6, Node* arg7); |
| 573 | 571 |
| 572 // Tail call the given call descriptor and the given arguments. |
| 573 Node* TailCallN(CallDescriptor* call_descriptor, Node* function, Node** args); |
| 574 // Tail call to a runtime function with one argument. |
| 575 Node* TailCallRuntime1(Runtime::FunctionId function, Node* arg0, |
| 576 Node* context); |
| 577 // Tail call to a runtime function with two arguments. |
| 578 Node* TailCallRuntime2(Runtime::FunctionId function, Node* arg1, Node* arg2, |
| 579 Node* context); |
| 580 |
| 581 |
| 574 // =========================================================================== | 582 // =========================================================================== |
| 575 // The following utility methods deal with control flow, hence might switch | 583 // The following utility methods deal with control flow, hence might switch |
| 576 // the current basic block or create new basic blocks for labels. | 584 // the current basic block or create new basic blocks for labels. |
| 577 | 585 |
| 578 // Control flow. | 586 // Control flow. |
| 579 void Goto(RawMachineLabel* label); | 587 void Goto(RawMachineLabel* label); |
| 580 void Branch(Node* condition, RawMachineLabel* true_val, | 588 void Branch(Node* condition, RawMachineLabel* true_val, |
| 581 RawMachineLabel* false_val); | 589 RawMachineLabel* false_val); |
| 582 void Switch(Node* index, RawMachineLabel* default_label, int32_t* case_values, | 590 void Switch(Node* index, RawMachineLabel* default_label, int32_t* case_values, |
| 583 RawMachineLabel** case_labels, size_t case_count); | 591 RawMachineLabel** case_labels, size_t case_count); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 bool bound_; | 659 bool bound_; |
| 652 friend class RawMachineAssembler; | 660 friend class RawMachineAssembler; |
| 653 DISALLOW_COPY_AND_ASSIGN(RawMachineLabel); | 661 DISALLOW_COPY_AND_ASSIGN(RawMachineLabel); |
| 654 }; | 662 }; |
| 655 | 663 |
| 656 } // namespace compiler | 664 } // namespace compiler |
| 657 } // namespace internal | 665 } // namespace internal |
| 658 } // namespace v8 | 666 } // namespace v8 |
| 659 | 667 |
| 660 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 668 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
| OLD | NEW |