Bug 863439 - Use BoxInputsPolicy for MUnbox.
authorBrian Hackett <bhackett1024@gmail.com>
Thu, 18 Apr 2013 15:12:07 -0600
changeset 129604 2a32d0f08dea4143473718027f67776fc9a3f092
parent 129603 11b64221636b72bf2c803f146e81ee960cabf47f
child 129605 c946f7a3939716cdcce47255ff6ff6ae20363215
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs863439
milestone23.0a1
Bug 863439 - Use BoxInputsPolicy for MUnbox.
js/src/ion/MIR.h
--- a/js/src/ion/MIR.h
+++ b/js/src/ion/MIR.h
@@ -1909,17 +1909,17 @@ JSOpToCondition(MCompare::CompareType co
 {
     bool isSigned = (compareType != MCompare::Compare_UInt32);
     return JSOpToCondition(op, isSigned);
 }
 
 // Takes a typed value and checks if it is a certain type. If so, the payload
 // is unpacked and returned as that type. Otherwise, it is considered a
 // deoptimization.
-class MUnbox : public MUnaryInstruction
+class MUnbox : public MUnaryInstruction, public BoxInputsPolicy
 {
   public:
     enum Mode {
         Fallible,       // Check the type, and deoptimize if unexpected.
         Infallible,     // Type guard is not necessary.
         TypeBarrier,    // Guard on the type, and act like a TypeBarrier on failure.
         TypeGuard       // Guard on the type, and deoptimize otherwise.
     };
@@ -1950,16 +1950,20 @@ class MUnbox : public MUnaryInstruction
 
   public:
     INSTRUCTION_HEADER(Unbox)
     static MUnbox *New(MDefinition *ins, MIRType type, Mode mode)
     {
         return new MUnbox(ins, type, mode);
     }
 
+    TypePolicy *typePolicy() {
+        return this;
+    }
+
     Mode mode() const {
         return mode_;
     }
     MDefinition *input() const {
         return getOperand(0);
     }
     BailoutKind bailoutKind() const {
         // If infallible, no bailout should be generated.