Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: runtime/vm/simulator_mips.cc

Issue 1261873005: Migrate stack resource unwinding to Thread. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Simulators. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/simulator_arm64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2449 matching lines...) Expand 10 before | Expand all | Expand 10 after
2460 SimulatorSetjmpBuffer* buf = last_setjmp_buffer(); 2460 SimulatorSetjmpBuffer* buf = last_setjmp_buffer();
2461 while (buf->link() != NULL && buf->link()->sp() <= sp) { 2461 while (buf->link() != NULL && buf->link()->sp() <= sp) {
2462 buf = buf->link(); 2462 buf = buf->link();
2463 } 2463 }
2464 ASSERT(buf != NULL); 2464 ASSERT(buf != NULL);
2465 2465
2466 // The C++ caller has not cleaned up the stack memory of C++ frames. 2466 // The C++ caller has not cleaned up the stack memory of C++ frames.
2467 // Prepare for unwinding frames by destroying all the stack resources 2467 // Prepare for unwinding frames by destroying all the stack resources
2468 // in the previous C++ frames. 2468 // in the previous C++ frames.
2469 Isolate* isolate = thread->isolate(); 2469 Isolate* isolate = thread->isolate();
2470 StackResource::Unwind(isolate); 2470 StackResource::Unwind(thread);
2471 2471
2472 // Unwind the C++ stack and continue simulation in the target frame. 2472 // Unwind the C++ stack and continue simulation in the target frame.
2473 set_pc(static_cast<int32_t>(pc)); 2473 set_pc(static_cast<int32_t>(pc));
2474 set_register(SP, static_cast<int32_t>(sp)); 2474 set_register(SP, static_cast<int32_t>(sp));
2475 set_register(FP, static_cast<int32_t>(fp)); 2475 set_register(FP, static_cast<int32_t>(fp));
2476 set_register(THR, reinterpret_cast<int32_t>(thread)); 2476 set_register(THR, reinterpret_cast<int32_t>(thread));
2477 // Set the tag. 2477 // Set the tag.
2478 isolate->set_vm_tag(VMTag::kDartTagId); 2478 isolate->set_vm_tag(VMTag::kDartTagId);
2479 // Clear top exit frame. 2479 // Clear top exit frame.
2480 isolate->set_top_exit_frame_info(0); 2480 isolate->set_top_exit_frame_info(0);
2481 2481
2482 ASSERT(raw_exception != Object::null()); 2482 ASSERT(raw_exception != Object::null());
2483 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); 2483 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception));
2484 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); 2484 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace));
2485 buf->Longjmp(); 2485 buf->Longjmp();
2486 } 2486 }
2487 2487
2488 } // namespace dart 2488 } // namespace dart
2489 2489
2490 #endif // defined(USING_SIMULATOR) 2490 #endif // defined(USING_SIMULATOR)
2491 2491
2492 #endif // defined TARGET_ARCH_MIPS 2492 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/simulator_arm64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698