Commit d9a03631 authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[heap] Track transition arrays using worklists.

This allows handling transitions arrays in concurrent marking

Bug: chromium:694255
Change-Id: I28196fccbf03bfba7d7dada1884813be372ddb54
Reviewed-on: https://chromium-review.googlesource.com/610961
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47303}
parent 622852e5
...@@ -74,13 +74,13 @@ class ConcurrentMarkingVisitor final ...@@ -74,13 +74,13 @@ class ConcurrentMarkingVisitor final
public: public:
using BaseClass = HeapVisitor<int, ConcurrentMarkingVisitor>; using BaseClass = HeapVisitor<int, ConcurrentMarkingVisitor>;
explicit ConcurrentMarkingVisitor( explicit ConcurrentMarkingVisitor(ConcurrentMarking::MarkingWorklist* shared,
ConcurrentMarking::MarkingWorklist* shared,
ConcurrentMarking::MarkingWorklist* bailout, ConcurrentMarking::MarkingWorklist* bailout,
ConcurrentMarking::WeakCellWorklist* weak_cells, int task_id) WeakObjects* weak_objects, int task_id)
: shared_(shared, task_id), : shared_(shared, task_id),
bailout_(bailout, task_id), bailout_(bailout, task_id),
weak_cells_(weak_cells, task_id) {} weak_objects_(weak_objects),
task_id_(task_id) {}
bool ShouldVisit(HeapObject* object) { bool ShouldVisit(HeapObject* object) {
return marking_state_.GreyToBlack(object); return marking_state_.GreyToBlack(object);
...@@ -217,10 +217,30 @@ class ConcurrentMarkingVisitor final ...@@ -217,10 +217,30 @@ class ConcurrentMarkingVisitor final
return 0; return 0;
} }
int VisitTransitionArray(Map* map, TransitionArray* object) { int VisitTransitionArray(Map* map, TransitionArray* array) {
// TODO(ulan): implement iteration of strong fields. if (!ShouldVisit(array)) return 0;
bailout_.Push(object); VisitMapPointer(array, array->map_slot());
return 0; // Visit strong references.
if (array->HasPrototypeTransitions()) {
VisitPointer(array, array->GetPrototypeTransitionsSlot());
}
int num_transitions = array->number_of_entries();
for (int i = 0; i < num_transitions; ++i) {
VisitPointer(array, array->GetKeySlot(i));
// A TransitionArray can hold maps or (transitioning StoreIC) handlers.
// Maps have custom weak handling; handlers (which in turn weakly point
// to maps) are marked strongly for now, and will be cleared during
// compaction when the maps they refer to are dead.
Object* target = array->GetRawTarget(i);
if (target->IsHeapObject()) {
Map* map = HeapObject::cast(target)->synchronized_map();
if (map->instance_type() != MAP_TYPE) {
VisitPointer(array, array->GetTargetSlot(i));
}
}
}
weak_objects_->transition_arrays.Push(task_id_, array);
return TransitionArray::BodyDescriptor::SizeOf(map, array);
} }
int VisitWeakCell(Map* map, WeakCell* object) { int VisitWeakCell(Map* map, WeakCell* object) {
...@@ -237,7 +257,7 @@ class ConcurrentMarkingVisitor final ...@@ -237,7 +257,7 @@ class ConcurrentMarkingVisitor final
// If we do not know about liveness of values of weak cells, we have to // If we do not know about liveness of values of weak cells, we have to
// process them when we know the liveness of the whole transitive // process them when we know the liveness of the whole transitive
// closure. // closure.
weak_cells_.Push(object); weak_objects_->weak_cells.Push(task_id_, object);
} }
} }
return WeakCell::BodyDescriptor::SizeOf(map, object); return WeakCell::BodyDescriptor::SizeOf(map, object);
...@@ -295,8 +315,9 @@ class ConcurrentMarkingVisitor final ...@@ -295,8 +315,9 @@ class ConcurrentMarkingVisitor final
} }
ConcurrentMarking::MarkingWorklist::View shared_; ConcurrentMarking::MarkingWorklist::View shared_;
ConcurrentMarking::MarkingWorklist::View bailout_; ConcurrentMarking::MarkingWorklist::View bailout_;
ConcurrentMarking::WeakCellWorklist::View weak_cells_; WeakObjects* weak_objects_;
ConcurrentMarkingState marking_state_; ConcurrentMarkingState marking_state_;
int task_id_;
SlotSnapshot slot_snapshot_; SlotSnapshot slot_snapshot_;
}; };
...@@ -325,11 +346,11 @@ class ConcurrentMarking::Task : public CancelableTask { ...@@ -325,11 +346,11 @@ class ConcurrentMarking::Task : public CancelableTask {
ConcurrentMarking::ConcurrentMarking(Heap* heap, MarkingWorklist* shared, ConcurrentMarking::ConcurrentMarking(Heap* heap, MarkingWorklist* shared,
MarkingWorklist* bailout, MarkingWorklist* bailout,
WeakCellWorklist* weak_cells) WeakObjects* weak_objects)
: heap_(heap), : heap_(heap),
shared_(shared), shared_(shared),
bailout_(bailout), bailout_(bailout),
weak_cells_(weak_cells), weak_objects_(weak_objects),
pending_task_count_(0) { pending_task_count_(0) {
// The runtime flag should be set only if the compile time flag was set. // The runtime flag should be set only if the compile time flag was set.
#ifndef V8_CONCURRENT_MARKING #ifndef V8_CONCURRENT_MARKING
...@@ -343,7 +364,7 @@ ConcurrentMarking::ConcurrentMarking(Heap* heap, MarkingWorklist* shared, ...@@ -343,7 +364,7 @@ ConcurrentMarking::ConcurrentMarking(Heap* heap, MarkingWorklist* shared,
void ConcurrentMarking::Run(int task_id, TaskInterrupt* interrupt) { void ConcurrentMarking::Run(int task_id, TaskInterrupt* interrupt) {
size_t kBytesUntilInterruptCheck = 64 * KB; size_t kBytesUntilInterruptCheck = 64 * KB;
int kObjectsUntilInterrupCheck = 1000; int kObjectsUntilInterrupCheck = 1000;
ConcurrentMarkingVisitor visitor(shared_, bailout_, weak_cells_, task_id); ConcurrentMarkingVisitor visitor(shared_, bailout_, weak_objects_, task_id);
double time_ms; double time_ms;
size_t total_bytes_marked = 0; size_t total_bytes_marked = 0;
if (FLAG_trace_concurrent_marking) { if (FLAG_trace_concurrent_marking) {
...@@ -386,7 +407,8 @@ void ConcurrentMarking::Run(int task_id, TaskInterrupt* interrupt) { ...@@ -386,7 +407,8 @@ void ConcurrentMarking::Run(int task_id, TaskInterrupt* interrupt) {
base::LockGuard<base::Mutex> guard(&interrupt->lock); base::LockGuard<base::Mutex> guard(&interrupt->lock);
bailout_->FlushToGlobal(task_id); bailout_->FlushToGlobal(task_id);
} }
weak_cells_->FlushToGlobal(task_id); weak_objects_->weak_cells.FlushToGlobal(task_id);
weak_objects_->transition_arrays.FlushToGlobal(task_id);
{ {
base::LockGuard<base::Mutex> guard(&pending_lock_); base::LockGuard<base::Mutex> guard(&pending_lock_);
is_pending_[task_id] = false; is_pending_[task_id] = false;
......
...@@ -16,7 +16,7 @@ namespace internal { ...@@ -16,7 +16,7 @@ namespace internal {
class Heap; class Heap;
class Isolate; class Isolate;
class WeakCell; struct WeakObjects;
class ConcurrentMarking { class ConcurrentMarking {
public: public:
...@@ -33,10 +33,9 @@ class ConcurrentMarking { ...@@ -33,10 +33,9 @@ class ConcurrentMarking {
static const int kTasks = 4; static const int kTasks = 4;
using MarkingWorklist = Worklist<HeapObject*, 64 /* segment size */>; using MarkingWorklist = Worklist<HeapObject*, 64 /* segment size */>;
using WeakCellWorklist = Worklist<WeakCell*, 64 /* segment size */>;
ConcurrentMarking(Heap* heap, MarkingWorklist* shared, ConcurrentMarking(Heap* heap, MarkingWorklist* shared,
MarkingWorklist* bailout, WeakCellWorklist* weak_cells); MarkingWorklist* bailout, WeakObjects* weak_objects);
void ScheduleTasks(); void ScheduleTasks();
void EnsureCompleted(); void EnsureCompleted();
...@@ -60,7 +59,7 @@ class ConcurrentMarking { ...@@ -60,7 +59,7 @@ class ConcurrentMarking {
Heap* heap_; Heap* heap_;
MarkingWorklist* shared_; MarkingWorklist* shared_;
MarkingWorklist* bailout_; MarkingWorklist* bailout_;
WeakCellWorklist* weak_cells_; WeakObjects* weak_objects_;
TaskInterrupt task_interrupt_[kTasks + 1]; TaskInterrupt task_interrupt_[kTasks + 1];
base::Mutex pending_lock_; base::Mutex pending_lock_;
base::ConditionVariable pending_condition_; base::ConditionVariable pending_condition_;
......
...@@ -177,7 +177,6 @@ Heap::Heap() ...@@ -177,7 +177,6 @@ Heap::Heap()
set_native_contexts_list(NULL); set_native_contexts_list(NULL);
set_allocation_sites_list(Smi::kZero); set_allocation_sites_list(Smi::kZero);
set_encountered_weak_collections(Smi::kZero); set_encountered_weak_collections(Smi::kZero);
set_encountered_transition_arrays(Smi::kZero);
// Put a dummy entry in the remembered pages so we can find the list the // Put a dummy entry in the remembered pages so we can find the list the
// minidump even if there are no real unmapped pages. // minidump even if there are no real unmapped pages.
RememberUnmappedPage(NULL, false); RememberUnmappedPage(NULL, false);
...@@ -2738,11 +2737,7 @@ AllocationResult Heap::AllocateTransitionArray(int capacity) { ...@@ -2738,11 +2737,7 @@ AllocationResult Heap::AllocateTransitionArray(int capacity) {
// Transition arrays are tenured. When black allocation is on we have to // Transition arrays are tenured. When black allocation is on we have to
// add the transition array to the list of encountered_transition_arrays. // add the transition array to the list of encountered_transition_arrays.
if (incremental_marking()->black_allocation()) { if (incremental_marking()->black_allocation()) {
array->set_next_link(encountered_transition_arrays(), mark_compact_collector()->AddTransitionArray(array);
UPDATE_WEAK_WRITE_BARRIER);
set_encountered_transition_arrays(array);
} else {
array->set_next_link(undefined_value(), SKIP_WRITE_BARRIER);
} }
return array; return array;
} }
...@@ -5965,7 +5960,7 @@ bool Heap::SetUp() { ...@@ -5965,7 +5960,7 @@ bool Heap::SetUp() {
mark_compact_collector_->marking_worklist(); mark_compact_collector_->marking_worklist();
concurrent_marking_ = new ConcurrentMarking( concurrent_marking_ = new ConcurrentMarking(
this, marking_worklist->shared(), marking_worklist->bailout(), this, marking_worklist->shared(), marking_worklist->bailout(),
mark_compact_collector_->weak_cells()); mark_compact_collector_->weak_objects());
} else { } else {
concurrent_marking_ = concurrent_marking_ =
new ConcurrentMarking(this, nullptr, nullptr, nullptr); new ConcurrentMarking(this, nullptr, nullptr, nullptr);
......
...@@ -748,13 +748,6 @@ class Heap { ...@@ -748,13 +748,6 @@ class Heap {
} }
void IterateEncounteredWeakCollections(RootVisitor* visitor); void IterateEncounteredWeakCollections(RootVisitor* visitor);
void set_encountered_transition_arrays(Object* transition_array) {
encountered_transition_arrays_ = transition_array;
}
Object* encountered_transition_arrays() const {
return encountered_transition_arrays_;
}
// Number of mark-sweeps. // Number of mark-sweeps.
int ms_count() const { return ms_count_; } int ms_count() const { return ms_count_; }
...@@ -2291,8 +2284,6 @@ class Heap { ...@@ -2291,8 +2284,6 @@ class Heap {
// contains Smi(0) while marking is not active. // contains Smi(0) while marking is not active.
Object* encountered_weak_collections_; Object* encountered_weak_collections_;
Object* encountered_transition_arrays_;
List<GCCallbackPair> gc_epilogue_callbacks_; List<GCCallbackPair> gc_epilogue_callbacks_;
List<GCCallbackPair> gc_prologue_callbacks_; List<GCCallbackPair> gc_prologue_callbacks_;
......
...@@ -481,7 +481,7 @@ void MinorMarkCompactCollector::SetUp() {} ...@@ -481,7 +481,7 @@ void MinorMarkCompactCollector::SetUp() {}
void MarkCompactCollector::TearDown() { void MarkCompactCollector::TearDown() {
AbortCompaction(); AbortCompaction();
weak_cells_.Clear(); AbortWeakObjects();
marking_worklist()->TearDown(); marking_worklist()->TearDown();
} }
...@@ -1008,8 +1008,7 @@ void MarkCompactCollector::Prepare() { ...@@ -1008,8 +1008,7 @@ void MarkCompactCollector::Prepare() {
heap()->incremental_marking()->AbortBlackAllocation(); heap()->incremental_marking()->AbortBlackAllocation();
ClearMarkbits(); ClearMarkbits();
AbortWeakCollections(); AbortWeakCollections();
AbortWeakCells(); AbortWeakObjects();
AbortTransitionArrays();
AbortCompaction(); AbortCompaction();
heap_->local_embedder_heap_tracer()->AbortTracing(); heap_->local_embedder_heap_tracer()->AbortTracing();
marking_worklist()->Clear(); marking_worklist()->Clear();
...@@ -2798,6 +2797,9 @@ void MarkCompactCollector::ClearNonLiveReferences() { ...@@ -2798,6 +2797,9 @@ void MarkCompactCollector::ClearNonLiveReferences() {
MarkDependentCodeForDeoptimization(dependent_code_list); MarkDependentCodeForDeoptimization(dependent_code_list);
ClearWeakCollections(); ClearWeakCollections();
DCHECK(weak_objects_.weak_cells.IsGlobalEmpty());
DCHECK(weak_objects_.transition_arrays.IsGlobalEmpty());
} }
...@@ -2894,10 +2896,8 @@ void MarkCompactCollector::ClearSimpleMapTransition(Map* map, ...@@ -2894,10 +2896,8 @@ void MarkCompactCollector::ClearSimpleMapTransition(Map* map,
} }
void MarkCompactCollector::ClearFullMapTransitions() { void MarkCompactCollector::ClearFullMapTransitions() {
HeapObject* undefined = heap()->undefined_value(); TransitionArray* array;
Object* obj = heap()->encountered_transition_arrays(); while (weak_objects_.transition_arrays.Pop(kMainThread, &array)) {
while (obj != Smi::kZero) {
TransitionArray* array = TransitionArray::cast(obj);
int num_transitions = array->number_of_entries(); int num_transitions = array->number_of_entries();
if (num_transitions > 0) { if (num_transitions > 0) {
Map* map = array->GetTarget(0); Map* map = array->GetTarget(0);
...@@ -2912,10 +2912,7 @@ void MarkCompactCollector::ClearFullMapTransitions() { ...@@ -2912,10 +2912,7 @@ void MarkCompactCollector::ClearFullMapTransitions() {
TrimDescriptorArray(parent, descriptors); TrimDescriptorArray(parent, descriptors);
} }
} }
obj = array->next_link();
array->set_next_link(undefined, SKIP_WRITE_BARRIER);
} }
heap()->set_encountered_transition_arrays(Smi::kZero);
} }
bool MarkCompactCollector::CompactTransitionArray( bool MarkCompactCollector::CompactTransitionArray(
...@@ -3088,7 +3085,7 @@ void MarkCompactCollector::ClearWeakCellsAndSimpleMapTransitions( ...@@ -3088,7 +3085,7 @@ void MarkCompactCollector::ClearWeakCellsAndSimpleMapTransitions(
DependentCode* dependent_code_head = DependentCode* dependent_code_head =
DependentCode::cast(heap->empty_fixed_array()); DependentCode::cast(heap->empty_fixed_array());
WeakCell* weak_cell; WeakCell* weak_cell;
while (weak_cells_.Pop(kMainThread, &weak_cell)) { while (weak_objects_.weak_cells.Pop(kMainThread, &weak_cell)) {
// We do not insert cleared weak cells into the list, so the value // We do not insert cleared weak cells into the list, so the value
// cannot be a Smi here. // cannot be a Smi here.
HeapObject* value = HeapObject::cast(weak_cell->value()); HeapObject* value = HeapObject::cast(weak_cell->value());
...@@ -3139,17 +3136,9 @@ void MarkCompactCollector::ClearWeakCellsAndSimpleMapTransitions( ...@@ -3139,17 +3136,9 @@ void MarkCompactCollector::ClearWeakCellsAndSimpleMapTransitions(
*dependent_code_list = dependent_code_head; *dependent_code_list = dependent_code_head;
} }
void MarkCompactCollector::AbortWeakCells() { weak_cells_.Clear(); } void MarkCompactCollector::AbortWeakObjects() {
weak_objects_.weak_cells.Clear();
void MarkCompactCollector::AbortTransitionArrays() { weak_objects_.transition_arrays.Clear();
HeapObject* undefined = heap()->undefined_value();
Object* obj = heap()->encountered_transition_arrays();
while (obj != Smi::kZero) {
TransitionArray* array = TransitionArray::cast(obj);
obj = array->next_link();
array->set_next_link(undefined, SKIP_WRITE_BARRIER);
}
heap()->set_encountered_transition_arrays(Smi::kZero);
} }
void MarkCompactCollector::RecordRelocSlot(Code* host, RelocInfo* rinfo, void MarkCompactCollector::RecordRelocSlot(Code* host, RelocInfo* rinfo,
......
...@@ -477,6 +477,12 @@ class MajorNonAtomicMarkingState final ...@@ -477,6 +477,12 @@ class MajorNonAtomicMarkingState final
} }
}; };
// Weak objects encountered during marking.
struct WeakObjects {
Worklist<WeakCell*, 64> weak_cells;
Worklist<TransitionArray*, 64> transition_arrays;
};
// Collector for young and old generation. // Collector for young and old generation.
class MarkCompactCollector final : public MarkCompactCollectorBase { class MarkCompactCollector final : public MarkCompactCollectorBase {
public: public:
...@@ -587,8 +593,6 @@ class MarkCompactCollector final : public MarkCompactCollectorBase { ...@@ -587,8 +593,6 @@ class MarkCompactCollector final : public MarkCompactCollectorBase {
ConcurrentMarkingWorklist bailout_; ConcurrentMarkingWorklist bailout_;
}; };
using WeakCellWorklist = Worklist<WeakCell*, 64 /* segment size */>;
class RootMarkingVisitor; class RootMarkingVisitor;
class CustomRootBodyMarkingVisitor; class CustomRootBodyMarkingVisitor;
...@@ -738,10 +742,14 @@ class MarkCompactCollector final : public MarkCompactCollectorBase { ...@@ -738,10 +742,14 @@ class MarkCompactCollector final : public MarkCompactCollectorBase {
MarkingWorklist* marking_worklist() { return &marking_worklist_; } MarkingWorklist* marking_worklist() { return &marking_worklist_; }
WeakCellWorklist* weak_cells() { return &weak_cells_; } WeakObjects* weak_objects() { return &weak_objects_; }
void AddWeakCell(WeakCell* weak_cell) { void AddWeakCell(WeakCell* weak_cell) {
weak_cells_.Push(kMainThread, weak_cell); weak_objects_.weak_cells.Push(kMainThread, weak_cell);
}
void AddTransitionArray(TransitionArray* array) {
weak_objects_.transition_arrays.Push(kMainThread, array);
} }
Sweeper& sweeper() { return sweeper_; } Sweeper& sweeper() { return sweeper_; }
...@@ -878,9 +886,7 @@ class MarkCompactCollector final : public MarkCompactCollectorBase { ...@@ -878,9 +886,7 @@ class MarkCompactCollector final : public MarkCompactCollectorBase {
// transition. // transition.
void ClearWeakCellsAndSimpleMapTransitions( void ClearWeakCellsAndSimpleMapTransitions(
DependentCode** dependent_code_list); DependentCode** dependent_code_list);
void AbortWeakCells(); void AbortWeakObjects();
void AbortTransitionArrays();
// Starts sweeping of spaces by contributing on the main thread and setting // Starts sweeping of spaces by contributing on the main thread and setting
// up other pages for sweeping. Does not start sweeper tasks. // up other pages for sweeping. Does not start sweeper tasks.
...@@ -939,7 +945,7 @@ class MarkCompactCollector final : public MarkCompactCollectorBase { ...@@ -939,7 +945,7 @@ class MarkCompactCollector final : public MarkCompactCollectorBase {
bool have_code_to_deoptimize_; bool have_code_to_deoptimize_;
MarkingWorklist marking_worklist_; MarkingWorklist marking_worklist_;
WeakCellWorklist weak_cells_; WeakObjects weak_objects_;
// Candidates for pages that should be evacuated. // Candidates for pages that should be evacuated.
std::vector<Page*> evacuation_candidates_; std::vector<Page*> evacuation_candidates_;
......
...@@ -210,13 +210,7 @@ int MarkingVisitor<ConcreteVisitor>::VisitTransitionArray( ...@@ -210,13 +210,7 @@ int MarkingVisitor<ConcreteVisitor>::VisitTransitionArray(
visitor->VisitPointer(array, array->GetTargetSlot(i)); visitor->VisitPointer(array, array->GetTargetSlot(i));
} }
} }
// Enqueue the array in linked list of encountered transition arrays if it is collector_->AddTransitionArray(array);
// not already in the list.
if (array->next_link()->IsUndefined(heap_->isolate())) {
array->set_next_link(heap_->encountered_transition_arrays(),
UPDATE_WEAK_WRITE_BARRIER);
heap_->set_encountered_transition_arrays(array);
}
return TransitionArray::BodyDescriptor::SizeOf(map, array); return TransitionArray::BodyDescriptor::SizeOf(map, array);
} }
......
...@@ -513,8 +513,6 @@ void TransitionArray::TransitionArrayVerify() { ...@@ -513,8 +513,6 @@ void TransitionArray::TransitionArrayVerify() {
VerifyPointer(e); VerifyPointer(e);
} }
CHECK_LE(LengthFor(number_of_transitions()), length()); CHECK_LE(LengthFor(number_of_transitions()), length());
CHECK(next_link()->IsUndefined(GetIsolate()) || next_link()->IsSmi() ||
next_link()->IsTransitionArray());
} }
void JSArgumentsObject::JSArgumentsObjectVerify() { void JSArgumentsObject::JSArgumentsObjectVerify() {
......
...@@ -687,7 +687,6 @@ void TransitionArray::TransitionArrayPrint(std::ostream& os) { // NOLINT ...@@ -687,7 +687,6 @@ void TransitionArray::TransitionArrayPrint(std::ostream& os) { // NOLINT
os << "\n - capacity: " << length(); os << "\n - capacity: " << length();
for (int i = 0; i < length(); i++) { for (int i = 0; i < length(); i++) {
os << "\n [" << i << "]: " << Brief(get(i)); os << "\n [" << i << "]: " << Brief(get(i));
if (i == kNextLinkIndex) os << " (next link)";
if (i == kPrototypeTransitionsIndex) os << " (prototype transitions)"; if (i == kPrototypeTransitionsIndex) os << " (prototype transitions)";
if (i == kTransitionLengthIndex) os << " (number of transitions)"; if (i == kTransitionLengthIndex) os << " (number of transitions)";
} }
......
...@@ -40,14 +40,6 @@ TransitionArray* TransitionArray::cast(Object* object) { ...@@ -40,14 +40,6 @@ TransitionArray* TransitionArray::cast(Object* object) {
} }
Object* TransitionArray::next_link() { return get(kNextLinkIndex); }
void TransitionArray::set_next_link(Object* next, WriteBarrierMode mode) {
return set(kNextLinkIndex, next, mode);
}
bool TransitionArray::HasPrototypeTransitions() { bool TransitionArray::HasPrototypeTransitions() {
return get(kPrototypeTransitionsIndex) != Smi::kZero; return get(kPrototypeTransitionsIndex) != Smi::kZero;
} }
......
...@@ -519,8 +519,6 @@ Handle<TransitionArray> TransitionArray::Allocate(Isolate* isolate, ...@@ -519,8 +519,6 @@ Handle<TransitionArray> TransitionArray::Allocate(Isolate* isolate,
} }
void TransitionArray::Zap() { void TransitionArray::Zap() {
// Do not zap the next link that is used by GC.
STATIC_ASSERT(kNextLinkIndex + 1 == kPrototypeTransitionsIndex);
MemsetPointer(data_start() + kPrototypeTransitionsIndex, MemsetPointer(data_start() + kPrototypeTransitionsIndex,
GetHeap()->the_hole_value(), GetHeap()->the_hole_value(),
length() - kPrototypeTransitionsIndex); length() - kPrototypeTransitionsIndex);
......
...@@ -235,10 +235,6 @@ class TransitionArray : public FixedArray { ...@@ -235,10 +235,6 @@ class TransitionArray : public FixedArray {
void Sort(); void Sort();
// This field should be used only by the GC.
inline void set_next_link(Object* next, WriteBarrierMode mode);
inline Object* next_link();
#if defined(DEBUG) || defined(OBJECT_PRINT) #if defined(DEBUG) || defined(OBJECT_PRINT)
// For our gdb macros. // For our gdb macros.
void Print(); void Print();
...@@ -281,10 +277,9 @@ class TransitionArray : public FixedArray { ...@@ -281,10 +277,9 @@ class TransitionArray : public FixedArray {
int value); int value);
// Layout for full transition arrays. // Layout for full transition arrays.
static const int kNextLinkIndex = 0; static const int kPrototypeTransitionsIndex = 0;
static const int kPrototypeTransitionsIndex = 1; static const int kTransitionLengthIndex = 1;
static const int kTransitionLengthIndex = 2; static const int kFirstIndex = 2;
static const int kFirstIndex = 3;
// Layout of map transition entries in full transition arrays. // Layout of map transition entries in full transition arrays.
static const int kTransitionKey = 0; static const int kTransitionKey = 0;
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "src/heap/concurrent-marking.h" #include "src/heap/concurrent-marking.h"
#include "src/heap/heap-inl.h" #include "src/heap/heap-inl.h"
#include "src/heap/heap.h" #include "src/heap/heap.h"
#include "src/heap/mark-compact.h"
#include "src/heap/worklist.h" #include "src/heap/worklist.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
#include "test/cctest/heap/heap-utils.h" #include "test/cctest/heap/heap-utils.h"
...@@ -30,9 +31,9 @@ TEST(ConcurrentMarking) { ...@@ -30,9 +31,9 @@ TEST(ConcurrentMarking) {
CcTest::InitializeVM(); CcTest::InitializeVM();
Heap* heap = CcTest::heap(); Heap* heap = CcTest::heap();
ConcurrentMarking::MarkingWorklist shared, bailout; ConcurrentMarking::MarkingWorklist shared, bailout;
ConcurrentMarking::WeakCellWorklist weak_cells; WeakObjects weak_objects;
ConcurrentMarking* concurrent_marking = ConcurrentMarking* concurrent_marking =
new ConcurrentMarking(heap, &shared, &bailout, &weak_cells); new ConcurrentMarking(heap, &shared, &bailout, &weak_objects);
PublishSegment(&shared, heap->undefined_value()); PublishSegment(&shared, heap->undefined_value());
concurrent_marking->ScheduleTasks(); concurrent_marking->ScheduleTasks();
concurrent_marking->EnsureCompleted(); concurrent_marking->EnsureCompleted();
...@@ -44,9 +45,9 @@ TEST(ConcurrentMarkingReschedule) { ...@@ -44,9 +45,9 @@ TEST(ConcurrentMarkingReschedule) {
CcTest::InitializeVM(); CcTest::InitializeVM();
Heap* heap = CcTest::heap(); Heap* heap = CcTest::heap();
ConcurrentMarking::MarkingWorklist shared, bailout; ConcurrentMarking::MarkingWorklist shared, bailout;
ConcurrentMarking::WeakCellWorklist weak_cells; WeakObjects weak_objects;
ConcurrentMarking* concurrent_marking = ConcurrentMarking* concurrent_marking =
new ConcurrentMarking(heap, &shared, &bailout, &weak_cells); new ConcurrentMarking(heap, &shared, &bailout, &weak_objects);
PublishSegment(&shared, heap->undefined_value()); PublishSegment(&shared, heap->undefined_value());
concurrent_marking->ScheduleTasks(); concurrent_marking->ScheduleTasks();
concurrent_marking->EnsureCompleted(); concurrent_marking->EnsureCompleted();
......
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