buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [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 | |
buzbee | 1bc37c6 | 2012-11-20 13:35:41 -0800 | [diff] [blame] | 17 | #include "../compiler_ir.h" |
| 18 | #include "ralloc_util.h" |
| 19 | #include "codegen_util.h" |
| 20 | |
Elliott Hughes | 11d1b0c | 2012-01-23 16:57:47 -0800 | [diff] [blame] | 21 | namespace art { |
| 22 | |
buzbee | b046e16 | 2012-10-30 15:48:42 -0700 | [diff] [blame] | 23 | /* This file contains target-independent codegen and support. */ |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 24 | |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 25 | /* |
| 26 | * Load an immediate value into a fixed or temp register. Target |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 27 | * register is clobbered, and marked in_use. |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 28 | */ |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 29 | LIR* LoadConstant(CompilationUnit* cu, int r_dest, int value) |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 30 | { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 31 | if (IsTemp(cu, r_dest)) { |
| 32 | Clobber(cu, r_dest); |
| 33 | MarkInUse(cu, r_dest); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 34 | } |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 35 | return LoadConstantNoClobber(cu, r_dest, value); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 36 | } |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 37 | |
| 38 | /* Load a word at base + displacement. Displacement must be word multiple */ |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 39 | LIR* LoadWordDisp(CompilationUnit* cu, int rBase, int displacement, |
| 40 | int r_dest) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 41 | { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 42 | return LoadBaseDisp(cu, rBase, displacement, r_dest, kWord, |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 43 | INVALID_SREG); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 44 | } |
| 45 | |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 46 | LIR* StoreWordDisp(CompilationUnit* cu, int rBase, int displacement, |
| 47 | int r_src) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 48 | { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 49 | return StoreBaseDisp(cu, rBase, displacement, r_src, kWord); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | /* |
| 53 | * Load a Dalvik register into a physical register. Take care when |
| 54 | * using this routine, as it doesn't perform any bookkeeping regarding |
| 55 | * register liveness. That is the responsibility of the caller. |
| 56 | */ |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 57 | void LoadValueDirect(CompilationUnit* cu, RegLocation rl_src, int r_dest) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 58 | { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 59 | rl_src = UpdateLoc(cu, rl_src); |
| 60 | if (rl_src.location == kLocPhysReg) { |
| 61 | OpRegCopy(cu, r_dest, rl_src.low_reg); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 62 | } else { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 63 | DCHECK((rl_src.location == kLocDalvikFrame) || |
| 64 | (rl_src.location == kLocCompilerTemp)); |
| 65 | LoadWordDisp(cu, TargetReg(kSp), SRegOffset(cu, rl_src.s_reg_low), r_dest); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 66 | } |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | /* |
buzbee | 52a77fc | 2012-11-20 19:50:46 -0800 | [diff] [blame] | 70 | * Similar to LoadValueDirect, but clobbers and allocates the target |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 71 | * register. Should be used when loading to a fixed register (for example, |
| 72 | * loading arguments to an out of line call. |
| 73 | */ |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 74 | void LoadValueDirectFixed(CompilationUnit* cu, RegLocation rl_src, int r_dest) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 75 | { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 76 | Clobber(cu, r_dest); |
| 77 | MarkInUse(cu, r_dest); |
| 78 | LoadValueDirect(cu, rl_src, r_dest); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 79 | } |
| 80 | |
| 81 | /* |
| 82 | * Load a Dalvik register pair into a physical register[s]. Take care when |
| 83 | * using this routine, as it doesn't perform any bookkeeping regarding |
| 84 | * register liveness. That is the responsibility of the caller. |
| 85 | */ |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 86 | void LoadValueDirectWide(CompilationUnit* cu, RegLocation rl_src, int reg_lo, |
| 87 | int reg_hi) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 88 | { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 89 | rl_src = UpdateLocWide(cu, rl_src); |
| 90 | if (rl_src.location == kLocPhysReg) { |
| 91 | OpRegCopyWide(cu, reg_lo, reg_hi, rl_src.low_reg, rl_src.high_reg); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 92 | } else { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 93 | DCHECK((rl_src.location == kLocDalvikFrame) || |
| 94 | (rl_src.location == kLocCompilerTemp)); |
| 95 | LoadBaseDispWide(cu, TargetReg(kSp), SRegOffset(cu, rl_src.s_reg_low), |
| 96 | reg_lo, reg_hi, INVALID_SREG); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 97 | } |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 98 | } |
| 99 | |
| 100 | /* |
buzbee | 52a77fc | 2012-11-20 19:50:46 -0800 | [diff] [blame] | 101 | * Similar to LoadValueDirect, but clobbers and allocates the target |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 102 | * registers. Should be used when loading to a fixed registers (for example, |
| 103 | * loading arguments to an out of line call. |
| 104 | */ |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 105 | void LoadValueDirectWideFixed(CompilationUnit* cu, RegLocation rl_src, |
| 106 | int reg_lo, int reg_hi) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 107 | { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 108 | Clobber(cu, reg_lo); |
| 109 | Clobber(cu, reg_hi); |
| 110 | MarkInUse(cu, reg_lo); |
| 111 | MarkInUse(cu, reg_hi); |
| 112 | LoadValueDirectWide(cu, rl_src, reg_lo, reg_hi); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 113 | } |
| 114 | |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 115 | RegLocation LoadValue(CompilationUnit* cu, RegLocation rl_src, |
| 116 | RegisterClass op_kind) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 117 | { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 118 | rl_src = EvalLoc(cu, rl_src, op_kind, false); |
| 119 | if (rl_src.location != kLocPhysReg) { |
| 120 | DCHECK((rl_src.location == kLocDalvikFrame) || |
| 121 | (rl_src.location == kLocCompilerTemp)); |
| 122 | LoadValueDirect(cu, rl_src, rl_src.low_reg); |
| 123 | rl_src.location = kLocPhysReg; |
| 124 | MarkLive(cu, rl_src.low_reg, rl_src.s_reg_low); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 125 | } |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 126 | return rl_src; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 127 | } |
| 128 | |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 129 | void StoreValue(CompilationUnit* cu, RegLocation rl_dest, RegLocation rl_src) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 130 | { |
buzbee | 3d66194 | 2012-03-14 17:37:27 -0700 | [diff] [blame] | 131 | #ifndef NDEBUG |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 132 | /* |
| 133 | * Sanity checking - should never try to store to the same |
| 134 | * ssa name during the compilation of a single instruction |
buzbee | 52a77fc | 2012-11-20 19:50:46 -0800 | [diff] [blame] | 135 | * without an intervening ClobberSReg(). |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 136 | */ |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 137 | DCHECK((cu->live_sreg == INVALID_SREG) || |
| 138 | (rl_dest.s_reg_low != cu->live_sreg)); |
| 139 | cu->live_sreg = rl_dest.s_reg_low; |
buzbee | 3d66194 | 2012-03-14 17:37:27 -0700 | [diff] [blame] | 140 | #endif |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 141 | LIR* def_start; |
| 142 | LIR* def_end; |
| 143 | DCHECK(!rl_dest.wide); |
| 144 | DCHECK(!rl_src.wide); |
| 145 | rl_src = UpdateLoc(cu, rl_src); |
| 146 | rl_dest = UpdateLoc(cu, rl_dest); |
| 147 | if (rl_src.location == kLocPhysReg) { |
| 148 | if (IsLive(cu, rl_src.low_reg) || |
| 149 | IsPromoted(cu, rl_src.low_reg) || |
| 150 | (rl_dest.location == kLocPhysReg)) { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 151 | // Src is live/promoted or Dest has assigned reg. |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 152 | rl_dest = EvalLoc(cu, rl_dest, kAnyReg, false); |
| 153 | OpRegCopy(cu, rl_dest.low_reg, rl_src.low_reg); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 154 | } else { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 155 | // Just re-assign the registers. Dest gets Src's regs |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 156 | rl_dest.low_reg = rl_src.low_reg; |
| 157 | Clobber(cu, rl_src.low_reg); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 158 | } |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 159 | } else { |
| 160 | // Load Src either into promoted Dest or temps allocated for Dest |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 161 | rl_dest = EvalLoc(cu, rl_dest, kAnyReg, false); |
| 162 | LoadValueDirect(cu, rl_src, rl_dest.low_reg); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 163 | } |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 164 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 165 | // Dest is now live and dirty (until/if we flush it to home location) |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 166 | MarkLive(cu, rl_dest.low_reg, rl_dest.s_reg_low); |
| 167 | MarkDirty(cu, rl_dest); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 168 | |
| 169 | |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 170 | ResetDefLoc(cu, rl_dest); |
| 171 | if (IsDirty(cu, rl_dest.low_reg) && |
| 172 | oat_live_out(cu, rl_dest.s_reg_low)) { |
| 173 | def_start = cu->last_lir_insn; |
| 174 | StoreBaseDisp(cu, TargetReg(kSp), SRegOffset(cu, rl_dest.s_reg_low), |
| 175 | rl_dest.low_reg, kWord); |
| 176 | MarkClean(cu, rl_dest); |
| 177 | def_end = cu->last_lir_insn; |
| 178 | MarkDef(cu, rl_dest, def_start, def_end); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 179 | } |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 180 | } |
| 181 | |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 182 | RegLocation LoadValueWide(CompilationUnit* cu, RegLocation rl_src, |
| 183 | RegisterClass op_kind) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 184 | { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 185 | DCHECK(rl_src.wide); |
| 186 | rl_src = EvalLoc(cu, rl_src, op_kind, false); |
| 187 | if (rl_src.location != kLocPhysReg) { |
| 188 | DCHECK((rl_src.location == kLocDalvikFrame) || |
| 189 | (rl_src.location == kLocCompilerTemp)); |
| 190 | LoadValueDirectWide(cu, rl_src, rl_src.low_reg, rl_src.high_reg); |
| 191 | rl_src.location = kLocPhysReg; |
| 192 | MarkLive(cu, rl_src.low_reg, rl_src.s_reg_low); |
| 193 | MarkLive(cu, rl_src.high_reg, |
| 194 | GetSRegHi(rl_src.s_reg_low)); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 195 | } |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 196 | return rl_src; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 197 | } |
| 198 | |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 199 | void StoreValueWide(CompilationUnit* cu, RegLocation rl_dest, |
| 200 | RegLocation rl_src) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 201 | { |
buzbee | 3d66194 | 2012-03-14 17:37:27 -0700 | [diff] [blame] | 202 | #ifndef NDEBUG |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 203 | /* |
| 204 | * Sanity checking - should never try to store to the same |
| 205 | * ssa name during the compilation of a single instruction |
buzbee | 52a77fc | 2012-11-20 19:50:46 -0800 | [diff] [blame] | 206 | * without an intervening ClobberSReg(). |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 207 | */ |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 208 | DCHECK((cu->live_sreg == INVALID_SREG) || |
| 209 | (rl_dest.s_reg_low != cu->live_sreg)); |
| 210 | cu->live_sreg = rl_dest.s_reg_low; |
buzbee | 3d66194 | 2012-03-14 17:37:27 -0700 | [diff] [blame] | 211 | #endif |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 212 | LIR* def_start; |
| 213 | LIR* def_end; |
| 214 | DCHECK_EQ(FpReg(rl_src.low_reg), FpReg(rl_src.high_reg)); |
| 215 | DCHECK(rl_dest.wide); |
| 216 | DCHECK(rl_src.wide); |
| 217 | if (rl_src.location == kLocPhysReg) { |
| 218 | if (IsLive(cu, rl_src.low_reg) || |
| 219 | IsLive(cu, rl_src.high_reg) || |
| 220 | IsPromoted(cu, rl_src.low_reg) || |
| 221 | IsPromoted(cu, rl_src.high_reg) || |
| 222 | (rl_dest.location == kLocPhysReg)) { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 223 | // Src is live or promoted or Dest has assigned reg. |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 224 | rl_dest = EvalLoc(cu, rl_dest, kAnyReg, false); |
| 225 | OpRegCopyWide(cu, rl_dest.low_reg, rl_dest.high_reg, |
| 226 | rl_src.low_reg, rl_src.high_reg); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 227 | } else { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 228 | // Just re-assign the registers. Dest gets Src's regs |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 229 | rl_dest.low_reg = rl_src.low_reg; |
| 230 | rl_dest.high_reg = rl_src.high_reg; |
| 231 | Clobber(cu, rl_src.low_reg); |
| 232 | Clobber(cu, rl_src.high_reg); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 233 | } |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 234 | } else { |
| 235 | // Load Src either into promoted Dest or temps allocated for Dest |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 236 | rl_dest = EvalLoc(cu, rl_dest, kAnyReg, false); |
| 237 | LoadValueDirectWide(cu, rl_src, rl_dest.low_reg, rl_dest.high_reg); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 238 | } |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 239 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 240 | // Dest is now live and dirty (until/if we flush it to home location) |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 241 | MarkLive(cu, rl_dest.low_reg, rl_dest.s_reg_low); |
| 242 | MarkLive(cu, rl_dest.high_reg, GetSRegHi(rl_dest.s_reg_low)); |
| 243 | MarkDirty(cu, rl_dest); |
| 244 | MarkPair(cu, rl_dest.low_reg, rl_dest.high_reg); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 245 | |
| 246 | |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 247 | ResetDefLocWide(cu, rl_dest); |
| 248 | if ((IsDirty(cu, rl_dest.low_reg) || |
| 249 | IsDirty(cu, rl_dest.high_reg)) && |
| 250 | (oat_live_out(cu, rl_dest.s_reg_low) || |
| 251 | oat_live_out(cu, GetSRegHi(rl_dest.s_reg_low)))) { |
| 252 | def_start = cu->last_lir_insn; |
| 253 | DCHECK_EQ((SRegToVReg(cu, rl_dest.s_reg_low)+1), |
| 254 | SRegToVReg(cu, GetSRegHi(rl_dest.s_reg_low))); |
| 255 | StoreBaseDispWide(cu, TargetReg(kSp), SRegOffset(cu, rl_dest.s_reg_low), |
| 256 | rl_dest.low_reg, rl_dest.high_reg); |
| 257 | MarkClean(cu, rl_dest); |
| 258 | def_end = cu->last_lir_insn; |
| 259 | MarkDefWide(cu, rl_dest, def_start, def_end); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 260 | } |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 261 | } |
Elliott Hughes | 11d1b0c | 2012-01-23 16:57:47 -0800 | [diff] [blame] | 262 | |
buzbee | e196567 | 2012-03-11 18:39:19 -0700 | [diff] [blame] | 263 | /* Utilities to load the current Method* */ |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 264 | void LoadCurrMethodDirect(CompilationUnit *cu, int r_tgt) |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 265 | { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 266 | LoadValueDirectFixed(cu, cu->method_loc, r_tgt); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 267 | } |
| 268 | |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 269 | RegLocation LoadCurrMethod(CompilationUnit *cu) |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 270 | { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame^] | 271 | return LoadValue(cu, cu->method_loc, kCoreReg); |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 272 | } |
| 273 | |
Elliott Hughes | 11d1b0c | 2012-01-23 16:57:47 -0800 | [diff] [blame] | 274 | } // namespace art |