2008-09-24 Maciej Stachowiak <mjs@apple.com>
[WebKit.git] / JavaScriptCore / VM / CTI.cpp
index 96e67e79248f0279c3891d56634e6618ab054cf6..a53ca6020d5e7cb9cf2724a8f7ead0eec467b4e5 100644 (file)
@@ -1417,7 +1417,21 @@ void CTI::privateCompileMainPass()
             break;
         }
         CTI_COMPILE_BINARY_OP(op_less)
             break;
         }
         CTI_COMPILE_BINARY_OP(op_less)
-        CTI_COMPILE_BINARY_OP(op_neq)
+        case op_neq: {
+            emitGetArg(instruction[i + 2].u.operand, X86::eax);
+            emitGetArg(instruction[i + 3].u.operand, X86::edx);
+            emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, i);
+            m_jit.cmpl_rr(X86::eax, X86::edx);
+
+            m_jit.setne_r(X86::eax);
+            m_jit.movzbl_rr(X86::eax, X86::eax);
+            emitTagAsBoolImmediate(X86::eax);
+
+            emitPutResult(instruction[i + 1].u.operand);
+
+            i += 4;
+            break;
+        }
         case op_post_dec: {
             int srcDst = instruction[i + 2].u.operand;
             emitGetArg(srcDst, X86::eax);
         case op_post_dec: {
             int srcDst = instruction[i + 2].u.operand;
             emitGetArg(srcDst, X86::eax);
@@ -2178,6 +2192,15 @@ void CTI::privateCompileSlowCases()
             i += 4;
             break;
         }
             i += 4;
             break;
         }
+        case op_neq: {
+            m_jit.link(iter->from, m_jit.label());
+            emitPutArg(X86::eax, 0);
+            emitPutArg(X86::edx, 4);
+            emitCall(i, Machine::cti_op_neq);
+            emitPutResult(instruction[i + 1].u.operand);
+            i += 4;
+            break;
+        }
         CTI_COMPILE_BINARY_OP_SLOW_CASE(op_stricteq);
         CTI_COMPILE_BINARY_OP_SLOW_CASE(op_nstricteq);
         case op_instanceof: {
         CTI_COMPILE_BINARY_OP_SLOW_CASE(op_stricteq);
         CTI_COMPILE_BINARY_OP_SLOW_CASE(op_nstricteq);
         case op_instanceof: {