Bug 1022232 - Add ConvertToInt32Policy to MLimitedTruncate. r=bbouvier a=abillings
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Thu, 19 Jun 2014 02:01:04 -0700
changeset 189542 d2152031a5d16dce0b10c3ebe6adf317a6e9d98b
parent 189541 2bc6f38f9cffebdaa584e7e069fbf0d3536de291
child 189543 5ea391573087a2d0cd3a08e9362079837dc268f8
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbbouvier, abillings
bugs1022232
milestone33.0a1
Bug 1022232 - Add ConvertToInt32Policy to MLimitedTruncate. r=bbouvier a=abillings
js/src/jit/MIR.h
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -1024,39 +1024,45 @@ class MNop : public MNullaryInstruction
 
     AliasSet getAliasSet() const {
         return AliasSet::None();
     }
 };
 
 // Truncation barrier. This is intended for protecting its input against
 // follow-up truncation optimizations.
-class MLimitedTruncate : public MUnaryInstruction
+class MLimitedTruncate
+  : public MUnaryInstruction,
+    public ConvertToInt32Policy<0>
 {
   public:
     TruncateKind truncate_;
     TruncateKind truncateLimit_;
 
   protected:
     MLimitedTruncate(MDefinition *input, TruncateKind limit)
       : MUnaryInstruction(input),
         truncate_(NoTruncate),
         truncateLimit_(limit)
     {
-        setResultType(input->type());
+        setResultType(MIRType_Int32);
         setResultTypeSet(input->resultTypeSet());
         setMovable();
     }
 
   public:
     INSTRUCTION_HEADER(LimitedTruncate)
     static MLimitedTruncate *New(TempAllocator &alloc, MDefinition *input, TruncateKind kind) {
         return new(alloc) MLimitedTruncate(input, kind);
     }
 
+    TypePolicy *typePolicy() {
+        return this;
+    }
+
     AliasSet getAliasSet() const {
         return AliasSet::None();
     }
 
     void computeRange(TempAllocator &alloc);
     bool truncate(TruncateKind kind);
     TruncateKind operandTruncateKind(size_t index) const;
     TruncateKind truncateKind() const {