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

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

Issue 548633003: ARM: for StrictCompare cache constant values in register instead of materializing it each time. Nex… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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 | « no previous file | 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_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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 if (!locs()->out(0).IsInvalid()) { 286 if (!locs()->out(0).IsInvalid()) {
287 const Register result = locs()->out(0).reg(); 287 const Register result = locs()->out(0).reg();
288 __ LoadObject(result, value()); 288 __ LoadObject(result, value());
289 } 289 }
290 } 290 }
291 291
292 292
293 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Isolate* isolate, 293 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Isolate* isolate,
294 bool opt) const { 294 bool opt) const {
295 const intptr_t kNumInputs = 0; 295 const intptr_t kNumInputs = 0;
296 const intptr_t kNumTemps = 1; 296 const intptr_t kNumTemps = (representation_ == kUnboxedInt32) ? 0 : 1;
297 LocationSummary* locs = new(isolate) LocationSummary( 297 LocationSummary* locs = new(isolate) LocationSummary(
298 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 298 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
299 locs->set_out(0, Location::RequiresFpuRegister()); 299 locs->set_out(0, Location::RequiresFpuRegister());
300 locs->set_temp(0, Location::RequiresRegister()); 300 if (representation_ != kUnboxedInt32) {
301 locs->set_temp(0, Location::RequiresRegister());
302 }
301 return locs; 303 return locs;
302 } 304 }
303 305
304 306
305 void UnboxedConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 307 void UnboxedConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
306 // The register allocator drops constant definitions that have no uses. 308 // The register allocator drops constant definitions that have no uses.
307 if (!locs()->out(0).IsInvalid()) { 309 if (!locs()->out(0).IsInvalid()) {
308 switch (representation_) { 310 switch (representation_) {
309 case kUnboxedDouble: 311 case kUnboxedDouble:
310 if (Utils::DoublesBitEqual(Double::Cast(value()).value(), 0.0) && 312 if (Utils::DoublesBitEqual(Double::Cast(value()).value(), 0.0) &&
(...skipping 6797 matching lines...) Expand 10 before | Expand all | Expand 10 after
7108 if (needs_number_check()) { 7110 if (needs_number_check()) {
7109 LocationSummary* locs = new(isolate) LocationSummary( 7111 LocationSummary* locs = new(isolate) LocationSummary(
7110 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); 7112 isolate, kNumInputs, kNumTemps, LocationSummary::kCall);
7111 locs->set_in(0, Location::RegisterLocation(R0)); 7113 locs->set_in(0, Location::RegisterLocation(R0));
7112 locs->set_in(1, Location::RegisterLocation(R1)); 7114 locs->set_in(1, Location::RegisterLocation(R1));
7113 locs->set_out(0, Location::RegisterLocation(R0)); 7115 locs->set_out(0, Location::RegisterLocation(R0));
7114 return locs; 7116 return locs;
7115 } 7117 }
7116 LocationSummary* locs = new(isolate) LocationSummary( 7118 LocationSummary* locs = new(isolate) LocationSummary(
7117 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 7119 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
7118 locs->set_in(0, Location::RegisterOrConstant(left())); 7120
7119 // Only one of the inputs can be a constant. Choose register if the first one 7121 ConstantInstr* constant = left()->definition()->AsConstant();
7120 // is a constant. 7122 if ((constant != NULL) && !left()->IsSingleUse()) {
zra 2014/09/05 20:52:15 Maybe add comment like: "Make sure we use a regist
srdjan 2014/09/05 20:58:29 Done.
7121 locs->set_in(1, locs->in(0).IsConstant() 7123 locs->set_in(0, Location::RequiresRegister());
7122 ? Location::RequiresRegister() 7124 } else {
7123 : Location::RegisterOrConstant(right())); 7125 locs->set_in(0, Location::RegisterOrConstant(left()));
7126 }
7127
7128 constant = right()->definition()->AsConstant();
7129 if ((constant != NULL) && !right()->IsSingleUse()) {
7130 locs->set_in(1, Location::RequiresRegister());
7131 } else {
7132 // Only one of the inputs can be a constant. Choose register if the first
7133 // one is a constant.
7134 locs->set_in(1, locs->in(0).IsConstant()
7135 ? Location::RequiresRegister()
7136 : Location::RegisterOrConstant(right()));
7137 }
7124 locs->set_out(0, Location::RequiresRegister()); 7138 locs->set_out(0, Location::RequiresRegister());
7125 return locs; 7139 return locs;
7126 } 7140 }
7127 7141
7128 7142
7129 Condition StrictCompareInstr::EmitComparisonCode(FlowGraphCompiler* compiler, 7143 Condition StrictCompareInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
7130 BranchLabels labels) { 7144 BranchLabels labels) {
7131 Location left = locs()->in(0); 7145 Location left = locs()->in(0);
7132 Location right = locs()->in(1); 7146 Location right = locs()->in(1);
7133 ASSERT(!left.IsConstant() || !right.IsConstant()); 7147 ASSERT(!left.IsConstant() || !right.IsConstant());
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
7221 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); 7235 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs());
7222 #if defined(DEBUG) 7236 #if defined(DEBUG)
7223 __ LoadImmediate(R4, kInvalidObjectPointer); 7237 __ LoadImmediate(R4, kInvalidObjectPointer);
7224 __ LoadImmediate(R5, kInvalidObjectPointer); 7238 __ LoadImmediate(R5, kInvalidObjectPointer);
7225 #endif 7239 #endif
7226 } 7240 }
7227 7241
7228 } // namespace dart 7242 } // namespace dart
7229 7243
7230 #endif // defined TARGET_ARCH_ARM 7244 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698