Chromium Code Reviews| Index: src/x64/macro-assembler-x64.cc |
| diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
| index b769c6308e1cacb3b00a5938a19ee771688d3c92..e302a419ea47513c4474aad05991f411cd89f62f 100644 |
| --- a/src/x64/macro-assembler-x64.cc |
| +++ b/src/x64/macro-assembler-x64.cc |
| @@ -662,27 +662,23 @@ void MacroAssembler::CallExternalReference(const ExternalReference& ext, |
| } |
| -void MacroAssembler::TailCallExternalReference(const ExternalReference& ext, |
| - int num_arguments) { |
| +void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) { |
| // ----------- S t a t e ------------- |
| // -- rsp[0] : return address |
| // -- rsp[8] : argument num_arguments - 1 |
| // ... |
| // -- rsp[8 * num_arguments] : argument 0 (receiver) |
| + // |
| + // For runtime functions with variable arguments: |
| + // -- rax : number of arguments |
| // ----------------------------------- |
| - // TODO(1236192): Most runtime routines don't need the number of |
| - // arguments passed in because it is constant. At some point we |
| - // should remove this need and make the runtime routine entry code |
| - // smarter. |
| - Set(rax, num_arguments); |
| - JumpToExternalReference(ext); |
| -} |
| - |
| - |
| -void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid, |
| - int num_arguments) { |
| - TailCallExternalReference(ExternalReference(fid, isolate()), num_arguments); |
| + const Runtime::Function* function = Runtime::FunctionForId(fid); |
| + DCHECK_EQ(1, function->result_size); |
| + if (function->nargs >= 0) { |
|
Igor Sheludko
2015/12/30 14:48:18
Ditto.
|
| + Set(rax, function->nargs); |
| + } |
| + JumpToExternalReference(ExternalReference(fid, isolate())); |
| } |