Unreviewed, rolling out r189136.
[WebKit-https.git] / Source / JavaScriptCore / dfg / DFGSpeculativeJIT.cpp
index 2a647a9..29ede52 100644 (file)
@@ -1278,14 +1278,14 @@ void SpeculativeJIT::compilePeepHoleBooleanBranch(Node* node, Node* branchNode,
         notTaken = tmp;
     }
 
-    if (node->child1()->isInt32Constant()) {
-        int32_t imm = node->child1()->asInt32();
+    if (node->child1()->isBooleanConstant()) {
+        bool imm = node->child1()->asBoolean();
         SpeculateBooleanOperand op2(this, node->child2());
-        branch32(condition, JITCompiler::Imm32(imm), op2.gpr(), taken);
-    } else if (node->child2()->isInt32Constant()) {
+        branch32(condition, JITCompiler::Imm32(static_cast<int32_t>(JSValue::encode(jsBoolean(imm)))), op2.gpr(), taken);
+    } else if (node->child2()->isBooleanConstant()) {
         SpeculateBooleanOperand op1(this, node->child1());
-        int32_t imm = node->child2()->asInt32();
-        branch32(condition, op1.gpr(), JITCompiler::Imm32(imm), taken);
+        bool imm = node->child2()->asBoolean();
+        branch32(condition, op1.gpr(), JITCompiler::Imm32(static_cast<int32_t>(JSValue::encode(jsBoolean(imm)))), taken);
     } else {
         SpeculateBooleanOperand op1(this, node->child1());
         SpeculateBooleanOperand op2(this, node->child2());