Don't run managed code until the runtime has started.
Previously we ended up running managed code because JNI was
triggering class initializers to run. This was triggered by
both Thread::CreatePeer() and InitBoxingMethods().
When these initializers were prevented from running, other
- Creating the peer for the main thread was relying on
ThreadGroup.<clinit> to assign the built-in thread groups.
- Creating the boxed methods caused class initialization of
the primitive wrapper classes; these need to be initialized
before Thread.<clinit> is run to avoid a crash in its own
This change works around those breaks by splitting thread peer
creation into two parts (allocation and running <init>) and
by calling InitBoxingMethods() during runtime start.
6 files changed