Invoke <clinit> where necessary.

This lets us run Long.toString and friends for integral types, though
we'll need a libcore hack to avoid ThreadLocals for the time being.

Change-Id: I04bba5914f1b7d00e4917922e65b9c27302a59ff
diff --git a/src/jni_internal.cc b/src/jni_internal.cc
index bd1ccec..ef15e8e 100644
--- a/src/jni_internal.cc
+++ b/src/jni_internal.cc
@@ -196,28 +196,8 @@
 
 JValue InvokeWithArgArray(ScopedJniThreadState& ts, Object* receiver,
                           Method* method, byte* args) {
-  Thread* self = ts.Self();
-
-  // Push a transition back into managed code onto the linked list in thread
-  CHECK_EQ(Thread::kRunnable, self->GetState());
-  NativeToManagedRecord record;
-  self->PushNativeToManagedRecord(&record);
-
-  // Call the invoke stub associated with the method
-  // Pass everything as arguments
-  const Method::InvokeStub* stub = method->GetInvokeStub();
   JValue result;
-
-  if (method->HasCode() && stub != NULL) {
-    (*stub)(method, receiver, self, args, &result);
-  } else {
-    LOG(WARNING) << "Not invoking method with no associated code: "
-                 << PrettyMethod(method);
-    result.j = 0;
-  }
-
-  // Pop transition
-  self->PopNativeToManagedRecord(record);
+  method->Invoke(ts.Self(), receiver, args, &result);
   return result;
 }