| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include <setjmp.h> // NOLINT | 5 #include <setjmp.h> // NOLINT |
| 6 #include <stdlib.h> | 6 #include <stdlib.h> |
| 7 | 7 |
| 8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
| 9 #if defined(TARGET_ARCH_ARM64) | 9 #if defined(TARGET_ARCH_ARM64) |
| 10 | 10 |
| (...skipping 3465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3476 SimulatorSetjmpBuffer* buf = last_setjmp_buffer(); | 3476 SimulatorSetjmpBuffer* buf = last_setjmp_buffer(); |
| 3477 while (buf->link() != NULL && buf->link()->sp() <= sp) { | 3477 while (buf->link() != NULL && buf->link()->sp() <= sp) { |
| 3478 buf = buf->link(); | 3478 buf = buf->link(); |
| 3479 } | 3479 } |
| 3480 ASSERT(buf != NULL); | 3480 ASSERT(buf != NULL); |
| 3481 | 3481 |
| 3482 // The C++ caller has not cleaned up the stack memory of C++ frames. | 3482 // The C++ caller has not cleaned up the stack memory of C++ frames. |
| 3483 // Prepare for unwinding frames by destroying all the stack resources | 3483 // Prepare for unwinding frames by destroying all the stack resources |
| 3484 // in the previous C++ frames. | 3484 // in the previous C++ frames. |
| 3485 uword native_sp = buf->native_sp(); | 3485 uword native_sp = buf->native_sp(); |
| 3486 while (isolate->top_resource() != NULL && | 3486 StackResource::Unwind(isolate, native_sp); |
| 3487 (reinterpret_cast<uword>(isolate->top_resource()) < native_sp)) { | |
| 3488 isolate->top_resource()->~StackResource(); | |
| 3489 } | |
| 3490 | 3487 |
| 3491 // Unwind the C++ stack and continue simulation in the target frame. | 3488 // Unwind the C++ stack and continue simulation in the target frame. |
| 3492 set_pc(static_cast<int64_t>(pc)); | 3489 set_pc(static_cast<int64_t>(pc)); |
| 3493 set_register(NULL, SP, static_cast<int64_t>(sp)); | 3490 set_register(NULL, SP, static_cast<int64_t>(sp)); |
| 3494 set_register(NULL, FP, static_cast<int64_t>(fp)); | 3491 set_register(NULL, FP, static_cast<int64_t>(fp)); |
| 3495 // Set the tag. | 3492 // Set the tag. |
| 3496 isolate->set_vm_tag(VMTag::kDartTagId); | 3493 isolate->set_vm_tag(VMTag::kDartTagId); |
| 3497 // Clear top exit frame. | 3494 // Clear top exit frame. |
| 3498 isolate->set_top_exit_frame_info(0); | 3495 isolate->set_top_exit_frame_info(0); |
| 3499 | 3496 |
| 3500 ASSERT(raw_exception != Object::null()); | 3497 ASSERT(raw_exception != Object::null()); |
| 3501 set_register(NULL, kExceptionObjectReg, bit_cast<int64_t>(raw_exception)); | 3498 set_register(NULL, kExceptionObjectReg, bit_cast<int64_t>(raw_exception)); |
| 3502 set_register(NULL, kStackTraceObjectReg, bit_cast<int64_t>(raw_stacktrace)); | 3499 set_register(NULL, kStackTraceObjectReg, bit_cast<int64_t>(raw_stacktrace)); |
| 3503 buf->Longjmp(); | 3500 buf->Longjmp(); |
| 3504 } | 3501 } |
| 3505 | 3502 |
| 3506 } // namespace dart | 3503 } // namespace dart |
| 3507 | 3504 |
| 3508 #endif // !defined(HOST_ARCH_ARM64) | 3505 #endif // !defined(HOST_ARCH_ARM64) |
| 3509 | 3506 |
| 3510 #endif // defined TARGET_ARCH_ARM64 | 3507 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |