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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 10534116: Implement kDoubleToDouble and kIntegerToDouble on ia32 and x64. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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/assembler_x64_test.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
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index 51e540a5f3fdbe412381fca26485f72d8b694211..757c08b8a956e9076bd989f6b2936e656fcdedee 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -388,12 +388,24 @@ void FlowGraphOptimizer::TryInlineInstanceMethod(InstanceCallComp* comp) {
ASSERT(classes.length() == 1);
MethodRecognizer::Kind recognized_kind =
MethodRecognizer::RecognizeKind(target);
+
+ ObjectKind from_kind;
if (recognized_kind == MethodRecognizer::kDoubleToDouble) {
- // TODO(srdjan): Implement.
+ from_kind = kDouble;
+ } else if (recognized_kind == MethodRecognizer::kIntegerToDouble) {
+ from_kind = kSmi;
+ } else {
+ return;
}
- if (recognized_kind == MethodRecognizer::kIntegerToDouble) {
- // TODO(srdjan): Implement.
+
+ if (classes[0]->id() != from_kind) {
+ return;
}
+
+ ToDoubleComp* coerce = new ToDoubleComp(
+ comp->InputAt(0), from_kind, comp);
+ coerce->set_instr(comp->instr());
+ comp->instr()->replace_computation(coerce);
}
« no previous file with comments | « runtime/vm/assembler_x64_test.cc ('k') | runtime/vm/il_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698