Igor Murashkin | 017efa8 | 2016-09-22 15:46:29 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #define LOG_TAG "NativeMethods" |
| 18 | |
| 19 | #define CLASS_NAME "benchmarks/MicroNative/java/NativeMethods" |
| 20 | |
| 21 | #include "JNIHelp.h" |
| 22 | #include "JniConstants.h" |
| 23 | |
| 24 | static void NativeMethods_emptyJniStaticSynchronizedMethod0(JNIEnv*, jclass) { } |
| 25 | static void NativeMethods_emptyJniSynchronizedMethod0(JNIEnv*, jclass) { } |
| 26 | |
| 27 | static JNINativeMethod gMethods_NormalOnly[] = { |
| 28 | NATIVE_METHOD(NativeMethods, emptyJniStaticSynchronizedMethod0, "()V"), |
| 29 | NATIVE_METHOD(NativeMethods, emptyJniSynchronizedMethod0, "()V"), |
| 30 | }; |
| 31 | |
| 32 | static void NativeMethods_emptyJniMethod0(JNIEnv*, jobject) { } |
| 33 | static void NativeMethods_emptyJniMethod6(JNIEnv*, jobject, int, int, int, int, int, int) { } |
| 34 | static void NativeMethods_emptyJniMethod6L(JNIEnv*, jobject, jobject, jarray, jarray, jobject, |
| 35 | jarray, jarray) { } |
| 36 | static void NativeMethods_emptyJniStaticMethod6L(JNIEnv*, jclass, jobject, jarray, jarray, jobject, |
| 37 | jarray, jarray) { } |
| 38 | |
| 39 | static void NativeMethods_emptyJniStaticMethod0(JNIEnv*, jclass) { } |
| 40 | static void NativeMethods_emptyJniStaticMethod6(JNIEnv*, jclass, int, int, int, int, int, int) { } |
| 41 | |
| 42 | static JNINativeMethod gMethods[] = { |
| 43 | NATIVE_METHOD(NativeMethods, emptyJniMethod0, "()V"), |
| 44 | NATIVE_METHOD(NativeMethods, emptyJniMethod6, "(IIIIII)V"), |
| 45 | NATIVE_METHOD(NativeMethods, emptyJniMethod6L, "(Ljava/lang/String;[Ljava/lang/String;[[ILjava/lang/Object;[Ljava/lang/Object;[[[[Ljava/lang/Object;)V"), |
| 46 | NATIVE_METHOD(NativeMethods, emptyJniStaticMethod6L, "(Ljava/lang/String;[Ljava/lang/String;[[ILjava/lang/Object;[Ljava/lang/Object;[[[[Ljava/lang/Object;)V"), |
| 47 | NATIVE_METHOD(NativeMethods, emptyJniStaticMethod0, "()V"), |
| 48 | NATIVE_METHOD(NativeMethods, emptyJniStaticMethod6, "(IIIIII)V"), |
| 49 | }; |
| 50 | |
| 51 | static void NativeMethods_emptyJniMethod0_Fast(JNIEnv*, jobject) { } |
| 52 | static void NativeMethods_emptyJniMethod6_Fast(JNIEnv*, jobject, int, int, int, int, int, int) { } |
| 53 | static void NativeMethods_emptyJniMethod6L_Fast(JNIEnv*, jobject, jobject, jarray, jarray, jobject, |
| 54 | jarray, jarray) { } |
| 55 | static void NativeMethods_emptyJniStaticMethod6L_Fast(JNIEnv*, jclass, jobject, jarray, jarray, |
| 56 | jobject, jarray, jarray) { } |
| 57 | |
| 58 | static void NativeMethods_emptyJniStaticMethod0_Fast(JNIEnv*, jclass) { } |
| 59 | static void NativeMethods_emptyJniStaticMethod6_Fast(JNIEnv*, jclass, int, int, int, int, int, int) { } |
| 60 | |
| 61 | static JNINativeMethod gMethods_Fast[] = { |
| 62 | NATIVE_METHOD(NativeMethods, emptyJniMethod0_Fast, "()V"), |
| 63 | NATIVE_METHOD(NativeMethods, emptyJniMethod6_Fast, "(IIIIII)V"), |
| 64 | NATIVE_METHOD(NativeMethods, emptyJniMethod6L_Fast, "(Ljava/lang/String;[Ljava/lang/String;[[ILjava/lang/Object;[Ljava/lang/Object;[[[[Ljava/lang/Object;)V"), |
| 65 | NATIVE_METHOD(NativeMethods, emptyJniStaticMethod6L_Fast, "(Ljava/lang/String;[Ljava/lang/String;[[ILjava/lang/Object;[Ljava/lang/Object;[[[[Ljava/lang/Object;)V"), |
| 66 | NATIVE_METHOD(NativeMethods, emptyJniStaticMethod0_Fast, "()V"), |
| 67 | NATIVE_METHOD(NativeMethods, emptyJniStaticMethod6_Fast, "(IIIIII)V"), |
| 68 | }; |
| 69 | |
| 70 | static void NativeMethods_emptyJniStaticMethod0_Critical() { } |
| 71 | static void NativeMethods_emptyJniStaticMethod6_Critical(int, int, int, int, int, int) { } |
| 72 | |
| 73 | static JNINativeMethod gMethods_Critical[] = { |
| 74 | NATIVE_METHOD(NativeMethods, emptyJniStaticMethod0_Critical, "()V"), |
| 75 | NATIVE_METHOD(NativeMethods, emptyJniStaticMethod6_Critical, "(IIIIII)V"), |
| 76 | }; |
| 77 | |
| 78 | void register_micro_native_methods(JNIEnv* env) { |
| 79 | jniRegisterNativeMethods(env, CLASS_NAME, gMethods_NormalOnly, NELEM(gMethods_NormalOnly)); |
| 80 | jniRegisterNativeMethods(env, CLASS_NAME, gMethods, NELEM(gMethods)); |
| 81 | jniRegisterNativeMethods(env, CLASS_NAME, gMethods_Fast, NELEM(gMethods_Fast)); |
| 82 | jniRegisterNativeMethods(env, CLASS_NAME, gMethods_Critical, NELEM(gMethods_Critical)); |
| 83 | } |