summaryrefslogtreecommitdiff
path: root/compiler/jni/jni_compiler_test.cc
diff options
context:
space:
mode:
author Igor Murashkin <iam@google.com> 2016-10-20 14:41:18 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2016-10-20 14:41:18 +0000
commit024662a3102df92fabf4f40d9ec40976f8e20c5d (patch)
tree248a072ebfa8e3a7897ad08f819456f28e47c0bc /compiler/jni/jni_compiler_test.cc
parent4a4ff643b629b268787fb97648116e1ac391f53b (diff)
parentaf1e2990cd1406a0fb7cba1d2e208208e950e413 (diff)
Merge changes I16f8b7ec,I075bbf55
* changes: jni: Support @FastNative methods that return objects Revert "jni: Disable FastNative path for methods returning objects"
Diffstat (limited to 'compiler/jni/jni_compiler_test.cc')
-rw-r--r--compiler/jni/jni_compiler_test.cc18
1 files changed, 6 insertions, 12 deletions
diff --git a/compiler/jni/jni_compiler_test.cc b/compiler/jni/jni_compiler_test.cc
index afb8fce8d7..ca1dc693eb 100644
--- a/compiler/jni/jni_compiler_test.cc
+++ b/compiler/jni/jni_compiler_test.cc
@@ -387,8 +387,7 @@ jobject JniCompilerTest::class_loader_;
// Test the normal compiler and normal generic JNI only.
// The following features are unsupported in @FastNative:
// 1) JNI stubs (lookup via dlsym) when methods aren't explicitly registered
-// 2) Returning objects from the JNI function
-// 3) synchronized keyword
+// 2) synchronized keyword
// -- TODO: We can support (1) if we remove the mutator lock assert during stub lookup.
# define JNI_TEST_NORMAL_ONLY(TestName) \
TEST_F(JniCompilerTest, TestName ## NormalCompiler) { \
@@ -826,8 +825,7 @@ void JniCompilerTest::CompileAndRunIntObjectObjectMethodImpl() {
gJava_MyClassNatives_fooIOO_calls[gCurrentJni] = 0;
}
-// TODO: Maybe. @FastNative support for returning Objects?
-JNI_TEST_NORMAL_ONLY(CompileAndRunIntObjectObjectMethod)
+JNI_TEST(CompileAndRunIntObjectObjectMethod)
int gJava_MyClassNatives_fooSII_calls[kJniKindCount] = {};
jint Java_MyClassNatives_fooSII(JNIEnv* env ATTRIBUTE_UNUSED,
@@ -1047,8 +1045,7 @@ void JniCompilerTest::CompileAndRunStaticIntObjectObjectMethodImpl() {
gJava_MyClassNatives_fooSIOO_calls[gCurrentJni] = 0;
}
-// TODO: Maybe. @FastNative support for returning Objects?
-JNI_TEST_NORMAL_ONLY(CompileAndRunStaticIntObjectObjectMethod)
+JNI_TEST(CompileAndRunStaticIntObjectObjectMethod)
int gJava_MyClassNatives_fooSSIOO_calls[kJniKindCount] = {};
jobject Java_MyClassNatives_fooSSIOO(JNIEnv*, jclass klass, jint x, jobject y, jobject z) {
@@ -1216,8 +1213,7 @@ void JniCompilerTest::ReturnGlobalRefImpl() {
EXPECT_TRUE(env_->IsSameObject(result, jobj_));
}
-// TODO: Maybe. @FastNative support for returning objects?
-JNI_TEST_NORMAL_ONLY(ReturnGlobalRef)
+JNI_TEST(ReturnGlobalRef)
jint local_ref_test(JNIEnv* env, jobject thisObj, jint x) {
// Add 10 local references
@@ -1357,8 +1353,7 @@ void JniCompilerTest::UpcallReturnTypeChecking_InstanceImpl() {
CurrentJniStringSuffix() + "() with CallStaticObjectMethodV");
}
-// TODO: Maybe support returning objects for @FastNative?
-JNI_TEST_NORMAL_ONLY(UpcallReturnTypeChecking_Instance)
+JNI_TEST(UpcallReturnTypeChecking_Instance)
void JniCompilerTest::UpcallReturnTypeChecking_StaticImpl() {
SetUpForTest(true, "staticMethodThatShouldReturnClass", "()Ljava/lang/Class;",
@@ -1385,8 +1380,7 @@ void JniCompilerTest::UpcallReturnTypeChecking_StaticImpl() {
CurrentJniStringSuffix() + "() with CallObjectMethodV");
}
-// TODO: Maybe support returning objects for @FastNative?
-JNI_TEST_NORMAL_ONLY(UpcallReturnTypeChecking_Static)
+JNI_TEST(UpcallReturnTypeChecking_Static)
// This should take jclass, but we're imitating a bug pattern.
void Java_MyClassNatives_instanceMethodThatShouldTakeClass(JNIEnv*, jobject, jclass) {