jni: Punt to generic JNI for mips
Preopting dex the bootclasspath causes dex2oat to crash for MIPS builds.
Disable JNI compiler for MIPS until it supports @CriticalNative.
Test: lunch aosp_mips-eng && make && make test-art-host
Bug: 31743474
Change-Id: I802f1e61863c4bb54a1bd884a4c9ce9a75bab62b
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index a149c07..2ead092 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -595,9 +595,14 @@
: optimizer::DexToDexCompilationLevel::kRequired);
}
} else if ((access_flags & kAccNative) != 0) {
- // Are we extracting only and have support for generic JNI down calls?
- if (!driver->GetCompilerOptions().IsJniCompilationEnabled() &&
- InstructionSetHasGenericJniStub(driver->GetInstructionSet())) {
+ const InstructionSet instruction_set = driver->GetInstructionSet();
+ const bool use_generic_jni =
+ // Are we extracting only and have support for generic JNI down calls?
+ (!driver->GetCompilerOptions().IsJniCompilationEnabled() &&
+ InstructionSetHasGenericJniStub(instruction_set)) ||
+ // Always punt to generic JNI for MIPS because of no support for @CriticalNative. b/31743474
+ (instruction_set == kMips || instruction_set == kMips64);
+ if (use_generic_jni) {
// Leaving this empty will trigger the generic JNI version
} else {
// Look-up the ArtMethod associated with this code_item (if any)