Skip to content

Array enumerators are not preinitialized anymore #82993

Closed
@MichalStrehovsky

Description

@MichalStrehovsky

Noticed this by accident:
Hello world before #82751: ILC: Preinitialized 183 types out of 266.
After: ILC: Preinitialized 105 types out of 266.

  ILC: Could not preinitialize '[S.P.CoreLib]System.SZGenericArrayEnumerator`1<System.Collections.Generic.LowLevelDicti
  onary`2+Entry<System.RuntimeTypeHandle,Internal.TypeSystem.TypeDesc>>': Method '[S.P.CoreLib]System.SZGenericArrayEnu
  meratorBase..ctor(Array)', opcode 'stfld' Reference field

Previously, we were storing endIndex separately and passed a null array to the empty enumerator. Now we store an actual object reference and that aborts the optimization. Maybe we could lift that in the interpreter but that might open a can of worms.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions