From: bmeurer@chromium.org Date: Thu, 13 Feb 2014 10:47:00 +0000 (+0000) Subject: Allow map check hoisting in GVN for stable maps. X-Git-Tag: upstream/4.7.83~10732 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=42c57ea94b266430f381e4b7e5d0e1a5da75e836;p=platform%2Fupstream%2Fv8.git Allow map check hoisting in GVN for stable maps. R=verwaest@chromium.org Review URL: https://codereview.chromium.org/163263002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19351 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h index 20a7212..a290080 100644 --- a/src/hydrogen-instructions.h +++ b/src/hydrogen-instructions.h @@ -1557,7 +1557,7 @@ class HCompareMap V8_FINAL : public HUnaryControlInstruction { ASSERT(!map.is_null()); is_stable_ = map->is_stable(); - if (FLAG_check_elimination && is_stable_) { + if (is_stable_) { map->AddDependentCompilationInfo( DependentCode::kPrototypeCheckGroup, info); } @@ -2700,10 +2700,12 @@ class HCheckMaps V8_FINAL : public HTemplateInstruction<2> { void Add(Handle map, CompilationInfo* info, Zone* zone) { map_set_.Add(Unique(map), zone); is_stable_ = is_stable_ && map->is_stable(); - - if (FLAG_check_elimination && is_stable_) { + if (is_stable_) { map->AddDependentCompilationInfo( DependentCode::kPrototypeCheckGroup, info); + } else { + SetDependsOnFlag(kMaps); + SetDependsOnFlag(kElementsKind); } if (!has_migration_target_ && map->is_migration_target()) { @@ -2722,8 +2724,6 @@ class HCheckMaps V8_FINAL : public HTemplateInstruction<2> { set_representation(Representation::Tagged()); SetFlag(kUseGVN); SetFlag(kTrackSideEffectDominators); - SetDependsOnFlag(kMaps); - SetDependsOnFlag(kElementsKind); } bool omit_; @@ -6506,7 +6506,7 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> { has_transition_ = true; is_stable_ = map->is_stable(); - if (FLAG_check_elimination && is_stable_) { + if (is_stable_) { map->AddDependentCompilationInfo( DependentCode::kPrototypeCheckGroup, info); } diff --git a/test/cctest/test-deoptimization.cc b/test/cctest/test-deoptimization.cc index 9e36476..dbbb3ed 100644 --- a/test/cctest/test-deoptimization.cc +++ b/test/cctest/test-deoptimization.cc @@ -538,7 +538,6 @@ TEST(DeoptimizeCompare) { TEST(DeoptimizeLoadICStoreIC) { i::FLAG_concurrent_recompilation = false; - i::FLAG_check_elimination = false; LocalContext env; v8::HandleScope scope(env->GetIsolate()); @@ -614,13 +613,11 @@ TEST(DeoptimizeLoadICStoreIC) { CHECK(!GetJSFunction(env->Global(), "g2")->IsOptimized()); CHECK_EQ(4, env->Global()->Get(v8_str("count"))->Int32Value()); CHECK_EQ(13, env->Global()->Get(v8_str("result"))->Int32Value()); - CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount(CcTest::i_isolate())); } TEST(DeoptimizeLoadICStoreICNested) { i::FLAG_concurrent_recompilation = false; - i::FLAG_check_elimination = false; LocalContext env; v8::HandleScope scope(env->GetIsolate()); @@ -697,5 +694,4 @@ TEST(DeoptimizeLoadICStoreICNested) { CHECK(!GetJSFunction(env->Global(), "g2")->IsOptimized()); CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value()); CHECK_EQ(13, env->Global()->Get(v8_str("result"))->Int32Value()); - CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount(CcTest::i_isolate())); }