buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 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 | namespace art { |
| 18 | |
| 19 | /* |
| 20 | * This source files contains "gen" codegen routines that should |
| 21 | * be applicable to most targets. Only mid-level support utilities |
| 22 | * and "op" calls may be used here. |
| 23 | */ |
| 24 | |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 25 | typedef int (*NextCallInsn)(CompilationUnit*, MIR*, int, uint32_t dexIdx, |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 26 | uint32_t methodIdx, uintptr_t directCode, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 27 | uintptr_t directMethod, InvokeType type); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 28 | /* |
| 29 | * If there are any ins passed in registers that have not been promoted |
| 30 | * to a callee-save register, flush them to the frame. Perform intial |
| 31 | * assignment of promoted arguments. |
| 32 | */ |
| 33 | void flushIns(CompilationUnit* cUnit) |
| 34 | { |
buzbee | 9c044ce | 2012-03-18 13:24:07 -0700 | [diff] [blame] | 35 | /* |
| 36 | * Dummy up a RegLocation for the incoming Method* |
| 37 | * It will attempt to keep rARG0 live (or copy it to home location |
| 38 | * if promoted). |
| 39 | */ |
| 40 | RegLocation rlSrc = cUnit->regLocation[cUnit->methodSReg]; |
| 41 | RegLocation rlMethod = cUnit->regLocation[cUnit->methodSReg]; |
| 42 | rlSrc.location = kLocPhysReg; |
| 43 | rlSrc.lowReg = rARG0; |
| 44 | rlSrc.home = false; |
| 45 | oatMarkLive(cUnit, rlSrc.lowReg, rlSrc.sRegLow); |
| 46 | storeValue(cUnit, rlMethod, rlSrc); |
| 47 | // If Method* has been promoted, explicitly flush |
| 48 | if (rlMethod.location == kLocPhysReg) { |
| 49 | storeWordDisp(cUnit, rSP, 0, rARG0); |
| 50 | } |
| 51 | |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 52 | if (cUnit->numIns == 0) |
| 53 | return; |
Ian Rogers | b3ab25b | 2012-03-19 01:12:01 -0700 | [diff] [blame] | 54 | const int numArgRegs = 3; |
| 55 | static int argRegs[] = {rARG1, rARG2, rARG3}; |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 56 | int startVReg = cUnit->numDalvikRegisters - cUnit->numIns; |
| 57 | /* |
buzbee | 86a4bce | 2012-03-06 18:15:00 -0800 | [diff] [blame] | 58 | * Copy incoming arguments to their proper home locations. |
| 59 | * NOTE: an older version of dx had an issue in which |
| 60 | * it would reuse static method argument registers. |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 61 | * This could result in the same Dalvik virtual register |
buzbee | 86a4bce | 2012-03-06 18:15:00 -0800 | [diff] [blame] | 62 | * being promoted to both core and fp regs. To account for this, |
| 63 | * we only copy to the corresponding promoted physical register |
| 64 | * if it matches the type of the SSA name for the incoming |
| 65 | * argument. It is also possible that long and double arguments |
| 66 | * end up half-promoted. In those cases, we must flush the promoted |
| 67 | * half to memory as well. |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 68 | */ |
| 69 | for (int i = 0; i < cUnit->numIns; i++) { |
buzbee | 86a4bce | 2012-03-06 18:15:00 -0800 | [diff] [blame] | 70 | PromotionMap* vMap = &cUnit->promotionMap[startVReg + i]; |
Ian Rogers | b3ab25b | 2012-03-19 01:12:01 -0700 | [diff] [blame] | 71 | if (i < numArgRegs) { |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 72 | // If arriving in register |
buzbee | 86a4bce | 2012-03-06 18:15:00 -0800 | [diff] [blame] | 73 | bool needFlush = true; |
| 74 | RegLocation* tLoc = &cUnit->regLocation[startVReg + i]; |
| 75 | if ((vMap->coreLocation == kLocPhysReg) && !tLoc->fp) { |
Ian Rogers | b3ab25b | 2012-03-19 01:12:01 -0700 | [diff] [blame] | 76 | opRegCopy(cUnit, vMap->coreReg, argRegs[i]); |
buzbee | 86a4bce | 2012-03-06 18:15:00 -0800 | [diff] [blame] | 77 | needFlush = false; |
| 78 | } else if ((vMap->fpLocation == kLocPhysReg) && tLoc->fp) { |
Ian Rogers | b3ab25b | 2012-03-19 01:12:01 -0700 | [diff] [blame] | 79 | opRegCopy(cUnit, vMap->fpReg, argRegs[i]); |
buzbee | 86a4bce | 2012-03-06 18:15:00 -0800 | [diff] [blame] | 80 | needFlush = false; |
| 81 | } else { |
| 82 | needFlush = true; |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 83 | } |
buzbee | 86a4bce | 2012-03-06 18:15:00 -0800 | [diff] [blame] | 84 | |
| 85 | // For wide args, force flush if only half is promoted |
| 86 | if (tLoc->wide) { |
| 87 | PromotionMap* pMap = vMap + (tLoc->highWord ? -1 : +1); |
| 88 | needFlush |= (pMap->coreLocation != vMap->coreLocation) || |
| 89 | (pMap->fpLocation != vMap->fpLocation); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 90 | } |
buzbee | 86a4bce | 2012-03-06 18:15:00 -0800 | [diff] [blame] | 91 | if (needFlush) { |
| 92 | storeBaseDisp(cUnit, rSP, oatSRegOffset(cUnit, startVReg + i), |
Ian Rogers | b3ab25b | 2012-03-19 01:12:01 -0700 | [diff] [blame] | 93 | argRegs[i], kWord); |
buzbee | 86a4bce | 2012-03-06 18:15:00 -0800 | [diff] [blame] | 94 | } |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 95 | } else { |
| 96 | // If arriving in frame & promoted |
buzbee | 86a4bce | 2012-03-06 18:15:00 -0800 | [diff] [blame] | 97 | if (vMap->coreLocation == kLocPhysReg) { |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 98 | loadWordDisp(cUnit, rSP, oatSRegOffset(cUnit, startVReg + i), |
buzbee | 86a4bce | 2012-03-06 18:15:00 -0800 | [diff] [blame] | 99 | vMap->coreReg); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 100 | } |
buzbee | 86a4bce | 2012-03-06 18:15:00 -0800 | [diff] [blame] | 101 | if (vMap->fpLocation == kLocPhysReg) { |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 102 | loadWordDisp(cUnit, rSP, oatSRegOffset(cUnit, startVReg + i), |
buzbee | 86a4bce | 2012-03-06 18:15:00 -0800 | [diff] [blame] | 103 | vMap->fpReg); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 104 | } |
| 105 | } |
| 106 | } |
| 107 | } |
| 108 | |
Ian Rogers | 3fa1379 | 2012-03-18 15:53:45 -0700 | [diff] [blame] | 109 | void scanMethodLiteralPool(CompilationUnit* cUnit, LIR** methodTarget, LIR** codeTarget, const DexFile* dexFile, uint32_t dexMethodIdx) |
| 110 | { |
| 111 | LIR* curTarget = cUnit->methodLiteralList; |
| 112 | LIR* nextTarget = curTarget != NULL ? curTarget->next : NULL; |
| 113 | while (curTarget != NULL && nextTarget != NULL) { |
| 114 | if (curTarget->operands[0] == (int)dexFile && |
| 115 | nextTarget->operands[0] == (int)dexMethodIdx) { |
| 116 | *codeTarget = curTarget; |
| 117 | *methodTarget = nextTarget; |
| 118 | DCHECK((*codeTarget)->next == *methodTarget); |
| 119 | DCHECK_EQ((*codeTarget)->operands[0], (int)dexFile); |
| 120 | DCHECK_EQ((*methodTarget)->operands[0], (int)dexMethodIdx); |
| 121 | break; |
| 122 | } |
| 123 | curTarget = nextTarget->next; |
| 124 | nextTarget = curTarget != NULL ? curTarget->next : NULL; |
| 125 | } |
| 126 | } |
| 127 | |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 128 | /* |
Elliott Hughes | bdf6c3d | 2012-03-20 13:43:53 -0700 | [diff] [blame] | 129 | * Bit of a hack here - in the absence of a real scheduling pass, |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 130 | * emit the next instruction in static & direct invoke sequences. |
| 131 | */ |
| 132 | int nextSDCallInsn(CompilationUnit* cUnit, MIR* mir, |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 133 | int state, uint32_t dexIdx, uint32_t unused, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 134 | uintptr_t directCode, uintptr_t directMethod, |
| 135 | InvokeType type) |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 136 | { |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 137 | #if !defined(TARGET_ARM) |
| 138 | directCode = 0; |
| 139 | directMethod = 0; |
| 140 | #endif |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 141 | if (directCode != 0 && directMethod != 0) { |
| 142 | switch(state) { |
| 143 | case 0: // Get the current Method* [sets rARG0] |
Ian Rogers | 3fa1379 | 2012-03-18 15:53:45 -0700 | [diff] [blame] | 144 | if (directCode != (uintptr_t)-1) { |
| 145 | loadConstant(cUnit, rINVOKE_TGT, directCode); |
| 146 | } else { |
| 147 | LIR* dataTarget = scanLiteralPool(cUnit->codeLiteralList, dexIdx, 0); |
| 148 | if (dataTarget == NULL) { |
| 149 | dataTarget = addWordData(cUnit, &cUnit->codeLiteralList, dexIdx); |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 150 | dataTarget->operands[1] = type; |
Ian Rogers | 3fa1379 | 2012-03-18 15:53:45 -0700 | [diff] [blame] | 151 | } |
| 152 | #if defined(TARGET_ARM) |
| 153 | LIR* loadPcRel = rawLIR(cUnit, cUnit->currentDalvikOffset, |
| 154 | kThumb2LdrPcRel12, rINVOKE_TGT, 0, 0, 0, 0, dataTarget); |
| 155 | oatAppendLIR(cUnit, loadPcRel); |
| 156 | #else |
| 157 | UNIMPLEMENTED(FATAL) << (void*)dataTarget; |
| 158 | #endif |
| 159 | } |
| 160 | if (directMethod != (uintptr_t)-1) { |
| 161 | loadConstant(cUnit, rARG0, directMethod); |
| 162 | } else { |
| 163 | LIR* dataTarget = scanLiteralPool(cUnit->methodLiteralList, dexIdx, 0); |
| 164 | if (dataTarget == NULL) { |
| 165 | dataTarget = addWordData(cUnit, &cUnit->methodLiteralList, dexIdx); |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 166 | dataTarget->operands[1] = type; |
Ian Rogers | 3fa1379 | 2012-03-18 15:53:45 -0700 | [diff] [blame] | 167 | } |
| 168 | #if defined(TARGET_ARM) |
| 169 | LIR* loadPcRel = rawLIR(cUnit, cUnit->currentDalvikOffset, |
| 170 | kThumb2LdrPcRel12, rARG0, 0, 0, 0, 0, dataTarget); |
| 171 | oatAppendLIR(cUnit, loadPcRel); |
| 172 | #else |
| 173 | UNIMPLEMENTED(FATAL) << (void*)dataTarget; |
| 174 | #endif |
| 175 | } |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 176 | break; |
| 177 | default: |
| 178 | return -1; |
| 179 | } |
| 180 | } else { |
| 181 | switch(state) { |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 182 | case 0: // Get the current Method* [sets rARG0] |
buzbee | 9c044ce | 2012-03-18 13:24:07 -0700 | [diff] [blame] | 183 | // TUNING: we can save a reg copy if Method* has been promoted |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 184 | loadCurrMethodDirect(cUnit, rARG0); |
| 185 | break; |
| 186 | case 1: // Get method->dex_cache_resolved_methods_ |
| 187 | loadWordDisp(cUnit, rARG0, |
| 188 | Method::DexCacheResolvedMethodsOffset().Int32Value(), |
| 189 | rARG0); |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 190 | // Set up direct code if known. |
| 191 | if (directCode != 0) { |
Ian Rogers | 3fa1379 | 2012-03-18 15:53:45 -0700 | [diff] [blame] | 192 | if (directCode != (uintptr_t)-1) { |
| 193 | loadConstant(cUnit, rINVOKE_TGT, directCode); |
| 194 | } else { |
| 195 | LIR* dataTarget = scanLiteralPool(cUnit->codeLiteralList, dexIdx, 0); |
| 196 | if (dataTarget == NULL) { |
| 197 | dataTarget = addWordData(cUnit, &cUnit->codeLiteralList, dexIdx); |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 198 | dataTarget->operands[1] = type; |
Ian Rogers | 3fa1379 | 2012-03-18 15:53:45 -0700 | [diff] [blame] | 199 | } |
| 200 | #if defined(TARGET_ARM) |
| 201 | LIR* loadPcRel = rawLIR(cUnit, cUnit->currentDalvikOffset, |
| 202 | kThumb2LdrPcRel12, rINVOKE_TGT, 0, 0, 0, 0, dataTarget); |
| 203 | oatAppendLIR(cUnit, loadPcRel); |
| 204 | #else |
| 205 | UNIMPLEMENTED(FATAL) << (void*)dataTarget; |
| 206 | #endif |
| 207 | } |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 208 | } |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 209 | break; |
| 210 | case 2: // Grab target method* |
| 211 | loadWordDisp(cUnit, rARG0, |
| 212 | Array::DataOffset(sizeof(Object*)).Int32Value() + dexIdx * 4, |
| 213 | rARG0); |
| 214 | break; |
Ian Rogers | 6cbb2bd | 2012-03-16 13:45:30 -0700 | [diff] [blame] | 215 | #if !defined(TARGET_X86) |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 216 | case 3: // Grab the code from the method* |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 217 | if (directCode == 0) { |
| 218 | loadWordDisp(cUnit, rARG0, Method::GetCodeOffset().Int32Value(), |
| 219 | rINVOKE_TGT); |
| 220 | } |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 221 | break; |
Ian Rogers | 6cbb2bd | 2012-03-16 13:45:30 -0700 | [diff] [blame] | 222 | #endif |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 223 | default: |
| 224 | return -1; |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 225 | } |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 226 | } |
| 227 | return state + 1; |
| 228 | } |
| 229 | |
| 230 | /* |
Elliott Hughes | bdf6c3d | 2012-03-20 13:43:53 -0700 | [diff] [blame] | 231 | * Bit of a hack here - in the absence of a real scheduling pass, |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 232 | * emit the next instruction in a virtual invoke sequence. |
| 233 | * We can use rLR as a temp prior to target address loading |
| 234 | * Note also that we'll load the first argument ("this") into |
| 235 | * rARG1 here rather than the standard loadArgRegs. |
| 236 | */ |
| 237 | int nextVCallInsn(CompilationUnit* cUnit, MIR* mir, |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 238 | int state, uint32_t dexIdx, uint32_t methodIdx, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 239 | uintptr_t unused, uintptr_t unused2, InvokeType unused3) |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 240 | { |
| 241 | RegLocation rlArg; |
| 242 | /* |
| 243 | * This is the fast path in which the target virtual method is |
| 244 | * fully resolved at compile time. |
| 245 | */ |
| 246 | switch(state) { |
| 247 | case 0: // Get "this" [set rARG1] |
| 248 | rlArg = oatGetSrc(cUnit, mir, 0); |
| 249 | loadValueDirectFixed(cUnit, rlArg, rARG1); |
| 250 | break; |
| 251 | case 1: // Is "this" null? [use rARG1] |
| 252 | genNullCheck(cUnit, oatSSASrc(mir,0), rARG1, mir); |
buzbee | 0398c42 | 2012-03-02 15:22:47 -0800 | [diff] [blame] | 253 | // get this->klass_ [use rARG1, set rINVOKE_TGT] |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 254 | loadWordDisp(cUnit, rARG1, Object::ClassOffset().Int32Value(), |
buzbee | 0398c42 | 2012-03-02 15:22:47 -0800 | [diff] [blame] | 255 | rINVOKE_TGT); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 256 | break; |
buzbee | 0398c42 | 2012-03-02 15:22:47 -0800 | [diff] [blame] | 257 | case 2: // Get this->klass_->vtable [usr rINVOKE_TGT, set rINVOKE_TGT] |
| 258 | loadWordDisp(cUnit, rINVOKE_TGT, Class::VTableOffset().Int32Value(), |
| 259 | rINVOKE_TGT); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 260 | break; |
buzbee | 0398c42 | 2012-03-02 15:22:47 -0800 | [diff] [blame] | 261 | case 3: // Get target method [use rINVOKE_TGT, set rARG0] |
| 262 | loadWordDisp(cUnit, rINVOKE_TGT, (methodIdx * 4) + |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 263 | Array::DataOffset(sizeof(Object*)).Int32Value(), |
| 264 | rARG0); |
| 265 | break; |
Ian Rogers | 6cbb2bd | 2012-03-16 13:45:30 -0700 | [diff] [blame] | 266 | #if !defined(TARGET_X86) |
buzbee | 0398c42 | 2012-03-02 15:22:47 -0800 | [diff] [blame] | 267 | case 4: // Get the compiled code address [uses rARG0, sets rINVOKE_TGT] |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 268 | loadWordDisp(cUnit, rARG0, Method::GetCodeOffset().Int32Value(), |
buzbee | 0398c42 | 2012-03-02 15:22:47 -0800 | [diff] [blame] | 269 | rINVOKE_TGT); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 270 | break; |
Ian Rogers | 6cbb2bd | 2012-03-16 13:45:30 -0700 | [diff] [blame] | 271 | #endif |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 272 | default: |
| 273 | return -1; |
| 274 | } |
| 275 | return state + 1; |
| 276 | } |
| 277 | |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 278 | int nextInvokeInsnSP(CompilationUnit* cUnit, MIR* mir, int trampoline, |
| 279 | int state, uint32_t dexIdx, uint32_t methodIdx) |
| 280 | { |
| 281 | /* |
| 282 | * This handles the case in which the base method is not fully |
| 283 | * resolved at compile time, we bail to a runtime helper. |
| 284 | */ |
Ian Rogers | 6cbb2bd | 2012-03-16 13:45:30 -0700 | [diff] [blame] | 285 | #if !defined(TARGET_X86) |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 286 | if (state == 0) { |
| 287 | // Load trampoline target |
buzbee | 0398c42 | 2012-03-02 15:22:47 -0800 | [diff] [blame] | 288 | loadWordDisp(cUnit, rSELF, trampoline, rINVOKE_TGT); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 289 | // Load rARG0 with method index |
| 290 | loadConstant(cUnit, rARG0, dexIdx); |
| 291 | return 1; |
| 292 | } |
Ian Rogers | 6cbb2bd | 2012-03-16 13:45:30 -0700 | [diff] [blame] | 293 | #endif |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 294 | return -1; |
| 295 | } |
| 296 | |
| 297 | int nextStaticCallInsnSP(CompilationUnit* cUnit, MIR* mir, |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 298 | int state, uint32_t dexIdx, uint32_t methodIdx, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 299 | uintptr_t unused, uintptr_t unused2, |
| 300 | InvokeType unused3) |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 301 | { |
| 302 | int trampoline = OFFSETOF_MEMBER(Thread, pInvokeStaticTrampolineWithAccessCheck); |
| 303 | return nextInvokeInsnSP(cUnit, mir, trampoline, state, dexIdx, 0); |
| 304 | } |
| 305 | |
| 306 | int nextDirectCallInsnSP(CompilationUnit* cUnit, MIR* mir, int state, |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 307 | uint32_t dexIdx, uint32_t methodIdx, uintptr_t unused, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 308 | uintptr_t unused2, InvokeType unused3) |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 309 | { |
| 310 | int trampoline = OFFSETOF_MEMBER(Thread, pInvokeDirectTrampolineWithAccessCheck); |
| 311 | return nextInvokeInsnSP(cUnit, mir, trampoline, state, dexIdx, 0); |
| 312 | } |
| 313 | |
| 314 | int nextSuperCallInsnSP(CompilationUnit* cUnit, MIR* mir, int state, |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 315 | uint32_t dexIdx, uint32_t methodIdx, uintptr_t unused, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 316 | uintptr_t unused2, InvokeType unused3) |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 317 | { |
| 318 | int trampoline = OFFSETOF_MEMBER(Thread, pInvokeSuperTrampolineWithAccessCheck); |
| 319 | return nextInvokeInsnSP(cUnit, mir, trampoline, state, dexIdx, 0); |
| 320 | } |
| 321 | |
| 322 | int nextVCallInsnSP(CompilationUnit* cUnit, MIR* mir, int state, |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 323 | uint32_t dexIdx, uint32_t methodIdx, uintptr_t unused, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 324 | uintptr_t unused2, InvokeType unused3) |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 325 | { |
| 326 | int trampoline = OFFSETOF_MEMBER(Thread, pInvokeVirtualTrampolineWithAccessCheck); |
| 327 | return nextInvokeInsnSP(cUnit, mir, trampoline, state, dexIdx, 0); |
| 328 | } |
| 329 | |
| 330 | /* |
| 331 | * All invoke-interface calls bounce off of art_invoke_interface_trampoline, |
| 332 | * which will locate the target and continue on via a tail call. |
| 333 | */ |
| 334 | int nextInterfaceCallInsn(CompilationUnit* cUnit, MIR* mir, int state, |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 335 | uint32_t dexIdx, uint32_t unused, uintptr_t unused2, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 336 | uintptr_t unused3, InvokeType unused4) |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 337 | { |
| 338 | int trampoline = OFFSETOF_MEMBER(Thread, pInvokeInterfaceTrampoline); |
| 339 | return nextInvokeInsnSP(cUnit, mir, trampoline, state, dexIdx, 0); |
| 340 | } |
| 341 | |
| 342 | int nextInterfaceCallInsnWithAccessCheck(CompilationUnit* cUnit, MIR* mir, |
| 343 | int state, uint32_t dexIdx, |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 344 | uint32_t unused, uintptr_t unused2, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 345 | uintptr_t unused3, InvokeType unused4) |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 346 | { |
| 347 | int trampoline = OFFSETOF_MEMBER(Thread, pInvokeInterfaceTrampolineWithAccessCheck); |
| 348 | return nextInvokeInsnSP(cUnit, mir, trampoline, state, dexIdx, 0); |
| 349 | } |
| 350 | |
| 351 | int loadArgRegs(CompilationUnit* cUnit, MIR* mir, DecodedInstruction* dInsn, |
| 352 | int callState, NextCallInsn nextCallInsn, uint32_t dexIdx, |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 353 | uint32_t methodIdx, uintptr_t directCode, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 354 | uintptr_t directMethod, InvokeType type, bool skipThis) |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 355 | { |
Ian Rogers | 6cbb2bd | 2012-03-16 13:45:30 -0700 | [diff] [blame] | 356 | #if !defined(TARGET_X86) |
| 357 | int lastArgReg = rARG3; |
| 358 | #else |
| 359 | int lastArgReg = rARG2; |
| 360 | #endif |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 361 | int nextReg = rARG1; |
| 362 | int nextArg = 0; |
| 363 | if (skipThis) { |
| 364 | nextReg++; |
| 365 | nextArg++; |
| 366 | } |
Ian Rogers | 6cbb2bd | 2012-03-16 13:45:30 -0700 | [diff] [blame] | 367 | for (; (nextReg <= lastArgReg) && (nextArg < mir->ssaRep->numUses); nextReg++) { |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 368 | RegLocation rlArg = oatGetRawSrc(cUnit, mir, nextArg++); |
| 369 | rlArg = oatUpdateRawLoc(cUnit, rlArg); |
| 370 | if (rlArg.wide && (nextReg <= rARG2)) { |
| 371 | loadValueDirectWideFixed(cUnit, rlArg, nextReg, nextReg + 1); |
| 372 | nextReg++; |
| 373 | nextArg++; |
| 374 | } else { |
| 375 | rlArg.wide = false; |
| 376 | loadValueDirectFixed(cUnit, rlArg, nextReg); |
| 377 | } |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 378 | callState = nextCallInsn(cUnit, mir, callState, dexIdx, methodIdx, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 379 | directCode, directMethod, type); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 380 | } |
| 381 | return callState; |
| 382 | } |
| 383 | |
| 384 | /* |
| 385 | * Load up to 5 arguments, the first three of which will be in |
| 386 | * rARG1 .. rARG3. On entry rARG0 contains the current method pointer, |
| 387 | * and as part of the load sequence, it must be replaced with |
| 388 | * the target method pointer. Note, this may also be called |
| 389 | * for "range" variants if the number of arguments is 5 or fewer. |
| 390 | */ |
| 391 | int genDalvikArgsNoRange(CompilationUnit* cUnit, MIR* mir, |
| 392 | DecodedInstruction* dInsn, int callState, |
| 393 | LIR** pcrLabel, NextCallInsn nextCallInsn, |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 394 | uint32_t dexIdx, uint32_t methodIdx, |
| 395 | uintptr_t directCode, uintptr_t directMethod, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 396 | InvokeType type, bool skipThis) |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 397 | { |
| 398 | RegLocation rlArg; |
| 399 | |
| 400 | /* If no arguments, just return */ |
| 401 | if (dInsn->vA == 0) |
| 402 | return callState; |
| 403 | |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 404 | callState = nextCallInsn(cUnit, mir, callState, dexIdx, methodIdx, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 405 | directCode, directMethod, type); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 406 | |
| 407 | DCHECK_LE(dInsn->vA, 5U); |
| 408 | if (dInsn->vA > 3) { |
| 409 | uint32_t nextUse = 3; |
| 410 | //Detect special case of wide arg spanning arg3/arg4 |
| 411 | RegLocation rlUse0 = oatGetRawSrc(cUnit, mir, 0); |
| 412 | RegLocation rlUse1 = oatGetRawSrc(cUnit, mir, 1); |
| 413 | RegLocation rlUse2 = oatGetRawSrc(cUnit, mir, 2); |
| 414 | if (((!rlUse0.wide && !rlUse1.wide) || rlUse0.wide) && |
| 415 | rlUse2.wide) { |
Ian Rogers | 6cbb2bd | 2012-03-16 13:45:30 -0700 | [diff] [blame] | 416 | int reg = -1; |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 417 | // Wide spans, we need the 2nd half of uses[2]. |
| 418 | rlArg = oatUpdateLocWide(cUnit, rlUse2); |
| 419 | if (rlArg.location == kLocPhysReg) { |
| 420 | reg = rlArg.highReg; |
| 421 | } else { |
| 422 | // rARG2 & rARG3 can safely be used here |
| 423 | reg = rARG3; |
| 424 | loadWordDisp(cUnit, rSP, |
| 425 | oatSRegOffset(cUnit, rlArg.sRegLow) + 4, reg); |
| 426 | callState = nextCallInsn(cUnit, mir, callState, dexIdx, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 427 | methodIdx, directCode, directMethod, |
| 428 | type); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 429 | } |
| 430 | storeBaseDisp(cUnit, rSP, (nextUse + 1) * 4, reg, kWord); |
| 431 | storeBaseDisp(cUnit, rSP, 16 /* (3+1)*4 */, reg, kWord); |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 432 | callState = nextCallInsn(cUnit, mir, callState, dexIdx, methodIdx, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 433 | directCode, directMethod, type); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 434 | nextUse++; |
| 435 | } |
| 436 | // Loop through the rest |
| 437 | while (nextUse < dInsn->vA) { |
| 438 | int lowReg; |
Ian Rogers | 6cbb2bd | 2012-03-16 13:45:30 -0700 | [diff] [blame] | 439 | int highReg = -1; |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 440 | rlArg = oatGetRawSrc(cUnit, mir, nextUse); |
| 441 | rlArg = oatUpdateRawLoc(cUnit, rlArg); |
| 442 | if (rlArg.location == kLocPhysReg) { |
| 443 | lowReg = rlArg.lowReg; |
| 444 | highReg = rlArg.highReg; |
| 445 | } else { |
| 446 | lowReg = rARG2; |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 447 | if (rlArg.wide) { |
Ian Rogers | b41b33b | 2012-03-20 14:22:54 -0700 | [diff] [blame^] | 448 | highReg = rARG3; |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 449 | loadValueDirectWideFixed(cUnit, rlArg, lowReg, highReg); |
| 450 | } else { |
| 451 | loadValueDirectFixed(cUnit, rlArg, lowReg); |
| 452 | } |
| 453 | callState = nextCallInsn(cUnit, mir, callState, dexIdx, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 454 | methodIdx, directCode, directMethod, |
| 455 | type); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 456 | } |
| 457 | int outsOffset = (nextUse + 1) * 4; |
| 458 | if (rlArg.wide) { |
| 459 | storeBaseDispWide(cUnit, rSP, outsOffset, lowReg, highReg); |
| 460 | nextUse += 2; |
| 461 | } else { |
| 462 | storeWordDisp(cUnit, rSP, outsOffset, lowReg); |
| 463 | nextUse++; |
| 464 | } |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 465 | callState = nextCallInsn(cUnit, mir, callState, dexIdx, methodIdx, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 466 | directCode, directMethod, type); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 467 | } |
| 468 | } |
| 469 | |
| 470 | callState = loadArgRegs(cUnit, mir, dInsn, callState, nextCallInsn, |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 471 | dexIdx, methodIdx, directCode, directMethod, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 472 | type, skipThis); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 473 | |
| 474 | if (pcrLabel) { |
| 475 | *pcrLabel = genNullCheck(cUnit, oatSSASrc(mir,0), rARG1, mir); |
| 476 | } |
| 477 | return callState; |
| 478 | } |
| 479 | |
| 480 | /* |
| 481 | * May have 0+ arguments (also used for jumbo). Note that |
| 482 | * source virtual registers may be in physical registers, so may |
| 483 | * need to be flushed to home location before copying. This |
| 484 | * applies to arg3 and above (see below). |
| 485 | * |
| 486 | * Two general strategies: |
| 487 | * If < 20 arguments |
| 488 | * Pass args 3-18 using vldm/vstm block copy |
| 489 | * Pass arg0, arg1 & arg2 in rARG1-rARG3 |
| 490 | * If 20+ arguments |
| 491 | * Pass args arg19+ using memcpy block copy |
| 492 | * Pass arg0, arg1 & arg2 in rARG1-rARG3 |
| 493 | * |
| 494 | */ |
| 495 | int genDalvikArgsRange(CompilationUnit* cUnit, MIR* mir, |
| 496 | DecodedInstruction* dInsn, int callState, |
| 497 | LIR** pcrLabel, NextCallInsn nextCallInsn, |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 498 | uint32_t dexIdx, uint32_t methodIdx, |
| 499 | uintptr_t directCode, uintptr_t directMethod, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 500 | InvokeType type, bool skipThis) |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 501 | { |
| 502 | int firstArg = dInsn->vC; |
| 503 | int numArgs = dInsn->vA; |
| 504 | |
| 505 | // If we can treat it as non-range (Jumbo ops will use range form) |
| 506 | if (numArgs <= 5) |
| 507 | return genDalvikArgsNoRange(cUnit, mir, dInsn, callState, pcrLabel, |
| 508 | nextCallInsn, dexIdx, methodIdx, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 509 | directCode, directMethod, type, skipThis); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 510 | /* |
| 511 | * Make sure range list doesn't span the break between in normal |
| 512 | * Dalvik vRegs and the ins. |
| 513 | */ |
| 514 | int highestArg = oatGetSrc(cUnit, mir, numArgs-1).sRegLow; |
| 515 | int boundaryReg = cUnit->numDalvikRegisters - cUnit->numIns; |
| 516 | if ((firstArg < boundaryReg) && (highestArg >= boundaryReg)) { |
| 517 | LOG(FATAL) << "Argument list spanned locals & args"; |
| 518 | } |
| 519 | |
| 520 | /* |
| 521 | * First load the non-register arguments. Both forms expect all |
| 522 | * of the source arguments to be in their home frame location, so |
| 523 | * scan the sReg names and flush any that have been promoted to |
| 524 | * frame backing storage. |
| 525 | */ |
| 526 | // Scan the rest of the args - if in physReg flush to memory |
| 527 | for (int nextArg = 0; nextArg < numArgs;) { |
| 528 | RegLocation loc = oatGetRawSrc(cUnit, mir, nextArg); |
| 529 | if (loc.wide) { |
| 530 | loc = oatUpdateLocWide(cUnit, loc); |
| 531 | if ((nextArg >= 2) && (loc.location == kLocPhysReg)) { |
| 532 | storeBaseDispWide(cUnit, rSP, |
| 533 | oatSRegOffset(cUnit, loc.sRegLow), |
| 534 | loc.lowReg, loc.highReg); |
| 535 | } |
| 536 | nextArg += 2; |
| 537 | } else { |
| 538 | loc = oatUpdateLoc(cUnit, loc); |
| 539 | if ((nextArg >= 3) && (loc.location == kLocPhysReg)) { |
| 540 | storeBaseDisp(cUnit, rSP, oatSRegOffset(cUnit, loc.sRegLow), |
| 541 | loc.lowReg, kWord); |
| 542 | } |
| 543 | nextArg++; |
| 544 | } |
| 545 | } |
| 546 | |
| 547 | int startOffset = oatSRegOffset(cUnit, |
| 548 | cUnit->regLocation[mir->ssaRep->uses[3]].sRegLow); |
| 549 | int outsOffset = 4 /* Method* */ + (3 * 4); |
Ian Rogers | ab2b55d | 2012-03-18 00:06:11 -0700 | [diff] [blame] | 550 | #if defined(TARGET_MIPS) || defined(TARGET_X86) |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 551 | // Generate memcpy |
| 552 | opRegRegImm(cUnit, kOpAdd, rARG0, rSP, outsOffset); |
| 553 | opRegRegImm(cUnit, kOpAdd, rARG1, rSP, startOffset); |
Ian Rogers | ab2b55d | 2012-03-18 00:06:11 -0700 | [diff] [blame] | 554 | callRuntimeHelperRegRegImm(cUnit, OFFSETOF_MEMBER(Thread, pMemcpy), |
| 555 | rARG0, rARG1, (numArgs - 3) * 4); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 556 | #else |
| 557 | if (numArgs >= 20) { |
| 558 | // Generate memcpy |
| 559 | opRegRegImm(cUnit, kOpAdd, rARG0, rSP, outsOffset); |
| 560 | opRegRegImm(cUnit, kOpAdd, rARG1, rSP, startOffset); |
Ian Rogers | ab2b55d | 2012-03-18 00:06:11 -0700 | [diff] [blame] | 561 | callRuntimeHelperRegRegImm(cUnit, OFFSETOF_MEMBER(Thread, pMemcpy), |
| 562 | rARG0, rARG1, (numArgs - 3) * 4); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 563 | } else { |
| 564 | // Use vldm/vstm pair using rARG3 as a temp |
| 565 | int regsLeft = std::min(numArgs - 3, 16); |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 566 | callState = nextCallInsn(cUnit, mir, callState, dexIdx, methodIdx, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 567 | directCode, directMethod, type); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 568 | opRegRegImm(cUnit, kOpAdd, rARG3, rSP, startOffset); |
| 569 | LIR* ld = newLIR3(cUnit, kThumb2Vldms, rARG3, fr0, regsLeft); |
| 570 | //TUNING: loosen barrier |
| 571 | ld->defMask = ENCODE_ALL; |
| 572 | setMemRefType(ld, true /* isLoad */, kDalvikReg); |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 573 | callState = nextCallInsn(cUnit, mir, callState, dexIdx, methodIdx, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 574 | directCode, directMethod, type); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 575 | opRegRegImm(cUnit, kOpAdd, rARG3, rSP, 4 /* Method* */ + (3 * 4)); |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 576 | callState = nextCallInsn(cUnit, mir, callState, dexIdx, methodIdx, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 577 | directCode, directMethod, type); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 578 | LIR* st = newLIR3(cUnit, kThumb2Vstms, rARG3, fr0, regsLeft); |
| 579 | setMemRefType(st, false /* isLoad */, kDalvikReg); |
| 580 | st->defMask = ENCODE_ALL; |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 581 | callState = nextCallInsn(cUnit, mir, callState, dexIdx, methodIdx, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 582 | directCode, directMethod, type); |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 583 | |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 584 | } |
| 585 | #endif |
| 586 | |
| 587 | callState = loadArgRegs(cUnit, mir, dInsn, callState, nextCallInsn, |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 588 | dexIdx, methodIdx, directCode, directMethod, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 589 | type, skipThis); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 590 | |
Ian Rogers | 2ed3b95 | 2012-03-17 11:49:39 -0700 | [diff] [blame] | 591 | callState = nextCallInsn(cUnit, mir, callState, dexIdx, methodIdx, |
Brian Carlstrom | f582258 | 2012-03-19 22:34:31 -0700 | [diff] [blame] | 592 | directCode, directMethod, type); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 593 | if (pcrLabel) { |
| 594 | *pcrLabel = genNullCheck(cUnit, oatSSASrc(mir,0), rARG1, mir); |
| 595 | } |
| 596 | return callState; |
| 597 | } |
| 598 | |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 599 | } // namespace art |