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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 27307005: Change == into an instance call to allow polymorphic inlining of ==. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: rebased, addressed comments 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.h ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
===================================================================
--- runtime/vm/intermediate_language.cc (revision 29797)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -24,16 +24,12 @@
namespace dart {
-DEFINE_FLAG(int, max_equality_polymorphic_checks, 32,
- "Maximum number of polymorphic checks in equality operator,"
- " otherwise use megamorphic dispatch.");
DEFINE_FLAG(bool, new_identity_spec, true,
"Use new identity check rules for numbers.");
DEFINE_FLAG(bool, propagate_ic_data, true,
"Propagate IC data from unoptimized to optimized IC calls.");
DECLARE_FLAG(bool, enable_type_checks);
DECLARE_FLAG(bool, eliminate_type_checks);
-DECLARE_FLAG(int, max_polymorphic_checks);
DECLARE_FLAG(bool, trace_optimization);
DECLARE_FLAG(bool, trace_constant_propagation);
DECLARE_FLAG(bool, throw_on_javascript_int_overflow);
@@ -170,6 +166,7 @@
(result_cid() == other_op->result_cid());
}
+
bool BinarySmiOpInstr::AttributesEqual(Instruction* other) const {
BinarySmiOpInstr* other_op = other->AsBinarySmiOp();
ASSERT(other_op != NULL);
@@ -1119,21 +1116,6 @@
}
-bool EqualityCompareInstr::IsPolymorphic() const {
- return HasICData() &&
- (ic_data()->NumberOfChecks() > 0) &&
- (ic_data()->NumberOfChecks() <= FLAG_max_polymorphic_checks);
-}
-
-
-bool EqualityCompareInstr::IsCheckedStrictEqual() const {
- if (!HasICData()) return false;
- return ic_data()->AllTargetsHaveSameOwner(kInstanceCid) &&
- (unary_ic_data_->NumberOfChecks() <=
- FLAG_max_equality_polymorphic_checks);
-}
-
-
bool BinarySmiOpInstr::CanDeoptimize() const {
if (FLAG_throw_on_javascript_int_overflow && (Smi::kBits > 32)) {
// If Smi's are bigger than 32-bits, then the instruction could deoptimize
@@ -1542,9 +1524,9 @@
Definition* BooleanNegateInstr::Canonicalize(FlowGraph* flow_graph) {
Definition* defn = value()->definition();
- if (defn->IsComparison() &&
- (value()->Type()->ToCid() == kBoolCid) &&
- defn->HasOnlyUse(value())) {
+ if (defn->IsComparison() && defn->HasOnlyUse(value())) {
+ // Comparisons always have a bool result.
+ ASSERT(value()->Type()->ToCid() == kBoolCid);
defn->AsComparison()->NegateComparison();
return defn;
}
@@ -1613,7 +1595,7 @@
(other->Type()->ToCid() == kBoolCid)) {
return other_defn;
}
- // Handle e !== true
+ // Handle e !== true.
if ((kind == Token::kNE_STRICT) &&
(constant.raw() == Bool::True().raw()) &&
other_defn->IsComparison() &&
@@ -1622,6 +1604,7 @@
*negated = true;
return other_defn;
}
+ // Handle e === false.
if ((kind == Token::kEQ_STRICT) &&
(constant.raw() == Bool::False().raw()) &&
other_defn->IsComparison() &&
@@ -1666,6 +1649,9 @@
}
RemoveEnvironment();
flow_graph->CopyDeoptTarget(this, comp);
+ // Unlink environment from the comparison since it is copied to the
+ // branch instruction.
+ comp->RemoveEnvironment();
comp->RemoveFromGraph();
SetComparison(comp);
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698