Commit 1929f80a authored by jarin's avatar jarin Committed by Commit bot

[turbofan] Improve handling of TransitionElementsKind in load elimination.

We do not have to invalidate the abstract state if we are transitioning to
the object's map.

Review-Url: https://codereview.chromium.org/2510843002
Cr-Commit-Position: refs/heads/master@{#41053}
parent 04fee02e
...@@ -866,10 +866,15 @@ LoadElimination::AbstractState const* LoadElimination::ComputeLoopState( ...@@ -866,10 +866,15 @@ LoadElimination::AbstractState const* LoadElimination::ComputeLoopState(
} }
case IrOpcode::kTransitionElementsKind: { case IrOpcode::kTransitionElementsKind: {
Node* const object = NodeProperties::GetValueInput(current, 0); Node* const object = NodeProperties::GetValueInput(current, 0);
state = state->KillField( Node* const target_map = NodeProperties::GetValueInput(current, 2);
object, FieldIndexOf(HeapObject::kMapOffset), zone()); Node* const object_map = state->LookupField(
state = state->KillField( object, FieldIndexOf(HeapObject::kMapOffset));
object, FieldIndexOf(JSObject::kElementsOffset), zone()); if (target_map != object_map) {
state = state->KillField(
object, FieldIndexOf(HeapObject::kMapOffset), zone());
state = state->KillField(
object, FieldIndexOf(JSObject::kElementsOffset), zone());
}
break; break;
} }
case IrOpcode::kStoreField: { case IrOpcode::kStoreField: {
......
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