OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1219 __ SetStackPointer(jssp); | 1219 __ SetStackPointer(jssp); |
1220 | 1220 |
1221 // Retrieve the handler context, SP and FP. | 1221 // Retrieve the handler context, SP and FP. |
1222 __ Mov(cp, Operand(pending_handler_context_address)); | 1222 __ Mov(cp, Operand(pending_handler_context_address)); |
1223 __ Ldr(cp, MemOperand(cp)); | 1223 __ Ldr(cp, MemOperand(cp)); |
1224 __ Mov(jssp, Operand(pending_handler_sp_address)); | 1224 __ Mov(jssp, Operand(pending_handler_sp_address)); |
1225 __ Ldr(jssp, MemOperand(jssp)); | 1225 __ Ldr(jssp, MemOperand(jssp)); |
1226 __ Mov(fp, Operand(pending_handler_fp_address)); | 1226 __ Mov(fp, Operand(pending_handler_fp_address)); |
1227 __ Ldr(fp, MemOperand(fp)); | 1227 __ Ldr(fp, MemOperand(fp)); |
1228 | 1228 |
1229 // If the handler is a JS frame, restore the context to the frame. | 1229 // If the handler is a JS frame, restore the context to the frame. Note that |
1230 // (kind == ENTRY) == (fp == 0) == (cp == 0), so we could test either fp | 1230 // the context will be set to (cp == 0) for non-JS frames. |
1231 // or cp. | |
1232 Label not_js_frame; | 1231 Label not_js_frame; |
1233 __ Cbz(cp, ¬_js_frame); | 1232 __ Cbz(cp, ¬_js_frame); |
1234 __ Str(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 1233 __ Str(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
1235 __ Bind(¬_js_frame); | 1234 __ Bind(¬_js_frame); |
1236 | 1235 |
1237 // Compute the handler entry address and jump to it. | 1236 // Compute the handler entry address and jump to it. |
1238 __ Mov(x10, Operand(pending_handler_code_address)); | 1237 __ Mov(x10, Operand(pending_handler_code_address)); |
1239 __ Ldr(x10, MemOperand(x10)); | 1238 __ Ldr(x10, MemOperand(x10)); |
1240 __ Mov(x11, Operand(pending_handler_offset_address)); | 1239 __ Mov(x11, Operand(pending_handler_offset_address)); |
1241 __ Ldr(x11, MemOperand(x11)); | 1240 __ Ldr(x11, MemOperand(x11)); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1339 // field in the JSEnv and return a failure sentinel. Coming in here the | 1338 // field in the JSEnv and return a failure sentinel. Coming in here the |
1340 // fp will be invalid because the PushTryHandler below sets it to 0 to | 1339 // fp will be invalid because the PushTryHandler below sets it to 0 to |
1341 // signal the existence of the JSEntry frame. | 1340 // signal the existence of the JSEntry frame. |
1342 __ Mov(x10, Operand(ExternalReference(Isolate::kPendingExceptionAddress, | 1341 __ Mov(x10, Operand(ExternalReference(Isolate::kPendingExceptionAddress, |
1343 isolate()))); | 1342 isolate()))); |
1344 } | 1343 } |
1345 __ Str(code_entry, MemOperand(x10)); | 1344 __ Str(code_entry, MemOperand(x10)); |
1346 __ LoadRoot(x0, Heap::kExceptionRootIndex); | 1345 __ LoadRoot(x0, Heap::kExceptionRootIndex); |
1347 __ B(&exit); | 1346 __ B(&exit); |
1348 | 1347 |
1349 // Invoke: Link this frame into the handler chain. There's only one | 1348 // Invoke: Link this frame into the handler chain. |
1350 // handler block in this code object, so its index is 0. | |
1351 __ Bind(&invoke); | 1349 __ Bind(&invoke); |
1352 __ PushTryHandler(StackHandler::JS_ENTRY, 0); | 1350 __ PushStackHandler(); |
1353 // If an exception not caught by another handler occurs, this handler | 1351 // If an exception not caught by another handler occurs, this handler |
1354 // returns control to the code after the B(&invoke) above, which | 1352 // returns control to the code after the B(&invoke) above, which |
1355 // restores all callee-saved registers (including cp and fp) to their | 1353 // restores all callee-saved registers (including cp and fp) to their |
1356 // saved values before returning a failure to C. | 1354 // saved values before returning a failure to C. |
1357 | 1355 |
1358 // Clear any pending exceptions. | 1356 // Clear any pending exceptions. |
1359 __ Mov(x10, Operand(isolate()->factory()->the_hole_value())); | 1357 __ Mov(x10, Operand(isolate()->factory()->the_hole_value())); |
1360 __ Mov(x11, Operand(ExternalReference(Isolate::kPendingExceptionAddress, | 1358 __ Mov(x11, Operand(ExternalReference(Isolate::kPendingExceptionAddress, |
1361 isolate()))); | 1359 isolate()))); |
1362 __ Str(x10, MemOperand(x11)); | 1360 __ Str(x10, MemOperand(x11)); |
(...skipping 13 matching lines...) Expand all Loading... |
1376 : Builtins::kJSEntryTrampoline, | 1374 : Builtins::kJSEntryTrampoline, |
1377 isolate()); | 1375 isolate()); |
1378 __ Mov(x10, entry); | 1376 __ Mov(x10, entry); |
1379 | 1377 |
1380 // Call the JSEntryTrampoline. | 1378 // Call the JSEntryTrampoline. |
1381 __ Ldr(x11, MemOperand(x10)); // Dereference the address. | 1379 __ Ldr(x11, MemOperand(x10)); // Dereference the address. |
1382 __ Add(x12, x11, Code::kHeaderSize - kHeapObjectTag); | 1380 __ Add(x12, x11, Code::kHeaderSize - kHeapObjectTag); |
1383 __ Blr(x12); | 1381 __ Blr(x12); |
1384 | 1382 |
1385 // Unlink this frame from the handler chain. | 1383 // Unlink this frame from the handler chain. |
1386 __ PopTryHandler(); | 1384 __ PopStackHandler(); |
1387 | 1385 |
1388 | 1386 |
1389 __ Bind(&exit); | 1387 __ Bind(&exit); |
1390 // x0 holds the result. | 1388 // x0 holds the result. |
1391 // The stack pointer points to the top of the entry frame pushed on entry from | 1389 // The stack pointer points to the top of the entry frame pushed on entry from |
1392 // C++ (at the beginning of this stub): | 1390 // C++ (at the beginning of this stub): |
1393 // jssp[0] : JS entry frame marker. | 1391 // jssp[0] : JS entry frame marker. |
1394 // jssp[1] : C entry FP. | 1392 // jssp[1] : C entry FP. |
1395 // jssp[2] : stack frame marker. | 1393 // jssp[2] : stack frame marker. |
1396 // jssp[3] : stack frmae marker. | 1394 // jssp[3] : stack frmae marker. |
(...skipping 4348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5745 kStackUnwindSpace, NULL, spill_offset, | 5743 kStackUnwindSpace, NULL, spill_offset, |
5746 MemOperand(fp, 6 * kPointerSize), NULL); | 5744 MemOperand(fp, 6 * kPointerSize), NULL); |
5747 } | 5745 } |
5748 | 5746 |
5749 | 5747 |
5750 #undef __ | 5748 #undef __ |
5751 | 5749 |
5752 } } // namespace v8::internal | 5750 } } // namespace v8::internal |
5753 | 5751 |
5754 #endif // V8_TARGET_ARCH_ARM64 | 5752 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |