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" |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 309 |
310 // End a no Dart API call backs Scope. | 310 // End a no Dart API call backs Scope. |
311 #define END_NO_CALLBACK_SCOPE(isolate) \ | 311 #define END_NO_CALLBACK_SCOPE(isolate) \ |
312 isolate->DecrementNoCallbackScopeDepth() | 312 isolate->DecrementNoCallbackScopeDepth() |
313 | 313 |
314 #define CHECK_CALLBACK_STATE(isolate) \ | 314 #define CHECK_CALLBACK_STATE(isolate) \ |
315 if (isolate->no_callback_scope_depth() != 0) { \ | 315 if (isolate->no_callback_scope_depth() != 0) { \ |
316 return reinterpret_cast<Dart_Handle>(Api::AcquiredError(isolate)); \ | 316 return reinterpret_cast<Dart_Handle>(Api::AcquiredError(isolate)); \ |
317 } \ | 317 } \ |
318 | 318 |
| 319 #define CHECK_COMPILATION_ALLOWED(isolate) \ |
| 320 if (!isolate->compilation_allowed()) { \ |
| 321 return Api::NewError("%s: Cannot load after Dart_Precompile", \ |
| 322 CURRENT_FUNC); \ |
| 323 } \ |
| 324 |
319 #define ASSERT_CALLBACK_STATE(isolate) \ | 325 #define ASSERT_CALLBACK_STATE(isolate) \ |
320 ASSERT(isolate->no_callback_scope_depth() == 0) | 326 ASSERT(isolate->no_callback_scope_depth() == 0) |
321 | 327 |
322 } // namespace dart. | 328 } // namespace dart. |
323 | 329 |
324 #endif // VM_DART_API_IMPL_H_ | 330 #endif // VM_DART_API_IMPL_H_ |
OLD | NEW |