Reviewers: antonm,

Description:
[Isolates] Small fixes after the last merge.

Please review this at http://codereview.chromium.org/6709026/

Affected files:
  M src/global-handles.h
  M src/global-handles.cc
  M src/heap.cc
  M src/mark-compact.cc


Index: src/global-handles.cc
diff --git a/src/global-handles.cc b/src/global-handles.cc
index b4dd027c18af9b26237f78f73dbe30030a8a9c41..4d138597b1282a7b46a7f9ed5444271219ff1ce9 100644
--- a/src/global-handles.cc
+++ b/src/global-handles.cc
@@ -566,13 +566,6 @@ void GlobalHandles::AddObjectGroup(Object*** handles,
 }


-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) {
@@ -580,12 +573,12 @@ void GlobalHandles::AddImplicitReferences(HeapObject* parent,
   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::RemoveObjectGroups() {


 void GlobalHandles::RemoveImplicitRefGroups() {
-  List<ImplicitRefGroup*>* ref_groups = ImplicitRefGroups();
-  for (int i = 0; i< ref_groups->length(); i++) {
-    delete ref_groups->at(i);
+  for (int i = 0; i < implicit_ref_groups_.length(); i++) {
+    delete implicit_ref_groups_.at(i);
   }
-  ref_groups->Clear();
+  implicit_ref_groups_.Clear();
 }


Index: src/global-handles.h
diff --git a/src/global-handles.h b/src/global-handles.h
index 0a45dd58d9bb875b5667f472a481dedded26790e..a6afb2dcdeec34fa89458710b08aaa83be89ac2e 100644
--- a/src/global-handles.h
+++ b/src/global-handles.h
@@ -162,11 +162,13 @@ class GlobalHandles {
   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 @@ class GlobalHandles {
   Pool* pool_;
   int post_gc_processing_count_;
   List<ObjectGroup*> object_groups_;
+  List<ImplicitRefGroup*> implicit_ref_groups_;

   friend class Isolate;

Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 9095a1c448b16eaf5e174374c90c381249ba559d..9a5a2b05a72a5699fed20e306307e70ea13dace6 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -2902,7 +2902,7 @@ MaybeObject* Heap::AllocateArgumentsObject(Object* callee, int length) {
             strict_mode_arguments_boilerplate();
     arguments_object_size = kArgumentsObjectSizeStrict;
   } else {
-    boilerplate =
+    boilerplate =
         isolate()->context()->global_context()->arguments_boilerplate();
     arguments_object_size = kArgumentsObjectSize;
   }
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index fbab8f3e1ce40a3e630d1c9237814dad8b3b2ffb..022636d70b83da1131610131efa6b502c7cc921b 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -1244,7 +1244,8 @@ void MarkCompactCollector::MarkObjectGroups() {


 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 @@ void MarkCompactCollector::MarkLiveObjects() {

   // 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