1 /*
2 * Copyright (C) 2009 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 /*
18 * Native implementation for the InstanceNonce class. See the test code
19 * in JniInstanceTest for more info.
20 */
21
22 #include <jni.h>
23
24 #include <stdbool.h>
25 #include <string.h>
26
27 #include "helper.h"
28
29 // public native void nop();
InstanceNonce_nop(JNIEnv * env,jobject this)30 static void InstanceNonce_nop(JNIEnv *env, jobject this) {
31 // This space intentionally left blank.
32 }
33
34 // public native void nopDlsym();
Java_android_jni_cts_InstanceNonce_nopDlsym(JNIEnv * env,jobject this)35 JNIEXPORT void Java_android_jni_cts_InstanceNonce_nopDlsym(JNIEnv *env,
36 jobject this) {
37 // This space intentionally left blank.
38 }
39
40 // @FastNative
41 // public native void nopFast();
InstanceNonce_nopFast(JNIEnv * env,jobject this)42 static void InstanceNonce_nopFast(JNIEnv *env, jobject this) {
43 // This space intentionally left blank.
44 }
45
46 // @FastNative
47 // public native void nopFastDlsym();
Java_android_jni_cts_InstanceNonce_nopFastDlsym(JNIEnv * env,jobject this)48 JNIEXPORT void Java_android_jni_cts_InstanceNonce_nopFastDlsym(JNIEnv *env,
49 jobject this) {
50 // This space intentionally left blank.
51 }
52
53 // public native boolean returnBoolean();
InstanceNonce_returnBoolean(JNIEnv * env,jobject this)54 static jboolean InstanceNonce_returnBoolean(JNIEnv *env, jobject this) {
55 return (jboolean) false;
56 }
57
58 // @FastNative
59 // public native boolean returnBooleanFast();
InstanceNonce_returnBooleanFast(JNIEnv * env,jobject this)60 static jboolean InstanceNonce_returnBooleanFast(JNIEnv *env, jobject this) {
61 return (jboolean) false;
62 }
63
64 // public native byte returnByte();
InstanceNonce_returnByte(JNIEnv * env,jobject this)65 static jbyte InstanceNonce_returnByte(JNIEnv *env, jobject this) {
66 return (jbyte) 123;
67 }
68
69 // @FastNative
70 // public native byte returnByteFast();
InstanceNonce_returnByteFast(JNIEnv * env,jobject this)71 static jbyte InstanceNonce_returnByteFast(JNIEnv *env, jobject this) {
72 return (jbyte) 123;
73 }
74
75 // public native short returnShort();
InstanceNonce_returnShort(JNIEnv * env,jobject this)76 static jshort InstanceNonce_returnShort(JNIEnv *env, jobject this) {
77 return (jshort) -12345;
78 }
79
80 // @FastNative
81 // public native short returnShortFast();
InstanceNonce_returnShortFast(JNIEnv * env,jobject this)82 static jshort InstanceNonce_returnShortFast(JNIEnv *env, jobject this) {
83 return (jshort) -12345;
84 }
85
86 // public native char returnChar();
InstanceNonce_returnChar(JNIEnv * env,jobject this)87 static jchar InstanceNonce_returnChar(JNIEnv *env, jobject this) {
88 return (jchar) 34567;
89 }
90
91 // @FastNative
92 // public native char returnCharFast();
InstanceNonce_returnCharFast(JNIEnv * env,jobject this)93 static jchar InstanceNonce_returnCharFast(JNIEnv *env, jobject this) {
94 return (jchar) 34567;
95 }
96
97 // public native int returnInt();
InstanceNonce_returnInt(JNIEnv * env,jobject this)98 static jint InstanceNonce_returnInt(JNIEnv *env, jobject this) {
99 return 12345678;
100 }
101
102 // @FastNative
103 // public native int returnIntFast();
InstanceNonce_returnIntFast(JNIEnv * env,jobject this)104 static jint InstanceNonce_returnIntFast(JNIEnv *env, jobject this) {
105 return 12345678;
106 }
107
108 // public native long returnLong();
InstanceNonce_returnLong(JNIEnv * env,jobject this)109 static jlong InstanceNonce_returnLong(JNIEnv *env, jobject this) {
110 return (jlong) -1098765432109876543LL;
111 }
112
113 // @FastNative
114 // public native long returnLongFast();
InstanceNonce_returnLongFast(JNIEnv * env,jobject this)115 static jlong InstanceNonce_returnLongFast(JNIEnv *env, jobject this) {
116 return (jlong) -1098765432109876543LL;
117 }
118
119 // public native float returnFloat();
InstanceNonce_returnFloat(JNIEnv * env,jobject this)120 static jfloat InstanceNonce_returnFloat(JNIEnv *env, jobject this) {
121 return (jfloat) -98765.4321F;
122 }
123
124 // @FastNative
125 // public native float returnFloatFast();
InstanceNonce_returnFloatFast(JNIEnv * env,jobject this)126 static jfloat InstanceNonce_returnFloatFast(JNIEnv *env, jobject this) {
127 return (jfloat) -98765.4321F;
128 }
129
130 // public native double returnDouble();
InstanceNonce_returnDouble(JNIEnv * env,jobject this)131 static jdouble InstanceNonce_returnDouble(JNIEnv *env, jobject this) {
132 return 12345678.9;
133 }
134
135 // @FastNative
136 // public native double returnDoubleFast();
InstanceNonce_returnDoubleFast(JNIEnv * env,jobject this)137 static jdouble InstanceNonce_returnDoubleFast(JNIEnv *env, jobject this) {
138 return 12345678.9;
139 }
140
141 // public native Object returnNull();
InstanceNonce_returnNull(JNIEnv * env,jobject this)142 static jobject InstanceNonce_returnNull(JNIEnv *env, jobject this) {
143 return NULL;
144 }
145
146 // @FastNative
147 // public native Object returnNullFast();
InstanceNonce_returnNullFast(JNIEnv * env,jobject this)148 static jobject InstanceNonce_returnNullFast(JNIEnv *env, jobject this) {
149 return NULL;
150 }
151
152 // public native String returnString();
InstanceNonce_returnString(JNIEnv * env,jobject this)153 static jstring InstanceNonce_returnString(JNIEnv *env, jobject this) {
154 return (*env)->NewStringUTF(env, "blort");
155 }
156
157 // @FastNative
158 // public native String returnStringFast();
InstanceNonce_returnStringFast(JNIEnv * env,jobject this)159 static jstring InstanceNonce_returnStringFast(JNIEnv *env, jobject this) {
160 return (*env)->NewStringUTF(env, "blort");
161 }
162
163 // public native short[] returnShortArray();
InstanceNonce_returnShortArray(JNIEnv * env,jobject this)164 static jshortArray InstanceNonce_returnShortArray(JNIEnv *env, jobject this) {
165 static jshort contents[] = { 10, 20, 30 };
166
167 jshortArray result = (*env)->NewShortArray(env, 3);
168
169 if (result == NULL) {
170 return NULL;
171 }
172
173 (*env)->SetShortArrayRegion(env, result, 0, 3, contents);
174 return result;
175 }
176
177 // @FastNative
178 // public native short[] returnShortArrayFast();
InstanceNonce_returnShortArrayFast(JNIEnv * env,jobject this)179 static jshortArray InstanceNonce_returnShortArrayFast(JNIEnv *env,
180 jobject this) {
181 return InstanceNonce_returnShortArray(env, this);
182 }
183
184 // public String[] returnStringArray();
InstanceNonce_returnStringArray(JNIEnv * env,jobject this)185 static jobjectArray InstanceNonce_returnStringArray(JNIEnv *env,
186 jobject this) {
187 static int indices[] = { 0, 50, 99 };
188 static const char *contents[] = { "blort", "zorch", "fizmo" };
189
190 jclass stringClass = (*env)->FindClass(env, "java/lang/String");
191
192 if ((*env)->ExceptionOccurred(env) != NULL) {
193 return NULL;
194 }
195
196 if (stringClass == NULL) {
197 throwException(env, "java/lang/AssertionError", "class String not found");
198 return NULL;
199 }
200
201 jobjectArray result = (*env)->NewObjectArray(env, 100, stringClass, NULL);
202
203 if (result == NULL) {
204 return NULL;
205 }
206
207 jsize i;
208 for (i = 0; i < 3; i++) {
209 jstring s = (*env)->NewStringUTF(env, contents[i]);
210
211 if (s == NULL) {
212 return NULL;
213 }
214
215 (*env)->SetObjectArrayElement(env, result, indices[i], s);
216
217 if ((*env)->ExceptionOccurred(env) != NULL) {
218 return NULL;
219 }
220 }
221
222 return result;
223 }
224
225 // @FastNative
226 // public String[] returnStringArrayFast();
InstanceNonce_returnStringArrayFast(JNIEnv * env,jobject this)227 static jobjectArray InstanceNonce_returnStringArrayFast(JNIEnv *env,
228 jobject this) {
229 return InstanceNonce_returnStringArray(env, this);
230 }
231
232 // public native Class returnThisClass();
InstanceNonce_returnThis(JNIEnv * env,jobject this)233 static jobject InstanceNonce_returnThis(JNIEnv *env, jobject this) {
234 return this;
235 }
236
237 // @FastNative
238 // public native Class returnThisClassFast();
InstanceNonce_returnThisFast(JNIEnv * env,jobject this)239 static jobject InstanceNonce_returnThisFast(JNIEnv *env, jobject this) {
240 return this;
241 }
242
243 // public native boolean takeBoolean(boolean v);
InstanceNonce_takeBoolean(JNIEnv * env,jobject this,jboolean v)244 static jboolean InstanceNonce_takeBoolean(JNIEnv *env, jobject this,
245 jboolean v) {
246 return v == false;
247 }
248
249 // @FastNative
250 // public native boolean takeBooleanFast(boolean v);
InstanceNonce_takeBooleanFast(JNIEnv * env,jobject this,jboolean v)251 static jboolean InstanceNonce_takeBooleanFast(JNIEnv *env, jobject this,
252 jboolean v) {
253 return v == false;
254 }
255
256 // public native boolean takeByte(byte v);
InstanceNonce_takeByte(JNIEnv * env,jobject this,jbyte v)257 static jboolean InstanceNonce_takeByte(JNIEnv *env, jobject this, jbyte v) {
258 return v == -99;
259 }
260
261 // @FastNative
262 // public native boolean takeByteFast(byte v);
InstanceNonce_takeByteFast(JNIEnv * env,jobject this,jbyte v)263 static jboolean InstanceNonce_takeByteFast(JNIEnv *env, jobject this,
264 jbyte v) {
265 return v == -99;
266 }
267
268 // public native boolean takeShort(short v);
InstanceNonce_takeShort(JNIEnv * env,jobject this,jshort v)269 static jboolean InstanceNonce_takeShort(JNIEnv *env, jobject this, jshort v) {
270 return v == 19991;
271 }
272
273 // @FastNative
274 // public native boolean takeShortFast(short v);
InstanceNonce_takeShortFast(JNIEnv * env,jobject this,jshort v)275 static jboolean InstanceNonce_takeShortFast(JNIEnv *env, jobject this,
276 jshort v) {
277 return v == 19991;
278 }
279
280 // public native boolean takeChar(char v);
InstanceNonce_takeChar(JNIEnv * env,jobject this,jchar v)281 static jboolean InstanceNonce_takeChar(JNIEnv *env, jobject this, jchar v) {
282 return v == 999;
283 }
284
285 // @FastNative
286 // public native boolean takeCharFast(char v);
InstanceNonce_takeCharFast(JNIEnv * env,jobject this,jchar v)287 static jboolean InstanceNonce_takeCharFast(JNIEnv *env, jobject this,
288 jchar v) {
289 return v == 999;
290 }
291
292 // public native boolean takeInt(int v);
InstanceNonce_takeInt(JNIEnv * env,jobject this,jint v)293 static jboolean InstanceNonce_takeInt(JNIEnv *env, jobject this, jint v) {
294 return v == -999888777;
295 }
296
297 // @FastNative
298 // public native boolean takeIntFast(int v);
InstanceNonce_takeIntFast(JNIEnv * env,jobject this,jint v)299 static jboolean InstanceNonce_takeIntFast(JNIEnv *env, jobject this, jint v) {
300 return v == -999888777;
301 }
302
303 // public native boolean takeLong(long v);
InstanceNonce_takeLong(JNIEnv * env,jobject this,jlong v)304 static jboolean InstanceNonce_takeLong(JNIEnv *env, jobject this, jlong v) {
305 return v == 999888777666555444LL;
306 }
307
308 // @FastNative
309 // public native boolean takeLongFast(long v);
InstanceNonce_takeLongFast(JNIEnv * env,jobject this,jlong v)310 static jboolean InstanceNonce_takeLongFast(JNIEnv *env, jobject this,
311 jlong v) {
312 return v == 999888777666555444LL;
313 }
314
315 // public native boolean takeFloat(float v);
InstanceNonce_takeFloat(JNIEnv * env,jobject this,jfloat v)316 static jboolean InstanceNonce_takeFloat(JNIEnv *env, jobject this, jfloat v) {
317 return v == -9988.7766F;
318 }
319
320 // @FastNative
321 // public native boolean takeFloatFast(float v);
InstanceNonce_takeFloatFast(JNIEnv * env,jobject this,jfloat v)322 static jboolean InstanceNonce_takeFloatFast(JNIEnv *env, jobject this,
323 jfloat v) {
324 return v == -9988.7766F;
325 }
326
327 // public native boolean takeDouble(double v);
InstanceNonce_takeDouble(JNIEnv * env,jobject this,jdouble v)328 static jboolean InstanceNonce_takeDouble(JNIEnv *env, jobject this,
329 jdouble v) {
330 return v == 999888777.666555;
331 }
332
333 // @FastNative
334 // public native boolean takeDoubleFast(double v);
InstanceNonce_takeDoubleFast(JNIEnv * env,jobject this,jdouble v)335 static jboolean InstanceNonce_takeDoubleFast(JNIEnv *env, jobject this,
336 jdouble v) {
337 return v == 999888777.666555;
338 }
339
340 // public native boolean takeNull(Object v);
InstanceNonce_takeNull(JNIEnv * env,jobject this,jobject v)341 static jboolean InstanceNonce_takeNull(JNIEnv *env, jobject this, jobject v) {
342 return v == NULL;
343 }
344
345 // @FastNative
346 // public native boolean takeNullFast(Object v);
InstanceNonce_takeNullFast(JNIEnv * env,jobject this,jobject v)347 static jboolean InstanceNonce_takeNullFast(JNIEnv *env, jobject this,
348 jobject v) {
349 return v == NULL;
350 }
351
352 // public native boolean takeString(String v);
InstanceNonce_takeString(JNIEnv * env,jobject this,jstring v)353 static jboolean InstanceNonce_takeString(JNIEnv *env, jobject this,
354 jstring v) {
355 if (v == NULL) {
356 return false;
357 }
358
359 const char *utf = (*env)->GetStringUTFChars(env, v, NULL);
360 jboolean result = (strcmp("fuzzbot", utf) == 0);
361
362 (*env)->ReleaseStringUTFChars(env, v, utf);
363 return result;
364 }
365
366 // @FastNative
367 // public native boolean takeStringFast(String v);
InstanceNonce_takeStringFast(JNIEnv * env,jobject this,jstring v)368 static jboolean InstanceNonce_takeStringFast(JNIEnv *env, jobject this,
369 jstring v) {
370 return InstanceNonce_takeString(env, this, v);
371 }
372
373 // public native boolean takeThis(InstanceNonce v);
InstanceNonce_takeThis(JNIEnv * env,jobject this,jobject v)374 static jboolean InstanceNonce_takeThis(JNIEnv *env, jobject this, jobject v) {
375 return (*env)->IsSameObject(env, this, v);
376 }
377
378 // @FastNative
379 // public native boolean takeThisFast(InstanceNonce v);
InstanceNonce_takeThisFast(JNIEnv * env,jobject this,jobject v)380 static jboolean InstanceNonce_takeThisFast(JNIEnv *env, jobject this,
381 jobject v) {
382 return (*env)->IsSameObject(env, this, v);
383 }
384
385 // public native boolean takeIntLong(int v1, long v2);
InstanceNonce_takeIntLong(JNIEnv * env,jobject this,jint v1,jlong v2)386 static jboolean InstanceNonce_takeIntLong(JNIEnv *env, jobject this,
387 jint v1, jlong v2) {
388 return (v1 == 914) && (v2 == 9140914091409140914LL);
389 }
390
391 // @FastNative
392 // public native boolean takeIntLongFast(int v1, long v2);
InstanceNonce_takeIntLongFast(JNIEnv * env,jobject this,jint v1,jlong v2)393 static jboolean InstanceNonce_takeIntLongFast(JNIEnv *env, jobject this,
394 jint v1, jlong v2) {
395 return (v1 == 914) && (v2 == 9140914091409140914LL);
396 }
397
398 // public native boolean takeLongInt(long v1, int v2);
InstanceNonce_takeLongInt(JNIEnv * env,jobject this,jlong v1,jint v2)399 static jboolean InstanceNonce_takeLongInt(JNIEnv *env, jobject this,
400 jlong v1, jint v2) {
401 return (v1 == -4321LL) && (v2 == 12341234);
402 }
403
404 // @FastNative
405 // public native boolean takeLongIntFast(long v1, int v2);
InstanceNonce_takeLongIntFast(JNIEnv * env,jobject this,jlong v1,jint v2)406 static jboolean InstanceNonce_takeLongIntFast(JNIEnv *env, jobject this,
407 jlong v1, jint v2) {
408 return (v1 == -4321LL) && (v2 == 12341234);
409 }
410
411 // public native boolean takeOneOfEach(boolean v0, byte v1, short v2,
412 // char v3, int v4, long v5, String v6, float v7, double v8,
413 // int[] v9);
InstanceNonce_takeOneOfEach(JNIEnv * env,jobject this,jboolean v0,jbyte v1,jshort v2,jchar v3,jint v4,jlong v5,jstring v6,jfloat v7,jdouble v8,jintArray v9)414 static jboolean InstanceNonce_takeOneOfEach(JNIEnv *env, jobject this,
415 jboolean v0, jbyte v1, jshort v2, jchar v3, jint v4, jlong v5,
416 jstring v6, jfloat v7, jdouble v8, jintArray v9) {
417 jsize length;
418 jboolean result;
419
420 if ((v0 != false) || (v1 != 1) || (v2 != 2) || (v3 != 3) ||
421 (v4 != 4) || (v5 != 5) || (v7 != 7.0f) || (v8 != 8.0)) {
422 return false;
423 }
424
425 length = (*env)->GetStringUTFLength(env, v6);
426
427 if (length != 3) {
428 throwException(env, "java/lang/AssertionError", "bad string length");
429 return false;
430 }
431
432 const char *utf = (*env)->GetStringUTFChars(env, v6, NULL);
433 result = (strncmp("six", utf, 3) == 0);
434
435 (*env)->ReleaseStringUTFChars(env, v6, utf);
436
437 if (! result) {
438 return false;
439 }
440
441 length = (*env)->GetArrayLength(env, v9);
442 if (length != 2) {
443 throwException(env, "java/lang/AssertionError", "bad array length");
444 return false;
445 }
446
447 jint *elements = (*env)->GetIntArrayElements(env, v9, NULL);
448 result = (elements[0] == 9) && (elements[1] == 10);
449 (*env)->ReleaseIntArrayElements(env, v9, elements, JNI_ABORT);
450
451 return result;
452 }
453
454 // public native boolean takeOneOfEachDlsym(boolean v0, byte v1, short v2,
455 // char v3, int v4, long v5, String v6, float v7, double v8,
456 // int[] v9);
Java_android_jni_cts_InstanceNonce_takeOneOfEachDlsym(JNIEnv * env,jobject this,jboolean v0,jbyte v1,jshort v2,jchar v3,jint v4,jlong v5,jstring v6,jfloat v7,jdouble v8,jintArray v9)457 JNIEXPORT jboolean Java_android_jni_cts_InstanceNonce_takeOneOfEachDlsym(
458 JNIEnv *env, jobject this, jboolean v0, jbyte v1, jshort v2, jchar v3,
459 jint v4, jlong v5, jstring v6, jfloat v7, jdouble v8, jintArray v9) {
460 return InstanceNonce_takeOneOfEach(
461 env, this, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
462 }
463
464 // @FastNative
465 // public native boolean takeOneOfEachFast(boolean v0, byte v1, short v2,
466 // char v3, int v4, long v5, String v6, float v7, double v8,
467 // int[] v9);
InstanceNonce_takeOneOfEachFast(JNIEnv * env,jobject this,jboolean v0,jbyte v1,jshort v2,jchar v3,jint v4,jlong v5,jstring v6,jfloat v7,jdouble v8,jintArray v9)468 static jboolean InstanceNonce_takeOneOfEachFast(JNIEnv *env, jobject this,
469 jboolean v0, jbyte v1, jshort v2, jchar v3, jint v4, jlong v5,
470 jstring v6, jfloat v7, jdouble v8, jintArray v9) {
471 return InstanceNonce_takeOneOfEach(
472 env, this, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
473 }
474
475 // @FastNative
476 // public native boolean takeOneOfEachFastDlsym(boolean v0, byte v1, short v2,
477 // char v3, int v4, long v5, String v6, float v7, double v8,
478 // int[] v9);
Java_android_jni_cts_InstanceNonce_takeOneOfEachFastDlsym(JNIEnv * env,jobject this,jboolean v0,jbyte v1,jshort v2,jchar v3,jint v4,jlong v5,jstring v6,jfloat v7,jdouble v8,jintArray v9)479 JNIEXPORT jboolean Java_android_jni_cts_InstanceNonce_takeOneOfEachFastDlsym(
480 JNIEnv *env, jobject this, jboolean v0, jbyte v1, jshort v2, jchar v3,
481 jint v4, jlong v5, jstring v6, jfloat v7, jdouble v8, jintArray v9) {
482 return InstanceNonce_takeOneOfEach(
483 env, this, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);
484 }
485
486 // public native boolean takeCoolHandLuke(
487 // int v1, int v2, int v3, int v4,
488 // int v5, int v6, int v7, int v8, int v9,
489 // int v10, int v11, int v12, int v13, int v14,
490 // int v15, int v16, int v17, int v18, int v19,
491 // int v20, int v21, int v22, int v23, int v24,
492 // int v25, int v26, int v27, int v28, int v29,
493 // int v30, int v31, int v32, int v33, int v34,
494 // int v35, int v36, int v37, int v38, int v39,
495 // int v40, int v41, int v42, int v43, int v44,
496 // int v45, int v46, int v47, int v48, int v49,
497 // int v50);
InstanceNonce_takeCoolHandLuke(JNIEnv * env,jobject this,jint v1,jint v2,jint v3,jint v4,jint v5,jint v6,jint v7,jint v8,jint v9,jint v10,jint v11,jint v12,jint v13,jint v14,jint v15,jint v16,jint v17,jint v18,jint v19,jint v20,jint v21,jint v22,jint v23,jint v24,jint v25,jint v26,jint v27,jint v28,jint v29,jint v30,jint v31,jint v32,jint v33,jint v34,jint v35,jint v36,jint v37,jint v38,jint v39,jint v40,jint v41,jint v42,jint v43,jint v44,jint v45,jint v46,jint v47,jint v48,jint v49,jint v50)498 static jboolean InstanceNonce_takeCoolHandLuke(JNIEnv *env, jobject this,
499 jint v1, jint v2, jint v3, jint v4,
500 jint v5, jint v6, jint v7, jint v8, jint v9,
501 jint v10, jint v11, jint v12, jint v13, jint v14,
502 jint v15, jint v16, jint v17, jint v18, jint v19,
503 jint v20, jint v21, jint v22, jint v23, jint v24,
504 jint v25, jint v26, jint v27, jint v28, jint v29,
505 jint v30, jint v31, jint v32, jint v33, jint v34,
506 jint v35, jint v36, jint v37, jint v38, jint v39,
507 jint v40, jint v41, jint v42, jint v43, jint v44,
508 jint v45, jint v46, jint v47, jint v48, jint v49,
509 jint v50) {
510 return (v1 == 1) && (v2 == 2) && (v3 == 3) &&
511 (v4 == 4) && (v5 == 5) && (v6 == 6) && (v7 == 7) &&
512 (v8 == 8) && (v9 == 9) &&
513 (v10 == 10) && (v11 == 11) && (v12 == 12) && (v13 == 13) &&
514 (v14 == 14) && (v15 == 15) && (v16 == 16) && (v17 == 17) &&
515 (v18 == 18) && (v19 == 19) &&
516 (v20 == 20) && (v21 == 21) && (v22 == 22) && (v23 == 23) &&
517 (v24 == 24) && (v25 == 25) && (v26 == 26) && (v27 == 27) &&
518 (v28 == 28) && (v29 == 29) &&
519 (v30 == 30) && (v31 == 31) && (v32 == 32) && (v33 == 33) &&
520 (v34 == 34) && (v35 == 35) && (v36 == 36) && (v37 == 37) &&
521 (v38 == 38) && (v39 == 39) &&
522 (v40 == 40) && (v41 == 41) && (v42 == 42) && (v43 == 43) &&
523 (v44 == 44) && (v45 == 45) && (v46 == 46) && (v47 == 47) &&
524 (v48 == 48) && (v49 == 49) &&
525 (v50 == 50);
526 }
527
528 // @FastNative
529 // public native boolean takeCoolHandLukeFast(
530 // int v1, int v2, int v3, int v4,
531 // int v5, int v6, int v7, int v8, int v9,
532 // int v10, int v11, int v12, int v13, int v14,
533 // int v15, int v16, int v17, int v18, int v19,
534 // int v20, int v21, int v22, int v23, int v24,
535 // int v25, int v26, int v27, int v28, int v29,
536 // int v30, int v31, int v32, int v33, int v34,
537 // int v35, int v36, int v37, int v38, int v39,
538 // int v40, int v41, int v42, int v43, int v44,
539 // int v45, int v46, int v47, int v48, int v49,
540 // int v50);
InstanceNonce_takeCoolHandLukeFast(JNIEnv * env,jobject this,jint v1,jint v2,jint v3,jint v4,jint v5,jint v6,jint v7,jint v8,jint v9,jint v10,jint v11,jint v12,jint v13,jint v14,jint v15,jint v16,jint v17,jint v18,jint v19,jint v20,jint v21,jint v22,jint v23,jint v24,jint v25,jint v26,jint v27,jint v28,jint v29,jint v30,jint v31,jint v32,jint v33,jint v34,jint v35,jint v36,jint v37,jint v38,jint v39,jint v40,jint v41,jint v42,jint v43,jint v44,jint v45,jint v46,jint v47,jint v48,jint v49,jint v50)541 static jboolean InstanceNonce_takeCoolHandLukeFast(JNIEnv *env, jobject this,
542 jint v1, jint v2, jint v3, jint v4,
543 jint v5, jint v6, jint v7, jint v8, jint v9,
544 jint v10, jint v11, jint v12, jint v13, jint v14,
545 jint v15, jint v16, jint v17, jint v18, jint v19,
546 jint v20, jint v21, jint v22, jint v23, jint v24,
547 jint v25, jint v26, jint v27, jint v28, jint v29,
548 jint v30, jint v31, jint v32, jint v33, jint v34,
549 jint v35, jint v36, jint v37, jint v38, jint v39,
550 jint v40, jint v41, jint v42, jint v43, jint v44,
551 jint v45, jint v46, jint v47, jint v48, jint v49,
552 jint v50) {
553 return InstanceNonce_takeCoolHandLuke(
554 env, this, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
555 v11, v12, v13, v14, v15, v16, v17, v18, v19, v20,
556 v21, v22, v23, v24, v25, v26, v27, v28, v29, v30,
557 v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
558 v41, v42, v43, v44, v45, v46, v47, v48, v49, v50);
559 }
560
561 static JNINativeMethod methods[] = {
562 // name, signature, function
563 { "nop", "()V", InstanceNonce_nop },
564 { "nopFast", "()V", InstanceNonce_nopFast },
565 { "returnBoolean", "()Z", InstanceNonce_returnBoolean },
566 { "returnBooleanFast", "()Z", InstanceNonce_returnBooleanFast },
567 { "returnByte", "()B", InstanceNonce_returnByte },
568 { "returnByteFast", "()B", InstanceNonce_returnByteFast },
569 { "returnShort", "()S", InstanceNonce_returnShort },
570 { "returnShortFast", "()S", InstanceNonce_returnShortFast },
571 { "returnChar", "()C", InstanceNonce_returnChar },
572 { "returnCharFast", "()C", InstanceNonce_returnCharFast },
573 { "returnInt", "()I", InstanceNonce_returnInt },
574 { "returnIntFast", "()I", InstanceNonce_returnIntFast },
575 { "returnLong", "()J", InstanceNonce_returnLong },
576 { "returnLongFast", "()J", InstanceNonce_returnLongFast },
577 { "returnFloat", "()F", InstanceNonce_returnFloat },
578 { "returnFloatFast", "()F", InstanceNonce_returnFloatFast },
579 { "returnDouble", "()D", InstanceNonce_returnDouble },
580 { "returnDoubleFast", "()D", InstanceNonce_returnDoubleFast },
581 { "returnNull", "()Ljava/lang/Object;", InstanceNonce_returnNull },
582 { "returnNullFast", "()Ljava/lang/Object;",
583 InstanceNonce_returnNullFast },
584 { "returnString", "()Ljava/lang/String;",
585 InstanceNonce_returnString },
586 { "returnStringFast", "()Ljava/lang/String;",
587 InstanceNonce_returnStringFast },
588 { "returnShortArray", "()[S", InstanceNonce_returnShortArray },
589 { "returnShortArrayFast", "()[S", InstanceNonce_returnShortArrayFast },
590 { "returnStringArray", "()[Ljava/lang/String;",
591 InstanceNonce_returnStringArray },
592 { "returnStringArrayFast", "()[Ljava/lang/String;",
593 InstanceNonce_returnStringArrayFast },
594 { "returnThis", "()Landroid/jni/cts/InstanceNonce;",
595 InstanceNonce_returnThis },
596 { "returnThisFast", "()Landroid/jni/cts/InstanceNonce;",
597 InstanceNonce_returnThisFast },
598 { "takeBoolean", "(Z)Z", InstanceNonce_takeBoolean },
599 { "takeBooleanFast", "(Z)Z", InstanceNonce_takeBooleanFast },
600 { "takeByte", "(B)Z", InstanceNonce_takeByte },
601 { "takeByteFast", "(B)Z", InstanceNonce_takeByteFast },
602 { "takeShort", "(S)Z", InstanceNonce_takeShort },
603 { "takeShortFast", "(S)Z", InstanceNonce_takeShortFast },
604 { "takeChar", "(C)Z", InstanceNonce_takeChar },
605 { "takeCharFast", "(C)Z", InstanceNonce_takeCharFast },
606 { "takeInt", "(I)Z", InstanceNonce_takeInt },
607 { "takeIntFast", "(I)Z", InstanceNonce_takeIntFast },
608 { "takeLong", "(J)Z", InstanceNonce_takeLong },
609 { "takeLongFast", "(J)Z", InstanceNonce_takeLongFast },
610 { "takeFloat", "(F)Z", InstanceNonce_takeFloat },
611 { "takeFloatFast", "(F)Z", InstanceNonce_takeFloatFast },
612 { "takeDouble", "(D)Z", InstanceNonce_takeDouble },
613 { "takeDoubleFast", "(D)Z", InstanceNonce_takeDoubleFast },
614 { "takeNull", "(Ljava/lang/Object;)Z", InstanceNonce_takeNull },
615 { "takeNullFast", "(Ljava/lang/Object;)Z",
616 InstanceNonce_takeNullFast },
617 { "takeString", "(Ljava/lang/String;)Z", InstanceNonce_takeString },
618 { "takeStringFast", "(Ljava/lang/String;)Z",
619 InstanceNonce_takeStringFast },
620 { "takeThis", "(Landroid/jni/cts/InstanceNonce;)Z",
621 InstanceNonce_takeThis },
622 { "takeThisFast", "(Landroid/jni/cts/InstanceNonce;)Z",
623 InstanceNonce_takeThisFast },
624 { "takeIntLong", "(IJ)Z", InstanceNonce_takeIntLong },
625 { "takeIntLongFast", "(IJ)Z", InstanceNonce_takeIntLongFast },
626 { "takeLongInt", "(JI)Z", InstanceNonce_takeLongInt },
627 { "takeLongIntFast", "(JI)Z", InstanceNonce_takeLongIntFast },
628 { "takeOneOfEach", "(ZBSCIJLjava/lang/String;FD[I)Z",
629 InstanceNonce_takeOneOfEach },
630 { "takeOneOfEachFast", "(ZBSCIJLjava/lang/String;FD[I)Z",
631 InstanceNonce_takeOneOfEachFast },
632 { "takeCoolHandLuke",
633 "(IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII)Z",
634 InstanceNonce_takeCoolHandLuke },
635 { "takeCoolHandLukeFast",
636 "(IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII)Z",
637 InstanceNonce_takeCoolHandLukeFast },
638 };
639
register_InstanceNonce(JNIEnv * env)640 int register_InstanceNonce(JNIEnv *env) {
641 return registerJniMethods(
642 env, "android/jni/cts/InstanceNonce",
643 methods, sizeof(methods) / sizeof(JNINativeMethod));
644 }
645