| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 Dart_Handle object); | 122 Dart_Handle object); |
| 123 CLASS_LIST_FOR_HANDLES(DECLARE_UNWRAP) | 123 CLASS_LIST_FOR_HANDLES(DECLARE_UNWRAP) |
| 124 #undef DECLARE_UNWRAP | 124 #undef DECLARE_UNWRAP |
| 125 | 125 |
| 126 // Unwraps the raw object from the handle using a reused handle. | 126 // Unwraps the raw object from the handle using a reused handle. |
| 127 static const String& UnwrapStringHandle( | 127 static const String& UnwrapStringHandle( |
| 128 const ReusableObjectHandleScope& reused, Dart_Handle object); | 128 const ReusableObjectHandleScope& reused, Dart_Handle object); |
| 129 static const Instance& UnwrapInstanceHandle( | 129 static const Instance& UnwrapInstanceHandle( |
| 130 const ReusableObjectHandleScope& reused, Dart_Handle object); | 130 const ReusableObjectHandleScope& reused, Dart_Handle object); |
| 131 | 131 |
| 132 // Validates and converts the passed in handle as a persistent handle. | |
| 133 static PersistentHandle* UnwrapAsPersistentHandle( | |
| 134 Dart_PersistentHandle object); | |
| 135 | |
| 136 // Validates and converts the passed in handle as a weak persistent handle. | |
| 137 static FinalizablePersistentHandle* UnwrapAsWeakPersistentHandle( | |
| 138 Dart_WeakPersistentHandle object); | |
| 139 | |
| 140 // Validates and converts the passed in handle as a prologue weak | |
| 141 // persistent handle. | |
| 142 static FinalizablePersistentHandle* UnwrapAsPrologueWeakPersistentHandle( | |
| 143 Dart_WeakPersistentHandle object); | |
| 144 | |
| 145 // Returns an Error handle if isolate is in an inconsistent state. | 132 // Returns an Error handle if isolate is in an inconsistent state. |
| 146 // Returns a Success handle when no error condition exists. | 133 // Returns a Success handle when no error condition exists. |
| 147 static Dart_Handle CheckIsolateState(Isolate *isolate); | 134 static Dart_Handle CheckIsolateState(Isolate *isolate); |
| 148 | 135 |
| 149 // Casts the internal Isolate* type to the external Dart_Isolate type. | 136 // Casts the internal Isolate* type to the external Dart_Isolate type. |
| 150 static Dart_Isolate CastIsolate(Isolate* isolate); | 137 static Dart_Isolate CastIsolate(Isolate* isolate); |
| 151 | 138 |
| 152 // Gets the handle used to designate successful return. | 139 // Gets the handle used to designate successful return. |
| 153 static Dart_Handle Success() { return Api::True(); } | 140 static Dart_Handle Success() { return Api::True(); } |
| 154 | 141 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 if (isolate->no_callback_scope_depth() != 0) { \ | 266 if (isolate->no_callback_scope_depth() != 0) { \ |
| 280 return reinterpret_cast<Dart_Handle>(Api::AcquiredError(isolate)); \ | 267 return reinterpret_cast<Dart_Handle>(Api::AcquiredError(isolate)); \ |
| 281 } \ | 268 } \ |
| 282 | 269 |
| 283 #define ASSERT_CALLBACK_STATE(isolate) \ | 270 #define ASSERT_CALLBACK_STATE(isolate) \ |
| 284 ASSERT(isolate->no_callback_scope_depth() == 0) | 271 ASSERT(isolate->no_callback_scope_depth() == 0) |
| 285 | 272 |
| 286 } // namespace dart. | 273 } // namespace dart. |
| 287 | 274 |
| 288 #endif // VM_DART_API_IMPL_H_ | 275 #endif // VM_DART_API_IMPL_H_ |
| OLD | NEW |