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

Unified Diff: src/global-handles.cc

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/global-handles.h ('k') | src/handles.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/global-handles.cc
===================================================================
--- src/global-handles.cc (revision 7254)
+++ src/global-handles.cc (working copy)
@@ -554,16 +554,36 @@
#endif
-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]);
+ }
object_groups_.Add(new_entry);
}
+List<ImplicitRefGroup*>* GlobalHandles::ImplicitRefGroups() {
+ // Lazily initialize the list to avoid startup time static constructors.
+ static List<ImplicitRefGroup*> groups(4);
Vitaly Repeshko 2011/03/18 10:38:00 This must be made non-static. I'll fix.
+ 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() {
for (int i = 0; i< object_groups_.length(); i++) {
delete object_groups_.at(i);
@@ -571,4 +591,14 @@
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/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698