Index: runtime/vm/intermediate_language.h |
=================================================================== |
--- runtime/vm/intermediate_language.h (revision 29901) |
+++ runtime/vm/intermediate_language.h (working copy) |
@@ -697,6 +697,7 @@ |
M(Int32x4SetFlag) \ |
M(Int32x4ToFloat32x4) \ |
M(BinaryInt32x4Op) \ |
+ M(TestSmi) |
zra
2013/11/05 18:38:03
It looks like we usually put a trailing \ after th
Florian Schneider
2013/11/06 12:13:42
Done.
|
#define FORWARD_DECLARATION(type) class type##Instr; |
@@ -2985,6 +2986,45 @@ |
}; |
+// Comparison instruction that is equivalent to the (left & right) == 0 |
+// comparison pattern. |
+class TestSmiInstr : public ComparisonInstr { |
+ public: |
+ TestSmiInstr(intptr_t token_pos, Token::Kind kind, Value* left, Value* right) |
+ : ComparisonInstr(token_pos, kind, left, right) { |
+ ASSERT(kind == Token::kEQ || kind == Token::kNE); |
+ } |
+ |
+ DECLARE_INSTRUCTION(TestSmi); |
+ virtual CompileType ComputeType() const; |
+ |
+ virtual bool CanDeoptimize() const { return false; } |
+ |
+ virtual bool CanBecomeDeoptimizationTarget() const { |
+ // TestSmi can be merged into Branch and thus needs an environment. |
+ return true; |
+ } |
+ |
+ virtual intptr_t DeoptimizationTarget() const { |
+ return GetDeoptId(); |
+ } |
+ |
+ virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
+ return kTagged; |
+ } |
+ |
+ virtual EffectSet Effects() const { return EffectSet::None(); } |
+ |
+ virtual bool MayThrow() const { return false; } |
+ |
+ virtual void EmitBranchCode(FlowGraphCompiler* compiler, |
+ BranchInstr* branch); |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(TestSmiInstr); |
+}; |
+ |
+ |
class EqualityCompareInstr : public ComparisonInstr { |
public: |
EqualityCompareInstr(intptr_t token_pos, |
@@ -3001,7 +3041,6 @@ |
DECLARE_INSTRUCTION(EqualityCompare) |
virtual CompileType ComputeType() const; |
- virtual bool RecomputeType(); |
virtual void PrintOperandsTo(BufferFormatter* f) const; |
@@ -3051,7 +3090,6 @@ |
DECLARE_INSTRUCTION(RelationalOp) |
virtual CompileType ComputeType() const; |
- virtual bool RecomputeType(); |
virtual void PrintOperandsTo(BufferFormatter* f) const; |