Put making embedded maps in optimized code weak behind a flag.

Disable the flag by default because of Chrome crashes.

BUG=172488,172489
R=mstarzinger@chromium.org

Review URL: https://chromiumcodereview.appspot.com/12091018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13523 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
ulan@chromium.org 2013-01-28 10:25:38 +00:00
parent fe8e97798e
commit fe0582c262
4 changed files with 9 additions and 3 deletions

View File

@ -402,6 +402,8 @@ DEFINE_bool(trace_external_memory, false,
"it is adjusted.") "it is adjusted.")
DEFINE_bool(collect_maps, true, DEFINE_bool(collect_maps, true,
"garbage collect maps from which no objects can be reached") "garbage collect maps from which no objects can be reached")
DEFINE_bool(weak_embedded_maps_in_optimized_code, false,
"make maps embedded in optimized code weak")
DEFINE_bool(flush_code, true, DEFINE_bool(flush_code, true,
"flush code that we expect not to use again (during full gc)") "flush code that we expect not to use again (during full gc)")
DEFINE_bool(flush_code_incrementally, true, DEFINE_bool(flush_code_incrementally, true,

View File

@ -429,7 +429,9 @@ Handle<Code> LChunk::Codegen(Code::Kind kind) {
Handle<Code> code = Handle<Code> code =
CodeGenerator::MakeCodeEpilogue(&assembler, flags, info()); CodeGenerator::MakeCodeEpilogue(&assembler, flags, info());
generator.FinishCode(code); generator.FinishCode(code);
RegisterDependentCodeForEmbeddedMaps(code); if (FLAG_weak_embedded_maps_in_optimized_code) {
RegisterDependentCodeForEmbeddedMaps(code);
}
CodeGenerator::PrintCode(code, info()); CodeGenerator::PrintCode(code, info());
return code; return code;
} }

View File

@ -85,7 +85,8 @@ class VerifyMarkingVisitor: public ObjectVisitor {
void VisitEmbeddedPointer(RelocInfo* rinfo) { void VisitEmbeddedPointer(RelocInfo* rinfo) {
ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT); ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT);
if (rinfo->host()->kind() != Code::OPTIMIZED_FUNCTION || if (!FLAG_weak_embedded_maps_in_optimized_code ||
rinfo->host()->kind() != Code::OPTIMIZED_FUNCTION ||
!rinfo->target_object()->IsMap() || !rinfo->target_object()->IsMap() ||
!Map::cast(rinfo->target_object())->CanTransition()) { !Map::cast(rinfo->target_object())->CanTransition()) {
VisitPointer(rinfo->target_object_address()); VisitPointer(rinfo->target_object_address());

View File

@ -175,7 +175,8 @@ void StaticMarkingVisitor<StaticVisitor>::VisitEmbeddedPointer(
ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT); ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT);
ASSERT(!rinfo->target_object()->IsConsString()); ASSERT(!rinfo->target_object()->IsConsString());
HeapObject* object = HeapObject::cast(rinfo->target_object()); HeapObject* object = HeapObject::cast(rinfo->target_object());
if (!FLAG_collect_maps || rinfo->host()->kind() != Code::OPTIMIZED_FUNCTION || if (!FLAG_weak_embedded_maps_in_optimized_code ||
!FLAG_collect_maps || rinfo->host()->kind() != Code::OPTIMIZED_FUNCTION ||
!object->IsMap() || !Map::cast(object)->CanTransition()) { !object->IsMap() || !Map::cast(object)->CanTransition()) {
heap->mark_compact_collector()->RecordRelocSlot(rinfo, object); heap->mark_compact_collector()->RecordRelocSlot(rinfo, object);
StaticVisitor::MarkObject(heap, object); StaticVisitor::MarkObject(heap, object);