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

Side by Side Diff: runtime/vm/intermediate_language_x64.cc

Issue 266633007: Merge ConstantInstr -> UnboxDouble to UnboxedConstant. Reduces register usage and allows for variou… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 221
222 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 222 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
223 // The register allocator drops constant definitions that have no uses. 223 // The register allocator drops constant definitions that have no uses.
224 if (!locs()->out(0).IsInvalid()) { 224 if (!locs()->out(0).IsInvalid()) {
225 Register result = locs()->out(0).reg(); 225 Register result = locs()->out(0).reg();
226 __ LoadObject(result, value(), PP); 226 __ LoadObject(result, value(), PP);
227 } 227 }
228 } 228 }
229 229
230 230
231 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(bool opt) const {
232 const intptr_t kNumInputs = 0;
233 const intptr_t kNumTemps = 0;
234 LocationSummary* locs =
235 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
236 locs->set_out(0, Location::RequiresFpuRegister());
237 return locs;
238 }
239
240
241 void UnboxedConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
242 // The register allocator drops constant definitions that have no uses.
243 if (!locs()->out(0).IsInvalid()) {
244 XmmRegister result = locs()->out(0).fpu_reg();
245 __ LoadDoubleConstant(result, Double::Cast(value()).value(), PP);
246 }
247 }
248
249
231 LocationSummary* AssertAssignableInstr::MakeLocationSummary(bool opt) const { 250 LocationSummary* AssertAssignableInstr::MakeLocationSummary(bool opt) const {
232 const intptr_t kNumInputs = 3; 251 const intptr_t kNumInputs = 3;
233 const intptr_t kNumTemps = 0; 252 const intptr_t kNumTemps = 0;
234 LocationSummary* summary = 253 LocationSummary* summary =
235 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 254 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
236 summary->set_in(0, Location::RegisterLocation(RAX)); // Value. 255 summary->set_in(0, Location::RegisterLocation(RAX)); // Value.
237 summary->set_in(1, Location::RegisterLocation(RCX)); // Instantiator. 256 summary->set_in(1, Location::RegisterLocation(RCX)); // Instantiator.
238 summary->set_in(2, Location::RegisterLocation(RDX)); // Type arguments. 257 summary->set_in(2, Location::RegisterLocation(RDX)); // Type arguments.
239 summary->set_out(0, Location::RegisterLocation(RAX)); 258 summary->set_out(0, Location::RegisterLocation(RAX));
240 return summary; 259 return summary;
(...skipping 5328 matching lines...) Expand 10 before | Expand all | Expand 10 after
5569 PcDescriptors::kOther, 5588 PcDescriptors::kOther,
5570 locs()); 5589 locs());
5571 __ Drop(ArgumentCount()); // Discard arguments. 5590 __ Drop(ArgumentCount()); // Discard arguments.
5572 } 5591 }
5573 5592
5574 } // namespace dart 5593 } // namespace dart
5575 5594
5576 #undef __ 5595 #undef __
5577 5596
5578 #endif // defined TARGET_ARCH_X64 5597 #endif // defined TARGET_ARCH_X64
OLDNEW
« runtime/vm/assembler_x64.cc ('K') | « runtime/vm/intermediate_language_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698