From 1c9528c4c44e0a1bce2fae9d4e2363420746744d Mon Sep 17 00:00:00 2001 From: jarin Date: Mon, 14 Nov 2016 04:10:29 -0800 Subject: [PATCH] Revert of [turbofan] Fix deoptimization of boolean bit constants. (patchset #1 id:1 of https://codereview.chromium.org/2495243002/ ) Reason for revert: Seems to break GC stress. Original issue's description: > [turbofan] Fix deoptimization of boolean bit constants. > > BUG=chromium:664490 TBR=bmeurer@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=chromium:664490 Review-Url: https://codereview.chromium.org/2502613002 Cr-Commit-Position: refs/heads/master@{#40961} --- src/compiler/code-generator.cc | 8 +------- src/compiler/simplified-lowering.cc | 2 -- test/mjsunit/compiler/regress-664490.js | 18 ------------------ 3 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 test/mjsunit/compiler/regress-664490.js diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc index 4327c7e6a3a3..852aa16e3197 100644 --- a/src/compiler/code-generator.cc +++ b/src/compiler/code-generator.cc @@ -858,18 +858,12 @@ void CodeGenerator::AddTranslationForOperand(Translation* translation, constant_object = handle(reinterpret_cast(constant.ToInt32()), isolate()); DCHECK(constant_object->IsSmi()); - } else if (type.representation() == MachineRepresentation::kBit) { - if (constant.ToInt32() == 0) { - constant_object = isolate()->factory()->false_value(); - } else { - DCHECK_EQ(1, constant.ToInt32()); - constant_object = isolate()->factory()->true_value(); - } } else { // TODO(jarin,bmeurer): We currently pass in raw pointers to the // JSFunction::entry here. We should really consider fixing this. DCHECK(type == MachineType::Int32() || type == MachineType::Uint32() || + type.representation() == MachineRepresentation::kBit || type.representation() == MachineRepresentation::kWord32 || type.representation() == MachineRepresentation::kNone); DCHECK(type.representation() != MachineRepresentation::kNone || diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc index a1cd46749617..a2b67db13bf0 100644 --- a/src/compiler/simplified-lowering.cc +++ b/src/compiler/simplified-lowering.cc @@ -1030,8 +1030,6 @@ class RepresentationSelector { MachineRepresentation::kWord32 || machine_type.semantic() == MachineSemantic::kInt32 || machine_type.semantic() == MachineSemantic::kUint32); - DCHECK(machine_type.representation() != MachineRepresentation::kBit || - input_type->Is(Type::Boolean())); (*types)[i] = machine_type; } } diff --git a/test/mjsunit/compiler/regress-664490.js b/test/mjsunit/compiler/regress-664490.js deleted file mode 100644 index 94094c736297..000000000000 --- a/test/mjsunit/compiler/regress-664490.js +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2016 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Flags: --allow-natives-syntax - -var foo = function(msg) {}; - -foo = function (value) { - assertEquals(false, value); -} - -function f() { - foo(undefined == 0); -} - -%OptimizeFunctionOnNextCall(f); -f();