1 /* 2 * Copyright (C) 2015 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 #ifndef ART_RUNTIME_INTERPRETER_UNSTARTED_RUNTIME_LIST_H_ 18 #define ART_RUNTIME_INTERPRETER_UNSTARTED_RUNTIME_LIST_H_ 19 20 // Methods that intercept available libcore implementations. 21 #define UNSTARTED_RUNTIME_DIRECT_LIST(V) \ 22 V(CharacterToLowerCase, "int java.lang.Character.toLowerCase(int)") \ 23 V(CharacterToUpperCase, "int java.lang.Character.toUpperCase(int)") \ 24 V(ClassForName, "java.lang.Class java.lang.Class.forName(java.lang.String)") \ 25 V(ClassForNameLong, "java.lang.Class java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader)") \ 26 V(ClassGetPrimitiveClass, "java.lang.Class java.lang.Class.getPrimitiveClass(java.lang.String)") \ 27 V(ClassClassForName, "java.lang.Class java.lang.Class.classForName(java.lang.String, boolean, java.lang.ClassLoader)") \ 28 V(ClassNewInstance, "java.lang.Object java.lang.Class.newInstance()") \ 29 V(ClassGetDeclaredField, "java.lang.reflect.Field java.lang.Class.getDeclaredField(java.lang.String)") \ 30 V(ClassGetDeclaredMethod, "java.lang.reflect.Method java.lang.Class.getDeclaredMethodInternal(java.lang.String, java.lang.Class[])") \ 31 V(ClassGetDeclaredConstructor, "java.lang.reflect.Constructor java.lang.Class.getDeclaredConstructorInternal(java.lang.Class[])") \ 32 V(ClassGetDeclaringClass, "java.lang.Class java.lang.Class.getDeclaringClass()") \ 33 V(ClassGetEnclosingClass, "java.lang.Class java.lang.Class.getEnclosingClass()") \ 34 V(ClassGetInnerClassFlags, "int java.lang.Class.getInnerClassFlags(int)") \ 35 V(ClassGetSignatureAnnotation, "java.lang.String[] java.lang.Class.getSignatureAnnotation()") \ 36 V(ClassIsAnonymousClass, "boolean java.lang.Class.isAnonymousClass()") \ 37 V(ClassLoaderGetResourceAsStream, "java.io.InputStream java.lang.ClassLoader.getResourceAsStream(java.lang.String)") \ 38 V(ConstructorNewInstance0, "java.lang.Object java.lang.reflect.Constructor.newInstance0(java.lang.Object[])") \ 39 V(VmClassLoaderFindLoadedClass, "java.lang.Class java.lang.VMClassLoader.findLoadedClass(java.lang.ClassLoader, java.lang.String)") \ 40 V(SystemArraycopy, "void java.lang.System.arraycopy(java.lang.Object, int, java.lang.Object, int, int)") \ 41 V(SystemArraycopyByte, "void java.lang.System.arraycopy(byte[], int, byte[], int, int)") \ 42 V(SystemArraycopyChar, "void java.lang.System.arraycopy(char[], int, char[], int, int)") \ 43 V(SystemArraycopyInt, "void java.lang.System.arraycopy(int[], int, int[], int, int)") \ 44 V(SystemGetSecurityManager, "java.lang.SecurityManager java.lang.System.getSecurityManager()") \ 45 V(SystemGetProperty, "java.lang.String java.lang.System.getProperty(java.lang.String)") \ 46 V(SystemGetPropertyWithDefault, "java.lang.String java.lang.System.getProperty(java.lang.String, java.lang.String)") \ 47 V(ThreadLocalGet, "java.lang.Object java.lang.ThreadLocal.get()") \ 48 V(MathCeil, "double java.lang.Math.ceil(double)") \ 49 V(MathFloor, "double java.lang.Math.floor(double)") \ 50 V(MathSin, "double java.lang.Math.sin(double)") \ 51 V(MathCos, "double java.lang.Math.cos(double)") \ 52 V(MathPow, "double java.lang.Math.pow(double, double)") \ 53 V(ObjectHashCode, "int java.lang.Object.hashCode()") \ 54 V(DoubleDoubleToRawLongBits, "long java.lang.Double.doubleToRawLongBits(double)") \ 55 V(MemoryPeekByte, "byte libcore.io.Memory.peekByte(long)") \ 56 V(MemoryPeekShort, "short libcore.io.Memory.peekShortNative(long)") \ 57 V(MemoryPeekInt, "int libcore.io.Memory.peekIntNative(long)") \ 58 V(MemoryPeekLong, "long libcore.io.Memory.peekLongNative(long)") \ 59 V(MemoryPeekByteArray, "void libcore.io.Memory.peekByteArray(long, byte[], int, int)") \ 60 V(MethodInvoke, "java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])") \ 61 V(ReferenceGetReferent, "java.lang.Object java.lang.ref.Reference.getReferent()") \ 62 V(RuntimeAvailableProcessors, "int java.lang.Runtime.availableProcessors()") \ 63 V(StringGetCharsNoCheck, "void java.lang.String.getCharsNoCheck(int, int, char[], int)") \ 64 V(StringCharAt, "char java.lang.String.charAt(int)") \ 65 V(StringDoReplace, "java.lang.String java.lang.String.doReplace(char, char)") \ 66 V(StringFactoryNewStringFromChars, "java.lang.String java.lang.StringFactory.newStringFromChars(int, int, char[])") \ 67 V(StringFactoryNewStringFromString, "java.lang.String java.lang.StringFactory.newStringFromString(java.lang.String)") \ 68 V(StringFastSubstring, "java.lang.String java.lang.String.fastSubstring(int, int)") \ 69 V(StringToCharArray, "char[] java.lang.String.toCharArray()") \ 70 V(ThreadCurrentThread, "java.lang.Thread java.lang.Thread.currentThread()") \ 71 V(ThreadGetNativeState, "int java.lang.Thread.nativeGetStatus(boolean)") \ 72 V(UnsafeCompareAndSwapLong, "boolean sun.misc.Unsafe.compareAndSwapLong(java.lang.Object, long, long, long)") \ 73 V(UnsafeCompareAndSwapObject, "boolean sun.misc.Unsafe.compareAndSwapObject(java.lang.Object, long, java.lang.Object, java.lang.Object)") \ 74 V(UnsafeGetObjectVolatile, "java.lang.Object sun.misc.Unsafe.getObjectVolatile(java.lang.Object, long)") \ 75 V(UnsafePutObjectVolatile, "void sun.misc.Unsafe.putObjectVolatile(java.lang.Object, long, java.lang.Object)") \ 76 V(UnsafePutOrderedObject, "void sun.misc.Unsafe.putOrderedObject(java.lang.Object, long, java.lang.Object)") \ 77 V(IntegerParseInt, "int java.lang.Integer.parseInt(java.lang.String)") \ 78 V(LongParseLong, "long java.lang.Long.parseLong(java.lang.String)") \ 79 V(SystemIdentityHashCode, "int java.lang.System.identityHashCode(java.lang.Object)") 80 81 // Methods that are native. 82 #define UNSTARTED_RUNTIME_JNI_LIST(V) \ 83 V(VMRuntimeIs64Bit, "boolean dalvik.system.VMRuntime.is64Bit()") \ 84 V(VMRuntimeNewUnpaddedArray, "java.lang.Object dalvik.system.VMRuntime.newUnpaddedArray(java.lang.Class, int)") \ 85 V(VMStackGetCallingClassLoader, "java.lang.ClassLoader dalvik.system.VMStack.getCallingClassLoader()") \ 86 V(VMStackGetStackClass2, "java.lang.Class dalvik.system.VMStack.getStackClass2()") \ 87 V(MathLog, "double java.lang.Math.log(double)") \ 88 V(MathExp, "double java.lang.Math.exp(double)") \ 89 V(AtomicLongVMSupportsCS8, "boolean java.util.concurrent.atomic.AtomicLong.VMSupportsCS8()") \ 90 V(ClassGetNameNative, "java.lang.String java.lang.Class.getNameNative()") \ 91 V(DoubleLongBitsToDouble, "double java.lang.Double.longBitsToDouble(long)") \ 92 V(FloatFloatToRawIntBits, "int java.lang.Float.floatToRawIntBits(float)") \ 93 V(FloatIntBitsToFloat, "float java.lang.Float.intBitsToFloat(int)") \ 94 V(ObjectInternalClone, "java.lang.Object java.lang.Object.internalClone()") \ 95 V(ObjectNotifyAll, "void java.lang.Object.notifyAll()") \ 96 V(StringCompareTo, "int java.lang.String.compareTo(java.lang.String)") \ 97 V(StringIntern, "java.lang.String java.lang.String.intern()") \ 98 V(ArrayCreateMultiArray, "java.lang.Object java.lang.reflect.Array.createMultiArray(java.lang.Class, int[])") \ 99 V(ArrayCreateObjectArray, "java.lang.Object java.lang.reflect.Array.createObjectArray(java.lang.Class, int)") \ 100 V(ThrowableNativeFillInStackTrace, "java.lang.Object java.lang.Throwable.nativeFillInStackTrace()") \ 101 V(ByteOrderIsLittleEndian, "boolean java.nio.ByteOrder.isLittleEndian()") \ 102 V(UnsafeCompareAndSwapInt, "boolean sun.misc.Unsafe.compareAndSwapInt(java.lang.Object, long, int, int)") \ 103 V(UnsafeGetIntVolatile, "int sun.misc.Unsafe.getIntVolatile(java.lang.Object, long)") \ 104 V(UnsafePutObject, "void sun.misc.Unsafe.putObject(java.lang.Object, long, java.lang.Object)") \ 105 V(UnsafeGetArrayBaseOffsetForComponentType, "int sun.misc.Unsafe.getArrayBaseOffsetForComponentType(java.lang.Class)") \ 106 V(UnsafeGetArrayIndexScaleForComponentType, "int sun.misc.Unsafe.getArrayIndexScaleForComponentType(java.lang.Class)") 107 108 #endif // ART_RUNTIME_INTERPRETER_UNSTARTED_RUNTIME_LIST_H_ 109 // the guard in this file is just for cpplint 110 #undef ART_RUNTIME_INTERPRETER_UNSTARTED_RUNTIME_LIST_H_ 111