Allow ArtMethod::Invoke in unstarted runtimes.
Change-Id: I0141f4daef4751589d03d27484eb65c811b14f27
diff --git a/runtime/mirror/art_method.cc b/runtime/mirror/art_method.cc
index 7453d4d..4275f25 100644
--- a/runtime/mirror/art_method.cc
+++ b/runtime/mirror/art_method.cc
@@ -287,9 +287,11 @@
Runtime* runtime = Runtime::Current();
// Call the invoke stub, passing everything as arguments.
if (UNLIKELY(!runtime->IsStarted())) {
- LOG(INFO) << "Not invoking " << PrettyMethod(this) << " for a runtime that isn't started";
- if (result != NULL) {
- result->SetJ(0);
+ if (IsStatic()) {
+ art::interpreter::EnterInterpreterFromInvoke(self, this, nullptr, args, result);
+ } else {
+ Object* receiver = reinterpret_cast<StackReference<Object>*>(&args[0])->AsMirrorPtr();
+ art::interpreter::EnterInterpreterFromInvoke(self, this, receiver, args + 1, result);
}
} else {
const bool kLogInvocationStartAndReturn = false;