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

Unified Diff: runtime/vm/intermediate_language_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/vm/flow_graph_compiler_dbc.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_dbc.cc
diff --git a/runtime/vm/intermediate_language_dbc.cc b/runtime/vm/intermediate_language_dbc.cc
index 91b96a7770dcea3e255de54124dee999907f86fb..ca81c461c83942f63806285fee1fff73cbc81dc3 100644
--- a/runtime/vm/intermediate_language_dbc.cc
+++ b/runtime/vm/intermediate_language_dbc.cc
@@ -40,7 +40,6 @@ DECLARE_FLAG(int, optimization_counter_threshold);
M(DoubleToDouble) \
M(DoubleToFloat) \
M(FloatToDouble) \
- M(UnboxedConstant) \
M(MathUnary) \
M(MathMinMax) \
M(BoxInt64) \
@@ -308,6 +307,25 @@ EMIT_NATIVE_CODE(Constant, 0, Location::RequiresRegister()) {
}
+EMIT_NATIVE_CODE(UnboxedConstant, 0, Location::RequiresRegister()) {
+ // The register allocator drops constant definitions that have no uses.
+ if (locs()->out(0).IsInvalid()) {
+ return;
+ }
+ if (representation_ != kUnboxedDouble) {
+ Unsupported(compiler);
+ UNREACHABLE();
+ }
+ const Register result = locs()->out(0).reg();
+ if (Utils::DoublesBitEqual(Double::Cast(value()).value(), 0.0)) {
+ __ BitXor(result, result, result);
+ } else {
+ __ LoadConstant(result, value());
+ __ UnboxDouble(result, result);
+ }
+}
+
+
EMIT_NATIVE_CODE(Return, 1) {
if (compiler->is_optimizing()) {
__ Return(locs()->in(0).reg());
« no previous file with comments | « runtime/vm/flow_graph_compiler_dbc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698