| 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/thread.h" | 10 #include "platform/thread.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // Overload the raw_ field as a next pointer when adding freed | 173 // Overload the raw_ field as a next pointer when adding freed |
| 174 // handles to the free list. | 174 // handles to the free list. |
| 175 FinalizablePersistentHandle* Next() { | 175 FinalizablePersistentHandle* Next() { |
| 176 return reinterpret_cast<FinalizablePersistentHandle*>(raw_); | 176 return reinterpret_cast<FinalizablePersistentHandle*>(raw_); |
| 177 } | 177 } |
| 178 void SetNext(FinalizablePersistentHandle* free_list) { | 178 void SetNext(FinalizablePersistentHandle* free_list) { |
| 179 raw_ = reinterpret_cast<RawObject*>(free_list); | 179 raw_ = reinterpret_cast<RawObject*>(free_list); |
| 180 ASSERT(!raw_->IsHeapObject()); | 180 ASSERT(!raw_->IsHeapObject()); |
| 181 } | 181 } |
| 182 void FreeHandle(FinalizablePersistentHandle* free_list) { | 182 void FreeHandle(FinalizablePersistentHandle* free_list) { |
| 183 Clear(); |
| 183 SetNext(free_list); | 184 SetNext(free_list); |
| 184 } | 185 } |
| 185 | 186 |
| 186 void Clear() { | 187 void Clear() { |
| 187 raw_ = Object::null(); | 188 raw_ = Object::null(); |
| 188 peer_ = NULL; | 189 peer_ = NULL; |
| 189 callback_ = NULL; | 190 callback_ = NULL; |
| 190 } | 191 } |
| 191 | 192 |
| 192 RawObject* raw_; | 193 RawObject* raw_; |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 ApiNativeScope::Current()->zone()->GetBaseZone()) {} | 674 ApiNativeScope::Current()->zone()->GetBaseZone()) {} |
| 674 ApiGrowableArray() | 675 ApiGrowableArray() |
| 675 : BaseGrowableArray<T, ValueObject>( | 676 : BaseGrowableArray<T, ValueObject>( |
| 676 ApiNativeScope::Current()->zone()->GetBaseZone()) {} | 677 ApiNativeScope::Current()->zone()->GetBaseZone()) {} |
| 677 }; | 678 }; |
| 678 | 679 |
| 679 | 680 |
| 680 } // namespace dart | 681 } // namespace dart |
| 681 | 682 |
| 682 #endif // VM_DART_API_STATE_H_ | 683 #endif // VM_DART_API_STATE_H_ |
| OLD | NEW |