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

Side by Side Diff: runtime/vm/intermediate_language_arm.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_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 269
270 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 270 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
271 // The register allocator drops constant definitions that have no uses. 271 // The register allocator drops constant definitions that have no uses.
272 if (!locs()->out(0).IsInvalid()) { 272 if (!locs()->out(0).IsInvalid()) {
273 Register result = locs()->out(0).reg(); 273 Register result = locs()->out(0).reg();
274 __ LoadObject(result, value()); 274 __ LoadObject(result, value());
275 } 275 }
276 } 276 }
277 277
278 278
279 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(bool opt) const {
280 const intptr_t kNumInputs = 0;
281 const intptr_t kNumTemps = 1;
282 LocationSummary* locs =
283 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
284 locs->set_out(0, Location::RequiresFpuRegister());
285 locs->set_temp(0, Location::RequiresRegister());
286 return locs;
287 }
288
289
290 void UnboxedConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
291 // The register allocator drops constant definitions that have no uses.
292 if (!locs()->out(0).IsInvalid()) {
293 DRegister dst = EvenDRegisterOf(locs()->out(0).fpu_reg());
294 Register temp = locs()->temp(0).reg();
295 __ LoadDImmediate(dst, Double::Cast(value()).value(), temp);
296 }
297 }
298
299
279 LocationSummary* AssertAssignableInstr::MakeLocationSummary(bool opt) const { 300 LocationSummary* AssertAssignableInstr::MakeLocationSummary(bool opt) const {
280 const intptr_t kNumInputs = 3; 301 const intptr_t kNumInputs = 3;
281 const intptr_t kNumTemps = 0; 302 const intptr_t kNumTemps = 0;
282 LocationSummary* summary = 303 LocationSummary* summary =
283 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 304 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
284 summary->set_in(0, Location::RegisterLocation(R0)); // Value. 305 summary->set_in(0, Location::RegisterLocation(R0)); // Value.
285 summary->set_in(1, Location::RegisterLocation(R2)); // Instantiator. 306 summary->set_in(1, Location::RegisterLocation(R2)); // Instantiator.
286 summary->set_in(2, Location::RegisterLocation(R1)); // Type arguments. 307 summary->set_in(2, Location::RegisterLocation(R1)); // Type arguments.
287 summary->set_out(0, Location::RegisterLocation(R0)); 308 summary->set_out(0, Location::RegisterLocation(R0));
288 return summary; 309 return summary;
(...skipping 5756 matching lines...) Expand 10 before | Expand all | Expand 10 after
6045 compiler->GenerateCall(token_pos(), 6066 compiler->GenerateCall(token_pos(),
6046 &label, 6067 &label,
6047 PcDescriptors::kOther, 6068 PcDescriptors::kOther,
6048 locs()); 6069 locs());
6049 __ Drop(ArgumentCount()); // Discard arguments. 6070 __ Drop(ArgumentCount()); // Discard arguments.
6050 } 6071 }
6051 6072
6052 } // namespace dart 6073 } // namespace dart
6053 6074
6054 #endif // defined TARGET_ARCH_ARM 6075 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698