riscv64: Disable Nterp so that zygote doesn't SIGILL at boot.
This started to happen after https://r.android.com/2537050, which
introduced initial support for Nterp in ART, but left all stubs
unimplemented (crashing with SIGILL on execution).
Bug: 271573990
Test: make sure zygote does not SIGILL at boot:
$ lunch aosp_cf_riscv64_phone-userdebug && m
$ launch_cvd --gpu_mode=drm_virgl
# grep logcat for SIGILL (in zygote64 process), observe none
Change-Id: I1ac53b57d66414d56b10cd3abb5ae8c25b42c05d
diff --git a/runtime/interpreter/mterp/nterp_impl.cc b/runtime/interpreter/mterp/nterp_impl.cc
index 98b8d6d..f2a9855 100644
--- a/runtime/interpreter/mterp/nterp_impl.cc
+++ b/runtime/interpreter/mterp/nterp_impl.cc
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#include "arch/instruction_set.h"
#include "interpreter/interpreter_common.h"
#include "nterp.h"
@@ -25,7 +26,10 @@
namespace interpreter {
-bool IsNterpSupported() { return !kPoisonHeapReferences && kReserveMarkingRegister; }
+bool IsNterpSupported() {
+ return !kPoisonHeapReferences && kReserveMarkingRegister &&
+ kRuntimeISA != InstructionSet::kRiscv64;
+}
bool CanRuntimeUseNterp() REQUIRES_SHARED(Locks::mutator_lock_) {
Runtime* runtime = Runtime::Current();