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

Unified Diff: src/hydrogen.cc

Issue 7887037: Nuke CompareToNull AST node. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 3 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/ia32/full-codegen-ia32.cc » ('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 9281)
+++ src/hydrogen.cc (working copy)
@@ -5721,6 +5721,11 @@
return;
}
+ if (expr->IsLiteralCompareNull(&sub_expr)) {
+ HandleLiteralCompareNull(expr, sub_expr);
+ return;
+ }
+
TypeInfo type_info = oracle()->CompareType(expr);
// Check if this expression was ever executed according to type feedback.
if (type_info.IsUninitialized()) {
@@ -5824,15 +5829,16 @@
}
-void HGraphBuilder::VisitCompareToNull(CompareToNull* expr) {
+void HGraphBuilder::HandleLiteralCompareNull(CompareOperation* compare_expr,
+ Expression* expr) {
ASSERT(!HasStackOverflow());
ASSERT(current_block() != NULL);
ASSERT(current_block()->HasPredecessor());
- CHECK_ALIVE(VisitForValue(expr->expression()));
+ CHECK_ALIVE(VisitForValue(expr));
HValue* value = Pop();
- HIsNullAndBranch* instr =
- new(zone()) HIsNullAndBranch(value, expr->is_strict());
- return ast_context()->ReturnControl(instr, expr->id());
+ bool is_strict = compare_expr->op() == Token::EQ_STRICT;
+ HIsNullAndBranch* instr = new(zone()) HIsNullAndBranch(value, is_strict);
+ return ast_context()->ReturnControl(instr, compare_expr->id());
}
« no previous file with comments | « src/hydrogen.h ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698