1 /* 2 * Copyright (C) 2007 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 package org.apache.harmony.dalvik; 18 19 /** 20 * Methods used to test calling into native code. The methods in this 21 * class are all effectively no-ops and may be used to test the mechanisms 22 * and performance of calling native methods. 23 */ 24 public final class NativeTestTarget { NativeTestTarget()25 public NativeTestTarget() { 26 } 27 emptyJniStaticSynchronizedMethod0()28 public static native synchronized void emptyJniStaticSynchronizedMethod0(); 29 emptyJniSynchronizedMethod0()30 public native synchronized void emptyJniSynchronizedMethod0(); 31 emptyJniStaticMethod0()32 public static native void emptyJniStaticMethod0(); 33 emptyJniMethod0()34 public native void emptyJniMethod0(); 35 emptyJniStaticMethod6(int a, int b, int c, int d, int e, int f)36 public static native void emptyJniStaticMethod6(int a, int b, int c, int d, int e, int f); 37 emptyJniMethod6(int a, int b, int c, int d, int e, int f)38 public native void emptyJniMethod6(int a, int b, int c, int d, int e, int f); 39 40 /** 41 * This is an empty native static method with six args, hooked up 42 * using JNI. These have more complex args to show the cost of 43 * parsing the signature. All six values should be null 44 * references. 45 */ emptyJniStaticMethod6L(String a, String[] b, int[][] c, Object d, Object[] e, Object[][][][] f)46 public static native void emptyJniStaticMethod6L(String a, String[] b, 47 int[][] c, Object d, Object[] e, Object[][][][] f); 48 emptyJniMethod6L(String a, String[] b, int[][] c, Object d, Object[] e, Object[][][][] f)49 public native void emptyJniMethod6L(String a, String[] b, 50 int[][] c, Object d, Object[] e, Object[][][][] f); 51 52 /** 53 * This is used to benchmark dalvik's inline natives. 54 */ emptyInlineMethod()55 public static void emptyInlineMethod() { 56 } 57 58 /** 59 * This is used to benchmark dalvik's inline natives. 60 */ emptyInternalStaticMethod()61 public static native void emptyInternalStaticMethod(); 62 } 63