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

Unified Diff: src/hydrogen.cc

Issue 14211009: Crankshaft: Recognize (i >>> 0) === i for integer32 inputs and replace (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: 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') | src/hydrogen-instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
===================================================================
--- src/hydrogen.cc (revision 14364)
+++ src/hydrogen.cc (working copy)
@@ -10041,6 +10041,21 @@
}
+void HOptimizedGraphBuilder::HandleTripleShiftZeroCompare(
+ CompareOperation* expr,
+ HValue* input) {
+ // (i >>> 0) === i is transformed to i >= 0.
+ // (i >>> 0) !== i is transformed to i < 0.
+ Token::Value op = (expr->op() == Token::EQ_STRICT) ? Token::GTE : Token::LT;
+ HCompareIDAndBranch* compare =
+ new(zone()) HCompareIDAndBranch(input, graph()->GetConstant0(), op);
+ compare->set_observed_input_representation(Representation::Integer32(),
+ Representation::Integer32());
+ compare->set_position(expr->position());
+ return ast_context()->ReturnControl(compare, expr->id());
+}
+
+
void HOptimizedGraphBuilder::HandleLiteralCompareTypeof(CompareOperation* expr,
HTypeof* typeof_expr,
Handle<String> check) {
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698