Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Unified Diff: src/heap/mark-compact.cc

Issue 1480873003: Introduce instance type for transition arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index 884a8abc285cc183e349a474ee6bbf215c6bad15..f3e1f7f17a70a7cd2f049390f3d0235ae194a977 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -782,6 +782,7 @@ void MarkCompactCollector::Prepare() {
ClearMarkbits();
AbortWeakCollections();
AbortWeakCells();
+ AbortTransitionArrays();
AbortCompaction();
was_marked_incrementally_ = false;
}
@@ -2208,14 +2209,15 @@ void MarkCompactCollector::ProcessWeakReferences() {
ClearNonLiveReferences();
ClearWeakCollections();
-
- heap_->set_encountered_weak_cells(Smi::FromInt(0));
}
void MarkCompactCollector::ClearNonLiveReferences() {
GCTracer::Scope gc_scope(heap()->tracer(),
GCTracer::Scope::MC_NONLIVEREFERENCES);
+
+ ProcessAndClearTransitionArrays();
+
// Iterate over the map space, setting map transitions that go from
// a marked map to an unmarked map to null transitions. This action
// is carried out only on maps of JSObjects and related subtypes.
@@ -2533,6 +2535,31 @@ void MarkCompactCollector::AbortWeakCells() {
}
+void MarkCompactCollector::ProcessAndClearTransitionArrays() {
+ HeapObject* undefined = heap()->undefined_value();
+ Object* obj = heap()->encountered_transition_arrays();
+ while (obj != Smi::FromInt(0)) {
+ TransitionArray* array = reinterpret_cast<TransitionArray*>(obj);
Michael Lippautz 2015/11/27 14:27:28 Let's use TransitionArray::cast()
ulan 2015/11/27 14:43:45 Done.
+ // TODO(ulan): move logic from ClearMapTransitions here.
+ obj = array->next_link();
+ array->set_next_link(undefined, SKIP_WRITE_BARRIER);
+ }
+ heap()->set_encountered_transition_arrays(Smi::FromInt(0));
+}
+
+
+void MarkCompactCollector::AbortTransitionArrays() {
+ HeapObject* undefined = heap()->undefined_value();
+ Object* obj = heap()->encountered_transition_arrays();
+ while (obj != Smi::FromInt(0)) {
+ TransitionArray* array = reinterpret_cast<TransitionArray*>(obj);
Michael Lippautz 2015/11/27 14:27:28 Let's use TransitionArray::cast()
ulan 2015/11/27 14:43:45 Done.
+ obj = array->next_link();
+ array->set_next_link(undefined, SKIP_WRITE_BARRIER);
+ }
+ heap()->set_encountered_transition_arrays(Smi::FromInt(0));
+}
+
+
void MarkCompactCollector::RecordMigratedSlot(
Object* value, Address slot, SlotsBuffer** evacuation_slots_buffer) {
// When parallel compaction is in progress, store and slots buffer entries

Powered by Google App Engine
This is Rietveld 408576698