Reviewers: Hannes Payer,

Message:
PTAL

Description:
Further improve old space allocation write barrier elimination.

Stores to old space allocations require no write barriers if the
object is the new space dominator and the value is not in new space.

Please review this at https://codereview.chromium.org/290173003/

SVN Base: [email protected]:v8/v8.git@master

Affected files (+9, -8 lines):
  M src/hydrogen-instructions.h


Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 011b4080e59999f30b5ce56a40341b7628b325d4..e4e3131c37c064e800981797dca814e63d5e3987 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -5721,19 +5721,20 @@ inline bool ReceiverObjectNeedsWriteBarrier(HValue* object,
     if (HAllocate::cast(object)->IsNewSpaceAllocation()) {
       return false;
     }
- // Storing a map or an immortal immovable object requires no write barriers
-    // if the object is the new space dominator.
-    if (value->IsConstant() &&
-        (HConstant::cast(value)->IsMap() ||
-         HConstant::cast(value)->ImmortalImmovable())) {
+ // Stores to old space allocations require no write barriers if the object
+    // is the new space dominator and the value is not in new space.
+    if (value->IsConstant() && HConstant::cast(value)->NotInNewSpace()) {
       return false;
     }
-    // Likewise we don't need a write barrier if we store a value that
-    // originates from the same allocation (via allocation folding).
+ // Likewise we don't need a write barrier if we store a value was previously
+    // allocated in old space.
     while (value->IsInnerAllocatedObject()) {
       value = HInnerAllocatedObject::cast(value)->base_object();
     }
-    return object != value;
+    if (value->IsAllocate() &&
+        HAllocate::cast(value)->IsOldDataSpaceAllocation()) {
+      return false;
+    }
   }
   return true;
 }


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to