OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1274 // If the handler is a JS frame, restore the context to the frame. | 1274 // If the handler is a JS frame, restore the context to the frame. |
1275 // (kind == ENTRY) == (fp == 0) == (cp == 0), so we could test either fp | 1275 // (kind == ENTRY) == (fp == 0) == (cp == 0), so we could test either fp |
1276 // or cp. | 1276 // or cp. |
1277 tst(cp, cp); | 1277 tst(cp, cp); |
1278 str(cp, MemOperand(fp, StandardFrameConstants::kContextOffset), ne); | 1278 str(cp, MemOperand(fp, StandardFrameConstants::kContextOffset), ne); |
1279 | 1279 |
1280 JumpToHandlerEntry(); | 1280 JumpToHandlerEntry(); |
1281 } | 1281 } |
1282 | 1282 |
1283 | 1283 |
1284 void MacroAssembler::ThrowUncatchable(UncatchableExceptionType type, | 1284 void MacroAssembler::ThrowUncatchable(Register value) { |
1285 Register value) { | |
1286 // Adjust this code if not the case. | 1285 // Adjust this code if not the case. |
1287 STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize); | 1286 STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize); |
1288 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); | 1287 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); |
1289 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize); | 1288 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize); |
1290 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize); | 1289 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize); |
1291 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize); | 1290 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize); |
1292 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize); | 1291 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize); |
1293 | 1292 |
1294 // The exception is expected in r0. | 1293 // The exception is expected in r0. |
1295 if (type == OUT_OF_MEMORY) { | 1294 if (!value.is(r0)) { |
1296 // Set external caught exception to false. | |
1297 ExternalReference external_caught(Isolate::kExternalCaughtExceptionAddress, | |
1298 isolate()); | |
1299 mov(r0, Operand(false, RelocInfo::NONE)); | |
1300 mov(r2, Operand(external_caught)); | |
1301 str(r0, MemOperand(r2)); | |
1302 | |
1303 // Set pending exception and r0 to out of memory exception. | |
1304 Failure* out_of_memory = Failure::OutOfMemoryException(); | |
1305 mov(r0, Operand(reinterpret_cast<int32_t>(out_of_memory))); | |
1306 mov(r2, Operand(ExternalReference(Isolate::kPendingExceptionAddress, | |
1307 isolate()))); | |
1308 str(r0, MemOperand(r2)); | |
1309 } else if (!value.is(r0)) { | |
1310 mov(r0, value); | 1295 mov(r0, value); |
1311 } | 1296 } |
1312 | |
1313 // Drop the stack pointer to the top of the top stack handler. | 1297 // Drop the stack pointer to the top of the top stack handler. |
1314 mov(r3, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); | 1298 mov(r3, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); |
1315 ldr(sp, MemOperand(r3)); | 1299 ldr(sp, MemOperand(r3)); |
1316 | 1300 |
1317 // Unwind the handlers until the ENTRY handler is found. | 1301 // Unwind the handlers until the ENTRY handler is found. |
1318 Label fetch_next, check_kind; | 1302 Label fetch_next, check_kind; |
1319 jmp(&check_kind); | 1303 jmp(&check_kind); |
1320 bind(&fetch_next); | 1304 bind(&fetch_next); |
1321 ldr(sp, MemOperand(sp, StackHandlerConstants::kNextOffset)); | 1305 ldr(sp, MemOperand(sp, StackHandlerConstants::kNextOffset)); |
1322 | 1306 |
(...skipping 2403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3726 void CodePatcher::EmitCondition(Condition cond) { | 3710 void CodePatcher::EmitCondition(Condition cond) { |
3727 Instr instr = Assembler::instr_at(masm_.pc_); | 3711 Instr instr = Assembler::instr_at(masm_.pc_); |
3728 instr = (instr & ~kCondMask) | cond; | 3712 instr = (instr & ~kCondMask) | cond; |
3729 masm_.emit(instr); | 3713 masm_.emit(instr); |
3730 } | 3714 } |
3731 | 3715 |
3732 | 3716 |
3733 } } // namespace v8::internal | 3717 } } // namespace v8::internal |
3734 | 3718 |
3735 #endif // V8_TARGET_ARCH_ARM | 3719 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |