Reviewers: danno,
Description:
Switch elements access to use IfBuilder instead of CheckBuilder.
[email protected]
Please review this at https://codereview.chromium.org/14365014/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/hydrogen.h
M src/hydrogen.cc
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index
435722d81dbaf819cd8ec4c249a7766b79601525..104ca7d3346fcdae26edf71096002265e9cbf366
100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -870,7 +870,6 @@ void HGraphBuilder::IfBuilder::Deopt() {
block->FinishExitWithDeoptimization(HDeoptimize::kUseAll);
if (did_else_) {
first_false_block_ = NULL;
- did_else_ = false;
} else {
first_true_block_ = NULL;
}
@@ -884,8 +883,9 @@ void HGraphBuilder::IfBuilder::End() {
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();
@@ -1312,18 +1312,18 @@ HInstruction*
HGraphBuilder::BuildUncheckedMonomorphicElementAccess(
HLoadExternalArrayPointer* external_elements =
new(zone) HLoadExternalArrayPointer(elements);
AddInstruction(external_elements);
- 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 bounds_checker(this);
+ bounds_checker.IfCompare(key, length, Token::LT);
+ HValue* bounds_check = bounds_checker.AndIfCompare(
key, graph()->GetConstant0(), Token::GTE);
- negative_checker.End();
+ bounds_checker.Then();
HInstruction* result = BuildExternalArrayElementAccess(
external_elements, key, val, bounds_check,
elements_kind, is_store);
AddInstruction(result);
- length_checker.End();
+ bounds_checker.Else();
+ bounds_checker.Deopt();
+ bounds_checker.End();
return result;
} else {
ASSERT(store_mode == STANDARD_STORE);
Index: src/hydrogen.h
diff --git a/src/hydrogen.h b/src/hydrogen.h
index
71a9cd2a45fa331cdc3cd4e99be947708a383d6c..a2dbe7de1df27f45fa1650555a05d3f06b98073f
100644
--- a/src/hydrogen.h
+++ b/src/hydrogen.h
@@ -1067,7 +1067,6 @@ class HGraphBuilder {
return compare;
}
- template<class Condition>
HInstruction* OrIfCompare(
HValue* p1,
HValue* p2,
@@ -1094,7 +1093,6 @@ class HGraphBuilder {
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.