1 /* 2 * Copyright (C) 2010 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 DALVIK_VM_COMPILER_CODEGEN_X86_CALLOUT_HELPER_H_ 18 #define DALVIK_VM_COMPILER_CODEGEN_X86_CALLOUT_HELPER_H_ 19 20 #include "Dalvik.h" 21 22 /* 23 * Declare/comment prototypes of all native callout functions invoked by the 24 * JIT'ed code here and use the LOAD_FUNC_ADDR macro to load the address into 25 * a register. In this way we have a centralized place to find out all native 26 * helper functions and we can grep for LOAD_FUNC_ADDR to find out all the 27 * callsites. 28 */ 29 30 /* Load a statically compiled function address as a constant */ 31 #define LOAD_FUNC_ADDR(cUnit, reg, addr) loadConstant(cUnit, reg, addr) 32 33 /* Originally declared in Sync.h */ 34 bool dvmUnlockObject(struct Thread* self, struct Object* obj); //OP_MONITOR_EXIT 35 36 /* Originally declared in oo/TypeCheck.h */ 37 bool dvmCanPutArrayElement(const ClassObject* elemClass, // OP_APUT_OBJECT 38 const ClassObject* arrayClass); 39 int dvmInstanceofNonTrivial(const ClassObject* instance, // OP_CHECK_CAST && 40 const ClassObject* clazz); // OP_INSTANCE_OF 41 42 /* Originally declared in oo/Array.h */ 43 ArrayObject* dvmAllocArrayByClass(ClassObject* arrayClass, // OP_NEW_ARRAY 44 size_t length, int allocFlags); 45 46 /* Originally declared in interp/InterpDefs.h */ 47 bool dvmInterpHandleFillArrayData(ArrayObject* arrayObject,// OP_FILL_ARRAY_DATA 48 const u2* arrayData); 49 50 /* Originally declared in alloc/Alloc.h */ 51 Object* dvmAllocObject(ClassObject* clazz, int flags); // OP_NEW_INSTANCE 52 53 /* 54 * Functions declared in gDvmInlineOpsTable[] are used for 55 * OP_EXECUTE_INLINE & OP_EXECUTE_INLINE_RANGE. 56 */ 57 extern "C" double sqrt(double x); // INLINE_MATH_SQRT 58 59 #endif // DALVIK_VM_COMPILER_CODEGEN_X86_CALLOUT_HELPER_H_ 60