Commit dcf178fb authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Move ChangeTaggedToFoo lowerings to EffectControlLinearizer.

These also lower to subgraphs that have to be connected to the effect
and control chains, otherwise removing the atomic regions around heap
allocations would still be unsound.

R=jarin@chromium.org

Review URL: https://codereview.chromium.org/1916763003

Cr-Commit-Position: refs/heads/master@{#35762}
parent 0ff89ea7
......@@ -31,14 +31,6 @@ Reduction ChangeLowering::Reduce(Node* node) {
return ChangeInt31ToTagged(node->InputAt(0), control);
case IrOpcode::kChangeTaggedSignedToInt32:
return ChangeTaggedSignedToInt32(node->InputAt(0));
case IrOpcode::kChangeTaggedToFloat64:
return ChangeTaggedToFloat64(node->InputAt(0), control);
case IrOpcode::kChangeTaggedToInt32:
return ChangeTaggedToUI32(node->InputAt(0), control, kSigned);
case IrOpcode::kChangeTaggedToUint32:
return ChangeTaggedToUI32(node->InputAt(0), control, kUnsigned);
case IrOpcode::kTruncateTaggedToWord32:
return TruncateTaggedToWord32(node->InputAt(0), control);
case IrOpcode::kLoadField:
return LoadField(node);
case IrOpcode::kStoreField:
......@@ -145,79 +137,6 @@ Reduction ChangeLowering::ChangeTaggedSignedToInt32(Node* value) {
return Replace(ChangeSmiToWord32(value));
}
Reduction ChangeLowering::ChangeTaggedToUI32(Node* value, Node* control,
Signedness signedness) {
const Operator* op = (signedness == kSigned)
? machine()->ChangeFloat64ToInt32()
: machine()->ChangeFloat64ToUint32();
if (NodeProperties::GetType(value)->Is(Type::TaggedPointer()) &&
NodeProperties::GetType(value)->Is(Type::Number())) {
return Replace(graph()->NewNode(op, LoadHeapNumberValue(value, control)));
}
Node* check = TestNotSmi(value);
Node* branch =
graph()->NewNode(common()->Branch(BranchHint::kFalse), check, control);
Node* if_not_smi = graph()->NewNode(common()->IfTrue(), branch);
STATIC_ASSERT(HeapNumber::kValueOffset == Oddball::kToNumberRawOffset);
Node* vnot_smi = graph()->NewNode(op, LoadHeapNumberValue(value, if_not_smi));
Node* if_smi = graph()->NewNode(common()->IfFalse(), branch);
Node* vfrom_smi = ChangeSmiToWord32(value);
Node* merge = graph()->NewNode(common()->Merge(2), if_not_smi, if_smi);
Node* phi = graph()->NewNode(common()->Phi(MachineRepresentation::kWord32, 2),
vnot_smi, vfrom_smi, merge);
return Replace(phi);
}
Reduction ChangeLowering::ChangeTaggedToFloat64(Node* value, Node* control) {
Node* check = TestNotSmi(value);
Node* branch =
graph()->NewNode(common()->Branch(BranchHint::kFalse), check, control);
Node* if_not_smi = graph()->NewNode(common()->IfTrue(), branch);
STATIC_ASSERT(HeapNumber::kValueOffset == Oddball::kToNumberRawOffset);
Node* vnot_smi = LoadHeapNumberValue(value, if_not_smi);
Node* if_smi = graph()->NewNode(common()->IfFalse(), branch);
Node* vfrom_smi = ChangeSmiToFloat64(value);
Node* merge = graph()->NewNode(common()->Merge(2), if_not_smi, if_smi);
Node* phi =
graph()->NewNode(common()->Phi(MachineRepresentation::kFloat64, 2),
vnot_smi, vfrom_smi, merge);
return Replace(phi);
}
Reduction ChangeLowering::TruncateTaggedToWord32(Node* value, Node* control) {
Node* check = TestNotSmi(value);
Node* branch =
graph()->NewNode(common()->Branch(BranchHint::kFalse), check, control);
Node* if_not_smi = graph()->NewNode(common()->IfTrue(), branch);
STATIC_ASSERT(HeapNumber::kValueOffset == Oddball::kToNumberRawOffset);
Node* vnot_smi = graph()->NewNode(machine()->TruncateFloat64ToWord32(),
LoadHeapNumberValue(value, if_not_smi));
Node* if_smi = graph()->NewNode(common()->IfFalse(), branch);
Node* vfrom_smi = ChangeSmiToWord32(value);
Node* merge = graph()->NewNode(common()->Merge(2), if_not_smi, if_smi);
Node* phi = graph()->NewNode(common()->Phi(MachineRepresentation::kWord32, 2),
vnot_smi, vfrom_smi, merge);
return Replace(phi);
}
namespace {
WriteBarrierKind ComputeWriteBarrierKind(BaseTaggedness base_is_tagged,
......
......@@ -45,11 +45,7 @@ class ChangeLowering final : public Reducer {
Reduction ChangeInt31ToTagged(Node* value, Node* control);
Reduction ChangeInt32ToTagged(Node* value, Node* control);
Reduction ChangeTaggedSignedToInt32(Node* value);
Reduction ChangeTaggedToFloat64(Node* value, Node* control);
Reduction ChangeTaggedToUI32(Node* value, Node* control,
Signedness signedness);
Reduction ChangeUint32ToTagged(Node* value, Node* control);
Reduction TruncateTaggedToWord32(Node* value, Node* control);
Reduction LoadField(Node* node);
Reduction StoreField(Node* node);
......
......@@ -355,6 +355,18 @@ bool EffectControlLinearizer::TryWireInStateEffect(Node* node, Node** effect,
case IrOpcode::kChangeFloat64ToTagged:
state = LowerChangeFloat64ToTagged(node, *effect, *control);
break;
case IrOpcode::kChangeTaggedToInt32:
state = LowerChangeTaggedToInt32(node, *effect, *control);
break;
case IrOpcode::kChangeTaggedToUint32:
state = LowerChangeTaggedToUint32(node, *effect, *control);
break;
case IrOpcode::kChangeTaggedToFloat64:
state = LowerChangeTaggedToFloat64(node, *effect, *control);
break;
case IrOpcode::kTruncateTaggedToWord32:
state = LowerTruncateTaggedToWord32(node, *effect, *control);
break;
case IrOpcode::kObjectIsCallable:
state = LowerObjectIsCallable(node, *effect, *control);
break;
......@@ -505,6 +517,140 @@ EffectControlLinearizer::LowerChangeUint32ToTagged(Node* node, Node* effect,
return ValueEffectControl(phi, ephi, merge);
}
EffectControlLinearizer::ValueEffectControl
EffectControlLinearizer::LowerChangeTaggedToInt32(Node* node, Node* effect,
Node* control) {
Node* value = node->InputAt(0);
Node* check = graph()->NewNode(simplified()->ObjectIsSmi(), value);
Node* branch =
graph()->NewNode(common()->Branch(BranchHint::kTrue), check, control);
Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
Node* etrue = effect;
Node* vtrue =
graph()->NewNode(simplified()->ChangeTaggedSignedToInt32(), value);
Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
Node* efalse = effect;
Node* vfalse;
{
STATIC_ASSERT(HeapNumber::kValueOffset == Oddball::kToNumberRawOffset);
vfalse = efalse = graph()->NewNode(
simplified()->LoadField(AccessBuilder::ForHeapNumberValue()), value,
efalse, if_false);
vfalse = graph()->NewNode(machine()->ChangeFloat64ToInt32(), vfalse);
}
control = graph()->NewNode(common()->Merge(2), if_true, if_false);
effect = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, control);
value = graph()->NewNode(common()->Phi(MachineRepresentation::kWord32, 2),
vtrue, vfalse, control);
return ValueEffectControl(value, effect, control);
}
EffectControlLinearizer::ValueEffectControl
EffectControlLinearizer::LowerChangeTaggedToUint32(Node* node, Node* effect,
Node* control) {
Node* value = node->InputAt(0);
Node* check = graph()->NewNode(simplified()->ObjectIsSmi(), value);
Node* branch =
graph()->NewNode(common()->Branch(BranchHint::kTrue), check, control);
Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
Node* etrue = effect;
Node* vtrue =
graph()->NewNode(simplified()->ChangeTaggedSignedToInt32(), value);
Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
Node* efalse = effect;
Node* vfalse;
{
STATIC_ASSERT(HeapNumber::kValueOffset == Oddball::kToNumberRawOffset);
vfalse = efalse = graph()->NewNode(
simplified()->LoadField(AccessBuilder::ForHeapNumberValue()), value,
efalse, if_false);
vfalse = graph()->NewNode(machine()->ChangeFloat64ToUint32(), vfalse);
}
control = graph()->NewNode(common()->Merge(2), if_true, if_false);
effect = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, control);
value = graph()->NewNode(common()->Phi(MachineRepresentation::kWord32, 2),
vtrue, vfalse, control);
return ValueEffectControl(value, effect, control);
}
EffectControlLinearizer::ValueEffectControl
EffectControlLinearizer::LowerChangeTaggedToFloat64(Node* node, Node* effect,
Node* control) {
Node* value = node->InputAt(0);
Node* check = graph()->NewNode(simplified()->ObjectIsSmi(), value);
Node* branch =
graph()->NewNode(common()->Branch(BranchHint::kTrue), check, control);
Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
Node* etrue = effect;
Node* vtrue;
{
vtrue = graph()->NewNode(simplified()->ChangeTaggedSignedToInt32(), value);
vtrue = graph()->NewNode(machine()->ChangeInt32ToFloat64(), vtrue);
}
Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
Node* efalse = effect;
Node* vfalse;
{
STATIC_ASSERT(HeapNumber::kValueOffset == Oddball::kToNumberRawOffset);
vfalse = efalse = graph()->NewNode(
simplified()->LoadField(AccessBuilder::ForHeapNumberValue()), value,
efalse, if_false);
}
control = graph()->NewNode(common()->Merge(2), if_true, if_false);
effect = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, control);
value = graph()->NewNode(common()->Phi(MachineRepresentation::kFloat64, 2),
vtrue, vfalse, control);
return ValueEffectControl(value, effect, control);
}
EffectControlLinearizer::ValueEffectControl
EffectControlLinearizer::LowerTruncateTaggedToWord32(Node* node, Node* effect,
Node* control) {
Node* value = node->InputAt(0);
Node* check = graph()->NewNode(simplified()->ObjectIsSmi(), value);
Node* branch =
graph()->NewNode(common()->Branch(BranchHint::kTrue), check, control);
Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
Node* etrue = effect;
Node* vtrue =
graph()->NewNode(simplified()->ChangeTaggedSignedToInt32(), value);
Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
Node* efalse = effect;
Node* vfalse;
{
STATIC_ASSERT(HeapNumber::kValueOffset == Oddball::kToNumberRawOffset);
vfalse = efalse = graph()->NewNode(
simplified()->LoadField(AccessBuilder::ForHeapNumberValue()), value,
efalse, if_false);
vfalse = graph()->NewNode(machine()->TruncateFloat64ToWord32(), vfalse);
}
control = graph()->NewNode(common()->Merge(2), if_true, if_false);
effect = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, control);
value = graph()->NewNode(common()->Phi(MachineRepresentation::kWord32, 2),
vtrue, vfalse, control);
return ValueEffectControl(value, effect, control);
}
EffectControlLinearizer::ValueEffectControl
EffectControlLinearizer::LowerObjectIsCallable(Node* node, Node* effect,
Node* control) {
......
......@@ -47,6 +47,14 @@ class EffectControlLinearizer {
Node* control);
ValueEffectControl LowerChangeFloat64ToTagged(Node* node, Node* effect,
Node* control);
ValueEffectControl LowerChangeTaggedToInt32(Node* node, Node* effect,
Node* control);
ValueEffectControl LowerChangeTaggedToUint32(Node* node, Node* effect,
Node* control);
ValueEffectControl LowerChangeTaggedToFloat64(Node* node, Node* effect,
Node* control);
ValueEffectControl LowerTruncateTaggedToWord32(Node* node, Node* effect,
Node* control);
ValueEffectControl LowerObjectIsCallable(Node* node, Node* effect,
Node* control);
ValueEffectControl LowerObjectIsNumber(Node* node, Node* effect,
......
......@@ -143,113 +143,6 @@ class ChangesLoweringTester : public GraphBuilderTester<ReturnType> {
};
TEST(RunChangeTaggedToInt32) {
// Build and lower a graph by hand.
ChangesLoweringTester<int32_t> t(MachineType::AnyTagged());
t.BuildAndLower(t.simplified()->ChangeTaggedToInt32());
FOR_INT32_INPUTS(i) {
int32_t input = *i;
if (Smi::IsValid(input)) {
int32_t result = t.Call(Smi::FromInt(input));
CHECK_EQ(input, result);
}
{
Handle<Object> number = t.factory()->NewNumber(input);
int32_t result = t.Call(*number);
CHECK_EQ(input, result);
}
{
Handle<HeapNumber> number = t.factory()->NewHeapNumber(input);
int32_t result = t.Call(*number);
CHECK_EQ(input, result);
}
}
}
TEST(RunChangeTaggedToUint32) {
// Build and lower a graph by hand.
ChangesLoweringTester<uint32_t> t(MachineType::AnyTagged());
t.BuildAndLower(t.simplified()->ChangeTaggedToUint32());
FOR_UINT32_INPUTS(i) {
uint32_t input = *i;
if (Smi::IsValid(input)) {
uint32_t result = t.Call(Smi::FromInt(input));
CHECK_EQ(static_cast<int32_t>(input), static_cast<int32_t>(result));
}
{
Handle<Object> number = t.factory()->NewNumber(input);
uint32_t result = t.Call(*number);
CHECK_EQ(static_cast<int32_t>(input), static_cast<int32_t>(result));
}
{
Handle<HeapNumber> number = t.factory()->NewHeapNumber(input);
uint32_t result = t.Call(*number);
CHECK_EQ(static_cast<int32_t>(input), static_cast<int32_t>(result));
}
}
}
TEST(RunChangeTaggedToFloat64) {
ChangesLoweringTester<int32_t> t(MachineType::AnyTagged());
double result;
t.BuildStoreAndLower(t.simplified()->ChangeTaggedToFloat64(),
t.machine()->Store(StoreRepresentation(
MachineRepresentation::kFloat64, kNoWriteBarrier)),
&result);
{
FOR_INT32_INPUTS(i) {
int32_t input = *i;
if (Smi::IsValid(input)) {
t.Call(Smi::FromInt(input));
CHECK_EQ(input, static_cast<int32_t>(result));
}
{
Handle<Object> number = t.factory()->NewNumber(input);
t.Call(*number);
CHECK_EQ(input, static_cast<int32_t>(result));
}
{
Handle<HeapNumber> number = t.factory()->NewHeapNumber(input);
t.Call(*number);
CHECK_EQ(input, static_cast<int32_t>(result));
}
}
}
{
FOR_FLOAT64_INPUTS(i) {
double input = *i;
{
Handle<Object> number = t.factory()->NewNumber(input);
t.Call(*number);
CHECK_DOUBLE_EQ(input, result);
}
{
Handle<HeapNumber> number = t.factory()->NewHeapNumber(input);
t.Call(*number);
CHECK_DOUBLE_EQ(input, result);
}
}
}
}
TEST(RunChangeBoolToBit) {
ChangesLoweringTester<int32_t> t(MachineType::AnyTagged());
t.BuildAndLower(t.simplified()->ChangeBoolToBit());
......
......@@ -1398,9 +1398,9 @@ TEST(LowerLoadElement_to_load) {
TEST(LowerStoreElement_to_store) {
{
TestingGraph t(Type::Any(), Type::Signed32());
for (size_t i = 0; i < arraysize(kMachineReps); i++) {
TestingGraph t(Type::Any(), Type::Signed32());
ElementAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize,
Type::Any(), kMachineReps[i]};
......
......@@ -132,27 +132,6 @@ TARGET_TEST_P(ChangeLoweringCommonTest, ChangeInt31ToTagged) {
EXPECT_THAT(r.replacement(), IsChangeInt32ToSmi(value));
}
TARGET_TEST_P(ChangeLoweringCommonTest, ChangeTaggedToInt32WithTaggedNumber) {
Node* value =
Parameter(Type::Intersect(Type::TaggedPointer(), Type::Number(), zone()));
Reduction r =
Reduce(graph()->NewNode(simplified()->ChangeTaggedToInt32(), value));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), IsChangeFloat64ToInt32(
IsLoadHeapNumber(value, graph()->start())));
}
TARGET_TEST_P(ChangeLoweringCommonTest, ChangeTaggedToUint32WithTaggedPointer) {
Node* value =
Parameter(Type::Intersect(Type::TaggedPointer(), Type::Number(), zone()));
Reduction r =
Reduce(graph()->NewNode(simplified()->ChangeTaggedToUint32(), value));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), IsChangeFloat64ToUint32(
IsLoadHeapNumber(value, graph()->start())));
}
TARGET_TEST_P(ChangeLoweringCommonTest, StoreFieldSmi) {
FieldAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize,
Handle<Name>::null(), Type::Any(),
......@@ -316,181 +295,6 @@ TARGET_TEST_P(ChangeLoweringCommonTest, Allocate) {
ASSERT_TRUE(r.Changed());
}
INSTANTIATE_TEST_CASE_P(ChangeLoweringTest, ChangeLoweringCommonTest,
::testing::Values(MachineRepresentation::kWord32,
MachineRepresentation::kWord64));
// -----------------------------------------------------------------------------
// 32-bit
class ChangeLowering32Test : public ChangeLoweringTest {
public:
~ChangeLowering32Test() override {}
MachineRepresentation WordRepresentation() const final {
return MachineRepresentation::kWord32;
}
};
TARGET_TEST_F(ChangeLowering32Test, ChangeTaggedToFloat64) {
STATIC_ASSERT(kSmiTag == 0);
STATIC_ASSERT(kSmiTagSize == 1);
Node* value = Parameter(Type::Number());
Node* node = graph()->NewNode(simplified()->ChangeTaggedToFloat64(), value);
Reduction r = Reduce(node);
ASSERT_TRUE(r.Changed());
Capture<Node*> branch, if_true;
EXPECT_THAT(
r.replacement(),
IsPhi(MachineRepresentation::kFloat64,
IsLoadHeapNumber(value, CaptureEq(&if_true)),
IsChangeInt32ToFloat64(IsWord32Sar(
value, IsInt32Constant(kSmiTagSize + kSmiShiftSize))),
IsMerge(AllOf(CaptureEq(&if_true),
IsIfTrue(AllOf(
CaptureEq(&branch),
IsBranch(IsWord32And(
value, IsInt32Constant(kSmiTagMask)),
graph()->start())))),
IsIfFalse(CaptureEq(&branch)))));
}
TARGET_TEST_F(ChangeLowering32Test, ChangeTaggedToInt32) {
STATIC_ASSERT(kSmiTag == 0);
STATIC_ASSERT(kSmiTagSize == 1);
Node* value = Parameter(Type::Signed32());
Node* node = graph()->NewNode(simplified()->ChangeTaggedToInt32(), value);
Reduction r = Reduce(node);
ASSERT_TRUE(r.Changed());
Capture<Node*> branch, if_true;
EXPECT_THAT(
r.replacement(),
IsPhi(
MachineRepresentation::kWord32,
IsChangeFloat64ToInt32(IsLoadHeapNumber(value, CaptureEq(&if_true))),
IsWord32Sar(value, IsInt32Constant(kSmiTagSize + kSmiShiftSize)),
IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))),
IsIfFalse(AllOf(
CaptureEq(&branch),
IsBranch(IsWord32And(value, IsInt32Constant(kSmiTagMask)),
graph()->start()))))));
}
TARGET_TEST_F(ChangeLowering32Test, ChangeTaggedToUint32) {
STATIC_ASSERT(kSmiTag == 0);
STATIC_ASSERT(kSmiTagSize == 1);
Node* value = Parameter(Type::Unsigned32());
Node* node = graph()->NewNode(simplified()->ChangeTaggedToUint32(), value);
Reduction r = Reduce(node);
ASSERT_TRUE(r.Changed());
Capture<Node*> branch, if_true;
EXPECT_THAT(
r.replacement(),
IsPhi(
MachineRepresentation::kWord32,
IsChangeFloat64ToUint32(IsLoadHeapNumber(value, CaptureEq(&if_true))),
IsWord32Sar(value, IsInt32Constant(kSmiTagSize + kSmiShiftSize)),
IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))),
IsIfFalse(AllOf(
CaptureEq(&branch),
IsBranch(IsWord32And(value, IsInt32Constant(kSmiTagMask)),
graph()->start()))))));
}
// -----------------------------------------------------------------------------
// 64-bit
class ChangeLowering64Test : public ChangeLoweringTest {
public:
~ChangeLowering64Test() override {}
MachineRepresentation WordRepresentation() const final {
return MachineRepresentation::kWord64;
}
};
TARGET_TEST_F(ChangeLowering64Test, ChangeTaggedToFloat64) {
STATIC_ASSERT(kSmiTag == 0);
STATIC_ASSERT(kSmiTagSize == 1);
Node* value = Parameter(Type::Number());
Node* node = graph()->NewNode(simplified()->ChangeTaggedToFloat64(), value);
Reduction r = Reduce(node);
ASSERT_TRUE(r.Changed());
Capture<Node*> branch, if_true;
EXPECT_THAT(
r.replacement(),
IsPhi(MachineRepresentation::kFloat64,
IsLoadHeapNumber(value, CaptureEq(&if_true)),
IsChangeInt32ToFloat64(IsTruncateInt64ToInt32(IsWord64Sar(
value, IsInt64Constant(kSmiTagSize + kSmiShiftSize)))),
IsMerge(AllOf(CaptureEq(&if_true),
IsIfTrue(AllOf(
CaptureEq(&branch),
IsBranch(IsWord64And(
value, IsInt64Constant(kSmiTagMask)),
graph()->start())))),
IsIfFalse(CaptureEq(&branch)))));
}
TARGET_TEST_F(ChangeLowering64Test, ChangeTaggedToInt32) {
STATIC_ASSERT(kSmiTag == 0);
STATIC_ASSERT(kSmiTagSize == 1);
Node* value = Parameter(Type::Signed32());
Node* node = graph()->NewNode(simplified()->ChangeTaggedToInt32(), value);
Reduction r = Reduce(node);
ASSERT_TRUE(r.Changed());
Capture<Node*> branch, if_true;
EXPECT_THAT(
r.replacement(),
IsPhi(
MachineRepresentation::kWord32,
IsChangeFloat64ToInt32(IsLoadHeapNumber(value, CaptureEq(&if_true))),
IsTruncateInt64ToInt32(
IsWord64Sar(value, IsInt64Constant(kSmiTagSize + kSmiShiftSize))),
IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))),
IsIfFalse(AllOf(
CaptureEq(&branch),
IsBranch(IsWord64And(value, IsInt64Constant(kSmiTagMask)),
graph()->start()))))));
}
TARGET_TEST_F(ChangeLowering64Test, ChangeTaggedToUint32) {
STATIC_ASSERT(kSmiTag == 0);
STATIC_ASSERT(kSmiTagSize == 1);
Node* value = Parameter(Type::Unsigned32());
Node* node = graph()->NewNode(simplified()->ChangeTaggedToUint32(), value);
Reduction r = Reduce(node);
ASSERT_TRUE(r.Changed());
Capture<Node*> branch, if_true;
EXPECT_THAT(
r.replacement(),
IsPhi(
MachineRepresentation::kWord32,
IsChangeFloat64ToUint32(IsLoadHeapNumber(value, CaptureEq(&if_true))),
IsTruncateInt64ToInt32(
IsWord64Sar(value, IsInt64Constant(kSmiTagSize + kSmiShiftSize))),
IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))),
IsIfFalse(AllOf(
CaptureEq(&branch),
IsBranch(IsWord64And(value, IsInt64Constant(kSmiTagMask)),
graph()->start()))))));
}
} // namespace compiler
} // namespace internal
} // namespace v8
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