diff --git a/src/flag-definitions.h b/src/flag-definitions.h index 9f11616b67..566010b5ea 100644 --- a/src/flag-definitions.h +++ b/src/flag-definitions.h @@ -128,6 +128,9 @@ DEFINE_bool(use_inlining, true, "use function inlining") DEFINE_bool(limit_inlining, true, "limit code size growth from inlining") DEFINE_bool(eliminate_empty_blocks, true, "eliminate empty blocks") DEFINE_bool(loop_invariant_code_motion, true, "loop invariant code motion") +DEFINE_bool(collect_megamorphic_maps_from_stub_cache, + true, + "crankshaft harvests type feedback from stub cache") DEFINE_bool(hydrogen_stats, false, "print statistics for hydrogen") DEFINE_bool(trace_hydrogen, false, "trace generated hydrogen to file") DEFINE_bool(trace_inlining, false, "trace inlining decisions") diff --git a/src/type-info.cc b/src/type-info.cc index d522242e61..c781c615a7 100644 --- a/src/type-info.cc +++ b/src/type-info.cc @@ -419,7 +419,8 @@ void TypeFeedbackOracle::CollectReceiverTypes(unsigned ast_id, ASSERT(Handle::cast(object)->ic_state() == MEGAMORPHIC); } else if (object->IsMap()) { types->Add(Handle::cast(object)); - } else if (Handle::cast(object)->ic_state() == MEGAMORPHIC) { + } else if (FLAG_collect_megamorphic_maps_from_stub_cache && + Handle::cast(object)->ic_state() == MEGAMORPHIC) { types->Reserve(4); ASSERT(object->IsCode()); isolate_->stub_cache()->CollectMatchingMaps(types, *name, flags);