Index: runtime/vm/intermediate_language.h |
=================================================================== |
--- runtime/vm/intermediate_language.h (revision 29797) |
+++ runtime/vm/intermediate_language.h (working copy) |
@@ -39,6 +39,7 @@ |
// See intrinsifier for fingerprint computation. |
#define RECOGNIZED_LIST(V) \ |
V(::, identical, ObjectIdentical, 496869842) \ |
+ V(Object, ==, ObjectEquals, 180968008) \ |
V(Object, Object., ObjectConstructor, 1058585294) \ |
V(Object, get:_cid, ObjectCid, 1498721510) \ |
V(_List, get:length, ObjectArrayLength, 215153395) \ |
@@ -1015,6 +1016,7 @@ |
friend class BranchSimplifier; |
friend class BlockEntryInstr; |
friend class RelationalOpInstr; |
+ friend class EqualityCompareInstr; |
virtual void RawSetInputAt(intptr_t i, Value* value) = 0; |
@@ -2733,6 +2735,7 @@ |
ASSERT(!arguments->is_empty()); |
ASSERT(argument_names.IsZoneHandle() || argument_names.InVMHeap()); |
ASSERT(Token::IsBinaryOperator(token_kind) || |
+ Token::IsEqualityOperator(token_kind) || |
Token::IsRelationalOperator(token_kind) || |
Token::IsPrefixOperator(token_kind) || |
Token::IsIndexOperator(token_kind) || |
@@ -2988,43 +2991,25 @@ |
Token::Kind kind, |
Value* left, |
Value* right, |
- const Array& ic_data_array) |
- : ComparisonInstr(token_pos, kind, left, right), |
- ic_data_(GetICData(ic_data_array)), |
- unary_ic_data_(NULL) { |
- ASSERT((kind == Token::kEQ) || (kind == Token::kNE)); |
- if (HasICData()) { |
- unary_ic_data_ = &ICData::ZoneHandle(ic_data_->AsUnaryClassChecks()); |
- } |
+ intptr_t cid, |
+ intptr_t deopt_id) |
+ : ComparisonInstr(token_pos, kind, left, right) { |
+ ASSERT(Token::IsEqualityOperator(kind)); |
+ set_operation_cid(cid); |
+ deopt_id_ = deopt_id; // Override generated deopt-id. |
} |
DECLARE_INSTRUCTION(EqualityCompare) |
virtual CompileType ComputeType() const; |
virtual bool RecomputeType(); |
- const ICData* ic_data() const { return ic_data_; } |
- bool HasICData() const { |
- return (ic_data() != NULL) && !ic_data()->IsNull(); |
- } |
- void set_ic_data(const ICData* value) { |
- ic_data_ = value; |
- if (HasICData()) { |
- unary_ic_data_ = &ICData::ZoneHandle(ic_data_->AsUnaryClassChecks()); |
- } |
- } |
- |
- bool IsInlinedNumericComparison() const { |
- return (operation_cid() == kDoubleCid) |
- || (operation_cid() == kMintCid) |
- || (operation_cid() == kSmiCid); |
- } |
- |
- bool IsCheckedStrictEqual() const; |
- |
virtual void PrintOperandsTo(BufferFormatter* f) const; |
- virtual bool CanDeoptimize() const { |
- return !IsInlinedNumericComparison(); |
+ virtual bool CanDeoptimize() const { return false; } |
+ |
+ virtual bool CanBecomeDeoptimizationTarget() const { |
+ // EqualityCompare can be merged into Branch and thus needs an environment. |
+ return true; |
} |
virtual void EmitBranchCode(FlowGraphCompiler* compiler, |
@@ -3041,20 +3026,11 @@ |
return kTagged; |
} |
- bool IsPolymorphic() const; |
+ virtual EffectSet Effects() const { return EffectSet::None(); } |
- virtual EffectSet Effects() const { |
- return IsInlinedNumericComparison() ? EffectSet::None() : EffectSet::All(); |
- } |
+ virtual bool MayThrow() const { return false; } |
- virtual bool MayThrow() const { |
- return !IsInlinedNumericComparison() && !IsCheckedStrictEqual(); |
- } |
- |
private: |
- const ICData* ic_data_; |
- ICData* unary_ic_data_; |
- |
DISALLOW_COPY_AND_ASSIGN(EqualityCompareInstr); |
}; |
@@ -3781,7 +3757,7 @@ |
}; |
-// Note overrideable, built-in: value? false : true. |
+// Note overrideable, built-in: value ? false : true. |
class BooleanNegateInstr : public TemplateDefinition<1> { |
public: |
explicit BooleanNegateInstr(Value* value) { |