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

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

Issue 1009343002: Retain maps that have live prototypes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test Created 5 years, 9 months 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 | « no previous file | test/cctest/test-heap.cc » ('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 cbdfadc2b5341161e2617021fb38b7ccb68b8276..f0483c95615063b8b9954c979e565adfd628562e 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -2153,7 +2153,16 @@ void MarkCompactCollector::RetainMaps() {
// be created. Do not retain this map.
continue;
}
- new_age = age - 1;
+ Object* prototype = map->prototype();
+ if (prototype->IsHeapObject() &&
+ !Marking::MarkBitFrom(HeapObject::cast(prototype)).Get()) {
+ // The prototype is not marked, age the map.
+ new_age = age - 1;
+ } else {
+ // The prototype and the constructor are marked, this map keeps only
+ // transition tree alive, not JSObjects. Do not age the map.
+ new_age = age;
+ }
MarkObject(map, map_mark);
} else {
new_age = FLAG_retain_maps_for_n_gc;
« no previous file with comments | « no previous file | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698