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_MIPS64 | 9 #if V8_TARGET_ARCH_MIPS64 |
10 | 10 |
(...skipping 3204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3215 PrepareCEntryFunction(ExternalReference(Runtime::kDebugBreak, isolate())); | 3215 PrepareCEntryFunction(ExternalReference(Runtime::kDebugBreak, isolate())); |
3216 CEntryStub ces(isolate(), 1); | 3216 CEntryStub ces(isolate(), 1); |
3217 DCHECK(AllowThisStubCall(&ces)); | 3217 DCHECK(AllowThisStubCall(&ces)); |
3218 Call(ces.GetCode(), RelocInfo::DEBUG_BREAK); | 3218 Call(ces.GetCode(), RelocInfo::DEBUG_BREAK); |
3219 } | 3219 } |
3220 | 3220 |
3221 | 3221 |
3222 // --------------------------------------------------------------------------- | 3222 // --------------------------------------------------------------------------- |
3223 // Exception handling. | 3223 // Exception handling. |
3224 | 3224 |
3225 void MacroAssembler::PushTryHandler(StackHandler::Kind kind, | 3225 void MacroAssembler::PushStackHandler() { |
3226 int handler_index) { | |
3227 // Adjust this code if not the case. | 3226 // Adjust this code if not the case. |
3228 STATIC_ASSERT(StackHandlerConstants::kSize == 3 * kPointerSize); | 3227 STATIC_ASSERT(StackHandlerConstants::kSize == 1 * kPointerSize); |
3229 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); | 3228 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); |
3230 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize); | |
3231 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize); | |
3232 | |
3233 // For the JSEntry handler, we must preserve a0-a3 and s0. | |
3234 // a5-a7 are available. We will build up the handler from the bottom by | |
3235 // pushing on the stack. | |
3236 // Set up the the index (a6) for pushing. | |
3237 li(a6, Operand(handler_index)); | |
3238 | |
3239 // Push the context and index. | |
3240 if (kind == StackHandler::JS_ENTRY) { | |
3241 DCHECK(Smi::FromInt(0) == 0); | |
3242 // The zero_reg indicates no context. | |
3243 // The operands are reversed to match the order of MultiPush/Pop. | |
3244 Push(zero_reg, a6); | |
3245 } else { | |
3246 MultiPush(a6.bit() | cp.bit()); | |
3247 } | |
3248 | 3229 |
3249 // Link the current handler as the next handler. | 3230 // Link the current handler as the next handler. |
3250 li(a6, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); | 3231 li(a6, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); |
3251 ld(a5, MemOperand(a6)); | 3232 ld(a5, MemOperand(a6)); |
3252 push(a5); | 3233 push(a5); |
| 3234 |
3253 // Set this new handler as the current one. | 3235 // Set this new handler as the current one. |
3254 sd(sp, MemOperand(a6)); | 3236 sd(sp, MemOperand(a6)); |
3255 } | 3237 } |
3256 | 3238 |
3257 | 3239 |
3258 void MacroAssembler::PopTryHandler() { | 3240 void MacroAssembler::PopStackHandler() { |
3259 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); | 3241 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); |
3260 pop(a1); | 3242 pop(a1); |
3261 Daddu(sp, sp, Operand(StackHandlerConstants::kSize - kPointerSize)); | 3243 Daddu(sp, sp, Operand(StackHandlerConstants::kSize - kPointerSize)); |
3262 li(at, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); | 3244 li(at, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); |
3263 sd(a1, MemOperand(at)); | 3245 sd(a1, MemOperand(at)); |
3264 } | 3246 } |
3265 | 3247 |
3266 | 3248 |
3267 void MacroAssembler::Allocate(int object_size, | 3249 void MacroAssembler::Allocate(int object_size, |
3268 Register result, | 3250 Register result, |
(...skipping 2831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6100 } | 6082 } |
6101 if (mag.shift > 0) sra(result, result, mag.shift); | 6083 if (mag.shift > 0) sra(result, result, mag.shift); |
6102 srl(at, dividend, 31); | 6084 srl(at, dividend, 31); |
6103 Addu(result, result, Operand(at)); | 6085 Addu(result, result, Operand(at)); |
6104 } | 6086 } |
6105 | 6087 |
6106 | 6088 |
6107 } } // namespace v8::internal | 6089 } } // namespace v8::internal |
6108 | 6090 |
6109 #endif // V8_TARGET_ARCH_MIPS64 | 6091 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |