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

Side by Side Diff: runtime/vm/intermediate_language_mips.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_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 292 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
293 // The register allocator drops constant definitions that have no uses. 293 // The register allocator drops constant definitions that have no uses.
294 if (!locs()->out(0).IsInvalid()) { 294 if (!locs()->out(0).IsInvalid()) {
295 __ TraceSimMsg("ConstantInstr"); 295 __ TraceSimMsg("ConstantInstr");
296 Register result = locs()->out(0).reg(); 296 Register result = locs()->out(0).reg();
297 __ LoadObject(result, value()); 297 __ LoadObject(result, value());
298 } 298 }
299 } 299 }
300 300
301 301
302 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(bool opt) const {
303 const intptr_t kNumInputs = 0;
304 const intptr_t kNumTemps = 1;
305 LocationSummary* locs =
306 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
307 locs->set_out(0, Location::RequiresFpuRegister());
308 locs->set_temp(0, Location::RequiresRegister());
309 return locs;
310 }
311
312
313 void UnboxedConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
314 // The register allocator drops constant definitions that have no uses.
315 if (!locs()->out(0).IsInvalid()) {
316 ASSERT(value().IsDouble());
317 const Register const_value = locs()->temp(0).reg();
318 const DRegister result = locs()->out(0).fpu_reg();
319 __ LoadObject(const_value, value());
320 __ LoadDFromOffset(result, const_value,
321 Double::value_offset() - kHeapObjectTag);
322 }
323 }
324
325
302 LocationSummary* AssertAssignableInstr::MakeLocationSummary(bool opt) const { 326 LocationSummary* AssertAssignableInstr::MakeLocationSummary(bool opt) const {
303 const intptr_t kNumInputs = 3; 327 const intptr_t kNumInputs = 3;
304 const intptr_t kNumTemps = 0; 328 const intptr_t kNumTemps = 0;
305 LocationSummary* summary = 329 LocationSummary* summary =
306 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 330 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
307 summary->set_in(0, Location::RegisterLocation(A0)); // Value. 331 summary->set_in(0, Location::RegisterLocation(A0)); // Value.
308 summary->set_in(1, Location::RegisterLocation(A2)); // Instantiator. 332 summary->set_in(1, Location::RegisterLocation(A2)); // Instantiator.
309 summary->set_in(2, Location::RegisterLocation(A1)); // Type arguments. 333 summary->set_in(2, Location::RegisterLocation(A1)); // Type arguments.
310 summary->set_out(0, Location::RegisterLocation(A0)); 334 summary->set_out(0, Location::RegisterLocation(A0));
311 return summary; 335 return summary;
(...skipping 4151 matching lines...) Expand 10 before | Expand all | Expand 10 after
4463 compiler->GenerateCall(token_pos(), 4487 compiler->GenerateCall(token_pos(),
4464 &label, 4488 &label,
4465 PcDescriptors::kOther, 4489 PcDescriptors::kOther,
4466 locs()); 4490 locs());
4467 __ Drop(ArgumentCount()); // Discard arguments. 4491 __ Drop(ArgumentCount()); // Discard arguments.
4468 } 4492 }
4469 4493
4470 } // namespace dart 4494 } // namespace dart
4471 4495
4472 #endif // defined TARGET_ARCH_MIPS 4496 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698