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

Unified Diff: src/hydrogen.cc

Issue 1115973005: Revert of Collect type feedback on result of Math.[round|ceil|floor] (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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/code-stubs-ia32.cc » ('j') | 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 5f6e86bb28c0933b618153a726b70562ff0daf2c..937f5b086b41029a1e4c70130ae3953cca3d1fe8 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -8330,13 +8330,8 @@
if (!FLAG_fast_math) break;
// Fall through if FLAG_fast_math.
case kMathRound:
+ case kMathFround:
case kMathFloor:
- // If round has seen minus zero, don't inline, since that assumes
- // returned value is an integer, which -0 definitely is not.
- if (expr->ShouldHandleMinusZeroResult()) {
- break;
- }
- case kMathFround:
case kMathAbs:
case kMathSqrt:
case kMathLog:
@@ -8346,28 +8341,6 @@
Drop(2); // Receiver and function.
HInstruction* op = NewUncasted<HUnaryMathOperation>(argument, id);
ast_context()->ReturnInstruction(op, expr->id());
- return true;
- }
- break;
- case kMathCeil:
- // If round/floor has seen minus zero, don't inline, since that assumes
- // returned value is an integer, which -0 definitely is not.
- if (expr->ShouldHandleMinusZeroResult()) {
- break;
- }
- if (expr->arguments()->length() == 1) {
- HValue* argument = Pop();
- Drop(2); // Receiver and function.
- HValue* op = NULL;
- {
- NoObservableSideEffectsScope s(this);
- HValue* neg_arg =
- AddUncasted<HMul>(graph()->GetConstantMinus1(), argument);
- op = AddUncasted<HUnaryMathOperation>(neg_arg, kMathFloor);
- }
- HInstruction* neg_op =
- NewUncasted<HMul>(graph()->GetConstantMinus1(), op);
- ast_context()->ReturnInstruction(neg_op, expr->id());
return true;
}
break;
@@ -8464,13 +8437,8 @@
if (!FLAG_fast_math) break;
// Fall through if FLAG_fast_math.
case kMathRound:
+ case kMathFround:
case kMathFloor:
- // If round/floor has seen minus zero, don't inline, since that assumes
- // returned value is an integer, which -0 definitely is not.
- if (expr->ShouldHandleMinusZeroResult()) {
- break;
- }
- case kMathFround:
case kMathAbs:
case kMathSqrt:
case kMathLog:
@@ -8480,28 +8448,6 @@
Drop(2); // Receiver and function.
HInstruction* op = NewUncasted<HUnaryMathOperation>(argument, id);
ast_context()->ReturnInstruction(op, expr->id());
- return true;
- }
- break;
- case kMathCeil:
- // If round/floor has seen minus zero, don't inline, since that assumes
- // returned value is an integer, which -0 definitely is not.
- if (expr->ShouldHandleMinusZeroResult()) {
- break;
- }
- if (argument_count == 2) {
- HValue* argument = Pop();
- Drop(2); // Receiver and function.
- HValue* op = NULL;
- {
- NoObservableSideEffectsScope s(this);
- HValue* neg_arg =
- AddUncasted<HMul>(graph()->GetConstantMinus1(), argument);
- op = AddUncasted<HUnaryMathOperation>(neg_arg, kMathFloor);
- }
- HInstruction* neg_op =
- NewUncasted<HMul>(graph()->GetConstantMinus1(), op);
- ast_context()->ReturnInstruction(neg_op, expr->id());
return true;
}
break;
@@ -12240,6 +12186,15 @@
}
+void HOptimizedGraphBuilder::GenerateMathFloor(CallRuntime* call) {
+ DCHECK(call->arguments()->length() == 1);
+ CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
+ HValue* value = Pop();
+ HInstruction* result = NewUncasted<HUnaryMathOperation>(value, kMathFloor);
+ return ast_context()->ReturnInstruction(result, call->id());
+}
+
+
void HOptimizedGraphBuilder::GenerateMathLogRT(CallRuntime* call) {
DCHECK(call->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
« no previous file with comments | « src/hydrogen.h ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698