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

Unified Diff: src/ia32/codegen-ia32.cc

Issue 1074009: Mark all loop conditions. (Closed)
Patch Set: Negate test to match previous (and correct) behavior. Created 10 years, 9 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
« src/data-flow.cc ('K') | « src/data-flow.cc ('k') | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/codegen-ia32.cc
diff --git a/src/ia32/codegen-ia32.cc b/src/ia32/codegen-ia32.cc
index c7738362dfa79423dcba0679567b55694d535f74..19a2754289cfb38716c4e62beb3189b9fbb6c285 100644
--- a/src/ia32/codegen-ia32.cc
+++ b/src/ia32/codegen-ia32.cc
@@ -2472,11 +2472,11 @@ void CodeGenerator::Comparison(AstNode* node,
__ test(left_side.reg(), Immediate(kSmiTagMask));
is_smi.Branch(zero, taken);
- bool is_for_loop_compare = (node->AsCompareOperation() != NULL)
- && node->AsCompareOperation()->is_for_loop_condition();
- if (!is_for_loop_compare
- && CpuFeatures::IsSupported(SSE2)
- && right_val->IsSmi()) {
+ bool is_loop_condition = (node->AsExpression() != NULL) &&
fschneider 2010/03/23 13:19:38 I think we should change CodeGenerator::Comparison
+ node->AsExpression()->is_loop_condition();
+ if (!is_loop_condition &&
+ CpuFeatures::IsSupported(SSE2) &&
+ right_val->IsSmi()) {
// Right side is a constant smi and left side has been checked
// not to be a smi.
CpuFeatures::Scope use_sse2(SSE2);
@@ -2720,11 +2720,10 @@ void CodeGenerator::Comparison(AstNode* node,
// with smi's (not heap numbers) and the code to comparing smi's is inlined
// separately. The same reason applies for for-loop comparison which will
// also most likely be smi comparisons.
- bool is_for_loop_compare = (node->AsCompareOperation() != NULL)
- && node->AsCompareOperation()->is_for_loop_condition();
- bool inline_number_compare = loop_nesting() > 0
- && cc != equal
- && !is_for_loop_compare;
+ bool is_loop_condition = (node->AsExpression() != NULL)
+ && node->AsExpression()->is_loop_condition();
+ bool inline_number_compare =
+ loop_nesting() > 0 && cc != equal && !is_loop_condition;
// Left and right needed in registers for the following code.
left_side.ToRegister();
« src/data-flow.cc ('K') | « src/data-flow.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698