OLD | NEW |
---|---|
1 | 1 |
2 // Copyright 2012 the V8 project authors. All rights reserved. | 2 // Copyright 2012 the V8 project authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
7 | 7 |
8 #if V8_TARGET_ARCH_MIPS | 8 #if V8_TARGET_ARCH_MIPS |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 4503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4514 int num_arguments, | 4514 int num_arguments, |
4515 BranchDelaySlot bd) { | 4515 BranchDelaySlot bd) { |
4516 PrepareCEntryArgs(num_arguments); | 4516 PrepareCEntryArgs(num_arguments); |
4517 PrepareCEntryFunction(ext); | 4517 PrepareCEntryFunction(ext); |
4518 | 4518 |
4519 CEntryStub stub(isolate(), 1); | 4519 CEntryStub stub(isolate(), 1); |
4520 CallStub(&stub, TypeFeedbackId::None(), al, zero_reg, Operand(zero_reg), bd); | 4520 CallStub(&stub, TypeFeedbackId::None(), al, zero_reg, Operand(zero_reg), bd); |
4521 } | 4521 } |
4522 | 4522 |
4523 | 4523 |
4524 void MacroAssembler::TailCallExternalReference(const ExternalReference& ext, | 4524 void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) { |
4525 int num_arguments) { | 4525 const Runtime::Function* function = Runtime::FunctionForId(fid); |
4526 // TODO(1236192): Most runtime routines don't need the number of | 4526 DCHECK_EQ(1, function->result_size); |
4527 // arguments passed in because it is constant. At some point we | 4527 if (function->nargs >= 0) { |
Igor Sheludko
2015/12/30 14:48:17
The TODO comment seems to be still relevant. Pleas
| |
4528 // should remove this need and make the runtime routine entry code | 4528 PrepareCEntryArgs(function->nargs); |
4529 // smarter. | 4529 } |
4530 PrepareCEntryArgs(num_arguments); | 4530 JumpToExternalReference(ExternalReference(fid, isolate())); |
4531 JumpToExternalReference(ext); | |
4532 } | 4531 } |
4533 | 4532 |
4534 | 4533 |
4535 void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid, | |
4536 int num_arguments) { | |
4537 TailCallExternalReference(ExternalReference(fid, isolate()), num_arguments); | |
4538 } | |
4539 | |
4540 | |
4541 void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin, | 4534 void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin, |
4542 BranchDelaySlot bd) { | 4535 BranchDelaySlot bd) { |
4543 PrepareCEntryFunction(builtin); | 4536 PrepareCEntryFunction(builtin); |
4544 CEntryStub stub(isolate(), 1); | 4537 CEntryStub stub(isolate(), 1); |
4545 Jump(stub.GetCode(), | 4538 Jump(stub.GetCode(), |
4546 RelocInfo::CODE_TARGET, | 4539 RelocInfo::CODE_TARGET, |
4547 al, | 4540 al, |
4548 zero_reg, | 4541 zero_reg, |
4549 Operand(zero_reg), | 4542 Operand(zero_reg), |
4550 bd); | 4543 bd); |
(...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5760 if (mag.shift > 0) sra(result, result, mag.shift); | 5753 if (mag.shift > 0) sra(result, result, mag.shift); |
5761 srl(at, dividend, 31); | 5754 srl(at, dividend, 31); |
5762 Addu(result, result, Operand(at)); | 5755 Addu(result, result, Operand(at)); |
5763 } | 5756 } |
5764 | 5757 |
5765 | 5758 |
5766 } // namespace internal | 5759 } // namespace internal |
5767 } // namespace v8 | 5760 } // namespace v8 |
5768 | 5761 |
5769 #endif // V8_TARGET_ARCH_MIPS | 5762 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |