Commit 4829bbc5 authored by hpayer's avatar hpayer Committed by Commit bot

Revert "Directly remove slot buffer entries in deoptimized code objects."

This reverts commit 80b3f169.

Revert "Record code slots that may point to evacuation candidate objects after deoptimizing them."

This reverts commit 4621210c.

BUG=chromium:507840
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#29778}
parent fbe085fd
......@@ -414,11 +414,9 @@ void Deoptimizer::DeoptimizeMarkedCodeForContext(Context* context) {
PatchCodeForDeoptimization(isolate, codes[i]);
// We might be in the middle of incremental marking with compaction.
// Ignore all slots that might have been recorded in the body of the
// deoptimized code object.
Code* code = codes[i];
isolate->heap()->mark_compact_collector()->RemoveObjectSlots(
code->instruction_start(), code->address() + code->Size());
// Tell collector to treat this code object in a special way and
// ignore all slots that might have been recorded on it.
isolate->heap()->mark_compact_collector()->InvalidateCode(codes[i]);
}
}
......
This diff is collapsed.
......@@ -116,6 +116,10 @@ class Marking {
markbit.Next().Set();
}
static void SetAllMarkBitsInRange(MarkBit start, MarkBit end);
static void ClearAllMarkBitsOfCellsContainedInRange(MarkBit start,
MarkBit end);
void TransferMark(Address old_start, Address new_start);
#ifdef DEBUG
......@@ -321,12 +325,6 @@ class SlotsBuffer {
slots_[idx_++] = slot;
}
// Should be used for testing only.
ObjectSlot Get(intptr_t i) {
DCHECK(i >= 0 && i < kNumberOfElements);
return slots_[i];
}
enum SlotType {
EMBEDDED_OBJECT_SLOT,
OBJECT_SLOT,
......@@ -362,6 +360,8 @@ class SlotsBuffer {
void UpdateSlots(Heap* heap);
void UpdateSlotsWithFilter(Heap* heap);
SlotsBuffer* next() { return next_; }
static int SizeOfChain(SlotsBuffer* buffer) {
......@@ -374,9 +374,14 @@ class SlotsBuffer {
inline bool HasSpaceForTypedSlot() { return idx_ < kNumberOfElements - 1; }
static void UpdateSlotsRecordedIn(Heap* heap, SlotsBuffer* buffer) {
static void UpdateSlotsRecordedIn(Heap* heap, SlotsBuffer* buffer,
bool code_slots_filtering_required) {
while (buffer != NULL) {
buffer->UpdateSlots(heap);
if (code_slots_filtering_required) {
buffer->UpdateSlotsWithFilter(heap);
} else {
buffer->UpdateSlots(heap);
}
buffer = buffer->next();
}
}
......@@ -415,10 +420,6 @@ class SlotsBuffer {
// before sweeping when mark bits are still intact.
static void RemoveInvalidSlots(Heap* heap, SlotsBuffer* buffer);
// Eliminate all slots that are within the given address range.
static void RemoveObjectSlots(Heap* heap, SlotsBuffer* buffer,
Address start_slot, Address end_slot);
// Ensures that there are no invalid slots in the chain of slots buffers.
static void VerifySlots(Heap* heap, SlotsBuffer* buffer);
......@@ -666,6 +667,8 @@ class MarkCompactCollector {
bool TryPromoteObject(HeapObject* object, int object_size);
void InvalidateCode(Code* code);
void ClearMarkbits();
bool abort_incremental_marking() const { return abort_incremental_marking_; }
......@@ -738,17 +741,16 @@ class MarkCompactCollector {
bool IsSlotInLiveObject(Address slot);
void VerifyIsSlotInLiveObject(Address slot, HeapObject* object);
// Removes all the slots in the slot buffers that are within the given
// address range.
void RemoveObjectSlots(Address start_slot, Address end_slot);
private:
class SweeperTask;
explicit MarkCompactCollector(Heap* heap);
~MarkCompactCollector();
bool MarkInvalidatedCode();
bool WillBeDeoptimized(Code* code);
void RemoveDeadInvalidatedCode();
void ProcessInvalidatedCode(ObjectVisitor* visitor);
void EvictPopularEvacuationCandidate(Page* page);
void ClearInvalidSlotsBufferEntries(PagedSpace* space);
void ClearInvalidStoreAndSlotsBufferEntries();
......@@ -965,6 +967,7 @@ class MarkCompactCollector {
bool have_code_to_deoptimize_;
List<Page*> evacuation_candidates_;
List<Code*> invalidated_code_;
base::SmartPointer<FreeList> free_list_old_space_;
......
......@@ -6009,49 +6009,3 @@ TEST(AllocationThroughput) {
throughput = tracer->AllocationThroughputInBytesPerMillisecond(100);
CHECK_EQ(2 * (counter3 - counter1) / (time3 - time1), throughput);
}
TEST(SlotsBufferObjectSlotsRemoval) {
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
Isolate* isolate = CcTest::i_isolate();
Heap* heap = isolate->heap();
Factory* factory = isolate->factory();
SlotsBuffer* buffer = new SlotsBuffer(NULL);
void* fake_object[1];
Handle<FixedArray> array = factory->NewFixedArray(2, TENURED);
CHECK(heap->old_space()->Contains(*array));
array->set(0, reinterpret_cast<Object*>(fake_object), SKIP_WRITE_BARRIER);
// Firstly, let's test the regular slots buffer entry.
buffer->Add(HeapObject::RawField(*array, FixedArray::kHeaderSize));
DCHECK(reinterpret_cast<void*>(buffer->Get(0)) ==
HeapObject::RawField(*array, FixedArray::kHeaderSize));
SlotsBuffer::RemoveObjectSlots(CcTest::i_isolate()->heap(), buffer,
array->address(),
array->address() + array->Size());
DCHECK(reinterpret_cast<void*>(buffer->Get(0)) ==
HeapObject::RawField(heap->empty_fixed_array(),
FixedArrayBase::kLengthOffset));
// Secondly, let's test the typed slots buffer entry.
SlotsBuffer::AddTo(NULL, &buffer, SlotsBuffer::EMBEDDED_OBJECT_SLOT,
array->address() + FixedArray::kHeaderSize,
SlotsBuffer::FAIL_ON_OVERFLOW);
DCHECK(reinterpret_cast<void*>(buffer->Get(1)) ==
reinterpret_cast<Object**>(SlotsBuffer::EMBEDDED_OBJECT_SLOT));
DCHECK(reinterpret_cast<void*>(buffer->Get(2)) ==
HeapObject::RawField(*array, FixedArray::kHeaderSize));
SlotsBuffer::RemoveObjectSlots(CcTest::i_isolate()->heap(), buffer,
array->address(),
array->address() + array->Size());
DCHECK(reinterpret_cast<void*>(buffer->Get(1)) ==
HeapObject::RawField(heap->empty_fixed_array(),
FixedArrayBase::kLengthOffset));
DCHECK(reinterpret_cast<void*>(buffer->Get(2)) ==
HeapObject::RawField(heap->empty_fixed_array(),
FixedArrayBase::kLengthOffset));
delete buffer;
}
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