| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 "include/dart_api.h" | 5 #include "include/dart_api.h" |
| 6 | 6 |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 136 #define DEFINE_UNWRAP(type) \ | 136 #define DEFINE_UNWRAP(type) \ |
| 137 const type& Api::Unwrap##type##Handle(Isolate* iso, \ | 137 const type& Api::Unwrap##type##Handle(Isolate* iso, \ |
| 138 Dart_Handle dart_handle) { \ | 138 Dart_Handle dart_handle) { \ |
| 139 const Object& obj = Object::Handle(iso, Api::UnwrapHandle(dart_handle)); \ | 139 const Object& obj = Object::Handle(iso, Api::UnwrapHandle(dart_handle)); \ |
| 140 if (obj.Is##type()) { \ | 140 if (obj.Is##type()) { \ |
| 141 return type::Cast(obj); \ | 141 return type::Cast(obj); \ |
| 142 } \ | 142 } \ |
| 143 return type::Handle(iso); \ | 143 return type::Handle(iso); \ |
| 144 } | 144 } |
| 145 CLASS_LIST_NO_OBJECT(DEFINE_UNWRAP) | 145 CLASS_LIST_FOR_HANDLES(DEFINE_UNWRAP) |
| 146 #undef DEFINE_UNWRAP | 146 #undef DEFINE_UNWRAP |
| 147 | 147 |
| 148 | 148 |
| 149 LocalHandle* Api::UnwrapAsLocalHandle(const ApiState& state, | 149 LocalHandle* Api::UnwrapAsLocalHandle(const ApiState& state, |
| 150 Dart_Handle object) { | 150 Dart_Handle object) { |
| 151 ASSERT(state.IsValidLocalHandle(object)); | 151 ASSERT(state.IsValidLocalHandle(object)); |
| 152 return reinterpret_cast<LocalHandle*>(object); | 152 return reinterpret_cast<LocalHandle*>(object); |
| 153 } | 153 } |
| 154 | 154 |
| 155 | 155 |
| (...skipping 4278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4434 } | 4434 } |
| 4435 { | 4435 { |
| 4436 NoGCScope no_gc; | 4436 NoGCScope no_gc; |
| 4437 RawObject* raw_obj = obj.raw(); | 4437 RawObject* raw_obj = obj.raw(); |
| 4438 isolate->heap()->SetPeer(raw_obj, peer); | 4438 isolate->heap()->SetPeer(raw_obj, peer); |
| 4439 } | 4439 } |
| 4440 return Api::Success(isolate); | 4440 return Api::Success(isolate); |
| 4441 } | 4441 } |
| 4442 | 4442 |
| 4443 } // namespace dart | 4443 } // namespace dart |
| OLD | NEW |