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

Unified Diff: src/global-handles.cc

Issue 6686053: Introduce one way dependencies into object grouping. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Renaming 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/global-handles.h ('k') | src/mark-compact.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/global-handles.cc
diff --git a/src/global-handles.cc b/src/global-handles.cc
index 6cc0cfb04eefef8b0db21ce216707be39db69c4c..c75b67cdfc2b8ae085bfd08bd1609c77eb70aa0c 100644
--- a/src/global-handles.cc
+++ b/src/global-handles.cc
@@ -541,16 +541,36 @@ List<ObjectGroup*>* GlobalHandles::ObjectGroups() {
return &groups;
}
-void GlobalHandles::AddGroup(Object*** handles,
- size_t length,
- v8::RetainedObjectInfo* info) {
+
+void GlobalHandles::AddObjectGroup(Object*** handles,
+ size_t length,
+ v8::RetainedObjectInfo* info) {
ObjectGroup* new_entry = new ObjectGroup(length, info);
- for (size_t i = 0; i < length; ++i)
+ for (size_t i = 0; i < length; ++i) {
new_entry->objects_.Add(handles[i]);
+ }
ObjectGroups()->Add(new_entry);
}
+List<ImplicitRefGroup*>* GlobalHandles::ImplicitRefGroups() {
+ // Lazily initialize the list to avoid startup time static constructors.
+ static List<ImplicitRefGroup*> groups(4);
+ return &groups;
+}
+
+
+void GlobalHandles::AddImplicitReferences(HeapObject* parent,
+ Object*** children,
+ size_t length) {
+ ImplicitRefGroup* new_entry = new ImplicitRefGroup(parent, length);
+ for (size_t i = 0; i < length; ++i) {
+ new_entry->children_.Add(children[i]);
+ }
+ ImplicitRefGroups()->Add(new_entry);
+}
+
+
void GlobalHandles::RemoveObjectGroups() {
List<ObjectGroup*>* object_groups = ObjectGroups();
for (int i = 0; i< object_groups->length(); i++) {
@@ -559,4 +579,14 @@ void GlobalHandles::RemoveObjectGroups() {
object_groups->Clear();
}
+
+void GlobalHandles::RemoveImplicitRefGroups() {
+ List<ImplicitRefGroup*>* ref_groups = ImplicitRefGroups();
+ for (int i = 0; i< ref_groups->length(); i++) {
+ delete ref_groups->at(i);
+ }
+ ref_groups->Clear();
+}
+
+
} } // namespace v8::internal
« no previous file with comments | « src/global-handles.h ('k') | src/mark-compact.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698