Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Finalize story for reflection roots #5001

Open
MichalStrehovsky opened this issue Nov 23, 2017 · 2 comments
Open

Finalize story for reflection roots #5001

MichalStrehovsky opened this issue Nov 23, 2017 · 2 comments
Milestone

Comments

@MichalStrehovsky
Copy link
Member

The compiler currently supports a weird dialect of RD.XML (it's far from a proper subset) to describe dynamic behavior of the app. Placing full RD.XML support into the compiler is not feasible (as it requires whole program analysis).

We should explore:

  • Recognizing directives recognized by Mono linker
  • A proper subset of RD.XML
  • Something else?
@MichalStrehovsky MichalStrehovsky added this to the Preview milestone Nov 23, 2017
tonerdo added a commit to tonerdo/corert that referenced this issue Nov 21, 2018
tonerdo added a commit to tonerdo/corert that referenced this issue Nov 24, 2018
jkotas pushed a commit that referenced this issue Dec 17, 2018
* add support for stloc, ldloc, pop and dup (#5011)

* add support for not and neg opcodes (#5011)

* add preliminary support for conv.* opcodes (#5011)

* add preliminary support for comparison opcodes (#5011)

* rename StackItem *IntPtr methods to *NativeInt (#5011)

* add preliminary support for conversion opcodes (#5011)

* add implementation for bitwise shift opcodes (#5001)

* use checked blocks for overflow conversions (#5011)

* make improvements to interpreter code (#5011)

* use IsVoid to check for voidness of method return type (#5011)

* switch to switch statements where possible (#5011)

* add unchecked variant of StackItem As* methods (#5011)

* some code enhancements

* ensure correct behaviour for signed and unsigned numbers (#5011)

* specifically check for unsigned comparison opcodes (#5011)
@MichalStrehovsky
Copy link
Member Author

Bunch of work went in recently to limit the number of times people have to deal with RD.XML by default. See #6820, #6987, and #7143. E.g. the ASP.NET Sample we have in the repo now runs without any RD.XML.

@Suchiman
Copy link
Contributor

Suchiman commented Jun 30, 2019

Also the error message CoreRT emits will lead you down the wrong path.
E.g.

Unhandled Exception:
EETypeRva:0x0075BB30(System.Reflection.MissingRuntimeArtifactException): MakeGenericMethod()
cannot create this generic method instantiation because the instantiation was not metadata-enabled:
'System.GC.AllocateArray<System.Byte>(System.Int32)'
For more information, please visit http://go.microsoft.com/fwlink/?LinkID=616868

The link will then feed you with

<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
  <Application>
    <Type Name="System.GC">
      <MethodInstantiation Name="AllocateArray" Arguments="System.Byte" Dynamic="Required" />
    </Type>
  </Application>
</Directives>

which then causes this helpful message to popup during build

Unhandled Exception: System.NotSupportedException: Specified method is not supported.

which is because it only ever expects <Assembly> below <Application>, so if you wrap it in <Assembly> then, it blows up because it only supports <Method>, not <MethodInstantiation>...

Managed to reverse engineer the correct incarnation

<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
  <Application>
    <Assembly Name="System.Private.CoreLib">
      <Type Name="System.GC" Dynamic="Required All">
        <Method Name="AllocateArray" Dynamic="Required All">
          <GenericArgument Name="System.Byte" />
        </Method>
      </Type>
    </Assembly>
  </Application>
</Directives>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants