Commit 3fabe1a4 authored by machenbach's avatar machenbach Committed by Commit bot

Revert of [heap] Add optimized RecordWrites (patchset #3 id:40001 of...

Revert of [heap] Add optimized RecordWrites (patchset #3 id:40001 of https://codereview.chromium.org/1834373003/ )

Reason for revert:
[Sheriff] Likely causing blink crashes:
https://build.chromium.org/p/client.v8.fyi/builders/V8-Blink%20Linux%2064%20%28dbg%29/builds/3667

Original issue's description:
> [heap] Add optimized RecordWrites
> BUG=
>
> Committed: https://crrev.com/5210f167e802a3758aac1f2900a6560c8de07831
> Cr-Commit-Position: refs/heads/master@{#35231}

TBR=ulan@chromium.org,hpayer@chromium.org,mlippautz@chromium.org,cbruni@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

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

Cr-Commit-Position: refs/heads/master@{#35235}
parent 6ab9c185
......@@ -1011,10 +1011,13 @@ class ElementsAccessorBase : public ElementsAccessor {
&array_length) &&
array_length <= Smi::kMaxValue)) {
// Since we use std::sort above, the GC will no longer know where the
// HeapNumbers are. For Arrays with valid Smi length, we are sure to
// have no HeapNumber indices and thus we can skip this step.
FIXED_ARRAY_ELEMENTS_WRITE_BARRIER(isolate->heap(), *combined_keys, 0,
nof_indices);
// HeapNumbers are, hence we have to write them again.
// For Arrays with valid Smi length, we are sure to have no HeapNumber
// indices and thus we can skip this step.
for (uint32_t i = 0; i < nof_indices; i++) {
Object* index = combined_keys->get(i);
combined_keys->set(i, index);
}
}
}
......
......@@ -399,20 +399,9 @@ void Heap::RecordWrite(Object* object, int offset, Object* o) {
if (!InNewSpace(o) || !object->IsHeapObject() || InNewSpace(object)) {
return;
}
RememberedSet<OLD_TO_NEW>::Insert(
Page::FromAddress(reinterpret_cast<Address>(object)),
HeapObject::cast(object)->address() + offset);
}
void Heap::RecordFixedArrayElements(FixedArray* array, int offset, int length) {
if (InNewSpace(array)) return;
Page* page = Page::FromAddress(reinterpret_cast<Address>(array));
for (int i = 0; i < length; i++) {
if (!InNewSpace(array->get(i))) continue;
RememberedSet<OLD_TO_NEW>::Insert(
page,
reinterpret_cast<Address>(array->RawFieldOfElementAt(offset + i)));
}
Page* page = Page::FromAddress(reinterpret_cast<Address>(object));
Address slot = HeapObject::cast(object)->address() + offset;
RememberedSet<OLD_TO_NEW>::Insert(page, slot);
}
......
......@@ -1109,7 +1109,13 @@ void Heap::MoveElements(FixedArray* array, int dst_index, int src_index,
DCHECK(array->map() != fixed_cow_array_map());
Object** dst_objects = array->data_start() + dst_index;
MemMove(dst_objects, array->data_start() + src_index, len * kPointerSize);
FIXED_ARRAY_ELEMENTS_WRITE_BARRIER(this, array, dst_index, src_index);
if (!InNewSpace(array)) {
for (int i = 0; i < len; i++) {
RecordWrite(array, array->OffsetOfElementAt(dst_index + i),
dst_objects[i]);
}
}
incremental_marking()->IterateBlackObject(array);
}
......
......@@ -1084,8 +1084,6 @@ class Heap {
// Write barrier support for object[offset] = o;
inline void RecordWrite(Object* object, int offset, Object* o);
inline void RecordFixedArrayElements(FixedArray* array, int offset,
int length);
Address* store_buffer_top_address() { return store_buffer()->top_address(); }
......
......@@ -1149,12 +1149,6 @@ MaybeHandle<Object> JSReceiver::GetProperty(Isolate* isolate,
object, HeapObject::RawField(object, offset), value); \
heap->RecordWrite(object, offset, value);
#define FIXED_ARRAY_ELEMENTS_WRITE_BARRIER(heap, array, start, length) \
do { \
heap->RecordFixedArrayElements(array, start, length); \
heap->incremental_marking()->IterateBlackObject(array); \
} while (false)
#define CONDITIONAL_WRITE_BARRIER(heap, object, offset, value, mode) \
if (mode != SKIP_WRITE_BARRIER) { \
if (mode == UPDATE_WRITE_BARRIER) { \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment