[JSC] Make ArithClz32 work with Cell arguments
[WebKit-https.git] / Source / JavaScriptCore / dfg / DFGAbstractInterpreterInlines.h
index 8e32440..6b5e1de 100644 (file)
@@ -547,8 +547,8 @@ bool AbstractInterpreter<AbstractStateType>::executeEffects(unsigned clobberLimi
 
     case ArithClz32: {
         JSValue operand = forNode(node->child1()).value();
-        if (operand && operand.isNumber()) {
-            uint32_t value = toUInt32(operand.asNumber());
+        if (Optional<double> number = operand.toNumberFromPrimitive()) {
+            uint32_t value = toUInt32(*number);
             setConstant(node, jsNumber(clz32(value)));
             break;
         }