Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Add support for array interfaces - #927

Merged
jkotas merged 1 commit into
dotnet:masterfrom
MichalStrehovsky:arrayInterfaces
Mar 4, 2016
Merged

jkotas merged 1 commit into
dotnet:masterfrom
MichalStrehovsky:arrayInterfaces

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member
  • GetClosestMetadataType type was one of the methods we ported from
    NUTC. In NUTC, it takes advantage of arrays having
    System.Array<T> as their base type. The CoreRT type system
    derives arrays off System.Array. The implementation of
    GetClosestMetadataType needed tweaking.
  • Use GetClosestMedatadataType where appropriate
  • Be more rigorous at tracking constructed arrays.
  • Runtime workaround to make EEType::GetArrayBaseType work.

Fixes #915.

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

@jkotas @davidwrighton @nattress PTAL

I was basically just hacking on it until it worked. Hence the [WIP] tag on the pull request.

Comment thread src/JitInterface/src/CorInfoImpl.cs Outdated
pResult.lookup.constLookup.handle = (CORINFO_GENERIC_STRUCT_*)ObjectToHandle(_compilation.NodeFactory.NecessaryTypeSymbol(td));
if (td.IsArray && !td.IsSzArray)
{
// TODO: figure out how JIT can tell us that this call to embedGenericHandle

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a new CORINFO_TOKENKIND_XXX flag

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I file a RyuJIT issue after this is merged?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having a tracking issue to clean things up never hurts.

I have created dotnet/coreclr#3341 with the required change.

return type.BaseType;
// The implementation for this should mirror GetClosestMetadataType
throw new NotImplementedException();
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're going to just throw NotImplementedException here, perhaps this function shouldn't exist. Are there users of this api?

@MichalStrehovsky
MichalStrehovsky force-pushed the arrayInterfaces branch 2 times, most recently from db7c60b to 60c6e0e Compare March 4, 2016 09:59
@MichalStrehovsky

Copy link
Copy Markdown
Member Author

I addressed the original concern of common type system knowing about ArrayOfT by moving GetClosestMetadataType to the compiler.

* `GetClosestMetadataType` type was one of the methods we ported from
NUTC. In NUTC, it takes advantage of arrays having
`System.Array&lt;T&gt;` as their base type. The CoreRT type system
derives arrays off `System.Array`. The implementation of
`GetClosestMetadataType` needed tweaking.
* `Use GetClosestMedatadataType` where appropriate
* Be more rigorous at tracking constructed arrays.
* Runtime workaround to make EEType::GetArrayBaseType work.
@MichalStrehovsky MichalStrehovsky changed the title [WIP] Add support for array interfaces Add support for array interfaces Mar 4, 2016
@jkotas

jkotas commented Mar 4, 2016

Copy link
Copy Markdown
Member

LGTM

jkotas added a commit that referenced this pull request Mar 4, 2016
@jkotas
jkotas merged commit ae3f0cd into dotnet:master Mar 4, 2016
@MichalStrehovsky
MichalStrehovsky deleted the arrayInterfaces branch March 4, 2016 16:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants