Commit 7f441a5e authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Instance types don't change, so no need to watch for side effects.

The instance type of an object cannot change, only the concrete map
might. So when searching for an instance type witness, we don't need
to pay attention to potentially side-effecting nodes.

R=mstarzinger@chromium.org

Review-Url: https://codereview.chromium.org/2652893011
Cr-Commit-Position: refs/heads/master@{#42699}
parent 169b8567
...@@ -915,27 +915,15 @@ bool HasInstanceTypeWitness(Node* receiver, Node* effect, ...@@ -915,27 +915,15 @@ bool HasInstanceTypeWitness(Node* receiver, Node* effect,
} }
return true; return true;
} }
switch (dominator->opcode()) { // The instance type doesn't change for JSReceiver values, so we
case IrOpcode::kStoreField: { // don't need to pay attention to potentially side-effecting nodes
FieldAccess const& access = FieldAccessOf(dominator->op()); // here. Strings and internal structures like FixedArray and
if (access.base_is_tagged == kTaggedBase && // FixedDoubleArray are weird here, but we don't use this function then.
access.offset == HeapObject::kMapOffset) { DCHECK_LE(FIRST_JS_RECEIVER_TYPE, instance_type);
return false; DCHECK_EQ(1, dominator->op()->EffectOutputCount());
} if (dominator->op()->EffectInputCount() != 1) {
break; // Didn't find any appropriate CheckMaps node.
} return false;
case IrOpcode::kStoreElement:
case IrOpcode::kStoreTypedElement:
break;
default: {
DCHECK_EQ(1, dominator->op()->EffectOutputCount());
if (dominator->op()->EffectInputCount() != 1 ||
!dominator->op()->HasProperty(Operator::kNoWrite)) {
// Didn't find any appropriate CheckMaps node.
return false;
}
break;
}
} }
dominator = NodeProperties::GetEffectInput(dominator); dominator = NodeProperties::GetEffectInput(dominator);
} }
......
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