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
code broke:
 - 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
   initializer.

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.

Change-Id: I44be7170ce08451adf876ee73cba0f1f66d5a59e
6 files changed
tree: ccf8c190b8b4daf799e17ec8b04b77edfc5c72ff
  1. build/
  2. oat_process/
  3. oat_runtime/
  4. src/
  5. test/
  6. tools/
  7. Android.mk