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

Unified Diff: runtime/vm/flow_graph_compiler_dbc.cc

Issue 2150933008: DBC: UnboxedConstantInstr (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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/tests/vm/vm.status ('k') | runtime/vm/intermediate_language_dbc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_dbc.cc
diff --git a/runtime/vm/flow_graph_compiler_dbc.cc b/runtime/vm/flow_graph_compiler_dbc.cc
index fd52925bca5ecd9de3916a3e45fb03aee6a86c1c..fc1534ddb11a8a0cd426f80e2385e90de3b4f7a5 100644
--- a/runtime/vm/flow_graph_compiler_dbc.cc
+++ b/runtime/vm/flow_graph_compiler_dbc.cc
@@ -427,7 +427,18 @@ void ParallelMoveResolver::EmitMove(int index) {
} else if (source.IsRegister() && destination.IsRegister()) {
__ Move(destination.reg(), source.reg());
} else if (source.IsConstant() && destination.IsRegister()) {
- __ LoadConstant(destination.reg(), source.constant());
+ if (source.constant_instruction()->representation() == kUnboxedDouble) {
+ const Register result = destination.reg();
+ const Object& constant = source.constant();
+ if (Utils::DoublesBitEqual(Double::Cast(constant).value(), 0.0)) {
+ __ BitXor(result, result, result);
+ } else {
+ __ LoadConstant(result, constant);
+ __ UnboxDouble(result, result);
+ }
+ } else {
+ __ LoadConstant(destination.reg(), source.constant());
+ }
} else {
compiler_->Bailout("Unsupported move");
UNREACHABLE();
« no previous file with comments | « runtime/tests/vm/vm.status ('k') | runtime/vm/intermediate_language_dbc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698