| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 #include "include/dart_mirrors_api.h" | 6 #include "include/dart_mirrors_api.h" |
| 7 #include "include/dart_native_api.h" | 7 #include "include/dart_native_api.h" |
| 8 | 8 |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "vm/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 | 118 |
| 119 PersistentHandle* Api::UnwrapAsPersistentHandle(Dart_PersistentHandle object) { | 119 PersistentHandle* Api::UnwrapAsPersistentHandle(Dart_PersistentHandle object) { |
| 120 ASSERT(Isolate::Current()->api_state()->IsValidPersistentHandle(object)); | 120 ASSERT(Isolate::Current()->api_state()->IsValidPersistentHandle(object)); |
| 121 return reinterpret_cast<PersistentHandle*>(object); | 121 return reinterpret_cast<PersistentHandle*>(object); |
| 122 } | 122 } |
| 123 | 123 |
| 124 | 124 |
| 125 FinalizablePersistentHandle* Api::UnwrapAsWeakPersistentHandle( | 125 FinalizablePersistentHandle* Api::UnwrapAsWeakPersistentHandle( |
| 126 Dart_WeakPersistentHandle object) { | 126 Dart_WeakPersistentHandle object) { |
| 127 ASSERT(Isolate::Current()->api_state()->IsValidWeakPersistentHandle(object)); | 127 ASSERT(Isolate::Current()->api_state()->IsValidWeakPersistentHandle(object) || |
| 128 Isolate::Current()->api_state()-> |
| 129 IsValidPrologueWeakPersistentHandle(object)); |
| 128 return reinterpret_cast<FinalizablePersistentHandle*>(object); | 130 return reinterpret_cast<FinalizablePersistentHandle*>(object); |
| 129 } | 131 } |
| 130 | 132 |
| 131 | 133 |
| 132 FinalizablePersistentHandle* Api::UnwrapAsPrologueWeakPersistentHandle( | 134 FinalizablePersistentHandle* Api::UnwrapAsPrologueWeakPersistentHandle( |
| 133 Dart_WeakPersistentHandle object) { | 135 Dart_WeakPersistentHandle object) { |
| 134 ASSERT(Isolate::Current()->api_state()->IsValidPrologueWeakPersistentHandle( | 136 ASSERT(Isolate::Current()->api_state()->IsValidPrologueWeakPersistentHandle( |
| 135 object)); | 137 object)); |
| 136 return reinterpret_cast<FinalizablePersistentHandle*>(object); | 138 return reinterpret_cast<FinalizablePersistentHandle*>(object); |
| 137 } | 139 } |
| (...skipping 4199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4337 } | 4339 } |
| 4338 { | 4340 { |
| 4339 NoGCScope no_gc; | 4341 NoGCScope no_gc; |
| 4340 RawObject* raw_obj = obj.raw(); | 4342 RawObject* raw_obj = obj.raw(); |
| 4341 isolate->heap()->SetPeer(raw_obj, peer); | 4343 isolate->heap()->SetPeer(raw_obj, peer); |
| 4342 } | 4344 } |
| 4343 return Api::Success(); | 4345 return Api::Success(); |
| 4344 } | 4346 } |
| 4345 | 4347 |
| 4346 } // namespace dart | 4348 } // namespace dart |
| OLD | NEW |