Bug 1022232 - Add ConvertToInt32Policy to MLimitedTruncate. r=bbouvier a=abillings
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Fri, 20 Jun 2014 09:19:16 -0700
changeset 208258 c95d58f66658f1873c651ceb8e21c4715cae7396
parent 208257 15efc384af1f1a79ad2048bd85316f565c925882
child 208259 7037d7df546c87ae78bdd47cbecd384026c027fb
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier, abillings
bugs1022232
milestone32.0a2
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
@@ -1015,38 +1015,44 @@ class MNop : public MNullaryInstruction
 
     AliasSet getAliasSet() const {
         return AliasSet::None();
     }
 };
 
 // No-op instruction. This cannot be moved or eliminated, and is intended for
 // protecting the input against follow-up optimization.
-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());
     }
 
   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 {