Commit d382c2ea authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[ptr-compr] Adding compressed case to lowering of Boolean Not

Fixes the chromium bug 963891

Bug: chromium:963891
Change-Id: Ie90c9581044b7d10dd8fcd73d52bda5fdfead292
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1617248Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61608}
parent cf455537
...@@ -1745,6 +1745,10 @@ class RepresentationSelector { ...@@ -1745,6 +1745,10 @@ class RepresentationSelector {
// BooleanNot(x: kRepTagged) => WordEqual(x, #false) // BooleanNot(x: kRepTagged) => WordEqual(x, #false)
node->AppendInput(jsgraph_->zone(), jsgraph_->FalseConstant()); node->AppendInput(jsgraph_->zone(), jsgraph_->FalseConstant());
NodeProperties::ChangeOp(node, lowering->machine()->WordEqual()); NodeProperties::ChangeOp(node, lowering->machine()->WordEqual());
} else if (CanBeCompressedPointer(input_info->representation())) {
// BooleanNot(x: kRepCompressed) => Word32Equal(x, #false)
node->AppendInput(jsgraph_->zone(), jsgraph_->FalseConstant());
NodeProperties::ChangeOp(node, lowering->machine()->Word32Equal());
} else { } else {
DCHECK(TypeOf(node->InputAt(0)).IsNone()); DCHECK(TypeOf(node->InputAt(0)).IsNone());
DeferReplacement(node, lowering->jsgraph()->Int32Constant(0)); DeferReplacement(node, lowering->jsgraph()->Int32Constant(0));
......
// Copyright 2019 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 bar = true;
bar = false;
function foo() {
return !bar;
}
assertEquals(foo(), true);
%OptimizeFunctionOnNextCall(foo);
assertEquals(foo(), true);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment