Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(751)

Unified Diff: src/hydrogen.cc

Issue 14365014: Switch elements access to use IfBuilder instead of CheckBuilder. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Daniel Clifford. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 435722d81dbaf819cd8ec4c249a7766b79601525..b451c6ed472f75daa4570ac84ddf400208512c21 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();
@@ -1315,14 +1315,17 @@ HInstruction* HGraphBuilder::BuildUncheckedMonomorphicElementAccess(
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 {
« no previous file with comments | « src/hydrogen.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698