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
This commit is contained in:
bmeurer@chromium.org 2014-02-13 10:47:00 +00:00
parent a7e7d08448
commit 42c57ea94b
2 changed files with 6 additions and 10 deletions

View File

@ -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> map, CompilationInfo* info, Zone* zone) {
map_set_.Add(Unique<Map>(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);
}

View File

@ -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()));
}