| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_MIPS) | 9 #if defined(TARGET_ARCH_MIPS) |
| 10 | 10 |
| (...skipping 2458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2469 SimulatorSetjmpBuffer* buf = last_setjmp_buffer(); | 2469 SimulatorSetjmpBuffer* buf = last_setjmp_buffer(); |
| 2470 while (buf->link() != NULL && buf->link()->sp() <= sp) { | 2470 while (buf->link() != NULL && buf->link()->sp() <= sp) { |
| 2471 buf = buf->link(); | 2471 buf = buf->link(); |
| 2472 } | 2472 } |
| 2473 ASSERT(buf != NULL); | 2473 ASSERT(buf != NULL); |
| 2474 | 2474 |
| 2475 // The C++ caller has not cleaned up the stack memory of C++ frames. | 2475 // The C++ caller has not cleaned up the stack memory of C++ frames. |
| 2476 // Prepare for unwinding frames by destroying all the stack resources | 2476 // Prepare for unwinding frames by destroying all the stack resources |
| 2477 // in the previous C++ frames. | 2477 // in the previous C++ frames. |
| 2478 uword native_sp = buf->native_sp(); | 2478 uword native_sp = buf->native_sp(); |
| 2479 while (isolate->top_resource() != NULL && | 2479 StackResource::Unwind(isolate, native_sp); |
| 2480 (reinterpret_cast<uword>(isolate->top_resource()) < native_sp)) { | |
| 2481 isolate->top_resource()->~StackResource(); | |
| 2482 } | |
| 2483 | 2480 |
| 2484 // Unwind the C++ stack and continue simulation in the target frame. | 2481 // Unwind the C++ stack and continue simulation in the target frame. |
| 2485 set_pc(static_cast<int32_t>(pc)); | 2482 set_pc(static_cast<int32_t>(pc)); |
| 2486 set_register(SP, static_cast<int32_t>(sp)); | 2483 set_register(SP, static_cast<int32_t>(sp)); |
| 2487 set_register(FP, static_cast<int32_t>(fp)); | 2484 set_register(FP, static_cast<int32_t>(fp)); |
| 2488 // Set the tag. | 2485 // Set the tag. |
| 2489 isolate->set_vm_tag(VMTag::kDartTagId); | 2486 isolate->set_vm_tag(VMTag::kDartTagId); |
| 2490 // Clear top exit frame. | 2487 // Clear top exit frame. |
| 2491 isolate->set_top_exit_frame_info(0); | 2488 isolate->set_top_exit_frame_info(0); |
| 2492 | 2489 |
| 2493 ASSERT(raw_exception != Object::null()); | 2490 ASSERT(raw_exception != Object::null()); |
| 2494 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); | 2491 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); |
| 2495 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); | 2492 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); |
| 2496 buf->Longjmp(); | 2493 buf->Longjmp(); |
| 2497 } | 2494 } |
| 2498 | 2495 |
| 2499 } // namespace dart | 2496 } // namespace dart |
| 2500 | 2497 |
| 2501 #endif // !defined(HOST_ARCH_MIPS) | 2498 #endif // !defined(HOST_ARCH_MIPS) |
| 2502 | 2499 |
| 2503 #endif // defined TARGET_ARCH_MIPS | 2500 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |