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

Side by Side 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, 2 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/locations.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 ASSERT(result == value); // Assert that register assignment is correct. 231 ASSERT(result == value); // Assert that register assignment is correct.
232 __ movq(Address(RBP, local().index() * kWordSize), value); 232 __ movq(Address(RBP, local().index() * kWordSize), value);
233 } 233 }
234 234
235 235
236 LocationSummary* ConstantInstr::MakeLocationSummary(Zone* zone, 236 LocationSummary* ConstantInstr::MakeLocationSummary(Zone* zone,
237 bool opt) const { 237 bool opt) const {
238 const intptr_t kNumInputs = 0; 238 const intptr_t kNumInputs = 0;
239 return LocationSummary::Make(zone, 239 return LocationSummary::Make(zone,
240 kNumInputs, 240 kNumInputs,
241 Location::RequiresRegister(), 241 Assembler::IsSafe(value())
242 ? Location::Constant(this)
243 : Location::RequiresRegister(),
242 LocationSummary::kNoCall); 244 LocationSummary::kNoCall);
243 } 245 }
244 246
245 247
246 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 248 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
247 // The register allocator drops constant definitions that have no uses. 249 // The register allocator drops constant definitions that have no uses.
248 if (!locs()->out(0).IsInvalid()) { 250 Location out = locs()->out(0);
249 Register result = locs()->out(0).reg(); 251 ASSERT(out.IsRegister() || out.IsConstant() || out.IsInvalid());
252 if (out.IsRegister()) {
253 Register result = out.reg();
250 __ LoadObject(result, value()); 254 __ LoadObject(result, value());
251 } 255 }
252 } 256 }
253 257
254 258
255 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Zone* zone, 259 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Zone* zone,
256 bool opt) const { 260 bool opt) const {
257 const intptr_t kNumInputs = 0; 261 const intptr_t kNumInputs = 0;
258 const intptr_t kNumTemps = 0; 262 const intptr_t kNumTemps = 0;
259 LocationSummary* locs = new(zone) LocationSummary( 263 LocationSummary* locs = new(zone) LocationSummary(
(...skipping 6188 matching lines...) Expand 10 before | Expand all | Expand 10 after
6448 __ Drop(1); 6452 __ Drop(1);
6449 __ popq(result); 6453 __ popq(result);
6450 } 6454 }
6451 6455
6452 6456
6453 } // namespace dart 6457 } // namespace dart
6454 6458
6455 #undef __ 6459 #undef __
6456 6460
6457 #endif // defined TARGET_ARCH_X64 6461 #endif // defined TARGET_ARCH_X64
OLDNEW
« 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