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

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

Issue 1470773003: Optimize ClearNonLiveReferences: do not compact prototype transitions in GC. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments 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
« no previous file with comments | « src/heap/mark-compact.h ('k') | src/transitions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index a58b0678b5fae004175fb8935372c8ee9559d7b4..1c82da0d02e289dddd3a96f3ccc0485e643a9883 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -2261,10 +2261,7 @@ void MarkCompactCollector::ClearNonLiveReferences() {
Map* map = Map::cast(obj);
if (!map->CanTransition()) continue;
MarkBit map_mark = Marking::MarkBitFrom(map);
- bool alive = Marking::IsBlackOrGrey(map_mark);
- if (alive) {
- ClearNonLivePrototypeTransitions(map);
- } else {
+ if (Marking::IsWhite(map_mark)) {
ClearNonLiveMapTransitions(map);
}
}
@@ -2304,39 +2301,6 @@ void MarkCompactCollector::MarkDependentCodeListForDeoptimization(
}
-void MarkCompactCollector::ClearNonLivePrototypeTransitions(Map* map) {
- FixedArray* prototype_transitions =
- TransitionArray::GetPrototypeTransitions(map);
- int number_of_transitions =
- TransitionArray::NumberOfPrototypeTransitions(prototype_transitions);
-
- const int header = TransitionArray::kProtoTransitionHeaderSize;
- int new_number_of_transitions = 0;
- for (int i = 0; i < number_of_transitions; i++) {
- Object* cell = prototype_transitions->get(header + i);
- if (!WeakCell::cast(cell)->cleared()) {
- if (new_number_of_transitions != i) {
- prototype_transitions->set(header + new_number_of_transitions, cell);
- Object** slot = prototype_transitions->RawFieldOfElementAt(
- header + new_number_of_transitions);
- RecordSlot(prototype_transitions, slot, cell);
- }
- new_number_of_transitions++;
- }
- }
-
- if (new_number_of_transitions != number_of_transitions) {
- TransitionArray::SetNumberOfPrototypeTransitions(prototype_transitions,
- new_number_of_transitions);
- }
-
- // Fill slots that became free with undefined value.
- for (int i = new_number_of_transitions; i < number_of_transitions; i++) {
- prototype_transitions->set_undefined(header + i);
- }
-}
-
-
void MarkCompactCollector::ClearNonLiveMapTransitions(Map* map) {
Object* potential_parent = map->GetBackPointer();
if (!potential_parent->IsMap()) return;
« no previous file with comments | « src/heap/mark-compact.h ('k') | src/transitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698