Index: runtime/vm/dart_api_state.h |
diff --git a/runtime/vm/dart_api_state.h b/runtime/vm/dart_api_state.h |
index 3c7d3165adb4f23f98945c5165af4b371623f7b2..b510377352cdc294d017c4922a86bd2e052e0c5f 100644 |
--- a/runtime/vm/dart_api_state.h |
+++ b/runtime/vm/dart_api_state.h |
@@ -213,6 +213,10 @@ class FinalizablePersistentHandle { |
return reinterpret_cast<Dart_WeakPersistentHandle>(this); |
} |
+ intptr_t external_size() const { |
+ return ExternalSizeBits::decode(external_data_); |
+ } |
+ |
void SetExternalSize(intptr_t size, Isolate* isolate) { |
ASSERT(size >= 0); |
set_external_size(Utils::RoundUp(size, kObjectAlignment)); |
@@ -305,10 +309,6 @@ class FinalizablePersistentHandle { |
callback_ = callback; |
} |
- intptr_t external_size() const { |
- return ExternalSizeBits::decode(external_data_); |
- } |
- |
void set_external_size(intptr_t size) { |
ASSERT(ExternalSizeBits::is_valid(size)); |
external_data_ = ExternalSizeBits::update(size, external_data_); |
@@ -445,6 +445,13 @@ class PersistentHandles : Handles<kPersistentHandleSizeInWords, |
kOffsetOfRawPtrInPersistentHandle>::VisitObjectPointers(visitor); |
} |
+ // Visit all the handles. |
+ void Visit(HandleVisitor* visitor) { |
+ Handles<kPersistentHandleSizeInWords, |
+ kPersistentHandlesPerChunk, |
+ kOffsetOfRawPtrInPersistentHandle>::Visit(visitor); |
+ } |
+ |
// Allocates a persistent handle, these have to be destroyed explicitly |
// by calling FreeHandle. |
PersistentHandle* AllocateHandle() { |