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