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

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

Issue 13502002: Support FrameLookup vm test on ARM, requiring among other things: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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/intermediate_language_x64.cc ('k') | runtime/vm/simulator_arm.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 "vm/longjump.h" 5 #include "vm/longjump.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 8
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
11 #include "vm/object.h" 11 #include "vm/object.h"
12 #include "vm/object_store.h" 12 #include "vm/object_store.h"
13 #include "vm/os.h" 13 #include "vm/os.h"
14 #include "vm/simulator.h"
14 15
15 namespace dart { 16 namespace dart {
16 17
17 jmp_buf* LongJump::Set() { 18 jmp_buf* LongJump::Set() {
18 top_ = Isolate::Current()->top_resource(); 19 top_ = Isolate::Current()->top_resource();
19 return &environment_; 20 return &environment_;
20 } 21 }
21 22
22 23
23 bool LongJump::IsSafeToJump() { 24 bool LongJump::IsSafeToJump() {
24 // We do not want to jump past Dart frames. Note that this code 25 // We do not want to jump past Dart frames. Note that this code
25 // assumes the stack grows from high to low. 26 // assumes the stack grows from high to low.
26 Isolate* isolate = Isolate::Current(); 27 Isolate* isolate = Isolate::Current();
27 uword jumpbuf_addr = reinterpret_cast<uword>(this); 28 uword jumpbuf_addr = reinterpret_cast<uword>(this);
28 return (isolate->top_exit_frame_info() == 0 || 29 #if defined(USING_SIMULATOR)
29 jumpbuf_addr < isolate->top_exit_frame_info()); 30 uword top_exit_frame_info = isolate->simulator()->top_exit_frame_info();
31 #else
32 uword top_exit_frame_info = isolate->top_exit_frame_info();
33 #endif
34 return ((top_exit_frame_info == 0) || (jumpbuf_addr < top_exit_frame_info));
30 } 35 }
31 36
32 37
33 void LongJump::Jump(int value, const Error& error) { 38 void LongJump::Jump(int value, const Error& error) {
34 // A zero is the default return value from setting up a LongJump using Set. 39 // A zero is the default return value from setting up a LongJump using Set.
35 ASSERT(value != 0); 40 ASSERT(value != 0);
36 ASSERT(IsSafeToJump()); 41 ASSERT(IsSafeToJump());
37 42
38 Isolate* isolate = Isolate::Current(); 43 Isolate* isolate = Isolate::Current();
39 44
40 // Remember the error in the sticky error of this isolate. 45 // Remember the error in the sticky error of this isolate.
41 isolate->object_store()->set_sticky_error(error); 46 isolate->object_store()->set_sticky_error(error);
42 47
43 // Destruct all the active StackResource objects. 48 // Destruct all the active StackResource objects.
44 StackResource* current_resource = isolate->top_resource(); 49 StackResource* current_resource = isolate->top_resource();
45 while (current_resource != top_) { 50 while (current_resource != top_) {
46 current_resource->~StackResource(); 51 current_resource->~StackResource();
47 current_resource = isolate->top_resource(); 52 current_resource = isolate->top_resource();
48 } 53 }
49 longjmp(environment_, value); 54 longjmp(environment_, value);
50 UNREACHABLE(); 55 UNREACHABLE();
51 } 56 }
52 57
53 } // namespace dart 58 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | runtime/vm/simulator_arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698