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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 22859007: Insert dummy conversion instruction for impossible conversion requests. (Closed) Base URL: https://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 | no next file » | 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 6c3cb7bcc028d817e5b4d4e46d0d717671f765ca..74137bc45cb231e1e1ac8a394f204caf3d352e78 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -397,6 +397,22 @@ void FlowGraphOptimizer::InsertConversion(Representation from,
converted = new UnboxUint32x4Instr(use->CopyWithType(), deopt_id);
} else if ((from == kUnboxedUint32x4) && (to == kTagged)) {
converted = new BoxUint32x4Instr(use->CopyWithType());
+ } else {
+ const intptr_t deopt_id = (deopt_target != NULL) ?
+ deopt_target->DeoptimizationTarget() : Isolate::kNoDeoptId;
+ // We have failed to find a suitable conversion instruction.
+ // Insert a "dummy" conversion instruction with the correct
+ // "to" representation. The inserted instruction will trigger a
+ // a deoptimization if executed. See issue #12417 for a discussion.
+ if (to == kUnboxedDouble) {
+ converted = new UnboxDoubleInstr(use->CopyWithType(), deopt_id);
Florian Schneider 2013/08/15 09:11:35 How about inserting a Box- and an Unbox-instructio
srdjan 2013/08/15 14:34:39 What John has observed is that this code is actual
Cutch 2013/08/15 14:35:02 We are being asked to convert an UnboxedFloat32x4
Florian Schneider 2013/08/16 10:31:18 Still, I don't understand how this should work: Ev
Cutch 2013/08/16 15:57:05 So what ends up happening is that unboxed -> tagge
+ } else if (to == kUnboxedUint32x4) {
+ converted = new UnboxDoubleInstr(use->CopyWithType(), deopt_id);
Florian Schneider 2013/08/16 10:31:18 Ok, but shouldn't this be UnboxUint32x4Instr here?
Cutch 2013/08/16 15:57:05 Yes.
+ } else if (to == kUnboxedFloat32x4) {
+ converted = new UnboxDoubleInstr(use->CopyWithType(), deopt_id);
Florian Schneider 2013/08/16 10:31:18 Likewise, UnboxFloat32x4Instr here?
+ } else if (to == kUnboxedMint) {
+ converted = new UnboxIntegerInstr(use->CopyWithType(), deopt_id);
+ }
}
ASSERT(converted != NULL);
use->BindTo(converted);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698