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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 23068020: Fix performance regression on Tracer: recognize _doublePow in Math. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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 | « no previous file | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
===================================================================
--- runtime/vm/flow_graph_optimizer.cc (revision 26445)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -1722,7 +1722,7 @@
args->Add(new Value(call->ArgumentAt(i)));
}
InvokeMathCFunctionInstr* invoke =
- new InvokeMathCFunctionInstr(args, call, recognized_kind);
+ new InvokeMathCFunctionInstr(args, call->deopt_id(), recognized_kind);
ReplaceCall(call, invoke);
}
@@ -1861,7 +1861,6 @@
return true;
}
case MethodRecognizer::kDoubleMod:
- case MethodRecognizer::kDoublePow:
case MethodRecognizer::kDoubleRound:
ReplaceWithMathCFunction(call, recognized_kind);
return true;
@@ -2769,6 +2768,18 @@
ReplaceCall(call, min_max);
}
}
+ } else if (recognized_kind == MethodRecognizer::kMathDoublePow) {
+ // We know that first argument is double, the second is num.
+ // InvokeMathCFunctionInstr requires unboxed doubles. UnboxDouble
+ // instructions contain type checks and conversions to double.
+ ZoneGrowableArray<Value*>* args =
+ new ZoneGrowableArray<Value*>(call->ArgumentCount());
+ for (intptr_t i = 0; i < call->ArgumentCount(); i++) {
+ args->Add(new Value(call->ArgumentAt(i)));
+ }
+ InvokeMathCFunctionInstr* invoke =
+ new InvokeMathCFunctionInstr(args, call->deopt_id(), recognized_kind);
+ ReplaceCall(call, invoke);
}
}
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698