| 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 26 matching lines...) Expand all Loading... |
| 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 Isolate* isolate = Isolate::Current(); |
| 46 | 46 |
| 47 #if defined(DEBUG) |
| 48 #define CHECK_REUSABLE_HANDLE(name) \ |
| 49 ASSERT(!isolate->reusable_##name##_handle_scope_active()); |
| 50 REUSABLE_HANDLE_LIST(CHECK_REUSABLE_HANDLE) |
| 51 #undef CHECK_REUSABLE_HANDLE |
| 52 #endif // defined(DEBUG) |
| 53 |
| 47 // Remember the error in the sticky error of this isolate. | 54 // Remember the error in the sticky error of this isolate. |
| 48 isolate->object_store()->set_sticky_error(error); | 55 isolate->object_store()->set_sticky_error(error); |
| 49 | 56 |
| 50 // Destruct all the active StackResource objects. | 57 // Destruct all the active StackResource objects. |
| 51 StackResource* current_resource = isolate->top_resource(); | 58 StackResource* current_resource = isolate->top_resource(); |
| 52 while (current_resource != top_) { | 59 while (current_resource != top_) { |
| 53 current_resource->~StackResource(); | 60 current_resource->~StackResource(); |
| 54 current_resource = isolate->top_resource(); | 61 current_resource = isolate->top_resource(); |
| 55 } | 62 } |
| 56 longjmp(environment_, value); | 63 longjmp(environment_, value); |
| 57 UNREACHABLE(); | 64 UNREACHABLE(); |
| 58 } | 65 } |
| 59 | 66 |
| 60 } // namespace dart | 67 } // namespace dart |
| OLD | NEW |