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

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
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | no next file » | 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 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 __ LoadObject(TMP, value(), PP);
246 __ movsd(result, FieldAddress(TMP, Double::value_offset()));
247 }
248 }
249
250
231 LocationSummary* AssertAssignableInstr::MakeLocationSummary(bool opt) const { 251 LocationSummary* AssertAssignableInstr::MakeLocationSummary(bool opt) const {
232 const intptr_t kNumInputs = 3; 252 const intptr_t kNumInputs = 3;
233 const intptr_t kNumTemps = 0; 253 const intptr_t kNumTemps = 0;
234 LocationSummary* summary = 254 LocationSummary* summary =
235 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 255 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
236 summary->set_in(0, Location::RegisterLocation(RAX)); // Value. 256 summary->set_in(0, Location::RegisterLocation(RAX)); // Value.
237 summary->set_in(1, Location::RegisterLocation(RCX)); // Instantiator. 257 summary->set_in(1, Location::RegisterLocation(RCX)); // Instantiator.
238 summary->set_in(2, Location::RegisterLocation(RDX)); // Type arguments. 258 summary->set_in(2, Location::RegisterLocation(RDX)); // Type arguments.
239 summary->set_out(0, Location::RegisterLocation(RAX)); 259 summary->set_out(0, Location::RegisterLocation(RAX));
240 return summary; 260 return summary;
(...skipping 5328 matching lines...) Expand 10 before | Expand all | Expand 10 after
5569 PcDescriptors::kOther, 5589 PcDescriptors::kOther,
5570 locs()); 5590 locs());
5571 __ Drop(ArgumentCount()); // Discard arguments. 5591 __ Drop(ArgumentCount()); // Discard arguments.
5572 } 5592 }
5573 5593
5574 } // namespace dart 5594 } // namespace dart
5575 5595
5576 #undef __ 5596 #undef __
5577 5597
5578 #endif // defined TARGET_ARCH_X64 5598 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698