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 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 ASSERT(state != NULL); | 667 ASSERT(state != NULL); |
668 PersistentHandle* ref = PersistentHandle::Cast(object); | 668 PersistentHandle* ref = PersistentHandle::Cast(object); |
669 ASSERT(!state->IsProtectedHandle(ref)); | 669 ASSERT(!state->IsProtectedHandle(ref)); |
670 if (!state->IsProtectedHandle(ref)) { | 670 if (!state->IsProtectedHandle(ref)) { |
671 state->persistent_handles().FreeHandle(ref); | 671 state->persistent_handles().FreeHandle(ref); |
672 } | 672 } |
673 } | 673 } |
674 | 674 |
675 | 675 |
676 DART_EXPORT void Dart_DeleteWeakPersistentHandle( | 676 DART_EXPORT void Dart_DeleteWeakPersistentHandle( |
| 677 Dart_Isolate current_isolate, |
677 Dart_WeakPersistentHandle object) { | 678 Dart_WeakPersistentHandle object) { |
678 Isolate* isolate = Isolate::Current(); | 679 Isolate* isolate = reinterpret_cast<Isolate*>(current_isolate); |
679 CHECK_ISOLATE(isolate); | 680 CHECK_ISOLATE(isolate); |
| 681 ASSERT(isolate == Isolate::Current()); |
680 ApiState* state = isolate->api_state(); | 682 ApiState* state = isolate->api_state(); |
681 ASSERT(state != NULL); | 683 ASSERT(state != NULL); |
682 if (FinalizablePersistentHandle::IsPrologueWeakPersistentHandle(object)) { | 684 if (FinalizablePersistentHandle::IsPrologueWeakPersistentHandle(object)) { |
683 ASSERT(state->IsValidPrologueWeakPersistentHandle(object)); | 685 ASSERT(state->IsValidPrologueWeakPersistentHandle(object)); |
684 FinalizablePersistentHandle* weak_ref = | 686 FinalizablePersistentHandle* weak_ref = |
685 FinalizablePersistentHandle::Cast(object); | 687 FinalizablePersistentHandle::Cast(object); |
686 state->prologue_weak_persistent_handles().FreeHandle(weak_ref); | 688 state->prologue_weak_persistent_handles().FreeHandle(weak_ref); |
687 } else { | 689 } else { |
688 ASSERT(!state->IsValidPrologueWeakPersistentHandle(object)); | 690 ASSERT(!state->IsValidPrologueWeakPersistentHandle(object)); |
689 FinalizablePersistentHandle* weak_ref = | 691 FinalizablePersistentHandle* weak_ref = |
(...skipping 3921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4611 | 4613 |
4612 | 4614 |
4613 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( | 4615 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( |
4614 const char* name, | 4616 const char* name, |
4615 Dart_ServiceRequestCallback callback, | 4617 Dart_ServiceRequestCallback callback, |
4616 void* user_data) { | 4618 void* user_data) { |
4617 Service::RegisterRootEmbedderCallback(name, callback, user_data); | 4619 Service::RegisterRootEmbedderCallback(name, callback, user_data); |
4618 } | 4620 } |
4619 | 4621 |
4620 } // namespace dart | 4622 } // namespace dart |
OLD | NEW |