JNI/x86: Fix art_jni_unlock_object_no_inline.
Fix a small issue from
https://android-review.googlesource.com/1903379
for x86. (The same was done correctly for x86-64.)
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 172332525
Change-Id: Ib8be2de88035d4d39738ca3076902a2e2b7d4461
diff --git a/compiler/jni/jni_compiler_test.cc b/compiler/jni/jni_compiler_test.cc
index abff4b6..0a1f017 100644
--- a/compiler/jni/jni_compiler_test.cc
+++ b/compiler/jni/jni_compiler_test.cc
@@ -845,6 +845,10 @@
return x | y;
}
+void InitEntryPoints(JniEntryPoints* jpoints,
+ QuickEntryPoints* qpoints,
+ bool monitor_jni_entry_exit);
+
void JniCompilerTest::CompileAndRun_fooJJ_synchronizedImpl() {
SetUpForTest(false, "fooJJ_synchronized", "(JJ)J",
CURRENT_JNI_WRAPPER(Java_MyClassNatives_fooJJ_synchronized));
@@ -898,6 +902,22 @@
lock_word = GetLockWord(jobj_);
ASSERT_EQ(lock_word.GetState(), LockWord::kFatLocked);
+ // Exercise locking/unocking for "fat-locked" through the "no_inline" path.
+ // These entrypoints are selected with verbose "systrace_lock_logging".
+ Thread* self = Thread::Current();
+ ASSERT_FALSE(gLogVerbosity.systrace_lock_logging);
+ gLogVerbosity.systrace_lock_logging = true;
+ InitEntryPoints(&self->tlsPtr_.jni_entrypoints,
+ &self->tlsPtr_.quick_entrypoints,
+ self->ReadFlag(ThreadFlag::kMonitorJniEntryExit));
+ result = env_->CallNonvirtualLongMethod(jobj_, jklass_, jmethod_, a, b);
+ EXPECT_EQ(a | b, result);
+ EXPECT_EQ(5, gJava_MyClassNatives_fooJJ_synchronized_calls[gCurrentJni]);
+ gLogVerbosity.systrace_lock_logging = false;
+ InitEntryPoints(&self->tlsPtr_.jni_entrypoints,
+ &self->tlsPtr_.quick_entrypoints,
+ self->ReadFlag(ThreadFlag::kMonitorJniEntryExit));
+
gJava_MyClassNatives_fooJJ_synchronized_calls[gCurrentJni] = 0;
}