| OLD | NEW |
| 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" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 return ((top_exit_frame_info == 0) || (jumpbuf_addr < top_exit_frame_info)); | 35 return ((top_exit_frame_info == 0) || (jumpbuf_addr < top_exit_frame_info)); |
| 36 } | 36 } |
| 37 | 37 |
| 38 | 38 |
| 39 void LongJumpScope::Jump(int value, const Error& error) { | 39 void LongJumpScope::Jump(int value, const Error& error) { |
| 40 // A zero is the default return value from setting up a LongJumpScope | 40 // A zero is the default return value from setting up a LongJumpScope |
| 41 // using Set. | 41 // using Set. |
| 42 ASSERT(value != 0); | 42 ASSERT(value != 0); |
| 43 ASSERT(IsSafeToJump()); | 43 ASSERT(IsSafeToJump()); |
| 44 | 44 |
| 45 Isolate* isolate = Isolate::Current(); | 45 Thread* thread = Thread::Current(); |
| 46 Isolate* isolate = thread->isolate(); |
| 46 | 47 |
| 47 #if defined(DEBUG) | 48 #if defined(DEBUG) |
| 48 #define CHECK_REUSABLE_HANDLE(name) \ | 49 #define CHECK_REUSABLE_HANDLE(name) \ |
| 49 ASSERT(!isolate->reusable_##name##_handle_scope_active()); | 50 ASSERT(!isolate->reusable_##name##_handle_scope_active()); |
| 50 REUSABLE_HANDLE_LIST(CHECK_REUSABLE_HANDLE) | 51 REUSABLE_HANDLE_LIST(CHECK_REUSABLE_HANDLE) |
| 51 #undef CHECK_REUSABLE_HANDLE | 52 #undef CHECK_REUSABLE_HANDLE |
| 52 #endif // defined(DEBUG) | 53 #endif // defined(DEBUG) |
| 53 | 54 |
| 54 // Remember the error in the sticky error of this isolate. | 55 // Remember the error in the sticky error of this isolate. |
| 55 isolate->object_store()->set_sticky_error(error); | 56 isolate->object_store()->set_sticky_error(error); |
| 56 | 57 |
| 57 // Destruct all the active StackResource objects. | 58 // Destruct all the active StackResource objects. |
| 58 StackResource::UnwindAbove(isolate, top_); | 59 StackResource::UnwindAbove(thread, top_); |
| 59 longjmp(environment_, value); | 60 longjmp(environment_, value); |
| 60 UNREACHABLE(); | 61 UNREACHABLE(); |
| 61 } | 62 } |
| 62 | 63 |
| 63 } // namespace dart | 64 } // namespace dart |
| OLD | NEW |