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

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 60883003: Cleanup of code generation for StrictCompare. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_ia32.cc
===================================================================
--- runtime/vm/intermediate_language_ia32.cc (revision 30058)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -326,18 +326,6 @@
}
-static void EmitBranchOnValue(FlowGraphCompiler* compiler,
- TargetEntryInstr* true_successor,
- TargetEntryInstr* false_successor,
- bool value) {
- if (value && !compiler->CanFallThroughTo(true_successor)) {
- __ jmp(compiler->GetJumpLabel(true_successor));
- } else if (!value && !compiler->CanFallThroughTo(false_successor)) {
- __ jmp(compiler->GetJumpLabel(false_successor));
- }
-}
-
-
static void EmitBranchOnCondition(FlowGraphCompiler* compiler,
TargetEntryInstr* true_successor,
TargetEntryInstr* false_successor,
@@ -632,7 +620,6 @@
BranchInstr* branch) {
ASSERT((kind() == Token::kNE) || (kind() == Token::kEQ));
if (operation_cid() == kSmiCid) {
- // Deoptimizes if both arguments not Smi.
EmitSmiComparisonOp(compiler, *locs(), kind(), branch);
return;
}
@@ -4658,7 +4645,11 @@
LocationSummary* locs =
new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
locs->set_in(0, Location::RegisterOrConstant(left()));
- locs->set_in(1, Location::RegisterOrConstant(right()));
+ // Only one of the inputs can be a constant. Choose register if the first one
+ // is a constant.
+ locs->set_in(1, locs->in(0).IsConstant()
+ ? Location::RequiresRegister()
+ : Location::RegisterOrConstant(right()));
locs->set_out(Location::RequiresRegister());
return locs;
}
@@ -4669,14 +4660,7 @@
ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT);
Location left = locs()->in(0);
Location right = locs()->in(1);
- if (left.IsConstant() && right.IsConstant()) {
- // TODO(vegorov): should be eliminated earlier by constant propagation.
- const bool result = (kind() == Token::kEQ_STRICT) ?
- left.constant().raw() == right.constant().raw() :
- left.constant().raw() != right.constant().raw();
- __ LoadObject(locs()->out().reg(), Bool::Get(result));
- return;
- }
+ ASSERT(!left.IsConstant() || !right.IsConstant());
if (left.IsConstant()) {
compiler->EmitEqualityRegConstCompare(right.reg(),
left.constant(),
@@ -4711,17 +4695,7 @@
ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT);
Location left = locs()->in(0);
Location right = locs()->in(1);
- if (left.IsConstant() && right.IsConstant()) {
- // TODO(vegorov): should be eliminated earlier by constant propagation.
- const bool result = (kind() == Token::kEQ_STRICT) ?
- left.constant().raw() == right.constant().raw() :
- left.constant().raw() != right.constant().raw();
- EmitBranchOnValue(compiler,
- branch->true_successor(),
- branch->false_successor(),
- result);
- return;
- }
+ ASSERT(!left.IsConstant() || !right.IsConstant());
if (left.IsConstant()) {
compiler->EmitEqualityRegConstCompare(right.reg(),
left.constant(),
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698