| 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 #ifndef VM_DART_API_STATE_H_ | 5 #ifndef VM_DART_API_STATE_H_ |
| 6 #define VM_DART_API_STATE_H_ | 6 #define VM_DART_API_STATE_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 | 9 |
| 10 #include "platform/utils.h" | 10 #include "platform/utils.h" |
| (...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 ApiLocalScope* scope = top_scope_; | 811 ApiLocalScope* scope = top_scope_; |
| 812 while (scope != NULL) { | 812 while (scope != NULL) { |
| 813 total += scope->zone()->SizeInBytes(); | 813 total += scope->zone()->SizeInBytes(); |
| 814 scope = scope->previous(); | 814 scope = scope->previous(); |
| 815 } | 815 } |
| 816 return total; | 816 return total; |
| 817 } | 817 } |
| 818 | 818 |
| 819 void SetupAcquiredError() { | 819 void SetupAcquiredError() { |
| 820 ASSERT(acquired_error_ == NULL); | 820 ASSERT(acquired_error_ == NULL); |
| 821 acquired_error_ = persistent_handles().AllocateHandle(); | 821 const String& msg = String::Handle( |
| 822 acquired_error_->set_raw( | |
| 823 String::New("Internal Dart data pointers have been acquired, " | 822 String::New("Internal Dart data pointers have been acquired, " |
| 824 "please release them using Dart_TypedDataReleaseData.")); | 823 "please release them using Dart_TypedDataReleaseData.")); |
| 824 acquired_error_ = persistent_handles().AllocateHandle(); |
| 825 acquired_error_->set_raw(ApiError::New(msg)); |
| 825 } | 826 } |
| 826 | 827 |
| 827 PersistentHandle* AcquiredError() const { | 828 PersistentHandle* AcquiredError() const { |
| 828 ASSERT(acquired_error_ != NULL); | 829 ASSERT(acquired_error_ != NULL); |
| 829 return acquired_error_; | 830 return acquired_error_; |
| 830 } | 831 } |
| 831 | 832 |
| 832 WeakReferenceSetBuilder* NewWeakReferenceSetBuilder(); | 833 WeakReferenceSetBuilder* NewWeakReferenceSetBuilder(); |
| 833 | 834 |
| 834 void DelayWeakReferenceSet(WeakReferenceSet* reference_set); | 835 void DelayWeakReferenceSet(WeakReferenceSet* reference_set); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 ref->set_peer(peer); | 976 ref->set_peer(peer); |
| 976 ref->set_callback(callback); | 977 ref->set_callback(callback); |
| 977 // This may trigger GC, so it must be called last. | 978 // This may trigger GC, so it must be called last. |
| 978 ref->SetExternalSize(external_size, isolate); | 979 ref->SetExternalSize(external_size, isolate); |
| 979 return ref; | 980 return ref; |
| 980 } | 981 } |
| 981 | 982 |
| 982 } // namespace dart | 983 } // namespace dart |
| 983 | 984 |
| 984 #endif // VM_DART_API_STATE_H_ | 985 #endif // VM_DART_API_STATE_H_ |
| OLD | NEW |