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

Side by Side Diff: runtime/vm/simulator_arm.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/longjump.cc ('k') | runtime/vm/simulator_arm64.cc » ('j') | 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_ARM) 9 #if defined(TARGET_ARCH_ARM)
10 10
(...skipping 3841 matching lines...) Expand 10 before | Expand all | Expand 10 after
3852 SimulatorSetjmpBuffer* buf = last_setjmp_buffer(); 3852 SimulatorSetjmpBuffer* buf = last_setjmp_buffer();
3853 while (buf->link() != NULL && buf->link()->sp() <= sp) { 3853 while (buf->link() != NULL && buf->link()->sp() <= sp) {
3854 buf = buf->link(); 3854 buf = buf->link();
3855 } 3855 }
3856 ASSERT(buf != NULL); 3856 ASSERT(buf != NULL);
3857 3857
3858 // The C++ caller has not cleaned up the stack memory of C++ frames. 3858 // The C++ caller has not cleaned up the stack memory of C++ frames.
3859 // Prepare for unwinding frames by destroying all the stack resources 3859 // Prepare for unwinding frames by destroying all the stack resources
3860 // in the previous C++ frames. 3860 // in the previous C++ frames.
3861 Isolate* isolate = thread->isolate(); 3861 Isolate* isolate = thread->isolate();
3862 StackResource::Unwind(isolate); 3862 StackResource::Unwind(thread);
3863 3863
3864 // Unwind the C++ stack and continue simulation in the target frame. 3864 // Unwind the C++ stack and continue simulation in the target frame.
3865 set_register(PC, static_cast<int32_t>(pc)); 3865 set_register(PC, static_cast<int32_t>(pc));
3866 set_register(SP, static_cast<int32_t>(sp)); 3866 set_register(SP, static_cast<int32_t>(sp));
3867 set_register(FP, static_cast<int32_t>(fp)); 3867 set_register(FP, static_cast<int32_t>(fp));
3868 set_register(THR, reinterpret_cast<uword>(thread)); 3868 set_register(THR, reinterpret_cast<uword>(thread));
3869 // Set the tag. 3869 // Set the tag.
3870 isolate->set_vm_tag(VMTag::kDartTagId); 3870 isolate->set_vm_tag(VMTag::kDartTagId);
3871 // Clear top exit frame. 3871 // Clear top exit frame.
3872 isolate->set_top_exit_frame_info(0); 3872 isolate->set_top_exit_frame_info(0);
3873 3873
3874 ASSERT(raw_exception != Object::null()); 3874 ASSERT(raw_exception != Object::null());
3875 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); 3875 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception));
3876 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); 3876 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace));
3877 buf->Longjmp(); 3877 buf->Longjmp();
3878 } 3878 }
3879 3879
3880 } // namespace dart 3880 } // namespace dart
3881 3881
3882 #endif // defined(USING_SIMULATOR) 3882 #endif // defined(USING_SIMULATOR)
3883 3883
3884 #endif // defined TARGET_ARCH_ARM 3884 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/longjump.cc ('k') | runtime/vm/simulator_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698