Commit 4155b5b6 authored by QiuJi's avatar QiuJi Committed by V8 LUCI CQ

[compiler][cleanup] Move ToBoolean to simplified operator category

According to https://chromium-review.googlesource.com/c/v8/v8/+/725721/,
ToBoolean should be a simplified operator.

Change-Id: I4898e1c022f7b3083aefd880478529b18f0d2dad
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3361661Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: ji qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#78638}
parent f33e68ad
......@@ -2100,17 +2100,6 @@ class RepresentationSelector {
//------------------------------------------------------------------
// JavaScript operators.
//------------------------------------------------------------------
case IrOpcode::kToBoolean: {
if (truncation.IsUsedAsBool()) {
ProcessInput<T>(node, 0, UseInfo::Bool());
SetOutput<T>(node, MachineRepresentation::kBit);
if (lower<T>()) DeferReplacement(node, node->InputAt(0));
} else {
VisitInputs<T>(node);
SetOutput<T>(node, MachineRepresentation::kTaggedPointer);
}
return;
}
case IrOpcode::kJSToNumber:
case IrOpcode::kJSToNumberConvertBigInt:
case IrOpcode::kJSToNumeric: {
......@@ -2135,6 +2124,17 @@ class RepresentationSelector {
//------------------------------------------------------------------
// Simplified operators.
//------------------------------------------------------------------
case IrOpcode::kToBoolean: {
if (truncation.IsUsedAsBool()) {
ProcessInput<T>(node, 0, UseInfo::Bool());
SetOutput<T>(node, MachineRepresentation::kBit);
if (lower<T>()) DeferReplacement(node, node->InputAt(0));
} else {
VisitInputs<T>(node);
SetOutput<T>(node, MachineRepresentation::kTaggedPointer);
}
return;
}
case IrOpcode::kBooleanNot: {
if (lower<T>()) {
NodeInfo* input_info = GetInfo(node->InputAt(0));
......
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