buzbee | e3acd07 | 2012-02-25 17:03:10 -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 | #include "object_utils.h" |
| 18 | |
| 19 | namespace art { |
| 20 | |
| 21 | #define DISPLAY_MISSING_TARGETS (cUnit->enableDebug & \ |
| 22 | (1 << kDebugDisplayMissingTargets)) |
| 23 | |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 24 | const RegLocation badLoc = {kLocDalvikFrame, 0, 0, 0, 0, 0, 0, |
| 25 | INVALID_REG, INVALID_REG, INVALID_SREG}; |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 26 | |
| 27 | /* Mark register usage state and return long retloc */ |
Ian Rogers | f7d9ad3 | 2012-03-13 18:45:39 -0700 | [diff] [blame] | 28 | RegLocation oatGetReturnWide(CompilationUnit* cUnit, bool isDouble) |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 29 | { |
Ian Rogers | f7d9ad3 | 2012-03-13 18:45:39 -0700 | [diff] [blame] | 30 | RegLocation gpr_res = LOC_C_RETURN_WIDE; |
| 31 | RegLocation fpr_res = LOC_C_RETURN_WIDE_DOUBLE; |
| 32 | RegLocation res = isDouble ? fpr_res : gpr_res; |
buzbee | 86a4bce | 2012-03-06 18:15:00 -0800 | [diff] [blame] | 33 | oatClobber(cUnit, res.lowReg); |
| 34 | oatClobber(cUnit, res.highReg); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 35 | oatLockTemp(cUnit, res.lowReg); |
| 36 | oatLockTemp(cUnit, res.highReg); |
| 37 | oatMarkPair(cUnit, res.lowReg, res.highReg); |
| 38 | return res; |
| 39 | } |
| 40 | |
Ian Rogers | f7d9ad3 | 2012-03-13 18:45:39 -0700 | [diff] [blame] | 41 | RegLocation oatGetReturn(CompilationUnit* cUnit, bool isFloat) |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 42 | { |
Ian Rogers | f7d9ad3 | 2012-03-13 18:45:39 -0700 | [diff] [blame] | 43 | RegLocation gpr_res = LOC_C_RETURN; |
| 44 | RegLocation fpr_res = LOC_C_RETURN_FLOAT; |
| 45 | RegLocation res = isFloat ? fpr_res : gpr_res; |
buzbee | 86a4bce | 2012-03-06 18:15:00 -0800 | [diff] [blame] | 46 | oatClobber(cUnit, res.lowReg); |
Elliott Hughes | b3cd122 | 2012-03-09 16:00:38 -0800 | [diff] [blame] | 47 | if (cUnit->instructionSet == kMips) { |
| 48 | oatMarkInUse(cUnit, res.lowReg); |
| 49 | } else { |
| 50 | oatLockTemp(cUnit, res.lowReg); |
| 51 | } |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 52 | return res; |
| 53 | } |
| 54 | |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 55 | void genInvoke(CompilationUnit* cUnit, MIR* mir, InvokeType type, bool isRange) |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 56 | { |
buzbee | a7678db | 2012-03-05 15:35:46 -0800 | [diff] [blame] | 57 | #if defined(TARGET_X86) |
| 58 | UNIMPLEMENTED(WARNING) << "genInvoke"; |
| 59 | #else |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 60 | DecodedInstruction* dInsn = &mir->dalvikInsn; |
| 61 | int callState = 0; |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 62 | LIR* nullCk; |
| 63 | LIR** pNullCk = NULL; |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 64 | NextCallInsn nextCallInsn; |
| 65 | oatFlushAllRegs(cUnit); /* Everything to home location */ |
| 66 | // Explicit register usage |
| 67 | oatLockCallTemps(cUnit); |
| 68 | |
Logan Chien | 4dd96f5 | 2012-02-29 01:26:58 +0800 | [diff] [blame] | 69 | OatCompilationUnit mUnit(cUnit->class_loader, cUnit->class_linker, |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 70 | *cUnit->dex_file, *cUnit->dex_cache, |
| 71 | cUnit->code_item, cUnit->method_idx, |
| 72 | cUnit->access_flags); |
Logan Chien | 4dd96f5 | 2012-02-29 01:26:58 +0800 | [diff] [blame] | 73 | |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 74 | uint32_t dexMethodIdx = dInsn->vB; |
| 75 | int vtableIdx; |
| 76 | bool skipThis; |
| 77 | bool fastPath = |
Logan Chien | 4dd96f5 | 2012-02-29 01:26:58 +0800 | [diff] [blame] | 78 | cUnit->compiler->ComputeInvokeInfo(dexMethodIdx, &mUnit, type, |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 79 | vtableIdx) |
| 80 | && !SLOW_INVOKE_PATH; |
| 81 | if (type == kInterface) { |
| 82 | nextCallInsn = fastPath ? nextInterfaceCallInsn |
| 83 | : nextInterfaceCallInsnWithAccessCheck; |
| 84 | skipThis = false; |
| 85 | } else if (type == kDirect) { |
| 86 | if (fastPath) { |
| 87 | pNullCk = &nullCk; |
| 88 | } |
| 89 | nextCallInsn = fastPath ? nextSDCallInsn : nextDirectCallInsnSP; |
| 90 | skipThis = false; |
| 91 | } else if (type == kStatic) { |
| 92 | nextCallInsn = fastPath ? nextSDCallInsn : nextStaticCallInsnSP; |
| 93 | skipThis = false; |
| 94 | } else if (type == kSuper) { |
| 95 | nextCallInsn = fastPath ? nextSuperCallInsn : nextSuperCallInsnSP; |
| 96 | skipThis = fastPath; |
| 97 | } else { |
| 98 | DCHECK_EQ(type, kVirtual); |
| 99 | nextCallInsn = fastPath ? nextVCallInsn : nextVCallInsnSP; |
| 100 | skipThis = fastPath; |
| 101 | } |
| 102 | if (!isRange) { |
| 103 | callState = genDalvikArgsNoRange(cUnit, mir, dInsn, callState, pNullCk, |
| 104 | nextCallInsn, dexMethodIdx, |
| 105 | vtableIdx, skipThis); |
| 106 | } else { |
| 107 | callState = genDalvikArgsRange(cUnit, mir, dInsn, callState, pNullCk, |
| 108 | nextCallInsn, dexMethodIdx, vtableIdx, |
| 109 | skipThis); |
| 110 | } |
| 111 | // Finish up any of the call sequence not interleaved in arg loading |
| 112 | while (callState >= 0) { |
| 113 | callState = nextCallInsn(cUnit, mir, callState, dexMethodIdx, |
| 114 | vtableIdx); |
| 115 | } |
| 116 | if (DISPLAY_MISSING_TARGETS) { |
| 117 | genShowTarget(cUnit); |
| 118 | } |
buzbee | 0398c42 | 2012-03-02 15:22:47 -0800 | [diff] [blame] | 119 | opReg(cUnit, kOpBlx, rINVOKE_TGT); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 120 | oatClobberCalleeSave(cUnit); |
buzbee | a7678db | 2012-03-05 15:35:46 -0800 | [diff] [blame] | 121 | #endif |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 122 | } |
| 123 | |
| 124 | /* |
| 125 | * Target-independent code generation. Use only high-level |
| 126 | * load/store utilities here, or target-dependent genXX() handlers |
| 127 | * when necessary. |
| 128 | */ |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 129 | bool compileDalvikInstruction(CompilationUnit* cUnit, MIR* mir, |
| 130 | BasicBlock* bb, LIR* labelList) |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 131 | { |
| 132 | bool res = false; // Assume success |
| 133 | RegLocation rlSrc[3]; |
| 134 | RegLocation rlDest = badLoc; |
| 135 | RegLocation rlResult = badLoc; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 136 | Instruction::Code opcode = mir->dalvikInsn.opcode; |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 137 | |
| 138 | /* Prep Src and Dest locations */ |
| 139 | int nextSreg = 0; |
| 140 | int nextLoc = 0; |
| 141 | int attrs = oatDataFlowAttributes[opcode]; |
| 142 | rlSrc[0] = rlSrc[1] = rlSrc[2] = badLoc; |
| 143 | if (attrs & DF_UA) { |
| 144 | rlSrc[nextLoc++] = oatGetSrc(cUnit, mir, nextSreg); |
| 145 | nextSreg++; |
| 146 | } else if (attrs & DF_UA_WIDE) { |
| 147 | rlSrc[nextLoc++] = oatGetSrcWide(cUnit, mir, nextSreg, |
| 148 | nextSreg + 1); |
| 149 | nextSreg+= 2; |
| 150 | } |
| 151 | if (attrs & DF_UB) { |
| 152 | rlSrc[nextLoc++] = oatGetSrc(cUnit, mir, nextSreg); |
| 153 | nextSreg++; |
| 154 | } else if (attrs & DF_UB_WIDE) { |
| 155 | rlSrc[nextLoc++] = oatGetSrcWide(cUnit, mir, nextSreg, |
| 156 | nextSreg + 1); |
| 157 | nextSreg+= 2; |
| 158 | } |
| 159 | if (attrs & DF_UC) { |
| 160 | rlSrc[nextLoc++] = oatGetSrc(cUnit, mir, nextSreg); |
| 161 | } else if (attrs & DF_UC_WIDE) { |
| 162 | rlSrc[nextLoc++] = oatGetSrcWide(cUnit, mir, nextSreg, |
| 163 | nextSreg + 1); |
| 164 | } |
| 165 | if (attrs & DF_DA) { |
| 166 | rlDest = oatGetDest(cUnit, mir, 0); |
| 167 | } else if (attrs & DF_DA_WIDE) { |
| 168 | rlDest = oatGetDestWide(cUnit, mir, 0, 1); |
| 169 | } |
| 170 | |
| 171 | switch(opcode) { |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 172 | case Instruction::NOP: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 173 | break; |
| 174 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 175 | case Instruction::MOVE_EXCEPTION: |
buzbee | a7678db | 2012-03-05 15:35:46 -0800 | [diff] [blame] | 176 | #if defined(TARGET_X86) |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 177 | UNIMPLEMENTED(WARNING) << "Instruction::MOVE_EXCEPTION"; |
buzbee | a7678db | 2012-03-05 15:35:46 -0800 | [diff] [blame] | 178 | #else |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 179 | int exOffset; |
| 180 | int resetReg; |
| 181 | exOffset = Thread::ExceptionOffset().Int32Value(); |
| 182 | resetReg = oatAllocTemp(cUnit); |
| 183 | rlResult = oatEvalLoc(cUnit, rlDest, kCoreReg, true); |
| 184 | loadWordDisp(cUnit, rSELF, exOffset, rlResult.lowReg); |
| 185 | loadConstant(cUnit, resetReg, 0); |
| 186 | storeWordDisp(cUnit, rSELF, exOffset, resetReg); |
| 187 | storeValue(cUnit, rlDest, rlResult); |
buzbee | a7678db | 2012-03-05 15:35:46 -0800 | [diff] [blame] | 188 | #endif |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 189 | break; |
| 190 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 191 | case Instruction::RETURN_VOID: |
buzbee | 86a4bce | 2012-03-06 18:15:00 -0800 | [diff] [blame] | 192 | if (!cUnit->attrs & METHOD_IS_LEAF) { |
| 193 | genSuspendTest(cUnit, mir); |
| 194 | } |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 195 | break; |
| 196 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 197 | case Instruction::RETURN: |
| 198 | case Instruction::RETURN_OBJECT: |
buzbee | 86a4bce | 2012-03-06 18:15:00 -0800 | [diff] [blame] | 199 | if (!cUnit->attrs & METHOD_IS_LEAF) { |
| 200 | genSuspendTest(cUnit, mir); |
| 201 | } |
Ian Rogers | f7d9ad3 | 2012-03-13 18:45:39 -0700 | [diff] [blame] | 202 | storeValue(cUnit, oatGetReturn(cUnit, cUnit->shorty[0] == 'F'), |
| 203 | rlSrc[0]); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 204 | break; |
| 205 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 206 | case Instruction::RETURN_WIDE: |
buzbee | 86a4bce | 2012-03-06 18:15:00 -0800 | [diff] [blame] | 207 | if (!cUnit->attrs & METHOD_IS_LEAF) { |
| 208 | genSuspendTest(cUnit, mir); |
| 209 | } |
Ian Rogers | f7d9ad3 | 2012-03-13 18:45:39 -0700 | [diff] [blame] | 210 | storeValueWide(cUnit, oatGetReturnWide(cUnit, |
| 211 | cUnit->shorty[0] == 'D'), rlSrc[0]); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 212 | break; |
| 213 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 214 | case Instruction::MOVE_RESULT_WIDE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 215 | if (mir->optimizationFlags & MIR_INLINED) |
| 216 | break; // Nop - combined w/ previous invoke |
Ian Rogers | f7d9ad3 | 2012-03-13 18:45:39 -0700 | [diff] [blame] | 217 | storeValueWide(cUnit, rlDest, oatGetReturnWide(cUnit, rlDest.fp)); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 218 | break; |
| 219 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 220 | case Instruction::MOVE_RESULT: |
| 221 | case Instruction::MOVE_RESULT_OBJECT: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 222 | if (mir->optimizationFlags & MIR_INLINED) |
| 223 | break; // Nop - combined w/ previous invoke |
Ian Rogers | f7d9ad3 | 2012-03-13 18:45:39 -0700 | [diff] [blame] | 224 | storeValue(cUnit, rlDest, oatGetReturn(cUnit, rlDest.fp)); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 225 | break; |
| 226 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 227 | case Instruction::MOVE: |
| 228 | case Instruction::MOVE_OBJECT: |
| 229 | case Instruction::MOVE_16: |
| 230 | case Instruction::MOVE_OBJECT_16: |
| 231 | case Instruction::MOVE_FROM16: |
| 232 | case Instruction::MOVE_OBJECT_FROM16: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 233 | storeValue(cUnit, rlDest, rlSrc[0]); |
| 234 | break; |
| 235 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 236 | case Instruction::MOVE_WIDE: |
| 237 | case Instruction::MOVE_WIDE_16: |
| 238 | case Instruction::MOVE_WIDE_FROM16: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 239 | storeValueWide(cUnit, rlDest, rlSrc[0]); |
| 240 | break; |
| 241 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 242 | case Instruction::CONST: |
| 243 | case Instruction::CONST_4: |
| 244 | case Instruction::CONST_16: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 245 | rlResult = oatEvalLoc(cUnit, rlDest, kAnyReg, true); |
| 246 | loadConstantNoClobber(cUnit, rlResult.lowReg, mir->dalvikInsn.vB); |
| 247 | storeValue(cUnit, rlDest, rlResult); |
| 248 | break; |
| 249 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 250 | case Instruction::CONST_HIGH16: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 251 | rlResult = oatEvalLoc(cUnit, rlDest, kAnyReg, true); |
| 252 | loadConstantNoClobber(cUnit, rlResult.lowReg, |
| 253 | mir->dalvikInsn.vB << 16); |
| 254 | storeValue(cUnit, rlDest, rlResult); |
| 255 | break; |
| 256 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 257 | case Instruction::CONST_WIDE_16: |
| 258 | case Instruction::CONST_WIDE_32: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 259 | rlResult = oatEvalLoc(cUnit, rlDest, kAnyReg, true); |
| 260 | loadConstantValueWide(cUnit, rlResult.lowReg, rlResult.highReg, |
| 261 | mir->dalvikInsn.vB, |
| 262 | (mir->dalvikInsn.vB & 0x80000000) ? -1 : 0); |
| 263 | storeValueWide(cUnit, rlDest, rlResult); |
| 264 | break; |
| 265 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 266 | case Instruction::CONST_WIDE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 267 | rlResult = oatEvalLoc(cUnit, rlDest, kAnyReg, true); |
| 268 | loadConstantValueWide(cUnit, rlResult.lowReg, rlResult.highReg, |
| 269 | mir->dalvikInsn.vB_wide & 0xffffffff, |
| 270 | (mir->dalvikInsn.vB_wide >> 32) & 0xffffffff); |
| 271 | storeValueWide(cUnit, rlDest, rlResult); |
| 272 | break; |
| 273 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 274 | case Instruction::CONST_WIDE_HIGH16: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 275 | rlResult = oatEvalLoc(cUnit, rlDest, kAnyReg, true); |
| 276 | loadConstantValueWide(cUnit, rlResult.lowReg, rlResult.highReg, |
| 277 | 0, mir->dalvikInsn.vB << 16); |
| 278 | storeValueWide(cUnit, rlDest, rlResult); |
| 279 | break; |
| 280 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 281 | case Instruction::MONITOR_ENTER: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 282 | genMonitorEnter(cUnit, mir, rlSrc[0]); |
| 283 | break; |
| 284 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 285 | case Instruction::MONITOR_EXIT: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 286 | genMonitorExit(cUnit, mir, rlSrc[0]); |
| 287 | break; |
| 288 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 289 | case Instruction::CHECK_CAST: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 290 | genCheckCast(cUnit, mir, rlSrc[0]); |
| 291 | break; |
| 292 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 293 | case Instruction::INSTANCE_OF: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 294 | genInstanceof(cUnit, mir, rlDest, rlSrc[0]); |
| 295 | break; |
| 296 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 297 | case Instruction::NEW_INSTANCE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 298 | genNewInstance(cUnit, mir, rlDest); |
| 299 | break; |
| 300 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 301 | case Instruction::THROW: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 302 | genThrow(cUnit, mir, rlSrc[0]); |
| 303 | break; |
| 304 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 305 | case Instruction::THROW_VERIFICATION_ERROR: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 306 | genThrowVerificationError(cUnit, mir); |
| 307 | break; |
| 308 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 309 | case Instruction::ARRAY_LENGTH: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 310 | int lenOffset; |
| 311 | lenOffset = Array::LengthOffset().Int32Value(); |
| 312 | rlSrc[0] = loadValue(cUnit, rlSrc[0], kCoreReg); |
| 313 | genNullCheck(cUnit, rlSrc[0].sRegLow, rlSrc[0].lowReg, mir); |
| 314 | rlResult = oatEvalLoc(cUnit, rlDest, kCoreReg, true); |
| 315 | loadWordDisp(cUnit, rlSrc[0].lowReg, lenOffset, |
| 316 | rlResult.lowReg); |
| 317 | storeValue(cUnit, rlDest, rlResult); |
| 318 | break; |
| 319 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 320 | case Instruction::CONST_STRING: |
| 321 | case Instruction::CONST_STRING_JUMBO: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 322 | genConstString(cUnit, mir, rlDest, rlSrc[0]); |
| 323 | break; |
| 324 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 325 | case Instruction::CONST_CLASS: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 326 | genConstClass(cUnit, mir, rlDest, rlSrc[0]); |
| 327 | break; |
| 328 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 329 | case Instruction::FILL_ARRAY_DATA: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 330 | genFillArrayData(cUnit, mir, rlSrc[0]); |
| 331 | break; |
| 332 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 333 | case Instruction::FILLED_NEW_ARRAY: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 334 | genFilledNewArray(cUnit, mir, false /* not range */); |
| 335 | break; |
| 336 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 337 | case Instruction::FILLED_NEW_ARRAY_RANGE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 338 | genFilledNewArray(cUnit, mir, true /* range */); |
| 339 | break; |
| 340 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 341 | case Instruction::NEW_ARRAY: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 342 | genNewArray(cUnit, mir, rlDest, rlSrc[0]); |
| 343 | break; |
| 344 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 345 | case Instruction::GOTO: |
| 346 | case Instruction::GOTO_16: |
| 347 | case Instruction::GOTO_32: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 348 | if (bb->taken->startOffset <= mir->offset) { |
| 349 | genSuspendTest(cUnit, mir); |
| 350 | } |
buzbee | 82488f5 | 2012-03-02 08:20:26 -0800 | [diff] [blame] | 351 | opUnconditionalBranch(cUnit, &labelList[bb->taken->id]); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 352 | break; |
| 353 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 354 | case Instruction::PACKED_SWITCH: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 355 | genPackedSwitch(cUnit, mir, rlSrc[0]); |
| 356 | break; |
| 357 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 358 | case Instruction::SPARSE_SWITCH: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 359 | genSparseSwitch(cUnit, mir, rlSrc[0]); |
| 360 | break; |
| 361 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 362 | case Instruction::CMPL_FLOAT: |
| 363 | case Instruction::CMPG_FLOAT: |
| 364 | case Instruction::CMPL_DOUBLE: |
| 365 | case Instruction::CMPG_DOUBLE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 366 | res = genCmpFP(cUnit, mir, rlDest, rlSrc[0], rlSrc[1]); |
| 367 | break; |
| 368 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 369 | case Instruction::CMP_LONG: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 370 | genCmpLong(cUnit, mir, rlDest, rlSrc[0], rlSrc[1]); |
| 371 | break; |
| 372 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 373 | case Instruction::IF_EQ: |
| 374 | case Instruction::IF_NE: |
| 375 | case Instruction::IF_LT: |
| 376 | case Instruction::IF_GE: |
| 377 | case Instruction::IF_GT: |
| 378 | case Instruction::IF_LE: { |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 379 | bool backwardBranch; |
| 380 | backwardBranch = (bb->taken->startOffset <= mir->offset); |
| 381 | if (backwardBranch) { |
| 382 | genSuspendTest(cUnit, mir); |
| 383 | } |
| 384 | genCompareAndBranch(cUnit, bb, mir, rlSrc[0], rlSrc[1], labelList); |
| 385 | break; |
| 386 | } |
| 387 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 388 | case Instruction::IF_EQZ: |
| 389 | case Instruction::IF_NEZ: |
| 390 | case Instruction::IF_LTZ: |
| 391 | case Instruction::IF_GEZ: |
| 392 | case Instruction::IF_GTZ: |
| 393 | case Instruction::IF_LEZ: { |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 394 | bool backwardBranch; |
| 395 | backwardBranch = (bb->taken->startOffset <= mir->offset); |
| 396 | if (backwardBranch) { |
| 397 | genSuspendTest(cUnit, mir); |
| 398 | } |
| 399 | genCompareZeroAndBranch(cUnit, bb, mir, rlSrc[0], labelList); |
| 400 | break; |
| 401 | } |
| 402 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 403 | case Instruction::AGET_WIDE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 404 | genArrayGet(cUnit, mir, kLong, rlSrc[0], rlSrc[1], rlDest, 3); |
| 405 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 406 | case Instruction::AGET: |
| 407 | case Instruction::AGET_OBJECT: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 408 | genArrayGet(cUnit, mir, kWord, rlSrc[0], rlSrc[1], rlDest, 2); |
| 409 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 410 | case Instruction::AGET_BOOLEAN: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 411 | genArrayGet(cUnit, mir, kUnsignedByte, rlSrc[0], rlSrc[1], |
| 412 | rlDest, 0); |
| 413 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 414 | case Instruction::AGET_BYTE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 415 | genArrayGet(cUnit, mir, kSignedByte, rlSrc[0], rlSrc[1], rlDest, 0); |
| 416 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 417 | case Instruction::AGET_CHAR: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 418 | genArrayGet(cUnit, mir, kUnsignedHalf, rlSrc[0], rlSrc[1], |
| 419 | rlDest, 1); |
| 420 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 421 | case Instruction::AGET_SHORT: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 422 | genArrayGet(cUnit, mir, kSignedHalf, rlSrc[0], rlSrc[1], rlDest, 1); |
| 423 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 424 | case Instruction::APUT_WIDE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 425 | genArrayPut(cUnit, mir, kLong, rlSrc[1], rlSrc[2], rlSrc[0], 3); |
| 426 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 427 | case Instruction::APUT: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 428 | genArrayPut(cUnit, mir, kWord, rlSrc[1], rlSrc[2], rlSrc[0], 2); |
| 429 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 430 | case Instruction::APUT_OBJECT: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 431 | genArrayObjPut(cUnit, mir, rlSrc[1], rlSrc[2], rlSrc[0], 2); |
| 432 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 433 | case Instruction::APUT_SHORT: |
| 434 | case Instruction::APUT_CHAR: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 435 | genArrayPut(cUnit, mir, kUnsignedHalf, rlSrc[1], rlSrc[2], |
| 436 | rlSrc[0], 1); |
| 437 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 438 | case Instruction::APUT_BYTE: |
| 439 | case Instruction::APUT_BOOLEAN: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 440 | genArrayPut(cUnit, mir, kUnsignedByte, rlSrc[1], rlSrc[2], |
| 441 | rlSrc[0], 0); |
| 442 | break; |
| 443 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 444 | case Instruction::IGET_OBJECT: |
| 445 | //case Instruction::IGET_OBJECT_VOLATILE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 446 | genIGet(cUnit, mir, kWord, rlDest, rlSrc[0], false, true); |
| 447 | break; |
| 448 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 449 | case Instruction::IGET_WIDE: |
| 450 | //case Instruction::IGET_WIDE_VOLATILE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 451 | genIGet(cUnit, mir, kLong, rlDest, rlSrc[0], true, false); |
| 452 | break; |
| 453 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 454 | case Instruction::IGET: |
| 455 | //case Instruction::IGET_VOLATILE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 456 | genIGet(cUnit, mir, kWord, rlDest, rlSrc[0], false, false); |
| 457 | break; |
| 458 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 459 | case Instruction::IGET_CHAR: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 460 | genIGet(cUnit, mir, kUnsignedHalf, rlDest, rlSrc[0], false, false); |
| 461 | break; |
| 462 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 463 | case Instruction::IGET_SHORT: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 464 | genIGet(cUnit, mir, kSignedHalf, rlDest, rlSrc[0], false, false); |
| 465 | break; |
| 466 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 467 | case Instruction::IGET_BOOLEAN: |
| 468 | case Instruction::IGET_BYTE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 469 | genIGet(cUnit, mir, kUnsignedByte, rlDest, rlSrc[0], false, false); |
| 470 | break; |
| 471 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 472 | case Instruction::IPUT_WIDE: |
| 473 | //case Instruction::IPUT_WIDE_VOLATILE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 474 | genIPut(cUnit, mir, kLong, rlSrc[0], rlSrc[1], true, false); |
| 475 | break; |
| 476 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 477 | case Instruction::IPUT_OBJECT: |
| 478 | //case Instruction::IPUT_OBJECT_VOLATILE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 479 | genIPut(cUnit, mir, kWord, rlSrc[0], rlSrc[1], false, true); |
| 480 | break; |
| 481 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 482 | case Instruction::IPUT: |
| 483 | //case Instruction::IPUT_VOLATILE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 484 | genIPut(cUnit, mir, kWord, rlSrc[0], rlSrc[1], false, false); |
| 485 | break; |
| 486 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 487 | case Instruction::IPUT_BOOLEAN: |
| 488 | case Instruction::IPUT_BYTE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 489 | genIPut(cUnit, mir, kUnsignedByte, rlSrc[0], rlSrc[1], false, false); |
| 490 | break; |
| 491 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 492 | case Instruction::IPUT_CHAR: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 493 | genIPut(cUnit, mir, kUnsignedHalf, rlSrc[0], rlSrc[1], false, false); |
| 494 | break; |
| 495 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 496 | case Instruction::IPUT_SHORT: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 497 | genIPut(cUnit, mir, kSignedHalf, rlSrc[0], rlSrc[1], false, false); |
| 498 | break; |
| 499 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 500 | case Instruction::SGET_OBJECT: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 501 | genSget(cUnit, mir, rlDest, false, true); |
| 502 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 503 | case Instruction::SGET: |
| 504 | case Instruction::SGET_BOOLEAN: |
| 505 | case Instruction::SGET_BYTE: |
| 506 | case Instruction::SGET_CHAR: |
| 507 | case Instruction::SGET_SHORT: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 508 | genSget(cUnit, mir, rlDest, false, false); |
| 509 | break; |
| 510 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 511 | case Instruction::SGET_WIDE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 512 | genSget(cUnit, mir, rlDest, true, false); |
| 513 | break; |
| 514 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 515 | case Instruction::SPUT_OBJECT: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 516 | genSput(cUnit, mir, rlSrc[0], false, true); |
| 517 | break; |
| 518 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 519 | case Instruction::SPUT: |
| 520 | case Instruction::SPUT_BOOLEAN: |
| 521 | case Instruction::SPUT_BYTE: |
| 522 | case Instruction::SPUT_CHAR: |
| 523 | case Instruction::SPUT_SHORT: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 524 | genSput(cUnit, mir, rlSrc[0], false, false); |
| 525 | break; |
| 526 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 527 | case Instruction::SPUT_WIDE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 528 | genSput(cUnit, mir, rlSrc[0], true, false); |
| 529 | break; |
| 530 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 531 | case Instruction::INVOKE_STATIC_RANGE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 532 | genInvoke(cUnit, mir, kStatic, true /*range*/); |
| 533 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 534 | case Instruction::INVOKE_STATIC: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 535 | genInvoke(cUnit, mir, kStatic, false /*range*/); |
| 536 | break; |
| 537 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 538 | case Instruction::INVOKE_DIRECT: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 539 | genInvoke(cUnit, mir, kDirect, false /*range*/); |
| 540 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 541 | case Instruction::INVOKE_DIRECT_RANGE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 542 | genInvoke(cUnit, mir, kDirect, true /*range*/); |
| 543 | break; |
| 544 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 545 | case Instruction::INVOKE_VIRTUAL: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 546 | genInvoke(cUnit, mir, kVirtual, false /*range*/); |
| 547 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 548 | case Instruction::INVOKE_VIRTUAL_RANGE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 549 | genInvoke(cUnit, mir, kVirtual, true /*range*/); |
| 550 | break; |
| 551 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 552 | case Instruction::INVOKE_SUPER: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 553 | genInvoke(cUnit, mir, kSuper, false /*range*/); |
| 554 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 555 | case Instruction::INVOKE_SUPER_RANGE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 556 | genInvoke(cUnit, mir, kSuper, true /*range*/); |
| 557 | break; |
| 558 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 559 | case Instruction::INVOKE_INTERFACE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 560 | genInvoke(cUnit, mir, kInterface, false /*range*/); |
| 561 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 562 | case Instruction::INVOKE_INTERFACE_RANGE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 563 | genInvoke(cUnit, mir, kInterface, true /*range*/); |
| 564 | break; |
| 565 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 566 | case Instruction::NEG_INT: |
| 567 | case Instruction::NOT_INT: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 568 | res = genArithOpInt(cUnit, mir, rlDest, rlSrc[0], rlSrc[0]); |
| 569 | break; |
| 570 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 571 | case Instruction::NEG_LONG: |
| 572 | case Instruction::NOT_LONG: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 573 | res = genArithOpLong(cUnit, mir, rlDest, rlSrc[0], rlSrc[0]); |
| 574 | break; |
| 575 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 576 | case Instruction::NEG_FLOAT: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 577 | res = genArithOpFloat(cUnit, mir, rlDest, rlSrc[0], rlSrc[0]); |
| 578 | break; |
| 579 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 580 | case Instruction::NEG_DOUBLE: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 581 | res = genArithOpDouble(cUnit, mir, rlDest, rlSrc[0], rlSrc[0]); |
| 582 | break; |
| 583 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 584 | case Instruction::INT_TO_LONG: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 585 | genIntToLong(cUnit, mir, rlDest, rlSrc[0]); |
| 586 | break; |
| 587 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 588 | case Instruction::LONG_TO_INT: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 589 | rlSrc[0] = oatUpdateLocWide(cUnit, rlSrc[0]); |
| 590 | rlSrc[0] = oatWideToNarrow(cUnit, rlSrc[0]); |
| 591 | storeValue(cUnit, rlDest, rlSrc[0]); |
| 592 | break; |
| 593 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 594 | case Instruction::INT_TO_BYTE: |
| 595 | case Instruction::INT_TO_SHORT: |
| 596 | case Instruction::INT_TO_CHAR: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 597 | genIntNarrowing(cUnit, mir, rlDest, rlSrc[0]); |
| 598 | break; |
| 599 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 600 | case Instruction::INT_TO_FLOAT: |
| 601 | case Instruction::INT_TO_DOUBLE: |
| 602 | case Instruction::LONG_TO_FLOAT: |
| 603 | case Instruction::LONG_TO_DOUBLE: |
| 604 | case Instruction::FLOAT_TO_INT: |
| 605 | case Instruction::FLOAT_TO_LONG: |
| 606 | case Instruction::FLOAT_TO_DOUBLE: |
| 607 | case Instruction::DOUBLE_TO_INT: |
| 608 | case Instruction::DOUBLE_TO_LONG: |
| 609 | case Instruction::DOUBLE_TO_FLOAT: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 610 | genConversion(cUnit, mir); |
| 611 | break; |
| 612 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 613 | case Instruction::ADD_INT: |
| 614 | case Instruction::SUB_INT: |
| 615 | case Instruction::MUL_INT: |
| 616 | case Instruction::DIV_INT: |
| 617 | case Instruction::REM_INT: |
| 618 | case Instruction::AND_INT: |
| 619 | case Instruction::OR_INT: |
| 620 | case Instruction::XOR_INT: |
| 621 | case Instruction::SHL_INT: |
| 622 | case Instruction::SHR_INT: |
| 623 | case Instruction::USHR_INT: |
| 624 | case Instruction::ADD_INT_2ADDR: |
| 625 | case Instruction::SUB_INT_2ADDR: |
| 626 | case Instruction::MUL_INT_2ADDR: |
| 627 | case Instruction::DIV_INT_2ADDR: |
| 628 | case Instruction::REM_INT_2ADDR: |
| 629 | case Instruction::AND_INT_2ADDR: |
| 630 | case Instruction::OR_INT_2ADDR: |
| 631 | case Instruction::XOR_INT_2ADDR: |
| 632 | case Instruction::SHL_INT_2ADDR: |
| 633 | case Instruction::SHR_INT_2ADDR: |
| 634 | case Instruction::USHR_INT_2ADDR: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 635 | genArithOpInt(cUnit, mir, rlDest, rlSrc[0], rlSrc[1]); |
| 636 | break; |
| 637 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 638 | case Instruction::ADD_LONG: |
| 639 | case Instruction::SUB_LONG: |
| 640 | case Instruction::MUL_LONG: |
| 641 | case Instruction::DIV_LONG: |
| 642 | case Instruction::REM_LONG: |
| 643 | case Instruction::AND_LONG: |
| 644 | case Instruction::OR_LONG: |
| 645 | case Instruction::XOR_LONG: |
| 646 | case Instruction::ADD_LONG_2ADDR: |
| 647 | case Instruction::SUB_LONG_2ADDR: |
| 648 | case Instruction::MUL_LONG_2ADDR: |
| 649 | case Instruction::DIV_LONG_2ADDR: |
| 650 | case Instruction::REM_LONG_2ADDR: |
| 651 | case Instruction::AND_LONG_2ADDR: |
| 652 | case Instruction::OR_LONG_2ADDR: |
| 653 | case Instruction::XOR_LONG_2ADDR: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 654 | genArithOpLong(cUnit, mir, rlDest, rlSrc[0], rlSrc[1]); |
| 655 | break; |
| 656 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 657 | case Instruction::SHL_LONG: |
| 658 | case Instruction::SHR_LONG: |
| 659 | case Instruction::USHR_LONG: |
| 660 | case Instruction::SHL_LONG_2ADDR: |
| 661 | case Instruction::SHR_LONG_2ADDR: |
| 662 | case Instruction::USHR_LONG_2ADDR: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 663 | genShiftOpLong(cUnit,mir, rlDest, rlSrc[0], rlSrc[1]); |
| 664 | break; |
| 665 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 666 | case Instruction::ADD_FLOAT: |
| 667 | case Instruction::SUB_FLOAT: |
| 668 | case Instruction::MUL_FLOAT: |
| 669 | case Instruction::DIV_FLOAT: |
| 670 | case Instruction::REM_FLOAT: |
| 671 | case Instruction::ADD_FLOAT_2ADDR: |
| 672 | case Instruction::SUB_FLOAT_2ADDR: |
| 673 | case Instruction::MUL_FLOAT_2ADDR: |
| 674 | case Instruction::DIV_FLOAT_2ADDR: |
| 675 | case Instruction::REM_FLOAT_2ADDR: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 676 | genArithOpFloat(cUnit, mir, rlDest, rlSrc[0], rlSrc[1]); |
| 677 | break; |
| 678 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 679 | case Instruction::ADD_DOUBLE: |
| 680 | case Instruction::SUB_DOUBLE: |
| 681 | case Instruction::MUL_DOUBLE: |
| 682 | case Instruction::DIV_DOUBLE: |
| 683 | case Instruction::REM_DOUBLE: |
| 684 | case Instruction::ADD_DOUBLE_2ADDR: |
| 685 | case Instruction::SUB_DOUBLE_2ADDR: |
| 686 | case Instruction::MUL_DOUBLE_2ADDR: |
| 687 | case Instruction::DIV_DOUBLE_2ADDR: |
| 688 | case Instruction::REM_DOUBLE_2ADDR: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 689 | genArithOpDouble(cUnit, mir, rlDest, rlSrc[0], rlSrc[1]); |
| 690 | break; |
| 691 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 692 | case Instruction::RSUB_INT: |
| 693 | case Instruction::ADD_INT_LIT16: |
| 694 | case Instruction::MUL_INT_LIT16: |
| 695 | case Instruction::DIV_INT_LIT16: |
| 696 | case Instruction::REM_INT_LIT16: |
| 697 | case Instruction::AND_INT_LIT16: |
| 698 | case Instruction::OR_INT_LIT16: |
| 699 | case Instruction::XOR_INT_LIT16: |
| 700 | case Instruction::ADD_INT_LIT8: |
| 701 | case Instruction::RSUB_INT_LIT8: |
| 702 | case Instruction::MUL_INT_LIT8: |
| 703 | case Instruction::DIV_INT_LIT8: |
| 704 | case Instruction::REM_INT_LIT8: |
| 705 | case Instruction::AND_INT_LIT8: |
| 706 | case Instruction::OR_INT_LIT8: |
| 707 | case Instruction::XOR_INT_LIT8: |
| 708 | case Instruction::SHL_INT_LIT8: |
| 709 | case Instruction::SHR_INT_LIT8: |
| 710 | case Instruction::USHR_INT_LIT8: |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 711 | genArithOpIntLit(cUnit, mir, rlDest, rlSrc[0], mir->dalvikInsn.vC); |
| 712 | break; |
| 713 | |
| 714 | default: |
| 715 | res = true; |
| 716 | } |
| 717 | return res; |
| 718 | } |
| 719 | |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 720 | const char* extendedMIROpNames[kMirOpLast - kMirOpFirst] = { |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 721 | "kMirOpPhi", |
| 722 | "kMirOpNullNRangeUpCheck", |
| 723 | "kMirOpNullNRangeDownCheck", |
| 724 | "kMirOpLowerBound", |
buzbee | e196567 | 2012-03-11 18:39:19 -0700 | [diff] [blame] | 725 | "kMirOpCopy", |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 726 | }; |
| 727 | |
| 728 | /* Extended MIR instructions like PHI */ |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 729 | void handleExtendedMethodMIR(CompilationUnit* cUnit, MIR* mir) |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 730 | { |
| 731 | int opOffset = mir->dalvikInsn.opcode - kMirOpFirst; |
| 732 | char* msg = NULL; |
| 733 | if (cUnit->printMe) { |
| 734 | msg = (char*)oatNew(cUnit, strlen(extendedMIROpNames[opOffset]) + 1, |
| 735 | false, kAllocDebugInfo); |
| 736 | strcpy(msg, extendedMIROpNames[opOffset]); |
| 737 | } |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 738 | LIR* op = newLIR1(cUnit, kPseudoExtended, (int) msg); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 739 | |
| 740 | switch ((ExtendedMIROpcode)mir->dalvikInsn.opcode) { |
| 741 | case kMirOpPhi: { |
| 742 | char* ssaString = NULL; |
| 743 | if (cUnit->printMe) { |
| 744 | ssaString = oatGetSSAString(cUnit, mir->ssaRep); |
| 745 | } |
| 746 | op->flags.isNop = true; |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 747 | newLIR1(cUnit, kPseudoSSARep, (int) ssaString); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 748 | break; |
| 749 | } |
buzbee | e196567 | 2012-03-11 18:39:19 -0700 | [diff] [blame] | 750 | case kMirOpCopy: |
| 751 | UNIMPLEMENTED(FATAL) << "Need kMirOpCopy"; |
| 752 | break; |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 753 | default: |
| 754 | break; |
| 755 | } |
| 756 | } |
| 757 | |
| 758 | /* Handle the content in each basic block */ |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 759 | bool methodBlockCodeGen(CompilationUnit* cUnit, BasicBlock* bb) |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 760 | { |
| 761 | MIR* mir; |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 762 | LIR* labelList = (LIR*) cUnit->blockLabelList; |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 763 | int blockId = bb->id; |
| 764 | |
| 765 | cUnit->curBlock = bb; |
| 766 | labelList[blockId].operands[0] = bb->startOffset; |
| 767 | |
| 768 | /* Insert the block label */ |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 769 | labelList[blockId].opcode = kPseudoNormalBlockLabel; |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 770 | oatAppendLIR(cUnit, (LIR*) &labelList[blockId]); |
| 771 | |
buzbee | e196567 | 2012-03-11 18:39:19 -0700 | [diff] [blame] | 772 | /* Free temp registers and reset redundant store tracking */ |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 773 | oatResetRegPool(cUnit); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 774 | oatResetDefTracking(cUnit); |
| 775 | |
buzbee | e196567 | 2012-03-11 18:39:19 -0700 | [diff] [blame] | 776 | /* |
| 777 | * If control reached us from our immediate predecessor via |
| 778 | * fallthrough and we have no other incoming arcs we can |
| 779 | * reuse existing liveness. Otherwise, reset. |
| 780 | */ |
| 781 | if (!bb->fallThroughTarget || bb->predecessors->numUsed != 1) { |
| 782 | oatClobberAllRegs(cUnit); |
| 783 | } |
| 784 | |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 785 | LIR* headLIR = NULL; |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 786 | |
| 787 | if (bb->blockType == kEntryBlock) { |
| 788 | genEntrySequence(cUnit, bb); |
| 789 | } else if (bb->blockType == kExitBlock) { |
| 790 | genExitSequence(cUnit, bb); |
| 791 | } |
| 792 | |
| 793 | for (mir = bb->firstMIRInsn; mir; mir = mir->next) { |
| 794 | |
| 795 | oatResetRegPool(cUnit); |
| 796 | if (cUnit->disableOpt & (1 << kTrackLiveTemps)) { |
| 797 | oatClobberAllRegs(cUnit); |
| 798 | } |
| 799 | |
| 800 | if (cUnit->disableOpt & (1 << kSuppressLoads)) { |
| 801 | oatResetDefTracking(cUnit); |
| 802 | } |
| 803 | |
buzbee | 3d66194 | 2012-03-14 17:37:27 -0700 | [diff] [blame] | 804 | #ifndef NDEBUG |
| 805 | /* Reset temp tracking sanity check */ |
| 806 | cUnit->liveSReg = INVALID_SREG; |
| 807 | #endif |
| 808 | |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 809 | if ((int)mir->dalvikInsn.opcode >= (int)kMirOpFirst) { |
| 810 | handleExtendedMethodMIR(cUnit, mir); |
| 811 | continue; |
| 812 | } |
| 813 | |
| 814 | cUnit->currentDalvikOffset = mir->offset; |
| 815 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 816 | Instruction::Code dalvikOpcode = mir->dalvikInsn.opcode; |
| 817 | Instruction::Format dalvikFormat = Instruction::FormatOf(dalvikOpcode); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 818 | |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 819 | LIR* boundaryLIR; |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 820 | |
| 821 | /* Mark the beginning of a Dalvik instruction for line tracking */ |
| 822 | char* instStr = cUnit->printMe ? |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 823 | oatGetDalvikDisassembly(cUnit, mir->dalvikInsn, "") : NULL; |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 824 | boundaryLIR = newLIR1(cUnit, kPseudoDalvikByteCodeBoundary, |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 825 | (intptr_t) instStr); |
| 826 | cUnit->boundaryMap.insert(std::make_pair(mir->offset, |
| 827 | (LIR*)boundaryLIR)); |
| 828 | /* Remember the first LIR for this block */ |
| 829 | if (headLIR == NULL) { |
| 830 | headLIR = boundaryLIR; |
| 831 | /* Set the first boundaryLIR as a scheduling barrier */ |
| 832 | headLIR->defMask = ENCODE_ALL; |
| 833 | } |
| 834 | |
| 835 | /* If we're compiling for the debugger, generate an update callout */ |
| 836 | if (cUnit->genDebugger) { |
| 837 | genDebuggerUpdate(cUnit, mir->offset); |
| 838 | } |
| 839 | |
| 840 | /* Don't generate the SSA annotation unless verbose mode is on */ |
| 841 | if (cUnit->printMe && mir->ssaRep) { |
| 842 | char* ssaString = oatGetSSAString(cUnit, mir->ssaRep); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 843 | newLIR1(cUnit, kPseudoSSARep, (int) ssaString); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 844 | } |
| 845 | |
| 846 | bool notHandled = compileDalvikInstruction(cUnit, mir, bb, labelList); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 847 | if (notHandled) { |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 848 | LOG(FATAL) << StringPrintf("%#06x: Opcode %#x (%s) / Fmt %d not handled", |
| 849 | mir->offset, dalvikOpcode, Instruction::Name(dalvikOpcode), dalvikFormat); |
| 850 | |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 851 | } |
| 852 | } |
| 853 | |
| 854 | if (headLIR) { |
| 855 | /* |
| 856 | * Eliminate redundant loads/stores and delay stores into later |
| 857 | * slots |
| 858 | */ |
| 859 | oatApplyLocalOptimizations(cUnit, (LIR*) headLIR, |
| 860 | cUnit->lastLIRInsn); |
| 861 | |
| 862 | /* |
| 863 | * Generate an unconditional branch to the fallthrough block. |
| 864 | */ |
| 865 | if (bb->fallThrough) { |
buzbee | 82488f5 | 2012-03-02 08:20:26 -0800 | [diff] [blame] | 866 | opUnconditionalBranch(cUnit, |
| 867 | &labelList[bb->fallThrough->id]); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 868 | } |
| 869 | } |
| 870 | return false; |
| 871 | } |
| 872 | |
| 873 | void oatMethodMIR2LIR(CompilationUnit* cUnit) |
| 874 | { |
| 875 | /* Used to hold the labels of each block */ |
| 876 | cUnit->blockLabelList = |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 877 | (void *) oatNew(cUnit, sizeof(LIR) * cUnit->numBlocks, true, |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 878 | kAllocLIR); |
| 879 | |
| 880 | oatDataFlowAnalysisDispatcher(cUnit, methodBlockCodeGen, |
| 881 | kPreOrderDFSTraversal, false /* Iterative */); |
| 882 | handleSuspendLaunchpads(cUnit); |
| 883 | |
| 884 | handleThrowLaunchpads(cUnit); |
| 885 | |
buzbee | 86a4bce | 2012-03-06 18:15:00 -0800 | [diff] [blame] | 886 | if (!(cUnit->disableOpt & (1 << kSafeOptimizations))) { |
| 887 | removeRedundantBranches(cUnit); |
| 888 | } |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 889 | } |
| 890 | |
| 891 | /* Needed by the ld/st optmizatons */ |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 892 | LIR* oatRegCopyNoInsert(CompilationUnit* cUnit, int rDest, int rSrc) |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 893 | { |
buzbee | 82488f5 | 2012-03-02 08:20:26 -0800 | [diff] [blame] | 894 | return opRegCopyNoInsert(cUnit, rDest, rSrc); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 895 | } |
| 896 | |
| 897 | /* Needed by the register allocator */ |
| 898 | void oatRegCopy(CompilationUnit* cUnit, int rDest, int rSrc) |
| 899 | { |
buzbee | 82488f5 | 2012-03-02 08:20:26 -0800 | [diff] [blame] | 900 | opRegCopy(cUnit, rDest, rSrc); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 901 | } |
| 902 | |
| 903 | /* Needed by the register allocator */ |
| 904 | void oatRegCopyWide(CompilationUnit* cUnit, int destLo, int destHi, |
| 905 | int srcLo, int srcHi) |
| 906 | { |
buzbee | 82488f5 | 2012-03-02 08:20:26 -0800 | [diff] [blame] | 907 | opRegCopyWide(cUnit, destLo, destHi, srcLo, srcHi); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 908 | } |
| 909 | |
| 910 | void oatFlushRegImpl(CompilationUnit* cUnit, int rBase, |
| 911 | int displacement, int rSrc, OpSize size) |
| 912 | { |
| 913 | storeBaseDisp(cUnit, rBase, displacement, rSrc, size); |
| 914 | } |
| 915 | |
| 916 | void oatFlushRegWideImpl(CompilationUnit* cUnit, int rBase, |
| 917 | int displacement, int rSrcLo, int rSrcHi) |
| 918 | { |
| 919 | storeBaseDispWide(cUnit, rBase, displacement, rSrcLo, rSrcHi); |
| 920 | } |
| 921 | |
| 922 | } // namespace art |