| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 CURRENT_FUNC, #length, max); \ | 105 CURRENT_FUNC, #length, max); \ |
| 106 } \ | 106 } \ |
| 107 } while (0) | 107 } while (0) |
| 108 | 108 |
| 109 | 109 |
| 110 class Api : AllStatic { | 110 class Api : AllStatic { |
| 111 public: | 111 public: |
| 112 // Create on the stack to provide a new throw-safe api scope. | 112 // Create on the stack to provide a new throw-safe api scope. |
| 113 class Scope : public StackResource { | 113 class Scope : public StackResource { |
| 114 public: | 114 public: |
| 115 explicit Scope(Isolate* isolate) : StackResource(isolate) { | 115 explicit Scope(Thread* thread) : StackResource(thread) { |
| 116 Dart_EnterScope(); | 116 Dart_EnterScope(); |
| 117 } | 117 } |
| 118 ~Scope() { | 118 ~Scope() { |
| 119 Dart_ExitScope(); | 119 Dart_ExitScope(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 private: | 122 private: |
| 123 DISALLOW_COPY_AND_ASSIGN(Scope); | 123 DISALLOW_COPY_AND_ASSIGN(Scope); |
| 124 }; | 124 }; |
| 125 | 125 |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 return Api::NewError("%s: Cannot load after Dart_Precompile", \ | 322 return Api::NewError("%s: Cannot load after Dart_Precompile", \ |
| 323 CURRENT_FUNC); \ | 323 CURRENT_FUNC); \ |
| 324 } \ | 324 } \ |
| 325 | 325 |
| 326 #define ASSERT_CALLBACK_STATE(thread) \ | 326 #define ASSERT_CALLBACK_STATE(thread) \ |
| 327 ASSERT(thread->no_callback_scope_depth() == 0) | 327 ASSERT(thread->no_callback_scope_depth() == 0) |
| 328 | 328 |
| 329 } // namespace dart. | 329 } // namespace dart. |
| 330 | 330 |
| 331 #endif // VM_DART_API_IMPL_H_ | 331 #endif // VM_DART_API_IMPL_H_ |
| OLD | NEW |