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 #include <assert.h> // For assert | 5 #include <assert.h> // For assert |
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_PPC | 8 #if V8_TARGET_ARCH_PPC |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 2294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2305 void MacroAssembler::CallExternalReference(const ExternalReference& ext, | 2305 void MacroAssembler::CallExternalReference(const ExternalReference& ext, |
2306 int num_arguments) { | 2306 int num_arguments) { |
2307 mov(r3, Operand(num_arguments)); | 2307 mov(r3, Operand(num_arguments)); |
2308 mov(r4, Operand(ext)); | 2308 mov(r4, Operand(ext)); |
2309 | 2309 |
2310 CEntryStub stub(isolate(), 1); | 2310 CEntryStub stub(isolate(), 1); |
2311 CallStub(&stub); | 2311 CallStub(&stub); |
2312 } | 2312 } |
2313 | 2313 |
2314 | 2314 |
2315 void MacroAssembler::TailCallExternalReference(const ExternalReference& ext, | 2315 void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) { |
2316 int num_arguments) { | 2316 const Runtime::Function* function = Runtime::FunctionForId(fid); |
2317 // TODO(1236192): Most runtime routines don't need the number of | 2317 DCHECK_EQ(1, function->result_size); |
2318 // arguments passed in because it is constant. At some point we | 2318 if (function->nargs >= 0) { |
Igor Sheludko
2015/12/30 14:48:18
Ditto.
| |
2319 // should remove this need and make the runtime routine entry code | 2319 mov(r3, Operand(function->nargs)); |
2320 // smarter. | 2320 } |
2321 mov(r3, Operand(num_arguments)); | 2321 JumpToExternalReference(ExternalReference(fid, isolate())); |
2322 JumpToExternalReference(ext); | |
2323 } | 2322 } |
2324 | 2323 |
2325 | 2324 |
2326 void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid, | |
2327 int num_arguments) { | |
2328 TailCallExternalReference(ExternalReference(fid, isolate()), num_arguments); | |
2329 } | |
2330 | |
2331 | |
2332 void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin) { | 2325 void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin) { |
2333 mov(r4, Operand(builtin)); | 2326 mov(r4, Operand(builtin)); |
2334 CEntryStub stub(isolate(), 1); | 2327 CEntryStub stub(isolate(), 1); |
2335 Jump(stub.GetCode(), RelocInfo::CODE_TARGET); | 2328 Jump(stub.GetCode(), RelocInfo::CODE_TARGET); |
2336 } | 2329 } |
2337 | 2330 |
2338 | 2331 |
2339 void MacroAssembler::InvokeBuiltin(int native_context_index, InvokeFlag flag, | 2332 void MacroAssembler::InvokeBuiltin(int native_context_index, InvokeFlag flag, |
2340 const CallWrapper& call_wrapper) { | 2333 const CallWrapper& call_wrapper) { |
2341 // You can't call a builtin without a valid frame. | 2334 // You can't call a builtin without a valid frame. |
(...skipping 1950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4292 } | 4285 } |
4293 if (mag.shift > 0) srawi(result, result, mag.shift); | 4286 if (mag.shift > 0) srawi(result, result, mag.shift); |
4294 ExtractBit(r0, dividend, 31); | 4287 ExtractBit(r0, dividend, 31); |
4295 add(result, result, r0); | 4288 add(result, result, r0); |
4296 } | 4289 } |
4297 | 4290 |
4298 } // namespace internal | 4291 } // namespace internal |
4299 } // namespace v8 | 4292 } // namespace v8 |
4300 | 4293 |
4301 #endif // V8_TARGET_ARCH_PPC | 4294 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |