| Index: src/compiler/effect-control-linearizer.cc
|
| diff --git a/src/compiler/effect-control-linearizer.cc b/src/compiler/effect-control-linearizer.cc
|
| index ddcf1c1514fad6ed1cf9967eeaca7a77767426a7..763aaea84199243a391e2f3e47f4f67a35115e52 100644
|
| --- a/src/compiler/effect-control-linearizer.cc
|
| +++ b/src/compiler/effect-control-linearizer.cc
|
| @@ -290,7 +290,12 @@
|
| node->opcode() == IrOpcode::kBeginRegion) {
|
| // Update the value uses to the value input of the finish node and
|
| // the effect uses to the effect input.
|
| - return RemoveRegionNode(node);
|
| +
|
| + // TODO(jarin) Enable this once we make sure everything with side effects
|
| + // is marked as effectful.
|
| + if (false) {
|
| + return RemoveRegionNode(node);
|
| + }
|
| }
|
|
|
| if (node->opcode() == IrOpcode::kIfSuccess) {
|
| @@ -341,12 +346,6 @@
|
| Node** control) {
|
| ValueEffectControl state(nullptr, nullptr, nullptr);
|
| switch (node->opcode()) {
|
| - case IrOpcode::kChangeBitToTagged:
|
| - state = LowerChangeBitToTagged(node, *effect, *control);
|
| - break;
|
| - case IrOpcode::kChangeInt31ToTaggedSigned:
|
| - state = LowerChangeInt31ToTaggedSigned(node, *effect, *control);
|
| - break;
|
| case IrOpcode::kChangeInt32ToTagged:
|
| state = LowerChangeInt32ToTagged(node, *effect, *control);
|
| break;
|
| @@ -356,12 +355,6 @@
|
| case IrOpcode::kChangeFloat64ToTagged:
|
| state = LowerChangeFloat64ToTagged(node, *effect, *control);
|
| break;
|
| - case IrOpcode::kChangeTaggedSignedToInt32:
|
| - state = LowerChangeTaggedSignedToInt32(node, *effect, *control);
|
| - break;
|
| - case IrOpcode::kChangeTaggedToBit:
|
| - state = LowerChangeTaggedToBit(node, *effect, *control);
|
| - break;
|
| case IrOpcode::kChangeTaggedToInt32:
|
| state = LowerChangeTaggedToInt32(node, *effect, *control);
|
| break;
|
| @@ -382,9 +375,6 @@
|
| break;
|
| case IrOpcode::kObjectIsReceiver:
|
| state = LowerObjectIsReceiver(node, *effect, *control);
|
| - break;
|
| - case IrOpcode::kObjectIsSmi:
|
| - state = LowerObjectIsSmi(node, *effect, *control);
|
| break;
|
| case IrOpcode::kObjectIsString:
|
| state = LowerObjectIsString(node, *effect, *control);
|
| @@ -471,35 +461,6 @@
|
| }
|
|
|
| EffectControlLinearizer::ValueEffectControl
|
| -EffectControlLinearizer::LowerChangeBitToTagged(Node* node, Node* effect,
|
| - Node* control) {
|
| - Node* value = node->InputAt(0);
|
| -
|
| - Node* branch = graph()->NewNode(common()->Branch(), value, control);
|
| -
|
| - Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
|
| - Node* vtrue = jsgraph()->TrueConstant();
|
| -
|
| - Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
|
| - Node* vfalse = jsgraph()->FalseConstant();
|
| -
|
| - control = graph()->NewNode(common()->Merge(2), if_true, if_false);
|
| - value = graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2),
|
| - vtrue, vfalse, control);
|
| -
|
| - return ValueEffectControl(value, effect, control);
|
| -}
|
| -
|
| -EffectControlLinearizer::ValueEffectControl
|
| -EffectControlLinearizer::LowerChangeInt31ToTaggedSigned(Node* node,
|
| - Node* effect,
|
| - Node* control) {
|
| - Node* value = node->InputAt(0);
|
| - value = ChangeInt32ToSmi(value);
|
| - return ValueEffectControl(value, effect, control);
|
| -}
|
| -
|
| -EffectControlLinearizer::ValueEffectControl
|
| EffectControlLinearizer::LowerChangeInt32ToTagged(Node* node, Node* effect,
|
| Node* control) {
|
| Node* value = node->InputAt(0);
|
| @@ -557,35 +518,18 @@
|
| }
|
|
|
| EffectControlLinearizer::ValueEffectControl
|
| -EffectControlLinearizer::LowerChangeTaggedSignedToInt32(Node* node,
|
| - Node* effect,
|
| - Node* control) {
|
| - Node* value = node->InputAt(0);
|
| - value = ChangeSmiToInt32(value);
|
| - return ValueEffectControl(value, effect, control);
|
| -}
|
| -
|
| -EffectControlLinearizer::ValueEffectControl
|
| -EffectControlLinearizer::LowerChangeTaggedToBit(Node* node, Node* effect,
|
| - Node* control) {
|
| - Node* value = node->InputAt(0);
|
| - value = graph()->NewNode(machine()->WordEqual(), value,
|
| - jsgraph()->TrueConstant());
|
| - return ValueEffectControl(value, effect, control);
|
| -}
|
| -
|
| -EffectControlLinearizer::ValueEffectControl
|
| EffectControlLinearizer::LowerChangeTaggedToInt32(Node* node, Node* effect,
|
| Node* control) {
|
| Node* value = node->InputAt(0);
|
|
|
| - Node* check = ObjectIsSmi(value);
|
| + 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 = ChangeSmiToInt32(value);
|
| + Node* vtrue =
|
| + graph()->NewNode(simplified()->ChangeTaggedSignedToInt32(), value);
|
|
|
| Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
|
| Node* efalse = effect;
|
| @@ -611,13 +555,14 @@
|
| Node* control) {
|
| Node* value = node->InputAt(0);
|
|
|
| - Node* check = ObjectIsSmi(value);
|
| + 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 = ChangeSmiToInt32(value);
|
| + Node* vtrue =
|
| + graph()->NewNode(simplified()->ChangeTaggedSignedToInt32(), value);
|
|
|
| Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
|
| Node* efalse = effect;
|
| @@ -643,7 +588,7 @@
|
| Node* control) {
|
| Node* value = node->InputAt(0);
|
|
|
| - Node* check = ObjectIsSmi(value);
|
| + Node* check = graph()->NewNode(simplified()->ObjectIsSmi(), value);
|
| Node* branch =
|
| graph()->NewNode(common()->Branch(BranchHint::kTrue), check, control);
|
|
|
| @@ -651,7 +596,7 @@
|
| Node* etrue = effect;
|
| Node* vtrue;
|
| {
|
| - vtrue = ChangeSmiToInt32(value);
|
| + vtrue = graph()->NewNode(simplified()->ChangeTaggedSignedToInt32(), value);
|
| vtrue = graph()->NewNode(machine()->ChangeInt32ToFloat64(), vtrue);
|
| }
|
|
|
| @@ -678,13 +623,14 @@
|
| Node* control) {
|
| Node* value = node->InputAt(0);
|
|
|
| - Node* check = ObjectIsSmi(value);
|
| + 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 = ChangeSmiToInt32(value);
|
| + Node* vtrue =
|
| + graph()->NewNode(simplified()->ChangeTaggedSignedToInt32(), value);
|
|
|
| Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
|
| Node* efalse = effect;
|
| @@ -710,7 +656,7 @@
|
| Node* control) {
|
| Node* value = node->InputAt(0);
|
|
|
| - Node* check = ObjectIsSmi(value);
|
| + Node* check = graph()->NewNode(simplified()->ObjectIsSmi(), value);
|
| Node* branch =
|
| graph()->NewNode(common()->Branch(BranchHint::kFalse), check, control);
|
|
|
| @@ -750,7 +696,7 @@
|
| Node* control) {
|
| Node* value = node->InputAt(0);
|
|
|
| - Node* check = ObjectIsSmi(value);
|
| + Node* check = graph()->NewNode(simplified()->ObjectIsSmi(), value);
|
| Node* branch = graph()->NewNode(common()->Branch(), check, control);
|
|
|
| Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
|
| @@ -781,7 +727,7 @@
|
| Node* control) {
|
| Node* value = node->InputAt(0);
|
|
|
| - Node* check = ObjectIsSmi(value);
|
| + Node* check = graph()->NewNode(simplified()->ObjectIsSmi(), value);
|
| Node* branch =
|
| graph()->NewNode(common()->Branch(BranchHint::kFalse), check, control);
|
|
|
| @@ -814,19 +760,11 @@
|
| }
|
|
|
| EffectControlLinearizer::ValueEffectControl
|
| -EffectControlLinearizer::LowerObjectIsSmi(Node* node, Node* effect,
|
| - Node* control) {
|
| - Node* value = node->InputAt(0);
|
| - value = ObjectIsSmi(value);
|
| - return ValueEffectControl(value, effect, control);
|
| -}
|
| -
|
| -EffectControlLinearizer::ValueEffectControl
|
| EffectControlLinearizer::LowerObjectIsString(Node* node, Node* effect,
|
| Node* control) {
|
| Node* value = node->InputAt(0);
|
|
|
| - Node* check = ObjectIsSmi(value);
|
| + Node* check = graph()->NewNode(simplified()->ObjectIsSmi(), value);
|
| Node* branch =
|
| graph()->NewNode(common()->Branch(BranchHint::kFalse), check, control);
|
|
|
| @@ -861,7 +799,7 @@
|
| Node* control) {
|
| Node* value = node->InputAt(0);
|
|
|
| - Node* check = ObjectIsSmi(value);
|
| + Node* check = graph()->NewNode(simplified()->ObjectIsSmi(), value);
|
| Node* branch =
|
| graph()->NewNode(common()->Branch(BranchHint::kFalse), check, control);
|
|
|
| @@ -900,6 +838,7 @@
|
| EffectControlLinearizer::ValueEffectControl
|
| EffectControlLinearizer::AllocateHeapNumberWithValue(Node* value, Node* effect,
|
| Node* control) {
|
| + effect = graph()->NewNode(common()->BeginRegion(), effect);
|
| Node* result = effect = graph()->NewNode(
|
| simplified()->Allocate(NOT_TENURED),
|
| jsgraph()->Int32Constant(HeapNumber::kSize), effect, control);
|
| @@ -909,6 +848,7 @@
|
| effect = graph()->NewNode(
|
| simplified()->StoreField(AccessBuilder::ForHeapNumberValue()), result,
|
| value, effect, control);
|
| + result = effect = graph()->NewNode(common()->FinishRegion(), result, effect);
|
| return ValueEffectControl(result, effect, control);
|
| }
|
|
|
| @@ -934,22 +874,6 @@
|
| return graph()->NewNode(machine()->ChangeUint32ToFloat64(), value);
|
| }
|
|
|
| -Node* EffectControlLinearizer::ChangeSmiToInt32(Node* value) {
|
| - value = graph()->NewNode(machine()->WordSar(), value, SmiShiftBitsConstant());
|
| - if (machine()->Is64()) {
|
| - value = graph()->NewNode(machine()->TruncateInt64ToInt32(), value);
|
| - }
|
| - return value;
|
| -}
|
| -
|
| -Node* EffectControlLinearizer::ObjectIsSmi(Node* value) {
|
| - return graph()->NewNode(
|
| - machine()->WordEqual(),
|
| - graph()->NewNode(machine()->WordAnd(), value,
|
| - jsgraph()->IntPtrConstant(kSmiTagMask)),
|
| - jsgraph()->IntPtrConstant(kSmiTag));
|
| -}
|
| -
|
| Node* EffectControlLinearizer::SmiMaxValueConstant() {
|
| return jsgraph()->Int32Constant(Smi::kMaxValue);
|
| }
|
|
|