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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 10834311: Split ToDouble into two IL instruction to make it work with SSA. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: rebased... Created 8 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 | « runtime/vm/compiler.cc ('k') | runtime/vm/il_printer.cc » ('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 10708)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -378,23 +378,23 @@
MethodRecognizer::Kind recognized_kind =
MethodRecognizer::RecognizeKind(target);
- intptr_t from_class_id;
- if (recognized_kind == MethodRecognizer::kDoubleToDouble) {
- from_class_id = kDoubleCid;
- } else if (recognized_kind == MethodRecognizer::kIntegerToDouble) {
- from_class_id = kSmiCid;
- } else {
- return false;
+ if ((recognized_kind == MethodRecognizer::kDoubleToDouble) &&
+ (class_ids[0] == kDoubleCid)) {
+ DoubleToDoubleComp* d2d_comp =
+ new DoubleToDoubleComp(comp->ArgumentAt(0)->value(), comp);
+ instr->set_computation(d2d_comp);
+ RemovePushArguments(comp);
+ return true;
}
-
- if (class_ids[0] != from_class_id) {
- return false;
+ if ((recognized_kind == MethodRecognizer::kIntegerToDouble) &&
+ (class_ids[0] == kSmiCid)) {
+ SmiToDoubleComp* s2d_comp = new SmiToDoubleComp(comp);
+ instr->set_computation(s2d_comp);
+ // Pushed arguments are not removed because SmiToDouble is implemented
+ // as a call.
+ return true;
}
- ToDoubleComp* coerce = new ToDoubleComp(
- comp->ArgumentAt(0)->value(), from_class_id, comp);
- instr->set_computation(coerce);
- RemovePushArguments(comp);
- return true;
+ return false;
}
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/il_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698