Revert r14610 because of test-262 failures.
authorulan@chromium.org <ulan@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 10 May 2013 13:21:24 +0000 (13:21 +0000)
committerulan@chromium.org <ulan@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 10 May 2013 13:21:24 +0000 (13:21 +0000)
R=mstarzinger@chromium.org

Review URL: https://chromiumcodereview.appspot.com/14838012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14622 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/hydrogen.cc
src/hydrogen.h

index f34934c..2a1f84c 100644 (file)
@@ -752,7 +752,6 @@ void HGraphBuilder::IfBuilder::AddCompare(HControlInstruction* compare) {
       compare->SetSuccessorAt(1, split_edge);
     }
     split_edge->GotoNoSimulate(split_edge_merge_block_);
-    ASSERT(builder_->SafeToAddPhiInNoSideEffectsScope());
   } else {
     compare->SetSuccessorAt(0, first_true_block_);
     compare->SetSuccessorAt(1, first_false_block_);
@@ -770,7 +769,6 @@ void HGraphBuilder::IfBuilder::Or() {
     split_edge_merge_block_ =
         builder_->CreateBasicBlock(env->Copy());
     first_true_block_->GotoNoSimulate(split_edge_merge_block_);
-    ASSERT(builder_->SafeToAddPhiInNoSideEffectsScope());
     first_true_block_ = split_edge_merge_block_;
   }
   builder_->set_current_block(first_false_block_);
@@ -785,7 +783,6 @@ void HGraphBuilder::IfBuilder::And() {
   if (split_edge_merge_block_ == NULL) {
     split_edge_merge_block_ = builder_->CreateBasicBlock(env->Copy());
     first_false_block_->GotoNoSimulate(split_edge_merge_block_);
-    ASSERT(builder_->SafeToAddPhiInNoSideEffectsScope());
     first_false_block_ = split_edge_merge_block_;
   }
   builder_->set_current_block(first_true_block_);
@@ -817,7 +814,6 @@ void HGraphBuilder::IfBuilder::Then() {
     // Handle if's without any expressions, they jump directly to the "else"
     // branch.
     builder_->current_block()->GotoNoSimulate(first_false_block_);
-    ASSERT(builder_->SafeToAddPhiInNoSideEffectsScope());
     first_true_block_ = NULL;
   }
   builder_->set_current_block(first_true_block_);
@@ -880,7 +876,6 @@ void HGraphBuilder::IfBuilder::End() {
       ASSERT(!last_false_block->IsFinished());
       last_true_block_->GotoNoSimulate(merge_block_);
       last_false_block->GotoNoSimulate(merge_block_);
-      ASSERT(builder_->SafeToAddPhiInNoSideEffectsScope());
       builder_->set_current_block(merge_block_);
     }
   }
@@ -913,7 +908,6 @@ HValue* HGraphBuilder::LoopBuilder::BeginBody(
   phi_->AssumeRepresentation(Representation::Integer32());
   env->Push(initial);
   builder_->current_block()->GotoNoSimulate(header_block_);
-  ASSERT(builder_->SafeToAddPhiInNoSideEffectsScope());
 
   HEnvironment* body_env = env->Copy();
   HEnvironment* exit_env = env->Copy();
@@ -968,7 +962,6 @@ void HGraphBuilder::LoopBuilder::EndBody() {
   // Push the new increment value on the expression stack to merge into the phi.
   builder_->environment()->Push(increment_);
   builder_->current_block()->GotoNoSimulate(header_block_);
-  ASSERT(builder_->SafeToAddPhiInNoSideEffectsScope());
   header_block_->loop_information()->RegisterBackEdge(body_block_);
 
   builder_->set_current_block(exit_block_);
@@ -8235,7 +8228,6 @@ HValue* HOptimizedGraphBuilder::HandlePolymorphicElementAccess(
           access->set_position(position);
         }
         if_jsarray->GotoNoSimulate(join);
-        ASSERT(SafeToAddPhiInNoSideEffectsScope());
 
         set_current_block(if_fastobject);
         length = AddInstruction(new(zone()) HFixedArrayBaseLength(elements));
@@ -8262,7 +8254,6 @@ HValue* HOptimizedGraphBuilder::HandlePolymorphicElementAccess(
         Push(access);
       }
       current_block()->GotoNoSimulate(join);
-      ASSERT(SafeToAddPhiInNoSideEffectsScope());
       set_current_block(if_false);
     }
   }
index e5d8337..a95424a 100644 (file)
@@ -934,7 +934,6 @@ class HGraphBuilder {
       : info_(info),
         graph_(NULL),
         current_block_(NULL),
-        no_side_effects_scope_environment_delta_(0),
         no_side_effects_scope_count_(0) {}
   virtual ~HGraphBuilder() {}
 
@@ -966,31 +965,11 @@ class HGraphBuilder {
   HReturn* AddReturn(HValue* value);
 
   void IncrementInNoSideEffectsScope() {
-    if (no_side_effects_scope_count_ == 0) {
-      no_side_effects_scope_environment_delta_ =
-          environment()->push_count() - environment()->pop_count();
-    }
     no_side_effects_scope_count_++;
   }
 
   void DecrementInNoSideEffectsScope() {
     no_side_effects_scope_count_--;
-    if (no_side_effects_scope_count_ == 0) {
-      // No-side-effects scope should not change push-pop delta.
-      ASSERT_EQ(no_side_effects_scope_environment_delta_,
-                environment()->push_count() - environment()->pop_count());
-      no_side_effects_scope_environment_delta_ = 0;
-    }
-  }
-
-  bool SafeToAddPhiInNoSideEffectsScope() {
-    // Pops and pushes after a simulate are not visible in LChunkBuilder.
-    // If the number of pops is greater than the number pushes then the
-    // environment in HGraphBuilder is shorter then the corresponding
-    // environment in LChunkBuilder. This causes non-observable phis
-    // to be pushed in the environment, which breaks deoptimization.
-    return no_side_effects_scope_count_ == 0 ||
-           no_side_effects_scope_environment_delta_ >= 0;
   }
 
  protected:
@@ -1353,7 +1332,6 @@ class HGraphBuilder {
   CompilationInfo* info_;
   HGraph* graph_;
   HBasicBlock* current_block_;
-  int no_side_effects_scope_environment_delta_;
   int no_side_effects_scope_count_;
 };