Index: runtime/vm/intermediate_language.h |
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h |
index f424c9931d43c4a0e928b2c6fd1818978dd69ad2..731fecafea9e5ff468c11fafe74c19b467a1ec55 100644 |
--- a/runtime/vm/intermediate_language.h |
+++ b/runtime/vm/intermediate_language.h |
@@ -479,6 +479,7 @@ class EmbeddedArray<T, 0> { |
M(AllocateUninitializedContext) \ |
M(CloneContext) \ |
M(BinarySmiOp) \ |
+ M(CheckedSmiOp) \ |
M(BinaryInt32Op) \ |
M(UnarySmiOp) \ |
M(UnaryDoubleOp) \ |
@@ -2067,7 +2068,6 @@ class PushArgumentInstr : public TemplateDefinition<1, NoThrow> { |
virtual EffectSet Effects() const { return EffectSet::None(); } |
- |
virtual TokenPosition token_pos() const { |
return TokenPosition::kPushArgument; |
} |
@@ -6868,6 +6868,39 @@ class UnaryMintOpInstr : public UnaryIntegerOpInstr { |
}; |
+class CheckedSmiOpInstr : public TemplateDefinition<2, Throws> { |
+ public: |
+ CheckedSmiOpInstr(Token::Kind op_kind, |
+ Value* left, |
+ Value* right, |
+ InstanceCallInstr* call) |
+ : TemplateDefinition(call->deopt_id()), |
+ call_(call), |
+ op_kind_(op_kind) { |
+ SetInputAt(0, left); |
+ SetInputAt(1, right); |
+ } |
+ |
+ InstanceCallInstr* call() const { return call_; } |
+ Token::Kind op_kind() const { return op_kind_; } |
+ Value* left() const { return inputs_[0]; } |
+ Value* right() const { return inputs_[1]; } |
+ |
+ virtual bool CanDeoptimize() const { return true; } |
+ |
+ virtual EffectSet Effects() const { return EffectSet::All(); } |
+ |
+ PRINT_OPERANDS_TO_SUPPORT |
+ |
+ DECLARE_INSTRUCTION(CheckedSmiOp) |
+ |
+ private: |
+ InstanceCallInstr* call_; |
+ const Token::Kind op_kind_; |
+ DISALLOW_COPY_AND_ASSIGN(CheckedSmiOpInstr); |
+}; |
+ |
+ |
class BinaryIntegerOpInstr : public TemplateDefinition<2, NoThrow, Pure> { |
public: |
BinaryIntegerOpInstr(Token::Kind op_kind, |