| 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 #ifndef VM_DART_API_IMPL_H_ | 5 #ifndef VM_DART_API_IMPL_H_ |
| 6 #define VM_DART_API_IMPL_H_ | 6 #define VM_DART_API_IMPL_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/native_arguments.h" | 9 #include "vm/native_arguments.h" |
| 10 #include "vm/object.h" | 10 #include "vm/object.h" |
| 11 #include "vm/timer.h" | |
| 12 #include "vm/timer_scope.h" | |
| 13 | 11 |
| 14 namespace dart { | 12 namespace dart { |
| 15 | 13 |
| 16 DECLARE_FLAG(bool, trace_api); | 14 DECLARE_FLAG(bool, trace_api); |
| 17 | 15 |
| 18 class ApiLocalScope; | 16 class ApiLocalScope; |
| 19 class ApiState; | 17 class ApiState; |
| 20 class FinalizablePersistentHandle; | 18 class FinalizablePersistentHandle; |
| 21 class LocalHandle; | 19 class LocalHandle; |
| 22 class PersistentHandle; | 20 class PersistentHandle; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 #define CHECK_ISOLATE_SCOPE(isolate) \ | 58 #define CHECK_ISOLATE_SCOPE(isolate) \ |
| 61 do { \ | 59 do { \ |
| 62 Isolate* tmp = (isolate); \ | 60 Isolate* tmp = (isolate); \ |
| 63 CHECK_ISOLATE(tmp); \ | 61 CHECK_ISOLATE(tmp); \ |
| 64 ApiState* state = tmp->api_state(); \ | 62 ApiState* state = tmp->api_state(); \ |
| 65 ASSERT(state); \ | 63 ASSERT(state); \ |
| 66 if (state->top_scope() == NULL) { \ | 64 if (state->top_scope() == NULL) { \ |
| 67 FATAL1("%s expects to find a current scope. Did you forget to call " \ | 65 FATAL1("%s expects to find a current scope. Did you forget to call " \ |
| 68 "Dart_EnterScope?", CURRENT_FUNC); \ | 66 "Dart_EnterScope?", CURRENT_FUNC); \ |
| 69 } \ | 67 } \ |
| 70 } while (0); \ | 68 } while (0) |
| 71 NativeToVmTimerScope __temp_isolate_timer__(isolate); | |
| 72 | 69 |
| 73 #define DARTSCOPE(isolate) \ | 70 #define DARTSCOPE(isolate) \ |
| 74 Isolate* __temp_isolate__ = (isolate); \ | 71 Isolate* __temp_isolate__ = (isolate); \ |
| 75 CHECK_ISOLATE_SCOPE(__temp_isolate__); \ | 72 CHECK_ISOLATE_SCOPE(__temp_isolate__); \ |
| 76 HANDLESCOPE(__temp_isolate__); | 73 HANDLESCOPE(__temp_isolate__); |
| 77 | 74 |
| 78 | 75 |
| 79 #define RETURN_TYPE_ERROR(isolate, dart_handle, type) \ | 76 #define RETURN_TYPE_ERROR(isolate, dart_handle, type) \ |
| 80 do { \ | 77 do { \ |
| 81 const Object& tmp = \ | 78 const Object& tmp = \ |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 if (isolate->no_callback_scope_depth() != 0) { \ | 272 if (isolate->no_callback_scope_depth() != 0) { \ |
| 276 return reinterpret_cast<Dart_Handle>(Api::AcquiredError(isolate)); \ | 273 return reinterpret_cast<Dart_Handle>(Api::AcquiredError(isolate)); \ |
| 277 } \ | 274 } \ |
| 278 | 275 |
| 279 #define ASSERT_CALLBACK_STATE(isolate) \ | 276 #define ASSERT_CALLBACK_STATE(isolate) \ |
| 280 ASSERT(isolate->no_callback_scope_depth() == 0) | 277 ASSERT(isolate->no_callback_scope_depth() == 0) |
| 281 | 278 |
| 282 } // namespace dart. | 279 } // namespace dart. |
| 283 | 280 |
| 284 #endif // VM_DART_API_IMPL_H_ | 281 #endif // VM_DART_API_IMPL_H_ |
| OLD | NEW |