Index: src/global-handles.h |
diff --git a/src/global-handles.h b/src/global-handles.h |
index 37b2b44522e55ea628a433f8546b5a5fd6e8da74..3bab4b8c0ac5e7fa973b4c22ebd2e303bfbbda60 100644 |
--- a/src/global-handles.h |
+++ b/src/global-handles.h |
@@ -48,10 +48,16 @@ namespace internal { |
class ObjectGroup : public Malloced { |
public: |
ObjectGroup() : objects_(4) {} |
- explicit ObjectGroup(size_t capacity) |
- : objects_(static_cast<int>(capacity)) { } |
+ ObjectGroup(size_t capacity, v8::RetainedObjectInfo* info) |
+ : objects_(static_cast<int>(capacity)), |
+ info_(info) { } |
+ ~ObjectGroup() { if (info_ != NULL) info_->Dispose(); } |
List<Object**> objects_; |
+ v8::RetainedObjectInfo* info_; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(ObjectGroup); |
}; |
@@ -75,6 +81,8 @@ class GlobalHandles : public AllStatic { |
void* parameter, |
WeakReferenceCallback callback); |
+ static void SetWrapperClassId(Object** location, uint16_t class_id); |
+ |
// Returns the current number of weak handles. |
static int NumberOfWeakHandles() { return number_of_weak_handles_; } |
@@ -105,6 +113,9 @@ class GlobalHandles : public AllStatic { |
// Iterates over all handles. |
static void IterateAllRoots(ObjectVisitor* v); |
+ // Iterates over all handles that have embedder-assigned class ID. |
+ static void IterateAllRootsWithClassIds(ObjectVisitor* v); |
+ |
// Iterates over all weak roots in heap. |
static void IterateWeakRoots(ObjectVisitor* v); |
@@ -119,7 +130,9 @@ class GlobalHandles : public AllStatic { |
// Add an object group. |
// Should only used in GC callback function before a collection. |
// All groups are destroyed after a mark-compact collection. |
- static void AddGroup(Object*** handles, size_t length); |
+ static void AddGroup(Object*** handles, |
+ size_t length, |
+ v8::RetainedObjectInfo* info); |
// Returns the object groups. |
static List<ObjectGroup*>* ObjectGroups(); |