Revision: 7257
Author:   [email protected]
Date:     Fri Mar 18 05:22:55 2011
Log:      [Isolates] Small fixes after the last merge.

Review URL: http://codereview.chromium.org/6709026
http://code.google.com/p/v8/source/detail?r=7257

Modified:
 /branches/experimental/isolates/src/global-handles.cc
 /branches/experimental/isolates/src/global-handles.h
 /branches/experimental/isolates/src/heap.cc
 /branches/experimental/isolates/src/mark-compact.cc

=======================================
--- /branches/experimental/isolates/src/global-handles.cc Thu Mar 17 19:49:59 2011 +++ /branches/experimental/isolates/src/global-handles.cc Fri Mar 18 05:22:55 2011
@@ -564,13 +564,6 @@
   }
   object_groups_.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,
@@ -580,12 +573,12 @@
   for (size_t i = 0; i < length; ++i) {
     new_entry->children_.Add(children[i]);
   }
-  ImplicitRefGroups()->Add(new_entry);
+  implicit_ref_groups_.Add(new_entry);
 }


 void GlobalHandles::RemoveObjectGroups() {
-  for (int i = 0; i< object_groups_.length(); i++) {
+  for (int i = 0; i < object_groups_.length(); i++) {
     delete object_groups_.at(i);
   }
   object_groups_.Clear();
@@ -593,11 +586,10 @@


 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();
+  for (int i = 0; i < implicit_ref_groups_.length(); i++) {
+    delete implicit_ref_groups_.at(i);
+  }
+  implicit_ref_groups_.Clear();
 }


=======================================
--- /branches/experimental/isolates/src/global-handles.h Thu Mar 17 19:49:59 2011 +++ /branches/experimental/isolates/src/global-handles.h Fri Mar 18 05:22:55 2011
@@ -162,11 +162,13 @@
   List<ObjectGroup*>* object_groups() { return &object_groups_; }

   // Returns the implicit references' groups.
-  static List<ImplicitRefGroup*>* ImplicitRefGroups();
+  List<ImplicitRefGroup*>* implicit_ref_groups() {
+    return &implicit_ref_groups_;
+  }

   // Remove bags, this should only happen after GC.
   void RemoveObjectGroups();
-  static void RemoveImplicitRefGroups();
+  void RemoveImplicitRefGroups();

   // Tear down the global handle structure.
   void TearDown();
@@ -224,6 +226,7 @@
   Pool* pool_;
   int post_gc_processing_count_;
   List<ObjectGroup*> object_groups_;
+  List<ImplicitRefGroup*> implicit_ref_groups_;

   friend class Isolate;

=======================================
--- /branches/experimental/isolates/src/heap.cc Thu Mar 17 19:49:59 2011
+++ /branches/experimental/isolates/src/heap.cc Fri Mar 18 05:22:55 2011
@@ -2902,7 +2902,7 @@
             strict_mode_arguments_boilerplate();
     arguments_object_size = kArgumentsObjectSizeStrict;
   } else {
-    boilerplate =
+    boilerplate =
         isolate()->context()->global_context()->arguments_boilerplate();
     arguments_object_size = kArgumentsObjectSize;
   }
=======================================
--- /branches/experimental/isolates/src/mark-compact.cc Thu Mar 17 19:49:59 2011 +++ /branches/experimental/isolates/src/mark-compact.cc Fri Mar 18 05:22:55 2011
@@ -1244,7 +1244,8 @@


 void MarkCompactCollector::MarkImplicitRefGroups() {
-  List<ImplicitRefGroup*>* ref_groups = GlobalHandles::ImplicitRefGroups();
+  List<ImplicitRefGroup*>* ref_groups =
+      heap_->isolate()->global_handles()->implicit_ref_groups();

   for (int i = 0; i < ref_groups->length(); i++) {
     ImplicitRefGroup* entry = ref_groups->at(i);
@@ -1422,7 +1423,7 @@

   // Remove object groups after marking phase.
   heap_->isolate()->global_handles()->RemoveObjectGroups();
-  GlobalHandles::RemoveImplicitRefGroups();
+  heap_->isolate()->global_handles()->RemoveImplicitRefGroups();

   // Flush code from collected candidates.
   if (is_code_flushing_enabled()) {

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to