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

Unified Diff: runtime/vm/intermediate_language.h

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/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
===================================================================
--- runtime/vm/intermediate_language.h (revision 24590)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -2830,8 +2830,12 @@
const Array& ic_data_array)
: ComparisonInstr(token_pos, kind, left, right),
ic_data_(GetICData(ic_data_array)),
+ unary_ic_data_(NULL),
receiver_class_id_(kIllegalCid) {
ASSERT((kind == Token::kEQ) || (kind == Token::kNE));
+ if (HasICData()) {
+ unary_ic_data_ = &ICData::ZoneHandle(ic_data_->AsUnaryClassChecks());
+ }
}
DECLARE_INSTRUCTION(EqualityCompare)
@@ -2854,9 +2858,7 @@
|| (receiver_class_id() == kSmiCid);
}
- bool is_checked_strict_equal() const {
- return HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid);
- }
+ bool IsCheckedStrictEqual() const;
virtual void PrintOperandsTo(BufferFormatter* f) const;
@@ -2885,11 +2887,12 @@
}
virtual bool MayThrow() const {
- return !IsInlinedNumericComparison() && !is_checked_strict_equal();
+ return !IsInlinedNumericComparison() && !IsCheckedStrictEqual();
}
private:
const ICData* ic_data_;
+ ICData* unary_ic_data_;
intptr_t receiver_class_id_; // Set by optimizer.
DISALLOW_COPY_AND_ASSIGN(EqualityCompareInstr);
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698