diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc index 4d0753c4d2..b8cf80389c 100644 --- a/src/compiler/js-generic-lowering.cc +++ b/src/compiler/js-generic-lowering.cc @@ -385,9 +385,14 @@ void JSGenericLowering::ReplaceWithRuntimeCall(Node* node, Node* JSGenericLowering::LowerBranch(Node* node) { - Node* test = graph()->NewNode(machine()->WordEqual(), node->InputAt(0), - jsgraph()->TrueConstant()); - node->ReplaceInput(0, test); + if (!info()->is_typing_enabled()) { + // TODO(mstarzinger): If typing is enabled then simplified lowering will + // have inserted the correct ChangeBoolToBit, otherwise we need to perform + // poor-man's representation inference here and insert manual change. + Node* test = graph()->NewNode(machine()->WordEqual(), node->InputAt(0), + jsgraph()->TrueConstant()); + node->ReplaceInput(0, test); + } return node; }