Unreviewed, rolling out r189136.
[WebKit-https.git] / Source / JavaScriptCore / assembler / MacroAssemblerX86Common.h
index 6e63ce9..84a4f52 100644 (file)
@@ -1124,28 +1124,10 @@ public:
 
     Jump branch32(RelationalCondition cond, RegisterID left, TrustedImm32 right)
     {
-        if (!right.m_value && (cond == Equal || cond == NotEqual || cond == LessThan || cond == GreaterThanOrEqual)) {
-            ResultCondition resultCondition;
-            switch (cond) {
-            case Equal:
-                resultCondition = Zero;
-                break;
-            case NotEqual:
-                resultCondition = NonZero;
-                break;
-            case LessThan:
-                resultCondition = Signed;
-                break;
-            case GreaterThanOrEqual:
-                resultCondition = PositiveOrZero;
-                break;
-            default:
-                RELEASE_ASSERT_NOT_REACHED();
-            }
+        if (((cond == Equal) || (cond == NotEqual)) && !right.m_value)
             m_assembler.testl_rr(left, left);
-            return Jump(m_assembler.jCC(x86Condition(resultCondition)));
-        }
-        m_assembler.cmpl_ir(right.m_value, left);
+        else
+            m_assembler.cmpl_ir(right.m_value, left);
         return Jump(m_assembler.jCC(x86Condition(cond)));
     }
     
@@ -1455,29 +1437,10 @@ public:
 
     void compare32(RelationalCondition cond, RegisterID left, TrustedImm32 right, RegisterID dest)
     {
-        if (!right.m_value && (cond == Equal || cond == NotEqual || cond == LessThan || cond == GreaterThanOrEqual)) {
-            ResultCondition resultCondition;
-            switch (cond) {
-            case Equal:
-                resultCondition = Zero;
-                break;
-            case NotEqual:
-                resultCondition = NonZero;
-                break;
-            case LessThan:
-                resultCondition = Signed;
-                break;
-            case GreaterThanOrEqual:
-                resultCondition = PositiveOrZero;
-                break;
-            default:
-                RELEASE_ASSERT_NOT_REACHED();
-            }
+        if (((cond == Equal) || (cond == NotEqual)) && !right.m_value)
             m_assembler.testl_rr(left, left);
-            set32(x86Condition(resultCondition), dest);
-            return;
-        }
-        m_assembler.cmpl_ir(right.m_value, left);
+        else
+            m_assembler.cmpl_ir(right.m_value, left);
         set32(x86Condition(cond), dest);
     }