Commit 42c57ea9 authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

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
parent a7e7d084
...@@ -1557,7 +1557,7 @@ class HCompareMap V8_FINAL : public HUnaryControlInstruction { ...@@ -1557,7 +1557,7 @@ class HCompareMap V8_FINAL : public HUnaryControlInstruction {
ASSERT(!map.is_null()); ASSERT(!map.is_null());
is_stable_ = map->is_stable(); is_stable_ = map->is_stable();
if (FLAG_check_elimination && is_stable_) { if (is_stable_) {
map->AddDependentCompilationInfo( map->AddDependentCompilationInfo(
DependentCode::kPrototypeCheckGroup, info); DependentCode::kPrototypeCheckGroup, info);
} }
...@@ -2700,10 +2700,12 @@ class HCheckMaps V8_FINAL : public HTemplateInstruction<2> { ...@@ -2700,10 +2700,12 @@ class HCheckMaps V8_FINAL : public HTemplateInstruction<2> {
void Add(Handle<Map> map, CompilationInfo* info, Zone* zone) { void Add(Handle<Map> map, CompilationInfo* info, Zone* zone) {
map_set_.Add(Unique<Map>(map), zone); map_set_.Add(Unique<Map>(map), zone);
is_stable_ = is_stable_ && map->is_stable(); is_stable_ = is_stable_ && map->is_stable();
if (is_stable_) {
if (FLAG_check_elimination && is_stable_) {
map->AddDependentCompilationInfo( map->AddDependentCompilationInfo(
DependentCode::kPrototypeCheckGroup, info); DependentCode::kPrototypeCheckGroup, info);
} else {
SetDependsOnFlag(kMaps);
SetDependsOnFlag(kElementsKind);
} }
if (!has_migration_target_ && map->is_migration_target()) { if (!has_migration_target_ && map->is_migration_target()) {
...@@ -2722,8 +2724,6 @@ class HCheckMaps V8_FINAL : public HTemplateInstruction<2> { ...@@ -2722,8 +2724,6 @@ class HCheckMaps V8_FINAL : public HTemplateInstruction<2> {
set_representation(Representation::Tagged()); set_representation(Representation::Tagged());
SetFlag(kUseGVN); SetFlag(kUseGVN);
SetFlag(kTrackSideEffectDominators); SetFlag(kTrackSideEffectDominators);
SetDependsOnFlag(kMaps);
SetDependsOnFlag(kElementsKind);
} }
bool omit_; bool omit_;
...@@ -6506,7 +6506,7 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> { ...@@ -6506,7 +6506,7 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> {
has_transition_ = true; has_transition_ = true;
is_stable_ = map->is_stable(); is_stable_ = map->is_stable();
if (FLAG_check_elimination && is_stable_) { if (is_stable_) {
map->AddDependentCompilationInfo( map->AddDependentCompilationInfo(
DependentCode::kPrototypeCheckGroup, info); DependentCode::kPrototypeCheckGroup, info);
} }
......
...@@ -538,7 +538,6 @@ TEST(DeoptimizeCompare) { ...@@ -538,7 +538,6 @@ TEST(DeoptimizeCompare) {
TEST(DeoptimizeLoadICStoreIC) { TEST(DeoptimizeLoadICStoreIC) {
i::FLAG_concurrent_recompilation = false; i::FLAG_concurrent_recompilation = false;
i::FLAG_check_elimination = false;
LocalContext env; LocalContext env;
v8::HandleScope scope(env->GetIsolate()); v8::HandleScope scope(env->GetIsolate());
...@@ -614,13 +613,11 @@ TEST(DeoptimizeLoadICStoreIC) { ...@@ -614,13 +613,11 @@ TEST(DeoptimizeLoadICStoreIC) {
CHECK(!GetJSFunction(env->Global(), "g2")->IsOptimized()); CHECK(!GetJSFunction(env->Global(), "g2")->IsOptimized());
CHECK_EQ(4, env->Global()->Get(v8_str("count"))->Int32Value()); CHECK_EQ(4, env->Global()->Get(v8_str("count"))->Int32Value());
CHECK_EQ(13, env->Global()->Get(v8_str("result"))->Int32Value()); CHECK_EQ(13, env->Global()->Get(v8_str("result"))->Int32Value());
CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount(CcTest::i_isolate()));
} }
TEST(DeoptimizeLoadICStoreICNested) { TEST(DeoptimizeLoadICStoreICNested) {
i::FLAG_concurrent_recompilation = false; i::FLAG_concurrent_recompilation = false;
i::FLAG_check_elimination = false;
LocalContext env; LocalContext env;
v8::HandleScope scope(env->GetIsolate()); v8::HandleScope scope(env->GetIsolate());
...@@ -697,5 +694,4 @@ TEST(DeoptimizeLoadICStoreICNested) { ...@@ -697,5 +694,4 @@ TEST(DeoptimizeLoadICStoreICNested) {
CHECK(!GetJSFunction(env->Global(), "g2")->IsOptimized()); CHECK(!GetJSFunction(env->Global(), "g2")->IsOptimized());
CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value()); CHECK_EQ(1, env->Global()->Get(v8_str("count"))->Int32Value());
CHECK_EQ(13, env->Global()->Get(v8_str("result"))->Int32Value()); CHECK_EQ(13, env->Global()->Get(v8_str("result"))->Int32Value());
CHECK_EQ(0, Deoptimizer::GetDeoptimizedCodeCount(CcTest::i_isolate()));
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment