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 { 25 /** 26 * This class is uninstantiable. 27 */ NativeTestTarget()28 private NativeTestTarget() { 29 // This space intentionally left blank. 30 } 31 32 /** 33 * This is an empty native static method with no args, hooked up using 34 * JNI. 35 */ emptyJniStaticMethod0()36 public static native void emptyJniStaticMethod0(); 37 38 /** 39 * This is an empty native static method with six args, hooked up using 40 * JNI. 41 */ emptyJniStaticMethod6(int a, int b, int c, int d, int e, int f)42 public static native void emptyJniStaticMethod6(int a, int b, int c, 43 int d, int e, int f); 44 45 /** 46 * This is an empty native static method with six args, hooked up 47 * using JNI. These have more complex args to show the cost of 48 * parsing the signature. All six values should be null 49 * references. 50 */ emptyJniStaticMethod6L(String a, String[] b, int[][] c, Object d, Object[] e, Object[][][][] f)51 public static native void emptyJniStaticMethod6L(String a, String[] b, 52 int[][] c, Object d, Object[] e, Object[][][][] f); 53 54 /** 55 * This method is intended to be "inlined" by the virtual machine 56 * (e.g., given special treatment as an intrinsic). 57 */ emptyInlineMethod()58 public static void emptyInlineMethod() { 59 // This space intentionally left blank. 60 } 61 62 /** 63 * This method is intended to be defined in native code and hooked 64 * up using the virtual machine's special fast-path native linkage 65 * (as opposed to being hooked up using JNI). 66 */ emptyInternalStaticMethod()67 public static native void emptyInternalStaticMethod(); 68 } 69