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

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: 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
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..487d96194f51929571d9947e52acd8fc50429e86 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -238,14 +238,16 @@ 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()) {
+ if (locs()->out(0).IsRegister()) {
Register result = locs()->out(0).reg();
__ LoadObject(result, value());
}

Powered by Google App Engine
This is Rietveld 408576698