Revision: 9203
Author:   [email protected]
Date:     Thu Sep  8 12:00:24 2011
Log:      We don't need to track writes of
pointers to immortal immovable objects.
Review URL: http://codereview.chromium.org/7831052
http://code.google.com/p/v8/source/detail?r=9203

Modified:
 /branches/experimental/gc/src/hydrogen-instructions.h

=======================================
--- /branches/experimental/gc/src/hydrogen-instructions.h Mon Aug 29 05:23:10 2011 +++ /branches/experimental/gc/src/hydrogen-instructions.h Thu Sep 8 12:00:24 2011
@@ -2248,6 +2248,18 @@
   Handle<Object> handle() const { return handle_; }

   bool InOldSpace() const { return !HEAP->InNewSpace(*handle_); }
+
+  bool ImmortalImmovable() const {
+    Heap* heap = HEAP;
+    if (*handle_ == heap->undefined_value()) return true;
+    if (*handle_ == heap->null_value()) return true;
+    if (*handle_ == heap->true_value()) return true;
+    if (*handle_ == heap->false_value()) return true;
+    if (*handle_ == heap->the_hole_value()) return true;
+    if (*handle_ == heap->minus_zero_value()) return true;
+    if (*handle_ == heap->nan_value()) return true;
+    return false;
+  }

   virtual Representation RequiredInputRepresentation(int index) const {
     return Representation::None();
@@ -3333,7 +3345,9 @@
   // TODO(gc) On bleeding edge we omit write barrier when we are
   // storing old space constant. We can't allow such an optimization
   // on GC branch.
-  return !value->type().IsSmi();
+  return !value->type().IsBoolean()
+      && !value->type().IsSmi()
+ && !(value->IsConstant() && HConstant::cast(value)->ImmortalImmovable());
 }


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

Reply via email to