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

Side by Side Diff: runtime/vm/intermediate_language_ia32.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_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 kConditionTypeErrorRuntimeEntry); 190 kConditionTypeErrorRuntimeEntry);
191 // We should never return here. 191 // We should never return here.
192 __ int3(); 192 __ int3();
193 193
194 __ Bind(&done); 194 __ Bind(&done);
195 ASSERT(obj == result); 195 ASSERT(obj == result);
196 } 196 }
197 197
198 198
199 LocationSummary* EqualityCompareComp::MakeLocationSummary() const { 199 LocationSummary* EqualityCompareComp::MakeLocationSummary() const {
200 const LocationSummary::ContainsBranch contains_branch =
201 is_fused_with_branch() ? LocationSummary::kBranch
202 : LocationSummary::kNoBranch;
203
204 const intptr_t kNumInputs = 2; 200 const intptr_t kNumInputs = 2;
205 if (HasICData() && 201 if (HasICData() &&
206 (ic_data()->NumberOfChecks() == 1) && 202 (ic_data()->NumberOfChecks() == 1) &&
207 (ic_data()->GetReceiverClassIdAt(0) == kSmi)) { 203 (ic_data()->GetReceiverClassIdAt(0) == kSmi)) {
208 const intptr_t kNumTemps = 1; 204 const intptr_t kNumTemps = 1;
209 LocationSummary* locs = new LocationSummary(kNumInputs, 205 LocationSummary* locs = new LocationSummary(kNumInputs,
210 kNumTemps, 206 kNumTemps,
211 LocationSummary::kNoCall, 207 LocationSummary::kNoCall);
212 contains_branch);
213 locs->set_in(0, Location::RequiresRegister()); 208 locs->set_in(0, Location::RequiresRegister());
214 locs->set_in(1, Location::RequiresRegister()); 209 locs->set_in(1, Location::RequiresRegister());
215 locs->set_temp(0, Location::RequiresRegister()); 210 locs->set_temp(0, Location::RequiresRegister());
216 if (!is_fused_with_branch()) { 211 if (!is_fused_with_branch()) {
217 locs->set_out(Location::RequiresRegister()); 212 locs->set_out(Location::RequiresRegister());
218 } 213 }
219 return locs; 214 return locs;
220 } 215 }
221 if (HasICData() && (ic_data()->NumberOfChecks() > 0)) { 216 if (HasICData() && (ic_data()->NumberOfChecks() > 0)) {
222 const intptr_t kNumTemps = 1; 217 const intptr_t kNumTemps = 1;
223 LocationSummary* locs = new LocationSummary(kNumInputs, 218 LocationSummary* locs = new LocationSummary(kNumInputs,
224 kNumTemps, 219 kNumTemps,
225 LocationSummary::kCall, 220 LocationSummary::kCall);
226 contains_branch);
227 locs->set_in(0, Location::RequiresRegister()); 221 locs->set_in(0, Location::RequiresRegister());
228 locs->set_in(1, Location::RequiresRegister()); 222 locs->set_in(1, Location::RequiresRegister());
229 locs->set_temp(0, Location::RequiresRegister()); 223 locs->set_temp(0, Location::RequiresRegister());
230 if (!is_fused_with_branch()) { 224 if (!is_fused_with_branch()) {
231 locs->set_out(Location::RegisterLocation(EAX)); 225 locs->set_out(Location::RegisterLocation(EAX));
232 } 226 }
233 return locs; 227 return locs;
234 } 228 }
235 const intptr_t kNumTemps = 0; 229 const intptr_t kNumTemps = 0;
236 LocationSummary* locs = new LocationSummary(kNumInputs, 230 LocationSummary* locs = new LocationSummary(kNumInputs,
237 kNumTemps, 231 kNumTemps,
238 LocationSummary::kCall, 232 LocationSummary::kCall);
239 contains_branch);
240 locs->set_in(0, Location::RequiresRegister()); 233 locs->set_in(0, Location::RequiresRegister());
241 locs->set_in(1, Location::RequiresRegister()); 234 locs->set_in(1, Location::RequiresRegister());
242 if (!is_fused_with_branch()) { 235 if (!is_fused_with_branch()) {
243 locs->set_out(Location::RegisterLocation(EAX)); 236 locs->set_out(Location::RegisterLocation(EAX));
244 } 237 }
245 return locs; 238 return locs;
246 } 239 }
247 240
248 241
249 static void EmitSmiEqualityCompare(FlowGraphCompiler* compiler, 242 static void EmitSmiEqualityCompare(FlowGraphCompiler* compiler,
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 (ic_data()->NumberOfChecks() == 1) && 417 (ic_data()->NumberOfChecks() == 1) &&
425 (ic_data()->GetReceiverClassIdAt(0) == kSmi)) { 418 (ic_data()->GetReceiverClassIdAt(0) == kSmi)) {
426 EmitSmiEqualityCompare(compiler, this); 419 EmitSmiEqualityCompare(compiler, this);
427 return; 420 return;
428 } 421 }
429 EmitGenericEqualityCompare(compiler, this); 422 EmitGenericEqualityCompare(compiler, this);
430 } 423 }
431 424
432 425
433 LocationSummary* RelationalOpComp::MakeLocationSummary() const { 426 LocationSummary* RelationalOpComp::MakeLocationSummary() const {
434 const LocationSummary::ContainsBranch contains_branch =
435 is_fused_with_branch() ? LocationSummary::kBranch
436 : LocationSummary::kNoBranch;
437
438 if ((operands_class_id() == kSmi) || (operands_class_id() == kDouble)) { 427 if ((operands_class_id() == kSmi) || (operands_class_id() == kDouble)) {
439 const intptr_t kNumInputs = 2; 428 const intptr_t kNumInputs = 2;
440 const intptr_t kNumTemps = 1; 429 const intptr_t kNumTemps = 1;
441 LocationSummary* summary = new LocationSummary(kNumInputs, 430 LocationSummary* summary = new LocationSummary(kNumInputs,
442 kNumTemps, 431 kNumTemps,
443 LocationSummary::kNoCall, 432 LocationSummary::kNoCall);
444 contains_branch);
445 summary->set_in(0, Location::RequiresRegister()); 433 summary->set_in(0, Location::RequiresRegister());
446 summary->set_in(1, Location::RequiresRegister()); 434 summary->set_in(1, Location::RequiresRegister());
447 if (!is_fused_with_branch()) { 435 if (!is_fused_with_branch()) {
448 summary->set_out(Location::RequiresRegister()); 436 summary->set_out(Location::RequiresRegister());
449 } 437 }
450 summary->set_temp(0, Location::RequiresRegister()); 438 summary->set_temp(0, Location::RequiresRegister());
451 return summary; 439 return summary;
452 } 440 }
453 ASSERT(!is_fused_with_branch()); 441 ASSERT(!is_fused_with_branch());
454 ASSERT(operands_class_id() == kObject); 442 ASSERT(operands_class_id() == kObject);
(...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after
1974 instance_call()->argument_names()); 1962 instance_call()->argument_names());
1975 } 1963 }
1976 __ Bind(&done); 1964 __ Bind(&done);
1977 } 1965 }
1978 1966
1979 } // namespace dart 1967 } // namespace dart
1980 1968
1981 #undef __ 1969 #undef __
1982 1970
1983 #endif // defined TARGET_ARCH_X64 1971 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698