// 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;
{
HandleScope inner_scope(isolate);
Handle<Map> map = Map::Create(isolate, 1);
+ v8::Local<v8::Value> result =
+ CompileRun("(function () { return {x : 10}; })();");
+ Handle<JSObject> proto =
+ v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(result));
+ map->set_prototype(*proto);
heap->AddRetainedMap(map);
weak_cell = inner_scope.CloseAndEscape(Map::WeakCellForMap(map));
}