OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 #include "src/base/division-by-constant.h" | 9 #include "src/base/division-by-constant.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 5036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5047 int num_arguments, | 5047 int num_arguments, |
5048 BranchDelaySlot bd) { | 5048 BranchDelaySlot bd) { |
5049 PrepareCEntryArgs(num_arguments); | 5049 PrepareCEntryArgs(num_arguments); |
5050 PrepareCEntryFunction(ext); | 5050 PrepareCEntryFunction(ext); |
5051 | 5051 |
5052 CEntryStub stub(isolate(), 1); | 5052 CEntryStub stub(isolate(), 1); |
5053 CallStub(&stub, TypeFeedbackId::None(), al, zero_reg, Operand(zero_reg), bd); | 5053 CallStub(&stub, TypeFeedbackId::None(), al, zero_reg, Operand(zero_reg), bd); |
5054 } | 5054 } |
5055 | 5055 |
5056 | 5056 |
5057 void MacroAssembler::TailCallExternalReference(const ExternalReference& ext, | 5057 void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) { |
5058 int num_arguments) { | 5058 const Runtime::Function* function = Runtime::FunctionForId(fid); |
5059 // TODO(1236192): Most runtime routines don't need the number of | 5059 DCHECK_EQ(1, function->result_size); |
5060 // arguments passed in because it is constant. At some point we | 5060 if (function->nargs >= 0) { |
Igor Sheludko
2015/12/30 14:48:17
Ditto.
| |
5061 // should remove this need and make the runtime routine entry code | 5061 PrepareCEntryArgs(function->nargs); |
5062 // smarter. | 5062 } |
5063 PrepareCEntryArgs(num_arguments); | 5063 JumpToExternalReference(ExternalReference(fid, isolate())); |
5064 JumpToExternalReference(ext); | |
5065 } | 5064 } |
5066 | 5065 |
5067 | 5066 |
5068 void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid, | |
5069 int num_arguments) { | |
5070 TailCallExternalReference(ExternalReference(fid, isolate()), num_arguments); | |
5071 } | |
5072 | |
5073 | |
5074 void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin, | 5067 void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin, |
5075 BranchDelaySlot bd) { | 5068 BranchDelaySlot bd) { |
5076 PrepareCEntryFunction(builtin); | 5069 PrepareCEntryFunction(builtin); |
5077 CEntryStub stub(isolate(), 1); | 5070 CEntryStub stub(isolate(), 1); |
5078 Jump(stub.GetCode(), | 5071 Jump(stub.GetCode(), |
5079 RelocInfo::CODE_TARGET, | 5072 RelocInfo::CODE_TARGET, |
5080 al, | 5073 al, |
5081 zero_reg, | 5074 zero_reg, |
5082 Operand(zero_reg), | 5075 Operand(zero_reg), |
5083 bd); | 5076 bd); |
(...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6374 if (mag.shift > 0) sra(result, result, mag.shift); | 6367 if (mag.shift > 0) sra(result, result, mag.shift); |
6375 srl(at, dividend, 31); | 6368 srl(at, dividend, 31); |
6376 Addu(result, result, Operand(at)); | 6369 Addu(result, result, Operand(at)); |
6377 } | 6370 } |
6378 | 6371 |
6379 | 6372 |
6380 } // namespace internal | 6373 } // namespace internal |
6381 } // namespace v8 | 6374 } // namespace v8 |
6382 | 6375 |
6383 #endif // V8_TARGET_ARCH_MIPS64 | 6376 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |