| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 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 | /* |
| 18 | * This file contains codegen and support common to all supported |
| 19 | * ARM variants. It is included by: |
| 20 | * |
| 21 | * Codegen-$(TARGET_ARCH_VARIANT).c |
| 22 | * |
| 23 | * which combines this common code with specific support found in the |
| 24 | * applicable directory below this one. |
| 25 | */ |
| 26 | |
| 27 | #include "compiler/Loop.h" |
| 28 | |
| 29 | /* Array holding the entry offset of each template relative to the first one */ |
| 30 | static intptr_t templateEntryOffsets[TEMPLATE_LAST_MARK]; |
| 31 | |
| 32 | /* Track exercised opcodes */ |
| Dan Bornstein | ccaab18 | 2010-12-03 15:32:40 -0800 | [diff] [blame] | 33 | static int opcodeCoverage[kNumPackedOpcodes]; |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 34 | |
| Bill Buzbee | 1f74863 | 2010-03-02 16:14:41 -0800 | [diff] [blame] | 35 | static void setMemRefType(ArmLIR *lir, bool isLoad, int memType) |
| 36 | { |
| 37 | u8 *maskPtr; |
| 38 | u8 mask; |
| Dan Bornstein | 9a1f816 | 2010-12-01 17:02:26 -0800 | [diff] [blame] | 39 | assert( EncodingMap[lir->opcode].flags & (IS_LOAD | IS_STORE)); |
| Bill Buzbee | 1f74863 | 2010-03-02 16:14:41 -0800 | [diff] [blame] | 40 | if (isLoad) { |
| 41 | maskPtr = &lir->useMask; |
| 42 | mask = ENCODE_MEM_USE; |
| 43 | } else { |
| 44 | maskPtr = &lir->defMask; |
| 45 | mask = ENCODE_MEM_DEF; |
| 46 | } |
| 47 | /* Clear out the memref flags */ |
| 48 | *maskPtr &= ~mask; |
| 49 | /* ..and then add back the one we need */ |
| 50 | switch(memType) { |
| 51 | case kLiteral: |
| 52 | assert(isLoad); |
| 53 | *maskPtr |= (ENCODE_LITERAL | ENCODE_LITPOOL_REF); |
| 54 | break; |
| 55 | case kDalvikReg: |
| 56 | *maskPtr |= (ENCODE_DALVIK_REG | ENCODE_FRAME_REF); |
| 57 | break; |
| 58 | case kHeapRef: |
| 59 | *maskPtr |= ENCODE_HEAP_REF; |
| 60 | break; |
| 61 | default: |
| 62 | LOGE("Jit: invalid memref kind - %d", memType); |
| Bill Buzbee | fc519dc | 2010-03-06 23:30:57 -0800 | [diff] [blame] | 63 | assert(0); // Bail if debug build, set worst-case in the field |
| 64 | *maskPtr |= ENCODE_ALL; |
| Bill Buzbee | 1f74863 | 2010-03-02 16:14:41 -0800 | [diff] [blame] | 65 | } |
| 66 | } |
| 67 | |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 68 | /* |
| 69 | * Mark load/store instructions that access Dalvik registers through rFP + |
| 70 | * offset. |
| 71 | */ |
| 72 | static void annotateDalvikRegAccess(ArmLIR *lir, int regId, bool isLoad) |
| 73 | { |
| Bill Buzbee | 1f74863 | 2010-03-02 16:14:41 -0800 | [diff] [blame] | 74 | setMemRefType(lir, isLoad, kDalvikReg); |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 75 | |
| 76 | /* |
| 77 | * Store the Dalvik register id in aliasInfo. Mark he MSB if it is a 64-bit |
| 78 | * access. |
| 79 | */ |
| 80 | lir->aliasInfo = regId; |
| 81 | if (DOUBLEREG(lir->operands[0])) { |
| 82 | lir->aliasInfo |= 0x80000000; |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | /* |
| 87 | * Decode the register id and mark the corresponding bit(s). |
| 88 | */ |
| 89 | static inline void setupRegMask(u8 *mask, int reg) |
| 90 | { |
| 91 | u8 seed; |
| 92 | int shift; |
| 93 | int regId = reg & 0x1f; |
| 94 | |
| 95 | /* |
| 96 | * Each double register is equal to a pair of single-precision FP registers |
| 97 | */ |
| 98 | seed = DOUBLEREG(reg) ? 3 : 1; |
| 99 | /* FP register starts at bit position 16 */ |
| 100 | shift = FPREG(reg) ? kFPReg0 : 0; |
| 101 | /* Expand the double register id into single offset */ |
| 102 | shift += regId; |
| 103 | *mask |= seed << shift; |
| 104 | } |
| 105 | |
| 106 | /* |
| 107 | * Set up the proper fields in the resource mask |
| 108 | */ |
| 109 | static void setupResourceMasks(ArmLIR *lir) |
| 110 | { |
| Dan Bornstein | 9a1f816 | 2010-12-01 17:02:26 -0800 | [diff] [blame] | 111 | int opcode = lir->opcode; |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 112 | int flags; |
| 113 | |
| Dan Bornstein | 9a1f816 | 2010-12-01 17:02:26 -0800 | [diff] [blame] | 114 | if (opcode <= 0) { |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 115 | lir->useMask = lir->defMask = 0; |
| 116 | return; |
| 117 | } |
| 118 | |
| Dan Bornstein | 9a1f816 | 2010-12-01 17:02:26 -0800 | [diff] [blame] | 119 | flags = EncodingMap[lir->opcode].flags; |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 120 | |
| 121 | /* Set up the mask for resources that are updated */ |
| Bill Buzbee | 1f74863 | 2010-03-02 16:14:41 -0800 | [diff] [blame] | 122 | if (flags & (IS_LOAD | IS_STORE)) { |
| 123 | /* Default to heap - will catch specialized classes later */ |
| 124 | setMemRefType(lir, flags & IS_LOAD, kHeapRef); |
| 125 | } |
| 126 | |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 127 | if (flags & IS_BRANCH) { |
| 128 | lir->defMask |= ENCODE_REG_PC; |
| 129 | lir->useMask |= ENCODE_REG_PC; |
| 130 | } |
| 131 | |
| 132 | if (flags & REG_DEF0) { |
| 133 | setupRegMask(&lir->defMask, lir->operands[0]); |
| 134 | } |
| 135 | |
| 136 | if (flags & REG_DEF1) { |
| 137 | setupRegMask(&lir->defMask, lir->operands[1]); |
| 138 | } |
| 139 | |
| 140 | if (flags & REG_DEF_SP) { |
| 141 | lir->defMask |= ENCODE_REG_SP; |
| 142 | } |
| 143 | |
| Bill Buzbee | d867b23 | 2010-02-25 15:38:40 -0800 | [diff] [blame] | 144 | if (flags & REG_DEF_LR) { |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 145 | lir->defMask |= ENCODE_REG_LR; |
| 146 | } |
| 147 | |
| 148 | if (flags & REG_DEF_LIST0) { |
| 149 | lir->defMask |= ENCODE_REG_LIST(lir->operands[0]); |
| 150 | } |
| 151 | |
| 152 | if (flags & REG_DEF_LIST1) { |
| 153 | lir->defMask |= ENCODE_REG_LIST(lir->operands[1]); |
| 154 | } |
| 155 | |
| 156 | if (flags & SETS_CCODES) { |
| 157 | lir->defMask |= ENCODE_CCODE; |
| 158 | } |
| 159 | |
| 160 | /* Conservatively treat the IT block */ |
| 161 | if (flags & IS_IT) { |
| 162 | lir->defMask = ENCODE_ALL; |
| 163 | } |
| 164 | |
| 165 | /* Set up the mask for resources that are used */ |
| 166 | if (flags & IS_BRANCH) { |
| 167 | lir->useMask |= ENCODE_REG_PC; |
| 168 | } |
| 169 | |
| 170 | if (flags & (REG_USE0 | REG_USE1 | REG_USE2 | REG_USE3)) { |
| 171 | int i; |
| 172 | |
| 173 | for (i = 0; i < 4; i++) { |
| 174 | if (flags & (1 << (kRegUse0 + i))) { |
| 175 | setupRegMask(&lir->useMask, lir->operands[i]); |
| 176 | } |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | if (flags & REG_USE_PC) { |
| 181 | lir->useMask |= ENCODE_REG_PC; |
| 182 | } |
| 183 | |
| 184 | if (flags & REG_USE_SP) { |
| 185 | lir->useMask |= ENCODE_REG_SP; |
| 186 | } |
| 187 | |
| 188 | if (flags & REG_USE_LIST0) { |
| 189 | lir->useMask |= ENCODE_REG_LIST(lir->operands[0]); |
| 190 | } |
| 191 | |
| 192 | if (flags & REG_USE_LIST1) { |
| 193 | lir->useMask |= ENCODE_REG_LIST(lir->operands[1]); |
| 194 | } |
| 195 | |
| 196 | if (flags & USES_CCODES) { |
| 197 | lir->useMask |= ENCODE_CCODE; |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | /* |
| 202 | * The following are building blocks to construct low-level IRs with 0 - 4 |
| 203 | * operands. |
| 204 | */ |
| Dan Bornstein | 9a1f816 | 2010-12-01 17:02:26 -0800 | [diff] [blame] | 205 | static ArmLIR *newLIR0(CompilationUnit *cUnit, ArmOpcode opcode) |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 206 | { |
| Carl Shapiro | fc75f3e | 2010-12-07 11:43:38 -0800 | [diff] [blame] | 207 | ArmLIR *insn = (ArmLIR *) dvmCompilerNew(sizeof(ArmLIR), true); |
| Dan Bornstein | 9a1f816 | 2010-12-01 17:02:26 -0800 | [diff] [blame] | 208 | assert(isPseudoOpcode(opcode) || (EncodingMap[opcode].flags & NO_OPERAND)); |
| 209 | insn->opcode = opcode; |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 210 | setupResourceMasks(insn); |
| 211 | dvmCompilerAppendLIR(cUnit, (LIR *) insn); |
| 212 | return insn; |
| 213 | } |
| 214 | |
| Dan Bornstein | 9a1f816 | 2010-12-01 17:02:26 -0800 | [diff] [blame] | 215 | static ArmLIR *newLIR1(CompilationUnit *cUnit, ArmOpcode opcode, |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 216 | int dest) |
| 217 | { |
| Carl Shapiro | fc75f3e | 2010-12-07 11:43:38 -0800 | [diff] [blame] | 218 | ArmLIR *insn = (ArmLIR *) dvmCompilerNew(sizeof(ArmLIR), true); |
| Dan Bornstein | 9a1f816 | 2010-12-01 17:02:26 -0800 | [diff] [blame] | 219 | assert(isPseudoOpcode(opcode) || (EncodingMap[opcode].flags & IS_UNARY_OP)); |
| 220 | insn->opcode = opcode; |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 221 | insn->operands[0] = dest; |
| 222 | setupResourceMasks(insn); |
| 223 | dvmCompilerAppendLIR(cUnit, (LIR *) insn); |
| 224 | return insn; |
| 225 | } |
| 226 | |
| Dan Bornstein | 9a1f816 | 2010-12-01 17:02:26 -0800 | [diff] [blame] | 227 | static ArmLIR *newLIR2(CompilationUnit *cUnit, ArmOpcode opcode, |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 228 | int dest, int src1) |
| 229 | { |
| Carl Shapiro | fc75f3e | 2010-12-07 11:43:38 -0800 | [diff] [blame] | 230 | ArmLIR *insn = (ArmLIR *) dvmCompilerNew(sizeof(ArmLIR), true); |
| Dan Bornstein | 9a1f816 | 2010-12-01 17:02:26 -0800 | [diff] [blame] | 231 | assert(isPseudoOpcode(opcode) || |
| 232 | (EncodingMap[opcode].flags & IS_BINARY_OP)); |
| 233 | insn->opcode = opcode; |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 234 | insn->operands[0] = dest; |
| 235 | insn->operands[1] = src1; |
| 236 | setupResourceMasks(insn); |
| 237 | dvmCompilerAppendLIR(cUnit, (LIR *) insn); |
| 238 | return insn; |
| 239 | } |
| 240 | |
| Dan Bornstein | 9a1f816 | 2010-12-01 17:02:26 -0800 | [diff] [blame] | 241 | static ArmLIR *newLIR3(CompilationUnit *cUnit, ArmOpcode opcode, |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 242 | int dest, int src1, int src2) |
| 243 | { |
| Carl Shapiro | fc75f3e | 2010-12-07 11:43:38 -0800 | [diff] [blame] | 244 | ArmLIR *insn = (ArmLIR *) dvmCompilerNew(sizeof(ArmLIR), true); |
| Dan Bornstein | 9a1f816 | 2010-12-01 17:02:26 -0800 | [diff] [blame] | 245 | if (!(EncodingMap[opcode].flags & IS_TERTIARY_OP)) { |
| 246 | LOGE("Bad LIR3: %s[%d]",EncodingMap[opcode].name,opcode); |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 247 | } |
| Dan Bornstein | 9a1f816 | 2010-12-01 17:02:26 -0800 | [diff] [blame] | 248 | assert(isPseudoOpcode(opcode) || |
| 249 | (EncodingMap[opcode].flags & IS_TERTIARY_OP)); |
| 250 | insn->opcode = opcode; |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 251 | insn->operands[0] = dest; |
| 252 | insn->operands[1] = src1; |
| 253 | insn->operands[2] = src2; |
| 254 | setupResourceMasks(insn); |
| 255 | dvmCompilerAppendLIR(cUnit, (LIR *) insn); |
| 256 | return insn; |
| 257 | } |
| 258 | |
| Ben Cheng | fc075c2 | 2010-05-28 15:20:08 -0700 | [diff] [blame] | 259 | #if defined(_ARMV7_A) || defined(_ARMV7_A_NEON) |
| Dan Bornstein | 9a1f816 | 2010-12-01 17:02:26 -0800 | [diff] [blame] | 260 | static ArmLIR *newLIR4(CompilationUnit *cUnit, ArmOpcode opcode, |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 261 | int dest, int src1, int src2, int info) |
| 262 | { |
| Carl Shapiro | fc75f3e | 2010-12-07 11:43:38 -0800 | [diff] [blame] | 263 | ArmLIR *insn = (ArmLIR *) dvmCompilerNew(sizeof(ArmLIR), true); |
| Dan Bornstein | 9a1f816 | 2010-12-01 17:02:26 -0800 | [diff] [blame] | 264 | assert(isPseudoOpcode(opcode) || |
| 265 | (EncodingMap[opcode].flags & IS_QUAD_OP)); |
| 266 | insn->opcode = opcode; |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 267 | insn->operands[0] = dest; |
| 268 | insn->operands[1] = src1; |
| 269 | insn->operands[2] = src2; |
| 270 | insn->operands[3] = info; |
| 271 | setupResourceMasks(insn); |
| 272 | dvmCompilerAppendLIR(cUnit, (LIR *) insn); |
| 273 | return insn; |
| 274 | } |
| Ben Cheng | fc075c2 | 2010-05-28 15:20:08 -0700 | [diff] [blame] | 275 | #endif |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 276 | |
| 277 | /* |
| 278 | * If the next instruction is a move-result or move-result-long, |
| 279 | * return the target Dalvik sReg[s] and convert the next to a |
| 280 | * nop. Otherwise, return INVALID_SREG. Used to optimize method inlining. |
| 281 | */ |
| 282 | static RegLocation inlinedTarget(CompilationUnit *cUnit, MIR *mir, |
| 283 | bool fpHint) |
| 284 | { |
| 285 | if (mir->next && |
| Dan Bornstein | 9a1f816 | 2010-12-01 17:02:26 -0800 | [diff] [blame] | 286 | ((mir->next->dalvikInsn.opcode == OP_MOVE_RESULT) || |
| 287 | (mir->next->dalvikInsn.opcode == OP_MOVE_RESULT_OBJECT))) { |
| 288 | mir->next->dalvikInsn.opcode = OP_NOP; |
| Bill Buzbee | c6f1066 | 2010-02-09 11:16:15 -0800 | [diff] [blame] | 289 | return dvmCompilerGetDest(cUnit, mir->next, 0); |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 290 | } else { |
| 291 | RegLocation res = LOC_DALVIK_RETURN_VAL; |
| 292 | res.fp = fpHint; |
| 293 | return res; |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | /* |
| 298 | * Search the existing constants in the literal pool for an exact or close match |
| 299 | * within specified delta (greater or equal to 0). |
| 300 | */ |
| 301 | static ArmLIR *scanLiteralPool(CompilationUnit *cUnit, int value, |
| 302 | unsigned int delta) |
| 303 | { |
| 304 | LIR *dataTarget = cUnit->wordList; |
| 305 | while (dataTarget) { |
| 306 | if (((unsigned) (value - ((ArmLIR *) dataTarget)->operands[0])) <= |
| 307 | delta) |
| 308 | return (ArmLIR *) dataTarget; |
| 309 | dataTarget = dataTarget->next; |
| 310 | } |
| 311 | return NULL; |
| 312 | } |
| 313 | |
| 314 | /* |
| 315 | * The following are building blocks to insert constants into the pool or |
| 316 | * instruction streams. |
| 317 | */ |
| 318 | |
| 319 | /* Add a 32-bit constant either in the constant pool or mixed with code */ |
| 320 | static ArmLIR *addWordData(CompilationUnit *cUnit, int value, bool inPlace) |
| 321 | { |
| 322 | /* Add the constant to the literal pool */ |
| 323 | if (!inPlace) { |
| Carl Shapiro | fc75f3e | 2010-12-07 11:43:38 -0800 | [diff] [blame] | 324 | ArmLIR *newValue = (ArmLIR *) dvmCompilerNew(sizeof(ArmLIR), true); |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 325 | newValue->operands[0] = value; |
| 326 | newValue->generic.next = cUnit->wordList; |
| 327 | cUnit->wordList = (LIR *) newValue; |
| 328 | return newValue; |
| 329 | } else { |
| 330 | /* Add the constant in the middle of code stream */ |
| 331 | newLIR1(cUnit, kArm16BitData, (value & 0xffff)); |
| 332 | newLIR1(cUnit, kArm16BitData, (value >> 16)); |
| 333 | } |
| 334 | return NULL; |
| 335 | } |
| 336 | |
| 337 | static RegLocation inlinedTargetWide(CompilationUnit *cUnit, MIR *mir, |
| 338 | bool fpHint) |
| 339 | { |
| 340 | if (mir->next && |
| Dan Bornstein | 9a1f816 | 2010-12-01 17:02:26 -0800 | [diff] [blame] | 341 | (mir->next->dalvikInsn.opcode == OP_MOVE_RESULT_WIDE)) { |
| 342 | mir->next->dalvikInsn.opcode = OP_NOP; |
| Bill Buzbee | c6f1066 | 2010-02-09 11:16:15 -0800 | [diff] [blame] | 343 | return dvmCompilerGetDestWide(cUnit, mir->next, 0, 1); |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 344 | } else { |
| 345 | RegLocation res = LOC_DALVIK_RETURN_VAL_WIDE; |
| 346 | res.fp = fpHint; |
| 347 | return res; |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | |
| 352 | /* |
| 353 | * Generate an kArmPseudoBarrier marker to indicate the boundary of special |
| 354 | * blocks. |
| 355 | */ |
| 356 | static void genBarrier(CompilationUnit *cUnit) |
| 357 | { |
| 358 | ArmLIR *barrier = newLIR0(cUnit, kArmPseudoBarrier); |
| 359 | /* Mark all resources as being clobbered */ |
| 360 | barrier->defMask = -1; |
| 361 | } |
| 362 | |
| 363 | /* Create the PC reconstruction slot if not already done */ |
| Andy McFadden | 953a0ed | 2010-09-17 15:48:38 -0700 | [diff] [blame] | 364 | static ArmLIR *genCheckCommon(CompilationUnit *cUnit, int dOffset, |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 365 | ArmLIR *branch, |
| 366 | ArmLIR *pcrLabel) |
| 367 | { |
| Bill Buzbee | 1f5cd6f | 2010-01-11 21:44:36 -0800 | [diff] [blame] | 368 | /* Forget all def info (because we might rollback here. Bug #2367397 */ |
| Bill Buzbee | c6f1066 | 2010-02-09 11:16:15 -0800 | [diff] [blame] | 369 | dvmCompilerResetDefTracking(cUnit); |
| Bill Buzbee | 1f5cd6f | 2010-01-11 21:44:36 -0800 | [diff] [blame] | 370 | |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 371 | /* Set up the place holder to reconstruct this Dalvik PC */ |
| 372 | if (pcrLabel == NULL) { |
| 373 | int dPC = (int) (cUnit->method->insns + dOffset); |
| Carl Shapiro | fc75f3e | 2010-12-07 11:43:38 -0800 | [diff] [blame] | 374 | pcrLabel = (ArmLIR *) dvmCompilerNew(sizeof(ArmLIR), true); |
| Dan Bornstein | 9a1f816 | 2010-12-01 17:02:26 -0800 | [diff] [blame] | 375 | pcrLabel->opcode = kArmPseudoPCReconstructionCell; |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 376 | pcrLabel->operands[0] = dPC; |
| 377 | pcrLabel->operands[1] = dOffset; |
| 378 | /* Insert the place holder to the growable list */ |
| Ben Cheng | 0060307 | 2010-10-28 11:13:58 -0700 | [diff] [blame] | 379 | dvmInsertGrowableList(&cUnit->pcReconstructionList, |
| 380 | (intptr_t) pcrLabel); |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 381 | } |
| 382 | /* Branch to the PC reconstruction code */ |
| 383 | branch->generic.target = (LIR *) pcrLabel; |
| 384 | return pcrLabel; |
| 385 | } |