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 3207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::PushTryHandler(StackHandler::Kind kind, |
3226 int handler_index) { | 3226 int handler_index) { |
3227 // Adjust this code if not the case. | 3227 // Adjust this code if not the case. |
3228 STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize); | 3228 STATIC_ASSERT(StackHandlerConstants::kSize == 3 * kPointerSize); |
3229 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); | 3229 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); |
3230 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize); | 3230 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize); |
3231 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize); | 3231 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize); |
3232 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 3 * kPointerSize); | |
3233 | 3232 |
3234 // For the JSEntry handler, we must preserve a0-a3 and s0. | 3233 // For the JSEntry handler, we must preserve a0-a3 and s0. |
3235 // a5-a7 are available. We will build up the handler from the bottom by | 3234 // a5-a7 are available. We will build up the handler from the bottom by |
3236 // pushing on the stack. | 3235 // pushing on the stack. |
3237 // Set up the the state (r6) for pushing. | 3236 // Set up the the state (r6) for pushing. |
3238 unsigned state = | 3237 unsigned state = |
3239 StackHandler::IndexField::encode(handler_index) | | 3238 StackHandler::IndexField::encode(handler_index) | |
3240 StackHandler::KindField::encode(kind); | 3239 StackHandler::KindField::encode(kind); |
3241 li(a5, Operand(CodeObject()), CONSTANT_SIZE); | 3240 li(a5, Operand(CodeObject()), CONSTANT_SIZE); |
3242 li(a6, Operand(state)); | 3241 li(a6, Operand(state)); |
3243 | 3242 |
3244 // Push the frame pointer, context, and state. | 3243 // Push the context and state. |
3245 if (kind == StackHandler::JS_ENTRY) { | 3244 if (kind == StackHandler::JS_ENTRY) { |
3246 DCHECK_EQ(static_cast<Smi*>(0), Smi::FromInt(0)); | 3245 DCHECK(Smi::FromInt(0) == 0); |
3247 // The second zero_reg indicates no context. | 3246 // The zero_reg indicates no context. |
3248 // The first zero_reg is the NULL frame pointer. | |
3249 // The operands are reversed to match the order of MultiPush/Pop. | 3247 // The operands are reversed to match the order of MultiPush/Pop. |
3250 Push(zero_reg, zero_reg, a6); | 3248 Push(zero_reg, a6); |
3251 } else { | 3249 } else { |
3252 MultiPush(a6.bit() | cp.bit() | fp.bit()); | 3250 MultiPush(a6.bit() | cp.bit()); |
3253 } | 3251 } |
3254 | 3252 |
3255 // Link the current handler as the next handler. | 3253 // Link the current handler as the next handler. |
3256 li(a6, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); | 3254 li(a6, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); |
3257 ld(a5, MemOperand(a6)); | 3255 ld(a5, MemOperand(a6)); |
3258 push(a5); | 3256 push(a5); |
3259 // Set this new handler as the current one. | 3257 // Set this new handler as the current one. |
3260 sd(sp, MemOperand(a6)); | 3258 sd(sp, MemOperand(a6)); |
3261 } | 3259 } |
3262 | 3260 |
(...skipping 2843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6106 } | 6104 } |
6107 if (mag.shift > 0) sra(result, result, mag.shift); | 6105 if (mag.shift > 0) sra(result, result, mag.shift); |
6108 srl(at, dividend, 31); | 6106 srl(at, dividend, 31); |
6109 Addu(result, result, Operand(at)); | 6107 Addu(result, result, Operand(at)); |
6110 } | 6108 } |
6111 | 6109 |
6112 | 6110 |
6113 } } // namespace v8::internal | 6111 } } // namespace v8::internal |
6114 | 6112 |
6115 #endif // V8_TARGET_ARCH_MIPS64 | 6113 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |