Revert of Re-land new insertion write barrier. (patchset #3 id:40001 of https://coder...
authorhpayer <hpayer@chromium.org>
Thu, 18 Jun 2015 18:04:46 +0000 (11:04 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 18 Jun 2015 18:04:53 +0000 (18:04 +0000)
Reason for revert:
Deoptimizer crashes.

Original issue's description:
> Re-land new insertion write barrier.
>
> BUG=
>
> Committed: https://crrev.com/72f850458cb530d871cf3fb6442660555dc51bc2
> Cr-Commit-Position: refs/heads/master@{#29052}

TBR=ulan@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review URL: https://codereview.chromium.org/1176243015

Cr-Commit-Position: refs/heads/master@{#29123}

src/heap/incremental-marking-inl.h
src/heap/spaces.h

index e9cd4191e159ad8270914ff87b915d2facc33dba..42b3dcb127da27fc1ebd937912c43580735dd596 100644 (file)
@@ -15,14 +15,28 @@ bool IncrementalMarking::BaseRecordWrite(HeapObject* obj, Object** slot,
                                          Object* value) {
   HeapObject* value_heap_obj = HeapObject::cast(value);
   MarkBit value_bit = Marking::MarkBitFrom(value_heap_obj);
-  // Checking the obj marking state is not necessary, but reduces the marking
-  // load.
-  MarkBit obj_bit = Marking::MarkBitFrom(obj);
-  if (Marking::IsWhite(value_bit) && Marking::IsBlack(obj_bit)) {
-    WhiteToGreyAndPush(value_heap_obj, value_bit);
-    RestartIfNotMarking();
+  if (Marking::IsWhite(value_bit)) {
+    MarkBit obj_bit = Marking::MarkBitFrom(obj);
+    if (Marking::IsBlack(obj_bit)) {
+      MemoryChunk* chunk = MemoryChunk::FromAddress(obj->address());
+      if (chunk->IsFlagSet(MemoryChunk::HAS_PROGRESS_BAR)) {
+        if (chunk->IsLeftOfProgressBar(slot)) {
+          WhiteToGreyAndPush(value_heap_obj, value_bit);
+          RestartIfNotMarking();
+        } else {
+          return false;
+        }
+      } else {
+        BlackToGreyAndUnshift(obj, obj_bit);
+        RestartIfNotMarking();
+        return false;
+      }
+    } else {
+      return false;
+    }
   }
   if (!is_compacting_) return false;
+  MarkBit obj_bit = Marking::MarkBitFrom(obj);
   return Marking::IsBlack(obj_bit);
 }
 
index 369c6086d2a2c7b25ab48990cfd554c77e34bc9f..3461de3ef009f18d9549a8de8f18ce831ba2f572 100644 (file)
@@ -508,6 +508,13 @@ class MemoryChunk {
     }
   }
 
+  bool IsLeftOfProgressBar(Object** slot) {
+    Address slot_address = reinterpret_cast<Address>(slot);
+    DCHECK(slot_address > this->address());
+    return (slot_address - (this->address() + kObjectStartOffset)) <
+           progress_bar();
+  }
+
   static void IncrementLiveBytesFromGC(Address address, int by) {
     MemoryChunk::FromAddress(address)->IncrementLiveBytes(by);
   }