| 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/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 } | 375 } |
| 376 if (raw == Bool::False().raw()) { | 376 if (raw == Bool::False().raw()) { |
| 377 return False(); | 377 return False(); |
| 378 } | 378 } |
| 379 return InitNewHandle(isolate, raw); | 379 return InitNewHandle(isolate, raw); |
| 380 } | 380 } |
| 381 | 381 |
| 382 | 382 |
| 383 RawObject* Api::UnwrapHandle(Dart_Handle object) { | 383 RawObject* Api::UnwrapHandle(Dart_Handle object) { |
| 384 #if defined(DEBUG) | 384 #if defined(DEBUG) |
| 385 ASSERT(Thread::Current()->IsMutatorThread()); |
| 385 Isolate* isolate = Isolate::Current(); | 386 Isolate* isolate = Isolate::Current(); |
| 386 ASSERT(isolate != NULL); | 387 ASSERT(isolate != NULL); |
| 387 ApiState* state = isolate->api_state(); | 388 ApiState* state = isolate->api_state(); |
| 388 ASSERT(state != NULL); | 389 ASSERT(state != NULL); |
| 389 ASSERT(!FLAG_verify_handles || | 390 ASSERT(!FLAG_verify_handles || |
| 390 state->IsValidLocalHandle(object) || | 391 state->IsValidLocalHandle(object) || |
| 391 Dart::IsReadOnlyApiHandle(object)); | 392 Dart::IsReadOnlyApiHandle(object)); |
| 392 ASSERT(FinalizablePersistentHandle::raw_offset() == 0 && | 393 ASSERT(FinalizablePersistentHandle::raw_offset() == 0 && |
| 393 PersistentHandle::raw_offset() == 0 && | 394 PersistentHandle::raw_offset() == 0 && |
| 394 LocalHandle::raw_offset() == 0); | 395 LocalHandle::raw_offset() == 0); |
| (...skipping 5687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6082 ApiReallocate); | 6083 ApiReallocate); |
| 6083 writer.WriteFullSnapshot(); | 6084 writer.WriteFullSnapshot(); |
| 6084 *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize(); | 6085 *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize(); |
| 6085 *isolate_snapshot_size = writer.IsolateSnapshotSize(); | 6086 *isolate_snapshot_size = writer.IsolateSnapshotSize(); |
| 6086 *instructions_snapshot_size = writer.InstructionsSnapshotSize(); | 6087 *instructions_snapshot_size = writer.InstructionsSnapshotSize(); |
| 6087 | 6088 |
| 6088 return Api::Success(); | 6089 return Api::Success(); |
| 6089 } | 6090 } |
| 6090 | 6091 |
| 6091 } // namespace dart | 6092 } // namespace dart |
| OLD | NEW |