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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 | 369 |
370 | 370 |
371 RawObject* Api::UnwrapHandle(Dart_Handle object) { | 371 RawObject* Api::UnwrapHandle(Dart_Handle object) { |
372 #if defined(DEBUG) | 372 #if defined(DEBUG) |
373 Isolate* isolate = Isolate::Current(); | 373 Isolate* isolate = Isolate::Current(); |
374 ASSERT(isolate != NULL); | 374 ASSERT(isolate != NULL); |
375 ApiState* state = isolate->api_state(); | 375 ApiState* state = isolate->api_state(); |
376 ASSERT(state != NULL); | 376 ASSERT(state != NULL); |
377 ASSERT(!FLAG_verify_handles || | 377 ASSERT(!FLAG_verify_handles || |
378 state->IsValidLocalHandle(object) || | 378 state->IsValidLocalHandle(object) || |
379 Dart::vm_isolate()->api_state()->IsValidLocalHandle(object)); | 379 Dart::IsReadOnlyApiHandle(object)); |
380 ASSERT(FinalizablePersistentHandle::raw_offset() == 0 && | 380 ASSERT(FinalizablePersistentHandle::raw_offset() == 0 && |
381 PersistentHandle::raw_offset() == 0 && | 381 PersistentHandle::raw_offset() == 0 && |
382 LocalHandle::raw_offset() == 0); | 382 LocalHandle::raw_offset() == 0); |
383 #endif | 383 #endif |
384 return (reinterpret_cast<LocalHandle*>(object))->raw(); | 384 return (reinterpret_cast<LocalHandle*>(object))->raw(); |
385 } | 385 } |
386 | 386 |
387 | 387 |
388 #define DEFINE_UNWRAP(type) \ | 388 #define DEFINE_UNWRAP(type) \ |
389 const type& Api::Unwrap##type##Handle(Isolate* iso, \ | 389 const type& Api::Unwrap##type##Handle(Isolate* iso, \ |
(...skipping 5391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5781 ASSERT(stream != NULL); | 5781 ASSERT(stream != NULL); |
5782 TimelineEvent* event = stream->StartEvent(); | 5782 TimelineEvent* event = stream->StartEvent(); |
5783 if (event != NULL) { | 5783 if (event != NULL) { |
5784 event->AsyncEnd(label, async_id); | 5784 event->AsyncEnd(label, async_id); |
5785 event->Complete(); | 5785 event->Complete(); |
5786 } | 5786 } |
5787 return Api::Success(); | 5787 return Api::Success(); |
5788 } | 5788 } |
5789 | 5789 |
5790 } // namespace dart | 5790 } // namespace dart |
OLD | NEW |