Revision: 14360
Author:   [email protected]
Date:     Fri Apr 19 09:21:09 2013
Log:      Switch elements access to use IfBuilder instead of CheckBuilder.

[email protected]

Review URL: https://codereview.chromium.org/14365014
http://code.google.com/p/v8/source/detail?r=14360

Modified:
 /branches/bleeding_edge/src/hydrogen.cc
 /branches/bleeding_edge/src/hydrogen.h

=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Fri Apr 19 06:20:45 2013
+++ /branches/bleeding_edge/src/hydrogen.cc     Fri Apr 19 09:21:09 2013
@@ -870,7 +870,6 @@
   block->FinishExitWithDeoptimization(HDeoptimize::kUseAll);
   if (did_else_) {
     first_false_block_ = NULL;
-    did_else_ = false;
   } else {
     first_true_block_ = NULL;
   }
@@ -884,8 +883,9 @@
       last_true_block_ = builder_->current_block();
     }
     if (first_true_block_ == NULL) {
-      // Deopt on true. Nothing to do, just continue the else block.
+      // Deopt on true. Nothing to do, just continue the false block.
     } else if (first_false_block_ == NULL) {
+      // Deopt on false. Nothing to do except switching to the true block.
       builder_->set_current_block(last_true_block_);
     } else {
HEnvironment* merge_env = last_true_block_->last_environment()->Copy();
@@ -1315,14 +1315,17 @@
       IfBuilder length_checker(this);
       length_checker.IfCompare(key, length, Token::LT);
       length_checker.Then();
-      CheckBuilder negative_checker(this);
-      HValue* bounds_check = negative_checker.CheckIntegerCompare(
+      IfBuilder negative_checker(this);
+      HValue* bounds_check = negative_checker.IfCompare(
           key, graph()->GetConstant0(), Token::GTE);
-      negative_checker.End();
+      negative_checker.Then();
       HInstruction* result = BuildExternalArrayElementAccess(
           external_elements, key, val, bounds_check,
           elements_kind, is_store);
       AddInstruction(result);
+      negative_checker.Else();
+      negative_checker.Deopt();
+      negative_checker.End();
       length_checker.End();
       return result;
     } else {
=======================================
--- /branches/bleeding_edge/src/hydrogen.h      Fri Apr 19 06:20:45 2013
+++ /branches/bleeding_edge/src/hydrogen.h      Fri Apr 19 09:21:09 2013
@@ -1067,7 +1067,6 @@
       return compare;
     }

-    template<class Condition>
     HInstruction* OrIfCompare(
         HValue* p1,
         HValue* p2,
@@ -1094,7 +1093,6 @@
       return If<Condition>(p1, p2);
     }

-    template<class Condition>
     HInstruction* AndIfCompare(
         HValue* p1,
         HValue* p2,

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to