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

Support eager static constructors #471

Closed
MichalStrehovsky opened this issue Dec 3, 2015 · 0 comments
Closed

Support eager static constructors #471

MichalStrehovsky opened this issue Dec 3, 2015 · 0 comments
Assignees
Milestone

Comments

@MichalStrehovsky
Copy link
Member

Add support for static constructors that run at the module initialization time.

We should take the ordering algorithm from RhBind.

Depends on #469.
Prerequisite for #288.

@gkhanna79 gkhanna79 added this to the January milestone Dec 11, 2015
MichalStrehovsky added a commit to MichalStrehovsky/corert that referenced this issue Feb 19, 2016
This looks like a lot of code just to support a rarely used feature,
but a lot of this is plumbing that will let me delete some existing code
in a subsequent commit. Some of this will also be needed to support
the various preinitialized data attributes/general type preinitialization.

* Redirecting uses of HasStaticConstructor to go through the TypeInitialization class (exposing higher level APIs "HasLazyCctor" and "HasEagerCctor")
* Emitting a new table with an array of eager class constructors
* Augmenting GC/nonGC/ThreadStatic and Method nodes to depend on an entry in the eager cctor table if the owning type has a cctor
* Startup code addition to iterate over the list of eager cctors and call them one by one

Reusable code:
* ArrayOfEmbeddedPointers: we have a buch of places where we just want an array of pointers. This will let us e.g. delete StringIndirectionNode.

Missing features: ordering the eager cctors. I want to think a bit about
how we parse custom attribute blobs before I implement that.

Fixes dotnet#471.
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

3 participants