LUnbox support for MIRType_Boolean on x64. (No bug, r=dvander)
authorSean Stangl <sstangl@mozilla.com>
Wed, 11 Jan 2012 13:48:55 -0800
changeset 105551 6e4acb5ff1b82b0fdf4b3849380124f587b4669c
parent 105550 524b705fe740690fe0d8d1c9c44c74ab9dd7343d
child 105552 91c7d8b9c9e96bed8c5f867ccd98fed385638c48
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersdvander
milestone12.0a1
LUnbox support for MIRType_Boolean on x64. (No bug, r=dvander)
js/src/ion/x64/CodeGenerator-x64.cpp
--- a/js/src/ion/x64/CodeGenerator-x64.cpp
+++ b/js/src/ion/x64/CodeGenerator-x64.cpp
@@ -143,42 +143,49 @@ CodeGeneratorX64::visitUnbox(LUnbox *unb
     MUnbox *mir = unbox->mir();
 
     if (mir->fallible()) {
         Assembler::Condition cond;
         switch (mir->type()) {
           case MIRType_Int32:
             cond = masm.testInt32(Assembler::NotEqual, value);
             break;
+          case MIRType_Boolean:
+            cond = masm.testBoolean(Assembler::NotEqual, value);
+            break;
           case MIRType_Object:
             cond = masm.testObject(Assembler::NotEqual, value);
             break;
           case MIRType_String:
             cond = masm.testString(Assembler::NotEqual, value);
             break;
           default:
-            JS_NOT_REACHED("NYI");
+            JS_NOT_REACHED("Given MIRType cannot be unboxed.");
             return false;
         }
         if (!bailoutIf(cond, unbox->snapshot()))
             return false;
     }
 
     switch (mir->type()) {
       case MIRType_Int32:
         masm.unboxInt32(value, ToRegister(result));
         break;
+      case MIRType_Boolean:
+        masm.unboxBoolean(value, ToRegister(result));
+        break;
       case MIRType_Object:
         masm.unboxObject(value, ToRegister(result));
         break;
       case MIRType_String:
         masm.unboxString(value, ToRegister(result));
         break;
       default:
-        JS_NOT_REACHED("NYI");
+        JS_NOT_REACHED("Given MIRType cannot be unboxed.");
+        break;
     }
     
     return true;
 }
 
 Assembler::Condition
 CodeGeneratorX64::testStringTruthy(bool truthy, const ValueOperand &value)
 {