Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Unified Diff: src/global-handles.h

Issue 6711027: [Isolates] Merge 7201:7258 from bleeding_edge to isolates. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/factory.cc ('k') | src/global-handles.cc » ('j') | src/global-handles.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/global-handles.h
===================================================================
--- src/global-handles.h (revision 7254)
+++ src/global-handles.h (working copy)
@@ -39,9 +39,6 @@
// At GC the destroyed global handles are removed from the free list
// and deallocated.
-// Callback function on handling weak global handles.
-// typedef bool (*WeakSlotCallback)(Object** pointer);
-
// An object group is treated like a single JS object: if one of object in
// the group is alive, all objects in the same group are considered alive.
// An object group is used to simulate object relationship in a DOM tree.
@@ -61,6 +58,24 @@
};
+// An implicit references group consists of two parts: a parent object and
+// a list of children objects. If the parent is alive, all the children
+// are alive too.
+class ImplicitRefGroup : public Malloced {
+ public:
+ ImplicitRefGroup() : children_(4) {}
+ ImplicitRefGroup(HeapObject* parent, size_t capacity)
+ : parent_(parent),
+ children_(static_cast<int>(capacity)) { }
+
+ HeapObject* parent_;
+ List<Object**> children_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ImplicitRefGroup);
+};
+
+
typedef void (*WeakReferenceGuest)(Object* object, void* parameter);
class GlobalHandles {
@@ -130,17 +145,28 @@
void IdentifyWeakHandles(WeakSlotCallback f);
// Add an object group.
- // Should only used in GC callback function before a collection.
+ // Should be only used in GC callback function before a collection.
// All groups are destroyed after a mark-compact collection.
- void AddGroup(Object*** handles,
- size_t length,
- v8::RetainedObjectInfo* info);
+ void AddObjectGroup(Object*** handles,
+ size_t length,
+ v8::RetainedObjectInfo* info);
+ // Add an implicit references' group.
+ // Should be only used in GC callback function before a collection.
+ // All groups are destroyed after a mark-compact collection.
+ void AddImplicitReferences(HeapObject* parent,
+ Object*** children,
+ size_t length);
+
// Returns the object groups.
List<ObjectGroup*>* object_groups() { return &object_groups_; }
+ // Returns the implicit references' groups.
+ static List<ImplicitRefGroup*>* ImplicitRefGroups();
+
// Remove bags, this should only happen after GC.
void RemoveObjectGroups();
+ static void RemoveImplicitRefGroups();
// Tear down the global handle structure.
void TearDown();
« no previous file with comments | « src/factory.cc ('k') | src/global-handles.cc » ('j') | src/global-handles.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698