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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 18053010: Equality can be converted to a strict equality with checks. If the number of checks exceeds the thr… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 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 24590)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -21,6 +21,9 @@
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,
@@ -1034,6 +1037,14 @@
}
+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) return true;
switch (op_kind()) {
« 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