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

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

Issue 10698153: Change comparison-to-branch fusion to actually remove comparison from the graph. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 "lib/error.h" 10 #include "lib/error.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 kConditionTypeErrorRuntimeEntry); 198 kConditionTypeErrorRuntimeEntry);
199 // We should never return here. 199 // We should never return here.
200 __ int3(); 200 __ int3();
201 201
202 __ Bind(&done); 202 __ Bind(&done);
203 ASSERT(obj == result); 203 ASSERT(obj == result);
204 } 204 }
205 205
206 206
207 LocationSummary* EqualityCompareComp::MakeLocationSummary() const { 207 LocationSummary* EqualityCompareComp::MakeLocationSummary() const {
208 const LocationSummary::ContainsBranch contains_branch =
209 is_fused_with_branch() ? LocationSummary::kBranch
210 : LocationSummary::kNoBranch;
211
212 const intptr_t kNumInputs = 2; 208 const intptr_t kNumInputs = 2;
213 if (HasICData() && 209 if (HasICData() &&
214 (ic_data()->NumberOfChecks() == 1) && 210 (ic_data()->NumberOfChecks() == 1) &&
215 (ic_data()->GetReceiverClassIdAt(0) == kSmi)) { 211 (ic_data()->GetReceiverClassIdAt(0) == kSmi)) {
216 const intptr_t kNumTemps = 1; 212 const intptr_t kNumTemps = 1;
217 LocationSummary* locs = new LocationSummary(kNumInputs, 213 LocationSummary* locs = new LocationSummary(kNumInputs,
218 kNumTemps, 214 kNumTemps,
219 LocationSummary::kNoCall, 215 LocationSummary::kNoCall);
220 contains_branch);
221 locs->set_in(0, Location::RequiresRegister()); 216 locs->set_in(0, Location::RequiresRegister());
222 locs->set_in(1, Location::RequiresRegister()); 217 locs->set_in(1, Location::RequiresRegister());
223 locs->set_temp(0, Location::RequiresRegister()); 218 locs->set_temp(0, Location::RequiresRegister());
224 if (!is_fused_with_branch()) { 219 if (!is_fused_with_branch()) {
225 locs->set_out(Location::RequiresRegister()); 220 locs->set_out(Location::RequiresRegister());
226 } 221 }
227 return locs; 222 return locs;
228 } 223 }
229 if (HasICData() && (ic_data()->NumberOfChecks() > 0)) { 224 if (HasICData() && (ic_data()->NumberOfChecks() > 0)) {
230 const intptr_t kNumTemps = 1; 225 const intptr_t kNumTemps = 1;
231 LocationSummary* locs = new LocationSummary(kNumInputs, 226 LocationSummary* locs = new LocationSummary(kNumInputs,
232 kNumTemps, 227 kNumTemps,
233 LocationSummary::kCall, 228 LocationSummary::kCall);
234 contains_branch);
235 locs->set_in(0, Location::RequiresRegister()); 229 locs->set_in(0, Location::RequiresRegister());
236 locs->set_in(1, Location::RequiresRegister()); 230 locs->set_in(1, Location::RequiresRegister());
237 locs->set_temp(0, Location::RequiresRegister()); 231 locs->set_temp(0, Location::RequiresRegister());
238 if (!is_fused_with_branch()) { 232 if (!is_fused_with_branch()) {
239 locs->set_out(Location::RegisterLocation(RAX)); 233 locs->set_out(Location::RegisterLocation(RAX));
240 } 234 }
241 return locs; 235 return locs;
242 } 236 }
243 const intptr_t kNumTemps = 0; 237 const intptr_t kNumTemps = 0;
244 LocationSummary* locs = new LocationSummary(kNumInputs, 238 LocationSummary* locs = new LocationSummary(kNumInputs,
245 kNumTemps, 239 kNumTemps,
246 LocationSummary::kCall, 240 LocationSummary::kCall);
247 contains_branch);
248 locs->set_in(0, Location::RequiresRegister()); 241 locs->set_in(0, Location::RequiresRegister());
249 locs->set_in(1, Location::RequiresRegister()); 242 locs->set_in(1, Location::RequiresRegister());
250 if (!is_fused_with_branch()) { 243 if (!is_fused_with_branch()) {
251 locs->set_out(Location::RegisterLocation(RAX)); 244 locs->set_out(Location::RegisterLocation(RAX));
252 } 245 }
253 return locs; 246 return locs;
254 } 247 }
255 248
256 249
257 static void EmitSmiEqualityCompare(FlowGraphCompiler* compiler, 250 static void EmitSmiEqualityCompare(FlowGraphCompiler* compiler,
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 (ic_data()->NumberOfChecks() == 1) && 425 (ic_data()->NumberOfChecks() == 1) &&
433 (ic_data()->GetReceiverClassIdAt(0) == kSmi)) { 426 (ic_data()->GetReceiverClassIdAt(0) == kSmi)) {
434 EmitSmiEqualityCompare(compiler, this); 427 EmitSmiEqualityCompare(compiler, this);
435 return; 428 return;
436 } 429 }
437 EmitGenericEqualityCompare(compiler, this); 430 EmitGenericEqualityCompare(compiler, this);
438 } 431 }
439 432
440 433
441 LocationSummary* RelationalOpComp::MakeLocationSummary() const { 434 LocationSummary* RelationalOpComp::MakeLocationSummary() const {
442 const LocationSummary::ContainsBranch contains_branch =
443 is_fused_with_branch() ? LocationSummary::kBranch
444 : LocationSummary::kNoBranch;
445
446 if (operands_class_id() == kSmi || operands_class_id() == kDouble) { 435 if (operands_class_id() == kSmi || operands_class_id() == kDouble) {
447 const intptr_t kNumInputs = 2; 436 const intptr_t kNumInputs = 2;
448 const intptr_t kNumTemps = 1; 437 const intptr_t kNumTemps = 1;
449 LocationSummary* summary = new LocationSummary(kNumInputs, 438 LocationSummary* summary = new LocationSummary(kNumInputs,
450 kNumTemps, 439 kNumTemps,
451 LocationSummary::kCall, 440 LocationSummary::kCall);
452 contains_branch);
453 summary->set_in(0, Location::RequiresRegister()); 441 summary->set_in(0, Location::RequiresRegister());
454 summary->set_in(1, Location::RequiresRegister()); 442 summary->set_in(1, Location::RequiresRegister());
455 if (!is_fused_with_branch()) { 443 if (!is_fused_with_branch()) {
456 summary->set_out(Location::RequiresRegister()); 444 summary->set_out(Location::RequiresRegister());
457 } 445 }
458 summary->set_temp(0, Location::RequiresRegister()); 446 summary->set_temp(0, Location::RequiresRegister());
459 return summary; 447 return summary;
460 } 448 }
461 ASSERT(!is_fused_with_branch()); 449 ASSERT(!is_fused_with_branch());
462 ASSERT(operands_class_id() == kObject); 450 ASSERT(operands_class_id() == kObject);
(...skipping 1516 matching lines...) Expand 10 before | Expand all | Expand 10 after
1979 instance_call()->argument_names()); 1967 instance_call()->argument_names());
1980 } 1968 }
1981 __ Bind(&done); 1969 __ Bind(&done);
1982 } 1970 }
1983 1971
1984 } // namespace dart 1972 } // namespace dart
1985 1973
1986 #undef __ 1974 #undef __
1987 1975
1988 #endif // defined TARGET_ARCH_X64 1976 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698