Allow map check hoisting in GVN for stable maps.
authorbmeurer@chromium.org <bmeurer@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 13 Feb 2014 10:47:00 +0000 (10:47 +0000)
committerbmeurer@chromium.org <bmeurer@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 13 Feb 2014 10:47:00 +0000 (10:47 +0000)
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

src/hydrogen-instructions.h
test/cctest/test-deoptimization.cc

index 20a7212..a290080 100644 (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);
     }
index 9e36476..dbbb3ed 100644 (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()));
 }