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

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

Issue 927363004: Verify/document assumption about stack resource addresses. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
« 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 3842 matching lines...) Expand 10 before | Expand all | Expand 10 after
3853 SimulatorSetjmpBuffer* buf = last_setjmp_buffer(); 3853 SimulatorSetjmpBuffer* buf = last_setjmp_buffer();
3854 while (buf->link() != NULL && buf->link()->sp() <= sp) { 3854 while (buf->link() != NULL && buf->link()->sp() <= sp) {
3855 buf = buf->link(); 3855 buf = buf->link();
3856 } 3856 }
3857 ASSERT(buf != NULL); 3857 ASSERT(buf != NULL);
3858 3858
3859 // The C++ caller has not cleaned up the stack memory of C++ frames. 3859 // The C++ caller has not cleaned up the stack memory of C++ frames.
3860 // Prepare for unwinding frames by destroying all the stack resources 3860 // Prepare for unwinding frames by destroying all the stack resources
3861 // in the previous C++ frames. 3861 // in the previous C++ frames.
3862 uword native_sp = buf->native_sp(); 3862 uword native_sp = buf->native_sp();
3863 while (isolate->top_resource() != NULL && 3863 StackResource::Unwind(isolate, native_sp);
3864 (reinterpret_cast<uword>(isolate->top_resource()) < native_sp)) {
3865 isolate->top_resource()->~StackResource();
3866 }
3867 3864
3868 // Unwind the C++ stack and continue simulation in the target frame. 3865 // Unwind the C++ stack and continue simulation in the target frame.
3869 set_register(PC, static_cast<int32_t>(pc)); 3866 set_register(PC, static_cast<int32_t>(pc));
3870 set_register(SP, static_cast<int32_t>(sp)); 3867 set_register(SP, static_cast<int32_t>(sp));
3871 set_register(FP, static_cast<int32_t>(fp)); 3868 set_register(FP, static_cast<int32_t>(fp));
3872 // Set the tag. 3869 // Set the tag.
3873 isolate->set_vm_tag(VMTag::kDartTagId); 3870 isolate->set_vm_tag(VMTag::kDartTagId);
3874 // Clear top exit frame. 3871 // Clear top exit frame.
3875 isolate->set_top_exit_frame_info(0); 3872 isolate->set_top_exit_frame_info(0);
3876 3873
3877 ASSERT(raw_exception != Object::null()); 3874 ASSERT(raw_exception != Object::null());
3878 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); 3875 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception));
3879 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); 3876 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace));
3880 buf->Longjmp(); 3877 buf->Longjmp();
3881 } 3878 }
3882 3879
3883 } // namespace dart 3880 } // namespace dart
3884 3881
3885 #endif // !defined(HOST_ARCH_ARM) 3882 #endif // !defined(HOST_ARCH_ARM)
3886 3883
3887 #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