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

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

Issue 393103002: Revert r38240 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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/simulator_arm64.h ('k') | runtime/vm/simulator_mips.h » ('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) 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> 5 #include <setjmp.h>
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 3007 matching lines...) Expand 10 before | Expand all | Expand 10 after
3018 return_value = get_register(R0); 3018 return_value = get_register(R0);
3019 } 3019 }
3020 return return_value; 3020 return return_value;
3021 } 3021 }
3022 3022
3023 3023
3024 void Simulator::Longjmp(uword pc, 3024 void Simulator::Longjmp(uword pc,
3025 uword sp, 3025 uword sp,
3026 uword fp, 3026 uword fp,
3027 RawObject* raw_exception, 3027 RawObject* raw_exception,
3028 RawObject* raw_stacktrace, 3028 RawObject* raw_stacktrace) {
3029 Isolate* isolate) {
3030 // Walk over all setjmp buffers (simulated --> C++ transitions) 3029 // Walk over all setjmp buffers (simulated --> C++ transitions)
3031 // and try to find the setjmp associated with the simulated stack pointer. 3030 // and try to find the setjmp associated with the simulated stack pointer.
3032 SimulatorSetjmpBuffer* buf = last_setjmp_buffer(); 3031 SimulatorSetjmpBuffer* buf = last_setjmp_buffer();
3033 while (buf->link() != NULL && buf->link()->sp() <= sp) { 3032 while (buf->link() != NULL && buf->link()->sp() <= sp) {
3034 buf = buf->link(); 3033 buf = buf->link();
3035 } 3034 }
3036 ASSERT(buf != NULL); 3035 ASSERT(buf != NULL);
3037 3036
3038 // The C++ caller has not cleaned up the stack memory of C++ frames. 3037 // The C++ caller has not cleaned up the stack memory of C++ frames.
3039 // Prepare for unwinding frames by destroying all the stack resources 3038 // Prepare for unwinding frames by destroying all the stack resources
3040 // in the previous C++ frames. 3039 // in the previous C++ frames.
3041 uword native_sp = buf->native_sp(); 3040 uword native_sp = buf->native_sp();
3041 Isolate* isolate = Isolate::Current();
3042 while (isolate->top_resource() != NULL && 3042 while (isolate->top_resource() != NULL &&
3043 (reinterpret_cast<uword>(isolate->top_resource()) < native_sp)) { 3043 (reinterpret_cast<uword>(isolate->top_resource()) < native_sp)) {
3044 isolate->top_resource()->~StackResource(); 3044 isolate->top_resource()->~StackResource();
3045 } 3045 }
3046 3046
3047 // Unwind the C++ stack and continue simulation in the target frame. 3047 // Unwind the C++ stack and continue simulation in the target frame.
3048 set_pc(static_cast<int64_t>(pc)); 3048 set_pc(static_cast<int64_t>(pc));
3049 set_register(NULL, SP, static_cast<int64_t>(sp)); 3049 set_register(NULL, SP, static_cast<int64_t>(sp));
3050 set_register(NULL, FP, static_cast<int64_t>(fp)); 3050 set_register(NULL, FP, static_cast<int64_t>(fp));
3051 // Set the tag.
3052 isolate->set_vm_tag(VMTag::kScriptTagId);
3053 // Clear top exit frame.
3054 isolate->set_top_exit_frame_info(0);
3055 3051
3056 ASSERT(raw_exception != Object::null()); 3052 ASSERT(raw_exception != Object::null());
3057 set_register(NULL, kExceptionObjectReg, bit_cast<int64_t>(raw_exception)); 3053 set_register(NULL, kExceptionObjectReg, bit_cast<int64_t>(raw_exception));
3058 set_register(NULL, kStackTraceObjectReg, bit_cast<int64_t>(raw_stacktrace)); 3054 set_register(NULL, kStackTraceObjectReg, bit_cast<int64_t>(raw_stacktrace));
3059 buf->Longjmp(); 3055 buf->Longjmp();
3060 } 3056 }
3061 3057
3062 } // namespace dart 3058 } // namespace dart
3063 3059
3064 #endif // !defined(HOST_ARCH_ARM64) 3060 #endif // !defined(HOST_ARCH_ARM64)
3065 3061
3066 #endif // defined TARGET_ARCH_ARM64 3062 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/simulator_arm64.h ('k') | runtime/vm/simulator_mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698