Chromium Code Reviews| Index: src/compiler/raw-machine-assembler.h |
| diff --git a/src/compiler/raw-machine-assembler.h b/src/compiler/raw-machine-assembler.h |
| index 69151f1ecf09d763d4740b83b4cab2815c0999f2..b4445bdc119c893ee97172957eea50079e2fa67f 100644 |
| --- a/src/compiler/raw-machine-assembler.h |
| +++ b/src/compiler/raw-machine-assembler.h |
| @@ -6,7 +6,6 @@ |
| #define V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
| #include "src/assembler.h" |
| -#include "src/code-factory.h" |
| #include "src/compiler/common-operator.h" |
| #include "src/compiler/graph.h" |
| #include "src/compiler/linkage.h" |
| @@ -707,24 +706,20 @@ class V8_EXPORT_PRIVATE RawMachineAssembler { |
| Node* CallNWithFrameState(CallDescriptor* desc, Node* function, Node** args, |
| Node* frame_state); |
| - // Call to a runtime function with given arguments. |
| + // Call a given call descriptor and the given arguments. |
| template <class... TArgs> |
| - Node* CallRuntime(Runtime::FunctionId function, Node* context, |
| - TArgs... args) { |
| - int argc = static_cast<int>(sizeof...(args)); |
| - CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor( |
| - zone(), function, argc, Operator::kNoProperties, |
| - CallDescriptor::kNoFlags); |
| - int return_count = static_cast<int>(descriptor->ReturnCount()); |
| - |
| - Node* centry = |
| - HeapConstant(CodeFactory::RuntimeCEntry(isolate(), return_count)); |
| - Node* ref = AddNode( |
| - common()->ExternalConstant(ExternalReference(function, isolate()))); |
| - Node* arity = Int32Constant(argc); |
| + Node* CallV(CallDescriptor* desc, Node* target, TArgs... args) { |
|
Igor Sheludko
2016/12/15 23:34:07
I added suffix V to avoid conflicts in tests with
|
| + int input_count = static_cast<int>(sizeof...(args)) + 1; |
| + Node* nodes[] = {target, args...}; |
| + return AddNode(common()->Call(desc), input_count, nodes); |
| + } |
| - return AddNode(common()->Call(descriptor), centry, args..., ref, arity, |
| - context); |
| + // Tail call a given call descriptor and the given arguments. |
| + template <class... TArgs> |
| + Node* TailCallV(CallDescriptor* desc, Node* target, TArgs... args) { |
| + int input_count = static_cast<int>(sizeof...(args)) + 1; |
| + Node* nodes[] = {target, args...}; |
| + return TailCallN(desc, input_count, nodes); |
| } |
| // Call to a C function with zero arguments. |
| @@ -747,27 +742,6 @@ class V8_EXPORT_PRIVATE RawMachineAssembler { |
| // Tail call the given call descriptor and the given arguments. |
| Node* TailCallN(CallDescriptor* call_descriptor, Node* function, Node** args); |
| - // Tail call to a runtime function with zero arguments. |
| - Node* TailCallRuntime0(Runtime::FunctionId function, Node* context); |
| - // Tail call to a runtime function with one argument. |
| - Node* TailCallRuntime1(Runtime::FunctionId function, Node* arg0, |
| - Node* context); |
| - // Tail call to a runtime function with two arguments. |
| - Node* TailCallRuntime2(Runtime::FunctionId function, Node* arg1, Node* arg2, |
| - Node* context); |
| - // Tail call to a runtime function with three arguments. |
| - Node* TailCallRuntime3(Runtime::FunctionId function, Node* arg1, Node* arg2, |
| - Node* arg3, Node* context); |
| - // Tail call to a runtime function with four arguments. |
| - Node* TailCallRuntime4(Runtime::FunctionId function, Node* arg1, Node* arg2, |
| - Node* arg3, Node* arg4, Node* context); |
| - // Tail call to a runtime function with five arguments. |
| - Node* TailCallRuntime5(Runtime::FunctionId function, Node* arg1, Node* arg2, |
| - Node* arg3, Node* arg4, Node* arg5, Node* context); |
| - // Tail call to a runtime function with six arguments. |
| - Node* TailCallRuntime6(Runtime::FunctionId function, Node* arg1, Node* arg2, |
| - Node* arg3, Node* arg4, Node* arg5, Node* arg6, |
| - Node* context); |
| // =========================================================================== |
| // The following utility methods deal with control flow, hence might switch |
| @@ -832,6 +806,8 @@ class V8_EXPORT_PRIVATE RawMachineAssembler { |
| BasicBlock* EnsureBlock(RawMachineLabel* label); |
| BasicBlock* CurrentBlock(); |
| + Node* TailCallN(CallDescriptor* desc, int input_count, Node* const* inputs); |
| + |
| Schedule* schedule() { return schedule_; } |
| size_t parameter_count() const { return call_descriptor_->ParameterCount(); } |