17520ee7ff226e12e06818561b15741d2575072e3buzbee/*
27520ee7ff226e12e06818561b15741d2575072e3buzbee * Copyright (C) 2010 The Android Open Source Project
37520ee7ff226e12e06818561b15741d2575072e3buzbee *
47520ee7ff226e12e06818561b15741d2575072e3buzbee * Licensed under the Apache License, Version 2.0 (the "License");
57520ee7ff226e12e06818561b15741d2575072e3buzbee * you may not use this file except in compliance with the License.
67520ee7ff226e12e06818561b15741d2575072e3buzbee * You may obtain a copy of the License at
77520ee7ff226e12e06818561b15741d2575072e3buzbee *
87520ee7ff226e12e06818561b15741d2575072e3buzbee *      http://www.apache.org/licenses/LICENSE-2.0
97520ee7ff226e12e06818561b15741d2575072e3buzbee *
107520ee7ff226e12e06818561b15741d2575072e3buzbee * Unless required by applicable law or agreed to in writing, software
117520ee7ff226e12e06818561b15741d2575072e3buzbee * distributed under the License is distributed on an "AS IS" BASIS,
127520ee7ff226e12e06818561b15741d2575072e3buzbee * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
137520ee7ff226e12e06818561b15741d2575072e3buzbee * See the License for the specific language governing permissions and
147520ee7ff226e12e06818561b15741d2575072e3buzbee * limitations under the License.
157520ee7ff226e12e06818561b15741d2575072e3buzbee */
167520ee7ff226e12e06818561b15741d2575072e3buzbee
17375fb116bcb817b37509ab579dbd55cdbb765cbfCarl Shapiro#ifndef DALVIK_VM_COMPILER_CODEGEN_X86_CALLOUT_HELPER_H_
18375fb116bcb817b37509ab579dbd55cdbb765cbfCarl Shapiro#define DALVIK_VM_COMPILER_CODEGEN_X86_CALLOUT_HELPER_H_
197520ee7ff226e12e06818561b15741d2575072e3buzbee
20375fb116bcb817b37509ab579dbd55cdbb765cbfCarl Shapiro#include "Dalvik.h"
217520ee7ff226e12e06818561b15741d2575072e3buzbee
227520ee7ff226e12e06818561b15741d2575072e3buzbee/*
237520ee7ff226e12e06818561b15741d2575072e3buzbee * Declare/comment prototypes of all native callout functions invoked by the
247520ee7ff226e12e06818561b15741d2575072e3buzbee * JIT'ed code here and use the LOAD_FUNC_ADDR macro to load the address into
257520ee7ff226e12e06818561b15741d2575072e3buzbee * a register. In this way we have a centralized place to find out all native
267520ee7ff226e12e06818561b15741d2575072e3buzbee * helper functions and we can grep for LOAD_FUNC_ADDR to find out all the
277520ee7ff226e12e06818561b15741d2575072e3buzbee * callsites.
287520ee7ff226e12e06818561b15741d2575072e3buzbee */
297520ee7ff226e12e06818561b15741d2575072e3buzbee
307520ee7ff226e12e06818561b15741d2575072e3buzbee/* Load a statically compiled function address as a constant */
317520ee7ff226e12e06818561b15741d2575072e3buzbee#define LOAD_FUNC_ADDR(cUnit, reg, addr) loadConstant(cUnit, reg, addr)
327520ee7ff226e12e06818561b15741d2575072e3buzbee
337520ee7ff226e12e06818561b15741d2575072e3buzbee/* Originally declared in Sync.h */
347520ee7ff226e12e06818561b15741d2575072e3buzbeebool dvmUnlockObject(struct Thread* self, struct Object* obj); //OP_MONITOR_EXIT
357520ee7ff226e12e06818561b15741d2575072e3buzbee
367520ee7ff226e12e06818561b15741d2575072e3buzbee/* Originally declared in oo/TypeCheck.h */
377520ee7ff226e12e06818561b15741d2575072e3buzbeebool dvmCanPutArrayElement(const ClassObject* elemClass,   // OP_APUT_OBJECT
387520ee7ff226e12e06818561b15741d2575072e3buzbee                           const ClassObject* arrayClass);
397520ee7ff226e12e06818561b15741d2575072e3buzbeeint dvmInstanceofNonTrivial(const ClassObject* instance,   // OP_CHECK_CAST &&
407520ee7ff226e12e06818561b15741d2575072e3buzbee                            const ClassObject* clazz);     // OP_INSTANCE_OF
417520ee7ff226e12e06818561b15741d2575072e3buzbee
427520ee7ff226e12e06818561b15741d2575072e3buzbee/* Originally declared in oo/Array.h */
437520ee7ff226e12e06818561b15741d2575072e3buzbeeArrayObject* dvmAllocArrayByClass(ClassObject* arrayClass, // OP_NEW_ARRAY
447520ee7ff226e12e06818561b15741d2575072e3buzbee                                  size_t length, int allocFlags);
457520ee7ff226e12e06818561b15741d2575072e3buzbee
467520ee7ff226e12e06818561b15741d2575072e3buzbee/* Originally declared in interp/InterpDefs.h */
477520ee7ff226e12e06818561b15741d2575072e3buzbeebool dvmInterpHandleFillArrayData(ArrayObject* arrayObject,// OP_FILL_ARRAY_DATA
487520ee7ff226e12e06818561b15741d2575072e3buzbee                                  const u2* arrayData);
497520ee7ff226e12e06818561b15741d2575072e3buzbee
507520ee7ff226e12e06818561b15741d2575072e3buzbee/* Originally declared in alloc/Alloc.h */
517520ee7ff226e12e06818561b15741d2575072e3buzbeeObject* dvmAllocObject(ClassObject* clazz, int flags);  // OP_NEW_INSTANCE
527520ee7ff226e12e06818561b15741d2575072e3buzbee
537520ee7ff226e12e06818561b15741d2575072e3buzbee/*
547520ee7ff226e12e06818561b15741d2575072e3buzbee * Functions declared in gDvmInlineOpsTable[] are used for
557520ee7ff226e12e06818561b15741d2575072e3buzbee * OP_EXECUTE_INLINE & OP_EXECUTE_INLINE_RANGE.
567520ee7ff226e12e06818561b15741d2575072e3buzbee */
57d862faa2ceae186da5518607505eb942d634ced9Carl Shapiroextern "C" double sqrt(double x);  // INLINE_MATH_SQRT
587520ee7ff226e12e06818561b15741d2575072e3buzbee
59375fb116bcb817b37509ab579dbd55cdbb765cbfCarl Shapiro#endif  // DALVIK_VM_COMPILER_CODEGEN_X86_CALLOUT_HELPER_H_
60