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(ClassForName, "java.lang.Class java.lang.Class.forName(java.lang.String)") \
23   V(ClassForNameLong, "java.lang.Class java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader)") \
24   V(ClassClassForName, "java.lang.Class java.lang.Class.classForName(java.lang.String, boolean, java.lang.ClassLoader)") \
25   V(ClassNewInstance, "java.lang.Object java.lang.Class.newInstance()") \
26   V(ClassGetDeclaredField, "java.lang.reflect.Field java.lang.Class.getDeclaredField(java.lang.String)") \
27   V(VmClassLoaderFindLoadedClass, "java.lang.Class java.lang.VMClassLoader.findLoadedClass(java.lang.ClassLoader, java.lang.String)") \
28   V(VoidLookupType, "java.lang.Class java.lang.Void.lookupType()") \
29   V(SystemArraycopy, "void java.lang.System.arraycopy(java.lang.Object, int, java.lang.Object, int, int)") \
30   V(SystemArraycopyChar, "void java.lang.System.arraycopy(char[], int, char[], int, int)") \
31   V(SystemArraycopyInt, "void java.lang.System.arraycopy(int[], int, int[], int, int)") \
32   V(ThreadLocalGet, "java.lang.Object java.lang.ThreadLocal.get()") \
33   V(MathCeil, "double java.lang.Math.ceil(double)") \
34   V(ObjectHashCode, "int java.lang.Object.hashCode()") \
35   V(DoubleDoubleToRawLongBits, "long java.lang.Double.doubleToRawLongBits(double)") \
36   V(DexCacheGetDexNative, "com.android.dex.Dex java.lang.DexCache.getDexNative()") \
37   V(MemoryPeekByte, "byte libcore.io.Memory.peekByte(long)") \
38   V(MemoryPeekShort, "short libcore.io.Memory.peekShortNative(long)") \
39   V(MemoryPeekInt, "int libcore.io.Memory.peekIntNative(long)") \
40   V(MemoryPeekLong, "long libcore.io.Memory.peekLongNative(long)") \
41   V(MemoryPeekByteArray, "void libcore.io.Memory.peekByteArray(long, byte[], int, int)") \
42   V(SecurityGetSecurityPropertiesReader, "java.io.Reader java.security.Security.getSecurityPropertiesReader()") \
43   V(StringGetCharsNoCheck, "void java.lang.String.getCharsNoCheck(int, int, char[], int)") \
44   V(StringCharAt, "char java.lang.String.charAt(int)") \
45   V(StringSetCharAt, "void java.lang.String.setCharAt(int, char)") \
46   V(StringFactoryNewStringFromChars, "java.lang.String java.lang.StringFactory.newStringFromChars(int, int, char[])") \
47   V(StringFactoryNewStringFromString, "java.lang.String java.lang.StringFactory.newStringFromString(java.lang.String)") \
48   V(StringFastSubstring, "java.lang.String java.lang.String.fastSubstring(int, int)") \
49   V(StringToCharArray, "char[] java.lang.String.toCharArray()")
50 
51 // Methods that are native.
52 #define UNSTARTED_RUNTIME_JNI_LIST(V)           \
53   V(VMRuntimeNewUnpaddedArray, "java.lang.Object dalvik.system.VMRuntime.newUnpaddedArray(java.lang.Class, int)") \
54   V(VMStackGetCallingClassLoader, "java.lang.ClassLoader dalvik.system.VMStack.getCallingClassLoader()") \
55   V(VMStackGetStackClass2, "java.lang.Class dalvik.system.VMStack.getStackClass2()") \
56   V(MathLog, "double java.lang.Math.log(double)") \
57   V(MathExp, "double java.lang.Math.exp(double)") \
58   V(ClassGetNameNative, "java.lang.String java.lang.Class.getNameNative()") \
59   V(FloatFloatToRawIntBits, "int java.lang.Float.floatToRawIntBits(float)") \
60   V(FloatIntBitsToFloat, "float java.lang.Float.intBitsToFloat(int)") \
61   V(ObjectInternalClone, "java.lang.Object java.lang.Object.internalClone()") \
62   V(ObjectNotifyAll, "void java.lang.Object.notifyAll()") \
63   V(StringCompareTo, "int java.lang.String.compareTo(java.lang.String)") \
64   V(StringIntern, "java.lang.String java.lang.String.intern()") \
65   V(StringFastIndexOf, "int java.lang.String.fastIndexOf(int, int)") \
66   V(ArrayCreateMultiArray, "java.lang.Object java.lang.reflect.Array.createMultiArray(java.lang.Class, int[])") \
67   V(ArrayCreateObjectArray, "java.lang.Object java.lang.reflect.Array.createObjectArray(java.lang.Class, int)") \
68   V(ThrowableNativeFillInStackTrace, "java.lang.Object java.lang.Throwable.nativeFillInStackTrace()") \
69   V(SystemIdentityHashCode, "int java.lang.System.identityHashCode(java.lang.Object)") \
70   V(ByteOrderIsLittleEndian, "boolean java.nio.ByteOrder.isLittleEndian()") \
71   V(UnsafeCompareAndSwapInt, "boolean sun.misc.Unsafe.compareAndSwapInt(java.lang.Object, long, int, int)") \
72   V(UnsafePutObject, "void sun.misc.Unsafe.putObject(java.lang.Object, long, java.lang.Object)") \
73   V(UnsafeGetArrayBaseOffsetForComponentType, "int sun.misc.Unsafe.getArrayBaseOffsetForComponentType(java.lang.Class)") \
74   V(UnsafeGetArrayIndexScaleForComponentType, "int sun.misc.Unsafe.getArrayIndexScaleForComponentType(java.lang.Class)")
75 
76 #endif  // ART_RUNTIME_INTERPRETER_UNSTARTED_RUNTIME_LIST_H_
77 // the guard in this file is just for cpplint
78 #undef ART_RUNTIME_INTERPRETER_UNSTARTED_RUNTIME_LIST_H_
79