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 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #if V8_TARGET_ARCH_MIPS | 9 #if V8_TARGET_ARCH_MIPS |
10 | 10 |
(...skipping 3269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3280 | 3280 |
3281 | 3281 |
3282 void MacroAssembler::Push(Handle<Object> handle) { | 3282 void MacroAssembler::Push(Handle<Object> handle) { |
3283 li(at, Operand(handle)); | 3283 li(at, Operand(handle)); |
3284 push(at); | 3284 push(at); |
3285 } | 3285 } |
3286 | 3286 |
3287 | 3287 |
3288 void MacroAssembler::DebugBreak() { | 3288 void MacroAssembler::DebugBreak() { |
3289 PrepareCEntryArgs(0); | 3289 PrepareCEntryArgs(0); |
3290 PrepareCEntryFunction(ExternalReference(Runtime::kDebugBreak, isolate())); | 3290 PrepareCEntryFunction( |
| 3291 ExternalReference(Runtime::kHandleDebuggerStatement, isolate())); |
3291 CEntryStub ces(isolate(), 1); | 3292 CEntryStub ces(isolate(), 1); |
3292 DCHECK(AllowThisStubCall(&ces)); | 3293 DCHECK(AllowThisStubCall(&ces)); |
3293 Call(ces.GetCode(), RelocInfo::DEBUGGER_STATEMENT); | 3294 Call(ces.GetCode(), RelocInfo::DEBUGGER_STATEMENT); |
3294 } | 3295 } |
3295 | 3296 |
3296 | 3297 |
3297 // --------------------------------------------------------------------------- | 3298 // --------------------------------------------------------------------------- |
3298 // Exception handling. | 3299 // Exception handling. |
3299 | 3300 |
3300 void MacroAssembler::PushStackHandler() { | 3301 void MacroAssembler::PushStackHandler() { |
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4552 and_(overflow_dst, scratch, overflow_dst); | 4553 and_(overflow_dst, scratch, overflow_dst); |
4553 } else { | 4554 } else { |
4554 subu(dst, left, right); | 4555 subu(dst, left, right); |
4555 xor_(overflow_dst, dst, left); | 4556 xor_(overflow_dst, dst, left); |
4556 xor_(scratch, left, right); | 4557 xor_(scratch, left, right); |
4557 and_(overflow_dst, scratch, overflow_dst); | 4558 and_(overflow_dst, scratch, overflow_dst); |
4558 } | 4559 } |
4559 } | 4560 } |
4560 | 4561 |
4561 | 4562 |
4562 void MacroAssembler::CallRuntime(const Runtime::Function* f, | 4563 void MacroAssembler::CallRuntime(const Runtime::Function* f, int num_arguments, |
4563 int num_arguments, | 4564 SaveFPRegsMode save_doubles, |
4564 SaveFPRegsMode save_doubles) { | 4565 BranchDelaySlot bd) { |
4565 // All parameters are on the stack. v0 has the return value after call. | 4566 // All parameters are on the stack. v0 has the return value after call. |
4566 | 4567 |
4567 // If the expected number of arguments of the runtime function is | 4568 // If the expected number of arguments of the runtime function is |
4568 // constant, we check that the actual number of arguments match the | 4569 // constant, we check that the actual number of arguments match the |
4569 // expectation. | 4570 // expectation. |
4570 CHECK(f->nargs < 0 || f->nargs == num_arguments); | 4571 CHECK(f->nargs < 0 || f->nargs == num_arguments); |
4571 | 4572 |
4572 // TODO(1236192): Most runtime routines don't need the number of | 4573 // TODO(1236192): Most runtime routines don't need the number of |
4573 // arguments passed in because it is constant. At some point we | 4574 // arguments passed in because it is constant. At some point we |
4574 // should remove this need and make the runtime routine entry code | 4575 // should remove this need and make the runtime routine entry code |
4575 // smarter. | 4576 // smarter. |
4576 PrepareCEntryArgs(num_arguments); | 4577 PrepareCEntryArgs(num_arguments); |
4577 PrepareCEntryFunction(ExternalReference(f, isolate())); | 4578 PrepareCEntryFunction(ExternalReference(f, isolate())); |
4578 CEntryStub stub(isolate(), 1, save_doubles); | 4579 CEntryStub stub(isolate(), 1, save_doubles); |
4579 CallStub(&stub); | 4580 CallStub(&stub, TypeFeedbackId::None(), al, zero_reg, Operand(zero_reg), bd); |
4580 } | 4581 } |
4581 | 4582 |
4582 | 4583 |
4583 void MacroAssembler::CallExternalReference(const ExternalReference& ext, | 4584 void MacroAssembler::CallExternalReference(const ExternalReference& ext, |
4584 int num_arguments, | 4585 int num_arguments, |
4585 BranchDelaySlot bd) { | 4586 BranchDelaySlot bd) { |
4586 PrepareCEntryArgs(num_arguments); | 4587 PrepareCEntryArgs(num_arguments); |
4587 PrepareCEntryFunction(ext); | 4588 PrepareCEntryFunction(ext); |
4588 | 4589 |
4589 CEntryStub stub(isolate(), 1); | 4590 CEntryStub stub(isolate(), 1); |
(...skipping 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6115 if (mag.shift > 0) sra(result, result, mag.shift); | 6116 if (mag.shift > 0) sra(result, result, mag.shift); |
6116 srl(at, dividend, 31); | 6117 srl(at, dividend, 31); |
6117 Addu(result, result, Operand(at)); | 6118 Addu(result, result, Operand(at)); |
6118 } | 6119 } |
6119 | 6120 |
6120 | 6121 |
6121 } // namespace internal | 6122 } // namespace internal |
6122 } // namespace v8 | 6123 } // namespace v8 |
6123 | 6124 |
6124 #endif // V8_TARGET_ARCH_MIPS | 6125 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |