diff options
| author | 2018-02-22 15:03:05 -0800 | |
|---|---|---|
| committer | 2018-02-22 15:28:50 -0800 | |
| commit | 06537f7a6f0772cbef08bdded933828378b2d32a (patch) | |
| tree | e1505a3dea19d6585973d2db0d9dd6988bf0f03d /runtime/native/java_lang_System.cc | |
| parent | a502c7202f56b8f5f2c5de567359fa7f6bab406f (diff) | |
native: Cleanup jni usage code
Make the C++ signature consistent with the JNI descriptor by using the
same type as the descriptor whenever possible.
e.g. "()Ljava/lang/String;" should actually be "jstring fn(JNIEnv*,jobject)"
instead of "jobject fn(JNIEnv*,jobject)".
Bug: 35325126
Change-Id: I72318525fc3b18b013b8d6fa604d8dd6b5dd4400
Test: make -j32 test-art-host # and also manually that it boots
Diffstat (limited to 'runtime/native/java_lang_System.cc')
| -rw-r--r-- | runtime/native/java_lang_System.cc | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/runtime/native/java_lang_System.cc b/runtime/native/java_lang_System.cc index 553cbeaabc..390f026588 100644 --- a/runtime/native/java_lang_System.cc +++ b/runtime/native/java_lang_System.cc @@ -182,50 +182,55 @@ inline void System_arraycopyTUnchecked(JNIEnv* env, jobject javaSrc, jint srcPos AsPrimitiveArray<T>(dstArray)->Memmove(dstPos, AsPrimitiveArray<T>(srcArray), srcPos, count); } -static void System_arraycopyCharUnchecked(JNIEnv* env, jclass, jobject javaSrc, jint srcPos, - jobject javaDst, jint dstPos, jint count) { +static void System_arraycopyCharUnchecked(JNIEnv* env, jclass, jcharArray javaSrc, jint srcPos, + jcharArray javaDst, jint dstPos, jint count) { System_arraycopyTUnchecked<mirror::CharArray, Primitive::kPrimChar>(env, javaSrc, srcPos, javaDst, dstPos, count); } -static void System_arraycopyByteUnchecked(JNIEnv* env, jclass, jobject javaSrc, jint srcPos, - jobject javaDst, jint dstPos, jint count) { +static void System_arraycopyByteUnchecked(JNIEnv* env, jclass, jbyteArray javaSrc, jint srcPos, + jbyteArray javaDst, jint dstPos, jint count) { System_arraycopyTUnchecked<mirror::ByteArray, Primitive::kPrimByte>(env, javaSrc, srcPos, javaDst, dstPos, count); } -static void System_arraycopyShortUnchecked(JNIEnv* env, jclass, jobject javaSrc, jint srcPos, - jobject javaDst, jint dstPos, jint count) { +static void System_arraycopyShortUnchecked(JNIEnv* env, jclass, jshortArray javaSrc, jint srcPos, + jshortArray javaDst, jint dstPos, jint count) { System_arraycopyTUnchecked<mirror::ShortArray, Primitive::kPrimShort>(env, javaSrc, srcPos, javaDst, dstPos, count); } -static void System_arraycopyIntUnchecked(JNIEnv* env, jclass, jobject javaSrc, jint srcPos, - jobject javaDst, jint dstPos, jint count) { +static void System_arraycopyIntUnchecked(JNIEnv* env, jclass, jintArray javaSrc, jint srcPos, + jintArray javaDst, jint dstPos, jint count) { System_arraycopyTUnchecked<mirror::IntArray, Primitive::kPrimInt>(env, javaSrc, srcPos, javaDst, dstPos, count); } -static void System_arraycopyLongUnchecked(JNIEnv* env, jclass, jobject javaSrc, jint srcPos, - jobject javaDst, jint dstPos, jint count) { +static void System_arraycopyLongUnchecked(JNIEnv* env, jclass, jlongArray javaSrc, jint srcPos, + jlongArray javaDst, jint dstPos, jint count) { System_arraycopyTUnchecked<mirror::LongArray, Primitive::kPrimLong>(env, javaSrc, srcPos, javaDst, dstPos, count); } -static void System_arraycopyFloatUnchecked(JNIEnv* env, jclass, jobject javaSrc, jint srcPos, - jobject javaDst, jint dstPos, jint count) { +static void System_arraycopyFloatUnchecked(JNIEnv* env, jclass, jfloatArray javaSrc, jint srcPos, + jfloatArray javaDst, jint dstPos, jint count) { System_arraycopyTUnchecked<mirror::FloatArray, Primitive::kPrimFloat>(env, javaSrc, srcPos, javaDst, dstPos, count); } -static void System_arraycopyDoubleUnchecked(JNIEnv* env, jclass, jobject javaSrc, jint srcPos, - jobject javaDst, jint dstPos, jint count) { +static void System_arraycopyDoubleUnchecked(JNIEnv* env, jclass, jdoubleArray javaSrc, jint srcPos, + jdoubleArray javaDst, jint dstPos, jint count) { System_arraycopyTUnchecked<mirror::DoubleArray, Primitive::kPrimDouble>(env, javaSrc, srcPos, javaDst, dstPos, count); } -static void System_arraycopyBooleanUnchecked(JNIEnv* env, jclass, jobject javaSrc, jint srcPos, - jobject javaDst, jint dstPos, jint count) { +static void System_arraycopyBooleanUnchecked(JNIEnv* env, + jclass, + jbooleanArray javaSrc, + jint srcPos, + jbooleanArray javaDst, + jint dstPos, + jint count) { System_arraycopyTUnchecked<mirror::BooleanArray, Primitive::kPrimBoolean>(env, javaSrc, srcPos, javaDst, dstPos, count); } |