buzbee | eaf09bc | 2012-11-15 14:51:41 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2011 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_SRC_COMPILER_CODEGEN_GENCOMMON_H_ |
| 18 | #define ART_SRC_COMPILER_CODEGEN_GENCOMMON_H_ |
| 19 | |
| 20 | void markSafepointPC(CompilationUnit* cUnit, LIR* inst); |
| 21 | void callRuntimeHelperImm(CompilationUnit* cUnit, int helperOffset, int arg0, bool safepointPC); |
| 22 | void callRuntimeHelperReg(CompilationUnit* cUnit, int helperOffset, int arg0, bool safepointPC); |
| 23 | void callRuntimeHelperRegLocation(CompilationUnit* cUnit, int helperOffset, RegLocation arg0, bool safepointPC); |
| 24 | void callRuntimeHelperImmImm(CompilationUnit* cUnit, int helperOffset, int arg0, int arg1, bool safepointPC); |
| 25 | void callRuntimeHelperImmRegLocation(CompilationUnit* cUnit, int helperOffset, int arg0, RegLocation arg1, bool safepointPC); |
| 26 | void callRuntimeHelperRegLocationImm(CompilationUnit* cUnit, int helperOffset, RegLocation arg0, int arg1, bool safepointPC); |
| 27 | void callRuntimeHelperImmReg(CompilationUnit* cUnit, int helperOffset, int arg0, int arg1, bool safepointPC); |
| 28 | void callRuntimeHelperRegImm(CompilationUnit* cUnit, int helperOffset, int arg0, int arg1, bool safepointPC); |
| 29 | void callRuntimeHelperImmMethod(CompilationUnit* cUnit, int helperOffset, int arg0, bool safepointPC); |
| 30 | void callRuntimeHelperRegLocationRegLocation(CompilationUnit* cUnit, int helperOffset, RegLocation arg0, RegLocation arg1, bool safepointPC); |
| 31 | void callRuntimeHelperRegReg(CompilationUnit* cUnit, int helperOffset, int arg0, int arg1, bool safepointPC); |
| 32 | void callRuntimeHelperRegRegImm(CompilationUnit* cUnit, int helperOffset, int arg0, int arg1, int arg2, bool safepointPC); |
| 33 | void callRuntimeHelperImmMethodRegLocation(CompilationUnit* cUnit, int helperOffset, int arg0, RegLocation arg2, bool safepointPC); |
| 34 | void callRuntimeHelperImmMethodImm(CompilationUnit* cUnit, int helperOffset, int arg0, int arg2, bool safepointPC); |
| 35 | void callRuntimeHelperImmRegLocationRegLocation(CompilationUnit* cUnit, int helperOffset, int arg0, RegLocation arg1, RegLocation arg2, bool safepointPC); |
| 36 | void genBarrier(CompilationUnit* cUnit); |
| 37 | LIR* opUnconditionalBranch(CompilationUnit* cUnit, LIR* target); |
| 38 | LIR* genCheck(CompilationUnit* cUnit, ConditionCode cCode, ThrowKind kind); |
| 39 | LIR* genImmedCheck(CompilationUnit* cUnit, ConditionCode cCode, int reg, int immVal, ThrowKind kind); |
| 40 | LIR* genNullCheck(CompilationUnit* cUnit, int sReg, int mReg, int optFlags); |
| 41 | LIR* genRegRegCheck(CompilationUnit* cUnit, ConditionCode cCode, int reg1, int reg2, ThrowKind kind); |
| 42 | void genCompareAndBranch(CompilationUnit* cUnit, Instruction::Code opcode, RegLocation rlSrc1, RegLocation rlSrc2, LIR* taken, LIR* fallThrough); |
| 43 | void genCompareZeroAndBranch(CompilationUnit* cUnit, Instruction::Code opcode, RegLocation rlSrc, LIR* taken, LIR* fallThrough); |
| 44 | void genIntToLong(CompilationUnit* cUnit, RegLocation rlDest, RegLocation rlSrc); |
| 45 | void genIntNarrowing(CompilationUnit* cUnit, Instruction::Code opcode, RegLocation rlDest, RegLocation rlSrc); |
| 46 | void genNewArray(CompilationUnit* cUnit, uint32_t type_idx, RegLocation rlDest, RegLocation rlSrc); |
| 47 | void genFilledNewArray(CompilationUnit* cUnit, CallInfo* info); |
| 48 | void genSput(CompilationUnit* cUnit, uint32_t fieldIdx, RegLocation rlSrc, bool isLongOrDouble, bool isObject); |
| 49 | void genSget(CompilationUnit* cUnit, uint32_t fieldIdx, RegLocation rlDest, bool isLongOrDouble, bool isObject); |
| 50 | void genShowTarget(CompilationUnit* cUnit); |
| 51 | void handleSuspendLaunchpads(CompilationUnit *cUnit); |
| 52 | void handleIntrinsicLaunchpads(CompilationUnit *cUnit); |
| 53 | void handleThrowLaunchpads(CompilationUnit *cUnit); |
| 54 | void oatSetupResourceMasks(CompilationUnit* cUnit, LIR* lir); |
| 55 | bool fastInstance(CompilationUnit* cUnit, uint32_t fieldIdx, int& fieldOffset, bool& isVolatile, bool isPut); |
| 56 | void genIGet(CompilationUnit* cUnit, uint32_t fieldIdx, int optFlags, OpSize size, RegLocation rlDest, RegLocation rlObj, bool isLongOrDouble, bool isObject); |
| 57 | void genIPut(CompilationUnit* cUnit, uint32_t fieldIdx, int optFlags, OpSize size, RegLocation rlSrc, RegLocation rlObj, bool isLongOrDouble, bool isObject); |
| 58 | void genConstClass(CompilationUnit* cUnit, uint32_t type_idx, RegLocation rlDest); |
| 59 | void genConstString(CompilationUnit* cUnit, uint32_t string_idx, RegLocation rlDest); |
| 60 | void genNewInstance(CompilationUnit* cUnit, uint32_t type_idx, RegLocation rlDest); |
| 61 | void genMoveException(CompilationUnit* cUnit, RegLocation rlDest); |
| 62 | void genThrow(CompilationUnit* cUnit, RegLocation rlSrc); |
| 63 | void genInstanceof(CompilationUnit* cUnit, uint32_t type_idx, RegLocation rlDest, RegLocation rlSrc); |
| 64 | void genCheckCast(CompilationUnit* cUnit, uint32_t type_idx, RegLocation rlSrc); |
| 65 | void genArrayObjPut(CompilationUnit* cUnit, int optFlags, RegLocation rlArray, RegLocation rlIndex, RegLocation rlSrc, int scale); |
| 66 | void genArrayGet(CompilationUnit* cUnit, int optFlags, OpSize size, RegLocation rlArray, RegLocation rlIndex, RegLocation rlDest, int scale); |
| 67 | void genArrayPut(CompilationUnit* cUnit, int optFlags, OpSize size, RegLocation rlArray, RegLocation rlIndex, RegLocation rlSrc, int scale); |
| 68 | void genLong3Addr(CompilationUnit* cUnit, OpKind firstOp, OpKind secondOp, RegLocation rlDest, RegLocation rlSrc1, RegLocation rlSrc2); |
| 69 | bool genShiftOpLong(CompilationUnit* cUnit, Instruction::Code opcode, RegLocation rlDest, RegLocation rlSrc1, RegLocation rlShift); |
| 70 | bool genArithOpInt(CompilationUnit* cUnit, Instruction::Code opcode, RegLocation rlDest, RegLocation rlSrc1, RegLocation rlSrc2); |
| 71 | bool handleEasyDivide(CompilationUnit* cUnit, Instruction::Code dalvikOpcode, RegLocation rlSrc, RegLocation rlDest, int lit); |
| 72 | bool handleEasyMultiply(CompilationUnit* cUnit, RegLocation rlSrc, RegLocation rlDest, int lit); |
| 73 | bool genArithOpIntLit(CompilationUnit* cUnit, Instruction::Code opcode, RegLocation rlDest, RegLocation rlSrc, int lit); |
| 74 | bool genArithOpLong(CompilationUnit* cUnit, Instruction::Code opcode, RegLocation rlDest, RegLocation rlSrc1, RegLocation rlSrc2); |
| 75 | bool genConversionCall(CompilationUnit* cUnit, int funcOffset, RegLocation rlDest, RegLocation rlSrc); |
| 76 | bool genArithOpFloatPortable(CompilationUnit* cUnit, Instruction::Code opcode, RegLocation rlDest, RegLocation rlSrc1, RegLocation rlSrc2); |
| 77 | bool genArithOpDoublePortable(CompilationUnit* cUnit, Instruction::Code opcode, RegLocation rlDest, RegLocation rlSrc1, RegLocation rlSrc2); |
| 78 | bool genConversionPortable(CompilationUnit* cUnit, Instruction::Code opcode, RegLocation rlDest, RegLocation rlSrc); |
| 79 | void genSuspendTest(CompilationUnit* cUnit, int optFlags); |
| 80 | void genSuspendTestAndBranch(CompilationUnit* cUnit, int optFlags, LIR* target); |
| 81 | |
| 82 | #endif // ART_SRC_COMPILER_CODEGEN_GENCOMMON_H_ |