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

Unified Diff: runtime/vm/intermediate_language_x64.cc

Issue 1383573002: VM: More compact code for pushing constant arguments on ia32/x64. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 5 years, 3 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/intermediate_language_ia32.cc ('k') | runtime/vm/locations.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_x64.cc
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index b58e4d1b41aacce57bb8ca650a796d9a875a462d..ea5e6857b19fb72419657374546e17e9493cdef0 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -238,15 +238,19 @@ LocationSummary* ConstantInstr::MakeLocationSummary(Zone* zone,
const intptr_t kNumInputs = 0;
return LocationSummary::Make(zone,
kNumInputs,
- Location::RequiresRegister(),
+ Assembler::IsSafe(value())
+ ? Location::Constant(this)
+ : Location::RequiresRegister(),
LocationSummary::kNoCall);
}
void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
// The register allocator drops constant definitions that have no uses.
- if (!locs()->out(0).IsInvalid()) {
- Register result = locs()->out(0).reg();
+ Location out = locs()->out(0);
+ ASSERT(out.IsRegister() || out.IsConstant() || out.IsInvalid());
+ if (out.IsRegister()) {
+ Register result = out.reg();
__ LoadObject(result, value());
}
}
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/locations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698