Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 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 | #ifndef ART_COMPILER_OPTIMIZING_CODE_GENERATOR_MIPS_H_ |
| 18 | #define ART_COMPILER_OPTIMIZING_CODE_GENERATOR_MIPS_H_ |
| 19 | |
| 20 | #include "code_generator.h" |
Andreas Gampe | 8a0128a | 2016-11-28 07:38:35 -0800 | [diff] [blame] | 21 | #include "dex_file_types.h" |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 22 | #include "driver/compiler_options.h" |
| 23 | #include "nodes.h" |
| 24 | #include "parallel_move_resolver.h" |
Alexey Frunze | 06a46c4 | 2016-07-19 15:00:40 -0700 | [diff] [blame] | 25 | #include "string_reference.h" |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 26 | #include "utils/mips/assembler_mips.h" |
Alexey Frunze | 06a46c4 | 2016-07-19 15:00:40 -0700 | [diff] [blame] | 27 | #include "utils/type_reference.h" |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 28 | |
| 29 | namespace art { |
| 30 | namespace mips { |
| 31 | |
| 32 | // InvokeDexCallingConvention registers |
| 33 | |
| 34 | static constexpr Register kParameterCoreRegisters[] = |
Alexey Frunze | 1b8464d | 2016-11-12 17:22:05 -0800 | [diff] [blame] | 35 | { A1, A2, A3, T0, T1 }; |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 36 | static constexpr size_t kParameterCoreRegistersLength = arraysize(kParameterCoreRegisters); |
| 37 | |
| 38 | static constexpr FRegister kParameterFpuRegisters[] = |
Alexey Frunze | 1b8464d | 2016-11-12 17:22:05 -0800 | [diff] [blame] | 39 | { F8, F10, F12, F14, F16, F18 }; |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 40 | static constexpr size_t kParameterFpuRegistersLength = arraysize(kParameterFpuRegisters); |
| 41 | |
| 42 | |
| 43 | // InvokeRuntimeCallingConvention registers |
| 44 | |
| 45 | static constexpr Register kRuntimeParameterCoreRegisters[] = |
| 46 | { A0, A1, A2, A3 }; |
| 47 | static constexpr size_t kRuntimeParameterCoreRegistersLength = |
| 48 | arraysize(kRuntimeParameterCoreRegisters); |
| 49 | |
| 50 | static constexpr FRegister kRuntimeParameterFpuRegisters[] = |
Alexey Frunze | 1b8464d | 2016-11-12 17:22:05 -0800 | [diff] [blame] | 51 | { F12, F14 }; |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 52 | static constexpr size_t kRuntimeParameterFpuRegistersLength = |
| 53 | arraysize(kRuntimeParameterFpuRegisters); |
| 54 | |
| 55 | |
| 56 | static constexpr Register kCoreCalleeSaves[] = |
| 57 | { S0, S1, S2, S3, S4, S5, S6, S7, FP, RA }; |
| 58 | static constexpr FRegister kFpuCalleeSaves[] = |
| 59 | { F20, F22, F24, F26, F28, F30 }; |
| 60 | |
| 61 | |
| 62 | class CodeGeneratorMIPS; |
| 63 | |
| 64 | class InvokeDexCallingConvention : public CallingConvention<Register, FRegister> { |
| 65 | public: |
| 66 | InvokeDexCallingConvention() |
| 67 | : CallingConvention(kParameterCoreRegisters, |
| 68 | kParameterCoreRegistersLength, |
| 69 | kParameterFpuRegisters, |
| 70 | kParameterFpuRegistersLength, |
| 71 | kMipsPointerSize) {} |
| 72 | |
| 73 | private: |
| 74 | DISALLOW_COPY_AND_ASSIGN(InvokeDexCallingConvention); |
| 75 | }; |
| 76 | |
| 77 | class InvokeDexCallingConventionVisitorMIPS : public InvokeDexCallingConventionVisitor { |
| 78 | public: |
| 79 | InvokeDexCallingConventionVisitorMIPS() {} |
| 80 | virtual ~InvokeDexCallingConventionVisitorMIPS() {} |
| 81 | |
| 82 | Location GetNextLocation(Primitive::Type type) OVERRIDE; |
| 83 | Location GetReturnLocation(Primitive::Type type) const OVERRIDE; |
| 84 | Location GetMethodLocation() const OVERRIDE; |
| 85 | |
| 86 | private: |
| 87 | InvokeDexCallingConvention calling_convention; |
| 88 | |
| 89 | DISALLOW_COPY_AND_ASSIGN(InvokeDexCallingConventionVisitorMIPS); |
| 90 | }; |
| 91 | |
| 92 | class InvokeRuntimeCallingConvention : public CallingConvention<Register, FRegister> { |
| 93 | public: |
| 94 | InvokeRuntimeCallingConvention() |
| 95 | : CallingConvention(kRuntimeParameterCoreRegisters, |
| 96 | kRuntimeParameterCoreRegistersLength, |
| 97 | kRuntimeParameterFpuRegisters, |
| 98 | kRuntimeParameterFpuRegistersLength, |
| 99 | kMipsPointerSize) {} |
| 100 | |
| 101 | Location GetReturnLocation(Primitive::Type return_type); |
| 102 | |
| 103 | private: |
| 104 | DISALLOW_COPY_AND_ASSIGN(InvokeRuntimeCallingConvention); |
| 105 | }; |
| 106 | |
| 107 | class FieldAccessCallingConventionMIPS : public FieldAccessCallingConvention { |
| 108 | public: |
| 109 | FieldAccessCallingConventionMIPS() {} |
| 110 | |
| 111 | Location GetObjectLocation() const OVERRIDE { |
| 112 | return Location::RegisterLocation(A1); |
| 113 | } |
| 114 | Location GetFieldIndexLocation() const OVERRIDE { |
| 115 | return Location::RegisterLocation(A0); |
| 116 | } |
| 117 | Location GetReturnLocation(Primitive::Type type) const OVERRIDE { |
| 118 | return Primitive::Is64BitType(type) |
| 119 | ? Location::RegisterPairLocation(V0, V1) |
| 120 | : Location::RegisterLocation(V0); |
| 121 | } |
| 122 | Location GetSetValueLocation(Primitive::Type type, bool is_instance) const OVERRIDE { |
| 123 | return Primitive::Is64BitType(type) |
| 124 | ? Location::RegisterPairLocation(A2, A3) |
| 125 | : (is_instance ? Location::RegisterLocation(A2) : Location::RegisterLocation(A1)); |
| 126 | } |
| 127 | Location GetFpuLocation(Primitive::Type type ATTRIBUTE_UNUSED) const OVERRIDE { |
| 128 | return Location::FpuRegisterLocation(F0); |
| 129 | } |
| 130 | |
| 131 | private: |
| 132 | DISALLOW_COPY_AND_ASSIGN(FieldAccessCallingConventionMIPS); |
| 133 | }; |
| 134 | |
| 135 | class ParallelMoveResolverMIPS : public ParallelMoveResolverWithSwap { |
| 136 | public: |
| 137 | ParallelMoveResolverMIPS(ArenaAllocator* allocator, CodeGeneratorMIPS* codegen) |
| 138 | : ParallelMoveResolverWithSwap(allocator), codegen_(codegen) {} |
| 139 | |
| 140 | void EmitMove(size_t index) OVERRIDE; |
| 141 | void EmitSwap(size_t index) OVERRIDE; |
| 142 | void SpillScratch(int reg) OVERRIDE; |
| 143 | void RestoreScratch(int reg) OVERRIDE; |
| 144 | |
| 145 | void Exchange(int index1, int index2, bool double_slot); |
| 146 | |
| 147 | MipsAssembler* GetAssembler() const; |
| 148 | |
| 149 | private: |
| 150 | CodeGeneratorMIPS* const codegen_; |
| 151 | |
| 152 | DISALLOW_COPY_AND_ASSIGN(ParallelMoveResolverMIPS); |
| 153 | }; |
| 154 | |
| 155 | class SlowPathCodeMIPS : public SlowPathCode { |
| 156 | public: |
David Srbecky | 9cd6d37 | 2016-02-09 15:24:47 +0000 | [diff] [blame] | 157 | explicit SlowPathCodeMIPS(HInstruction* instruction) |
| 158 | : SlowPathCode(instruction), entry_label_(), exit_label_() {} |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 159 | |
| 160 | MipsLabel* GetEntryLabel() { return &entry_label_; } |
| 161 | MipsLabel* GetExitLabel() { return &exit_label_; } |
| 162 | |
| 163 | private: |
| 164 | MipsLabel entry_label_; |
| 165 | MipsLabel exit_label_; |
| 166 | |
| 167 | DISALLOW_COPY_AND_ASSIGN(SlowPathCodeMIPS); |
| 168 | }; |
| 169 | |
| 170 | class LocationsBuilderMIPS : public HGraphVisitor { |
| 171 | public: |
| 172 | LocationsBuilderMIPS(HGraph* graph, CodeGeneratorMIPS* codegen) |
| 173 | : HGraphVisitor(graph), codegen_(codegen) {} |
| 174 | |
| 175 | #define DECLARE_VISIT_INSTRUCTION(name, super) \ |
| 176 | void Visit##name(H##name* instr) OVERRIDE; |
| 177 | |
| 178 | FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION) |
| 179 | FOR_EACH_CONCRETE_INSTRUCTION_MIPS(DECLARE_VISIT_INSTRUCTION) |
| 180 | |
| 181 | #undef DECLARE_VISIT_INSTRUCTION |
| 182 | |
| 183 | void VisitInstruction(HInstruction* instruction) OVERRIDE { |
| 184 | LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() |
| 185 | << " (id " << instruction->GetId() << ")"; |
| 186 | } |
| 187 | |
| 188 | private: |
| 189 | void HandleInvoke(HInvoke* invoke); |
| 190 | void HandleBinaryOp(HBinaryOperation* operation); |
Vladimir Marko | 5f7b58e | 2015-11-23 19:49:34 +0000 | [diff] [blame] | 191 | void HandleCondition(HCondition* instruction); |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 192 | void HandleShift(HBinaryOperation* operation); |
| 193 | void HandleFieldSet(HInstruction* instruction, const FieldInfo& field_info); |
| 194 | void HandleFieldGet(HInstruction* instruction, const FieldInfo& field_info); |
Alexey Frunze | f58b248 | 2016-09-02 22:14:06 -0700 | [diff] [blame] | 195 | Location RegisterOrZeroConstant(HInstruction* instruction); |
| 196 | Location FpuRegisterOrConstantForStore(HInstruction* instruction); |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 197 | |
| 198 | InvokeDexCallingConventionVisitorMIPS parameter_visitor_; |
| 199 | |
| 200 | CodeGeneratorMIPS* const codegen_; |
| 201 | |
| 202 | DISALLOW_COPY_AND_ASSIGN(LocationsBuilderMIPS); |
| 203 | }; |
| 204 | |
Aart Bik | 42249c3 | 2016-01-07 15:33:50 -0800 | [diff] [blame] | 205 | class InstructionCodeGeneratorMIPS : public InstructionCodeGenerator { |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 206 | public: |
| 207 | InstructionCodeGeneratorMIPS(HGraph* graph, CodeGeneratorMIPS* codegen); |
| 208 | |
| 209 | #define DECLARE_VISIT_INSTRUCTION(name, super) \ |
| 210 | void Visit##name(H##name* instr) OVERRIDE; |
| 211 | |
| 212 | FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION) |
| 213 | FOR_EACH_CONCRETE_INSTRUCTION_MIPS(DECLARE_VISIT_INSTRUCTION) |
| 214 | |
| 215 | #undef DECLARE_VISIT_INSTRUCTION |
| 216 | |
| 217 | void VisitInstruction(HInstruction* instruction) OVERRIDE { |
| 218 | LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() |
| 219 | << " (id " << instruction->GetId() << ")"; |
| 220 | } |
| 221 | |
| 222 | MipsAssembler* GetAssembler() const { return assembler_; } |
| 223 | |
Alexey Frunze | 96b6682 | 2016-09-10 02:32:44 -0700 | [diff] [blame] | 224 | // Compare-and-jump packed switch generates approx. 3 + 2.5 * N 32-bit |
| 225 | // instructions for N cases. |
| 226 | // Table-based packed switch generates approx. 11 32-bit instructions |
| 227 | // and N 32-bit data words for N cases. |
| 228 | // At N = 6 they come out as 18 and 17 32-bit words respectively. |
| 229 | // We switch to the table-based method starting with 7 cases. |
| 230 | static constexpr uint32_t kPackedSwitchJumpTableThreshold = 6; |
| 231 | |
Chris Larsen | 5633ce7 | 2017-04-10 15:47:40 -0700 | [diff] [blame] | 232 | void GenerateMemoryBarrier(MemBarrierKind kind); |
| 233 | |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 234 | private: |
| 235 | void GenerateClassInitializationCheck(SlowPathCodeMIPS* slow_path, Register class_reg); |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 236 | void GenerateSuspendCheck(HSuspendCheck* check, HBasicBlock* successor); |
| 237 | void HandleBinaryOp(HBinaryOperation* operation); |
Vladimir Marko | 5f7b58e | 2015-11-23 19:49:34 +0000 | [diff] [blame] | 238 | void HandleCondition(HCondition* instruction); |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 239 | void HandleShift(HBinaryOperation* operation); |
Goran Jakovljevic | e114da2 | 2016-12-26 14:21:43 +0100 | [diff] [blame] | 240 | void HandleFieldSet(HInstruction* instruction, |
| 241 | const FieldInfo& field_info, |
| 242 | uint32_t dex_pc, |
| 243 | bool value_can_be_null); |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 244 | void HandleFieldGet(HInstruction* instruction, const FieldInfo& field_info, uint32_t dex_pc); |
Alexey Frunze | 1595815 | 2017-02-09 19:08:30 -0800 | [diff] [blame] | 245 | |
| 246 | // Generate a heap reference load using one register `out`: |
| 247 | // |
| 248 | // out <- *(out + offset) |
| 249 | // |
| 250 | // while honoring heap poisoning and/or read barriers (if any). |
| 251 | // |
| 252 | // Location `maybe_temp` is used when generating a read barrier and |
| 253 | // shall be a register in that case; it may be an invalid location |
| 254 | // otherwise. |
| 255 | void GenerateReferenceLoadOneRegister(HInstruction* instruction, |
| 256 | Location out, |
| 257 | uint32_t offset, |
| 258 | Location maybe_temp, |
| 259 | ReadBarrierOption read_barrier_option); |
| 260 | // Generate a heap reference load using two different registers |
| 261 | // `out` and `obj`: |
| 262 | // |
| 263 | // out <- *(obj + offset) |
| 264 | // |
| 265 | // while honoring heap poisoning and/or read barriers (if any). |
| 266 | // |
| 267 | // Location `maybe_temp` is used when generating a Baker's (fast |
| 268 | // path) read barrier and shall be a register in that case; it may |
| 269 | // be an invalid location otherwise. |
| 270 | void GenerateReferenceLoadTwoRegisters(HInstruction* instruction, |
| 271 | Location out, |
| 272 | Location obj, |
| 273 | uint32_t offset, |
| 274 | Location maybe_temp, |
| 275 | ReadBarrierOption read_barrier_option); |
| 276 | |
Alexey Frunze | 06a46c4 | 2016-07-19 15:00:40 -0700 | [diff] [blame] | 277 | // Generate a GC root reference load: |
| 278 | // |
| 279 | // root <- *(obj + offset) |
| 280 | // |
| 281 | // while honoring read barriers (if any). |
| 282 | void GenerateGcRootFieldLoad(HInstruction* instruction, |
| 283 | Location root, |
| 284 | Register obj, |
Alexey Frunze | 1595815 | 2017-02-09 19:08:30 -0800 | [diff] [blame] | 285 | uint32_t offset, |
| 286 | ReadBarrierOption read_barrier_option); |
| 287 | |
Alexey Frunze | cd7b0ee | 2015-12-03 16:46:38 -0800 | [diff] [blame] | 288 | void GenerateIntCompare(IfCondition cond, LocationSummary* locations); |
Alexey Frunze | 674b9ee | 2016-09-20 14:54:15 -0700 | [diff] [blame] | 289 | // When the function returns `false` it means that the condition holds if `dst` is non-zero |
| 290 | // and doesn't hold if `dst` is zero. If it returns `true`, the roles of zero and non-zero |
| 291 | // `dst` are exchanged. |
| 292 | bool MaterializeIntCompare(IfCondition cond, |
| 293 | LocationSummary* input_locations, |
| 294 | Register dst); |
Alexey Frunze | cd7b0ee | 2015-12-03 16:46:38 -0800 | [diff] [blame] | 295 | void GenerateIntCompareAndBranch(IfCondition cond, |
| 296 | LocationSummary* locations, |
| 297 | MipsLabel* label); |
Tijana Jakovljevic | 6d482aa | 2017-02-03 13:24:08 +0100 | [diff] [blame] | 298 | void GenerateLongCompare(IfCondition cond, LocationSummary* locations); |
Alexey Frunze | cd7b0ee | 2015-12-03 16:46:38 -0800 | [diff] [blame] | 299 | void GenerateLongCompareAndBranch(IfCondition cond, |
| 300 | LocationSummary* locations, |
| 301 | MipsLabel* label); |
Alexey Frunze | 2ddb717 | 2016-09-06 17:04:55 -0700 | [diff] [blame] | 302 | void GenerateFpCompare(IfCondition cond, |
| 303 | bool gt_bias, |
| 304 | Primitive::Type type, |
| 305 | LocationSummary* locations); |
Alexey Frunze | 674b9ee | 2016-09-20 14:54:15 -0700 | [diff] [blame] | 306 | // When the function returns `false` it means that the condition holds if the condition |
| 307 | // code flag `cc` is non-zero and doesn't hold if `cc` is zero. If it returns `true`, |
| 308 | // the roles of zero and non-zero values of the `cc` flag are exchanged. |
| 309 | bool MaterializeFpCompareR2(IfCondition cond, |
| 310 | bool gt_bias, |
| 311 | Primitive::Type type, |
| 312 | LocationSummary* input_locations, |
| 313 | int cc); |
| 314 | // When the function returns `false` it means that the condition holds if `dst` is non-zero |
| 315 | // and doesn't hold if `dst` is zero. If it returns `true`, the roles of zero and non-zero |
| 316 | // `dst` are exchanged. |
| 317 | bool MaterializeFpCompareR6(IfCondition cond, |
| 318 | bool gt_bias, |
| 319 | Primitive::Type type, |
| 320 | LocationSummary* input_locations, |
| 321 | FRegister dst); |
Alexey Frunze | cd7b0ee | 2015-12-03 16:46:38 -0800 | [diff] [blame] | 322 | void GenerateFpCompareAndBranch(IfCondition cond, |
| 323 | bool gt_bias, |
| 324 | Primitive::Type type, |
| 325 | LocationSummary* locations, |
| 326 | MipsLabel* label); |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 327 | void GenerateTestAndBranch(HInstruction* instruction, |
David Brazdil | 0debae7 | 2015-11-12 18:37:00 +0000 | [diff] [blame] | 328 | size_t condition_input_index, |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 329 | MipsLabel* true_target, |
David Brazdil | 0debae7 | 2015-11-12 18:37:00 +0000 | [diff] [blame] | 330 | MipsLabel* false_target); |
Alexey Frunze | 7e99e05 | 2015-11-24 19:28:01 -0800 | [diff] [blame] | 331 | void DivRemOneOrMinusOne(HBinaryOperation* instruction); |
| 332 | void DivRemByPowerOfTwo(HBinaryOperation* instruction); |
| 333 | void GenerateDivRemWithAnyConstant(HBinaryOperation* instruction); |
| 334 | void GenerateDivRemIntegral(HBinaryOperation* instruction); |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 335 | void HandleGoto(HInstruction* got, HBasicBlock* successor); |
Alexey Frunze | 96b6682 | 2016-09-10 02:32:44 -0700 | [diff] [blame] | 336 | void GenPackedSwitchWithCompares(Register value_reg, |
| 337 | int32_t lower_bound, |
| 338 | uint32_t num_entries, |
| 339 | HBasicBlock* switch_block, |
| 340 | HBasicBlock* default_block); |
| 341 | void GenTableBasedPackedSwitch(Register value_reg, |
| 342 | Register constant_area, |
| 343 | int32_t lower_bound, |
| 344 | uint32_t num_entries, |
| 345 | HBasicBlock* switch_block, |
| 346 | HBasicBlock* default_block); |
Alexey Frunze | 674b9ee | 2016-09-20 14:54:15 -0700 | [diff] [blame] | 347 | void GenConditionalMoveR2(HSelect* select); |
| 348 | void GenConditionalMoveR6(HSelect* select); |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 349 | |
| 350 | MipsAssembler* const assembler_; |
| 351 | CodeGeneratorMIPS* const codegen_; |
| 352 | |
| 353 | DISALLOW_COPY_AND_ASSIGN(InstructionCodeGeneratorMIPS); |
| 354 | }; |
| 355 | |
| 356 | class CodeGeneratorMIPS : public CodeGenerator { |
| 357 | public: |
| 358 | CodeGeneratorMIPS(HGraph* graph, |
| 359 | const MipsInstructionSetFeatures& isa_features, |
| 360 | const CompilerOptions& compiler_options, |
| 361 | OptimizingCompilerStats* stats = nullptr); |
| 362 | virtual ~CodeGeneratorMIPS() {} |
| 363 | |
Alexey Frunze | 73296a7 | 2016-06-03 22:51:46 -0700 | [diff] [blame] | 364 | void ComputeSpillMask() OVERRIDE; |
Alexey Frunze | 58320ce | 2016-08-30 21:40:46 -0700 | [diff] [blame] | 365 | bool HasAllocatedCalleeSaveRegisters() const OVERRIDE; |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 366 | void GenerateFrameEntry() OVERRIDE; |
| 367 | void GenerateFrameExit() OVERRIDE; |
| 368 | |
| 369 | void Bind(HBasicBlock* block) OVERRIDE; |
| 370 | |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 371 | void Move32(Location destination, Location source); |
| 372 | void Move64(Location destination, Location source); |
| 373 | void MoveConstant(Location location, HConstant* c); |
| 374 | |
| 375 | size_t GetWordSize() const OVERRIDE { return kMipsWordSize; } |
| 376 | |
| 377 | size_t GetFloatingPointSpillSlotSize() const OVERRIDE { return kMipsDoublewordSize; } |
| 378 | |
Alexandre Rames | c01a664 | 2016-04-15 11:54:06 +0100 | [diff] [blame] | 379 | uintptr_t GetAddressOf(HBasicBlock* block) OVERRIDE { |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 380 | return assembler_.GetLabelLocation(GetLabelOf(block)); |
| 381 | } |
| 382 | |
| 383 | HGraphVisitor* GetLocationBuilder() OVERRIDE { return &location_builder_; } |
| 384 | HGraphVisitor* GetInstructionVisitor() OVERRIDE { return &instruction_visitor_; } |
| 385 | MipsAssembler* GetAssembler() OVERRIDE { return &assembler_; } |
| 386 | const MipsAssembler& GetAssembler() const OVERRIDE { return assembler_; } |
| 387 | |
Alexey Frunze | e3fb245 | 2016-05-10 16:08:05 -0700 | [diff] [blame] | 388 | // Emit linker patches. |
| 389 | void EmitLinkerPatches(ArenaVector<LinkerPatch>* linker_patches) OVERRIDE; |
Alexey Frunze | 627c1a0 | 2017-01-30 19:28:14 -0800 | [diff] [blame] | 390 | void EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) OVERRIDE; |
Alexey Frunze | e3fb245 | 2016-05-10 16:08:05 -0700 | [diff] [blame] | 391 | |
Alexey Frunze | 1595815 | 2017-02-09 19:08:30 -0800 | [diff] [blame] | 392 | // Fast path implementation of ReadBarrier::Barrier for a heap |
| 393 | // reference field load when Baker's read barriers are used. |
| 394 | void GenerateFieldLoadWithBakerReadBarrier(HInstruction* instruction, |
| 395 | Location ref, |
| 396 | Register obj, |
| 397 | uint32_t offset, |
| 398 | Location temp, |
| 399 | bool needs_null_check); |
| 400 | // Fast path implementation of ReadBarrier::Barrier for a heap |
| 401 | // reference array load when Baker's read barriers are used. |
| 402 | void GenerateArrayLoadWithBakerReadBarrier(HInstruction* instruction, |
| 403 | Location ref, |
| 404 | Register obj, |
| 405 | uint32_t data_offset, |
| 406 | Location index, |
| 407 | Location temp, |
| 408 | bool needs_null_check); |
| 409 | |
| 410 | // Factored implementation, used by GenerateFieldLoadWithBakerReadBarrier, |
| 411 | // GenerateArrayLoadWithBakerReadBarrier and some intrinsics. |
| 412 | // |
| 413 | // Load the object reference located at the address |
| 414 | // `obj + offset + (index << scale_factor)`, held by object `obj`, into |
| 415 | // `ref`, and mark it if needed. |
| 416 | // |
| 417 | // If `always_update_field` is true, the value of the reference is |
| 418 | // atomically updated in the holder (`obj`). |
| 419 | void GenerateReferenceLoadWithBakerReadBarrier(HInstruction* instruction, |
| 420 | Location ref, |
| 421 | Register obj, |
| 422 | uint32_t offset, |
| 423 | Location index, |
| 424 | ScaleFactor scale_factor, |
| 425 | Location temp, |
| 426 | bool needs_null_check, |
| 427 | bool always_update_field = false); |
| 428 | |
| 429 | // Generate a read barrier for a heap reference within `instruction` |
| 430 | // using a slow path. |
| 431 | // |
| 432 | // A read barrier for an object reference read from the heap is |
| 433 | // implemented as a call to the artReadBarrierSlow runtime entry |
| 434 | // point, which is passed the values in locations `ref`, `obj`, and |
| 435 | // `offset`: |
| 436 | // |
| 437 | // mirror::Object* artReadBarrierSlow(mirror::Object* ref, |
| 438 | // mirror::Object* obj, |
| 439 | // uint32_t offset); |
| 440 | // |
| 441 | // The `out` location contains the value returned by |
| 442 | // artReadBarrierSlow. |
| 443 | // |
| 444 | // When `index` is provided (i.e. for array accesses), the offset |
| 445 | // value passed to artReadBarrierSlow is adjusted to take `index` |
| 446 | // into account. |
| 447 | void GenerateReadBarrierSlow(HInstruction* instruction, |
| 448 | Location out, |
| 449 | Location ref, |
| 450 | Location obj, |
| 451 | uint32_t offset, |
| 452 | Location index = Location::NoLocation()); |
| 453 | |
| 454 | // If read barriers are enabled, generate a read barrier for a heap |
| 455 | // reference using a slow path. If heap poisoning is enabled, also |
| 456 | // unpoison the reference in `out`. |
| 457 | void MaybeGenerateReadBarrierSlow(HInstruction* instruction, |
| 458 | Location out, |
| 459 | Location ref, |
| 460 | Location obj, |
| 461 | uint32_t offset, |
| 462 | Location index = Location::NoLocation()); |
| 463 | |
| 464 | // Generate a read barrier for a GC root within `instruction` using |
| 465 | // a slow path. |
| 466 | // |
| 467 | // A read barrier for an object reference GC root is implemented as |
| 468 | // a call to the artReadBarrierForRootSlow runtime entry point, |
| 469 | // which is passed the value in location `root`: |
| 470 | // |
| 471 | // mirror::Object* artReadBarrierForRootSlow(GcRoot<mirror::Object>* root); |
| 472 | // |
| 473 | // The `out` location contains the value returned by |
| 474 | // artReadBarrierForRootSlow. |
| 475 | void GenerateReadBarrierForRootSlow(HInstruction* instruction, Location out, Location root); |
| 476 | |
Goran Jakovljevic | e114da2 | 2016-12-26 14:21:43 +0100 | [diff] [blame] | 477 | void MarkGCCard(Register object, Register value, bool value_can_be_null); |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 478 | |
| 479 | // Register allocation. |
| 480 | |
David Brazdil | 58282f4 | 2016-01-14 12:45:10 +0000 | [diff] [blame] | 481 | void SetupBlockedRegisters() const OVERRIDE; |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 482 | |
Roland Levillain | f41f956 | 2016-09-14 19:26:48 +0100 | [diff] [blame] | 483 | size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; |
| 484 | size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; |
| 485 | size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; |
| 486 | size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE; |
Alexey Frunze | 06a46c4 | 2016-07-19 15:00:40 -0700 | [diff] [blame] | 487 | void ClobberRA() { |
| 488 | clobbered_ra_ = true; |
| 489 | } |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 490 | |
| 491 | void DumpCoreRegister(std::ostream& stream, int reg) const OVERRIDE; |
| 492 | void DumpFloatingPointRegister(std::ostream& stream, int reg) const OVERRIDE; |
| 493 | |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 494 | InstructionSet GetInstructionSet() const OVERRIDE { return InstructionSet::kMips; } |
| 495 | |
| 496 | const MipsInstructionSetFeatures& GetInstructionSetFeatures() const { |
| 497 | return isa_features_; |
| 498 | } |
| 499 | |
| 500 | MipsLabel* GetLabelOf(HBasicBlock* block) const { |
| 501 | return CommonGetLabelOf<MipsLabel>(block_labels_, block); |
| 502 | } |
| 503 | |
| 504 | void Initialize() OVERRIDE { |
| 505 | block_labels_ = CommonInitializeLabels<MipsLabel>(); |
| 506 | } |
| 507 | |
| 508 | void Finalize(CodeAllocator* allocator) OVERRIDE; |
| 509 | |
| 510 | // Code generation helpers. |
| 511 | |
| 512 | void MoveLocation(Location dst, Location src, Primitive::Type dst_type) OVERRIDE; |
| 513 | |
Roland Levillain | f41f956 | 2016-09-14 19:26:48 +0100 | [diff] [blame] | 514 | void MoveConstant(Location destination, int32_t value) OVERRIDE; |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 515 | |
| 516 | void AddLocationAsTemp(Location location, LocationSummary* locations) OVERRIDE; |
| 517 | |
| 518 | // Generate code to invoke a runtime entry point. |
| 519 | void InvokeRuntime(QuickEntrypointEnum entrypoint, |
| 520 | HInstruction* instruction, |
| 521 | uint32_t dex_pc, |
Serban Constantinescu | fca1666 | 2016-07-14 09:21:59 +0100 | [diff] [blame] | 522 | SlowPathCode* slow_path = nullptr) OVERRIDE; |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 523 | |
Alexey Frunze | 1595815 | 2017-02-09 19:08:30 -0800 | [diff] [blame] | 524 | // Generate code to invoke a runtime entry point, but do not record |
| 525 | // PC-related information in a stack map. |
| 526 | void InvokeRuntimeWithoutRecordingPcInfo(int32_t entry_point_offset, |
| 527 | HInstruction* instruction, |
| 528 | SlowPathCode* slow_path, |
| 529 | bool direct); |
| 530 | |
| 531 | void GenerateInvokeRuntime(int32_t entry_point_offset, bool direct); |
| 532 | |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 533 | ParallelMoveResolver* GetMoveResolver() OVERRIDE { return &move_resolver_; } |
| 534 | |
Roland Levillain | f41f956 | 2016-09-14 19:26:48 +0100 | [diff] [blame] | 535 | bool NeedsTwoRegisters(Primitive::Type type) const OVERRIDE { |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 536 | return type == Primitive::kPrimLong; |
| 537 | } |
| 538 | |
Vladimir Marko | cac5a7e | 2016-02-22 10:39:50 +0000 | [diff] [blame] | 539 | // Check if the desired_string_load_kind is supported. If it is, return it, |
| 540 | // otherwise return a fall-back kind that should be used instead. |
| 541 | HLoadString::LoadKind GetSupportedLoadStringKind( |
| 542 | HLoadString::LoadKind desired_string_load_kind) OVERRIDE; |
| 543 | |
Vladimir Marko | dbb7f5b | 2016-03-30 13:23:58 +0100 | [diff] [blame] | 544 | // Check if the desired_class_load_kind is supported. If it is, return it, |
| 545 | // otherwise return a fall-back kind that should be used instead. |
| 546 | HLoadClass::LoadKind GetSupportedLoadClassKind( |
| 547 | HLoadClass::LoadKind desired_class_load_kind) OVERRIDE; |
| 548 | |
Vladimir Marko | dc151b2 | 2015-10-15 18:02:30 +0100 | [diff] [blame] | 549 | // Check if the desired_dispatch_info is supported. If it is, return it, |
| 550 | // otherwise return a fall-back info that should be used instead. |
| 551 | HInvokeStaticOrDirect::DispatchInfo GetSupportedInvokeStaticOrDirectDispatch( |
| 552 | const HInvokeStaticOrDirect::DispatchInfo& desired_dispatch_info, |
Nicolas Geoffray | 5e4e11e | 2016-09-22 13:17:41 +0100 | [diff] [blame] | 553 | HInvokeStaticOrDirect* invoke) OVERRIDE; |
Vladimir Marko | dc151b2 | 2015-10-15 18:02:30 +0100 | [diff] [blame] | 554 | |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 555 | void GenerateStaticOrDirectCall(HInvokeStaticOrDirect* invoke, Location temp); |
Chris Larsen | 3acee73 | 2015-11-18 13:31:08 -0800 | [diff] [blame] | 556 | void GenerateVirtualCall(HInvokeVirtual* invoke, Location temp) OVERRIDE; |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 557 | |
| 558 | void MoveFromReturnRegister(Location trg ATTRIBUTE_UNUSED, |
| 559 | Primitive::Type type ATTRIBUTE_UNUSED) OVERRIDE { |
| 560 | UNIMPLEMENTED(FATAL) << "Not implemented on MIPS"; |
| 561 | } |
| 562 | |
Roland Levillain | f41f956 | 2016-09-14 19:26:48 +0100 | [diff] [blame] | 563 | void GenerateNop() OVERRIDE; |
| 564 | void GenerateImplicitNullCheck(HNullCheck* instruction) OVERRIDE; |
| 565 | void GenerateExplicitNullCheck(HNullCheck* instruction) OVERRIDE; |
David Srbecky | c7098ff | 2016-02-09 14:30:11 +0000 | [diff] [blame] | 566 | |
Alexey Frunze | e3fb245 | 2016-05-10 16:08:05 -0700 | [diff] [blame] | 567 | // The PcRelativePatchInfo is used for PC-relative addressing of dex cache arrays |
| 568 | // and boot image strings. The only difference is the interpretation of the offset_or_index. |
| 569 | struct PcRelativePatchInfo { |
| 570 | PcRelativePatchInfo(const DexFile& dex_file, uint32_t off_or_idx) |
| 571 | : target_dex_file(dex_file), offset_or_index(off_or_idx) { } |
| 572 | PcRelativePatchInfo(PcRelativePatchInfo&& other) = default; |
| 573 | |
| 574 | const DexFile& target_dex_file; |
Alexey Frunze | 06a46c4 | 2016-07-19 15:00:40 -0700 | [diff] [blame] | 575 | // Either the dex cache array element offset or the string/type index. |
Alexey Frunze | e3fb245 | 2016-05-10 16:08:05 -0700 | [diff] [blame] | 576 | uint32_t offset_or_index; |
| 577 | // Label for the instruction loading the most significant half of the offset that's added to PC |
| 578 | // to form the base address (the least significant half is loaded with the instruction that |
| 579 | // follows). |
| 580 | MipsLabel high_label; |
| 581 | // Label for the instruction corresponding to PC+0. |
| 582 | MipsLabel pc_rel_label; |
| 583 | }; |
| 584 | |
Vladimir Marko | 6bec91c | 2017-01-09 15:03:12 +0000 | [diff] [blame] | 585 | PcRelativePatchInfo* NewPcRelativeStringPatch(const DexFile& dex_file, |
| 586 | dex::StringIndex string_index); |
Andreas Gampe | a5b09a6 | 2016-11-17 15:21:22 -0800 | [diff] [blame] | 587 | PcRelativePatchInfo* NewPcRelativeTypePatch(const DexFile& dex_file, dex::TypeIndex type_index); |
Vladimir Marko | 1998cd0 | 2017-01-13 13:02:58 +0000 | [diff] [blame] | 588 | PcRelativePatchInfo* NewTypeBssEntryPatch(const DexFile& dex_file, dex::TypeIndex type_index); |
Alexey Frunze | e3fb245 | 2016-05-10 16:08:05 -0700 | [diff] [blame] | 589 | PcRelativePatchInfo* NewPcRelativeDexCacheArrayPatch(const DexFile& dex_file, |
| 590 | uint32_t element_offset); |
Andreas Gampe | 8a0128a | 2016-11-28 07:38:35 -0800 | [diff] [blame] | 591 | Literal* DeduplicateBootImageStringLiteral(const DexFile& dex_file, |
| 592 | dex::StringIndex string_index); |
Andreas Gampe | a5b09a6 | 2016-11-17 15:21:22 -0800 | [diff] [blame] | 593 | Literal* DeduplicateBootImageTypeLiteral(const DexFile& dex_file, dex::TypeIndex type_index); |
Alexey Frunze | 06a46c4 | 2016-07-19 15:00:40 -0700 | [diff] [blame] | 594 | Literal* DeduplicateBootImageAddressLiteral(uint32_t address); |
Alexey Frunze | e3fb245 | 2016-05-10 16:08:05 -0700 | [diff] [blame] | 595 | |
Alexey Frunze | 6b892cd | 2017-01-03 17:11:38 -0800 | [diff] [blame] | 596 | void EmitPcRelativeAddressPlaceholderHigh(PcRelativePatchInfo* info, Register out, Register base); |
Vladimir Marko | aad75c6 | 2016-10-03 08:46:48 +0000 | [diff] [blame] | 597 | |
Alexey Frunze | 627c1a0 | 2017-01-30 19:28:14 -0800 | [diff] [blame] | 598 | // The JitPatchInfo is used for JIT string and class loads. |
| 599 | struct JitPatchInfo { |
| 600 | JitPatchInfo(const DexFile& dex_file, uint64_t idx) |
| 601 | : target_dex_file(dex_file), index(idx) { } |
| 602 | JitPatchInfo(JitPatchInfo&& other) = default; |
| 603 | |
| 604 | const DexFile& target_dex_file; |
| 605 | // String/type index. |
| 606 | uint64_t index; |
| 607 | // Label for the instruction loading the most significant half of the address. |
| 608 | // The least significant half is loaded with the instruction that follows immediately. |
| 609 | MipsLabel high_label; |
| 610 | }; |
| 611 | |
| 612 | void PatchJitRootUse(uint8_t* code, |
| 613 | const uint8_t* roots_data, |
| 614 | const JitPatchInfo& info, |
| 615 | uint64_t index_in_table) const; |
| 616 | JitPatchInfo* NewJitRootStringPatch(const DexFile& dex_file, |
| 617 | dex::StringIndex dex_index, |
| 618 | Handle<mirror::String> handle); |
| 619 | JitPatchInfo* NewJitRootClassPatch(const DexFile& dex_file, |
| 620 | dex::TypeIndex dex_index, |
| 621 | Handle<mirror::Class> handle); |
| 622 | |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 623 | private: |
Alexey Frunze | e3fb245 | 2016-05-10 16:08:05 -0700 | [diff] [blame] | 624 | Register GetInvokeStaticOrDirectExtraParameter(HInvokeStaticOrDirect* invoke, Register temp); |
| 625 | |
Alexey Frunze | 06a46c4 | 2016-07-19 15:00:40 -0700 | [diff] [blame] | 626 | using Uint32ToLiteralMap = ArenaSafeMap<uint32_t, Literal*>; |
Alexey Frunze | e3fb245 | 2016-05-10 16:08:05 -0700 | [diff] [blame] | 627 | using MethodToLiteralMap = ArenaSafeMap<MethodReference, Literal*, MethodReferenceComparator>; |
Alexey Frunze | 06a46c4 | 2016-07-19 15:00:40 -0700 | [diff] [blame] | 628 | using BootStringToLiteralMap = ArenaSafeMap<StringReference, |
| 629 | Literal*, |
| 630 | StringReferenceValueComparator>; |
| 631 | using BootTypeToLiteralMap = ArenaSafeMap<TypeReference, |
| 632 | Literal*, |
| 633 | TypeReferenceValueComparator>; |
Alexey Frunze | e3fb245 | 2016-05-10 16:08:05 -0700 | [diff] [blame] | 634 | |
Alexey Frunze | 06a46c4 | 2016-07-19 15:00:40 -0700 | [diff] [blame] | 635 | Literal* DeduplicateUint32Literal(uint32_t value, Uint32ToLiteralMap* map); |
Alexey Frunze | e3fb245 | 2016-05-10 16:08:05 -0700 | [diff] [blame] | 636 | Literal* DeduplicateMethodLiteral(MethodReference target_method, MethodToLiteralMap* map); |
Alexey Frunze | e3fb245 | 2016-05-10 16:08:05 -0700 | [diff] [blame] | 637 | PcRelativePatchInfo* NewPcRelativePatch(const DexFile& dex_file, |
| 638 | uint32_t offset_or_index, |
| 639 | ArenaDeque<PcRelativePatchInfo>* patches); |
| 640 | |
Vladimir Marko | aad75c6 | 2016-10-03 08:46:48 +0000 | [diff] [blame] | 641 | template <LinkerPatch (*Factory)(size_t, const DexFile*, uint32_t, uint32_t)> |
| 642 | void EmitPcRelativeLinkerPatches(const ArenaDeque<PcRelativePatchInfo>& infos, |
| 643 | ArenaVector<LinkerPatch>* linker_patches); |
| 644 | |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 645 | // Labels for each block that will be compiled. |
| 646 | MipsLabel* block_labels_; |
| 647 | MipsLabel frame_entry_label_; |
| 648 | LocationsBuilderMIPS location_builder_; |
| 649 | InstructionCodeGeneratorMIPS instruction_visitor_; |
| 650 | ParallelMoveResolverMIPS move_resolver_; |
| 651 | MipsAssembler assembler_; |
| 652 | const MipsInstructionSetFeatures& isa_features_; |
| 653 | |
Alexey Frunze | 06a46c4 | 2016-07-19 15:00:40 -0700 | [diff] [blame] | 654 | // Deduplication map for 32-bit literals, used for non-patchable boot image addresses. |
| 655 | Uint32ToLiteralMap uint32_literals_; |
Alexey Frunze | e3fb245 | 2016-05-10 16:08:05 -0700 | [diff] [blame] | 656 | // PC-relative patch info for each HMipsDexCacheArraysBase. |
| 657 | ArenaDeque<PcRelativePatchInfo> pc_relative_dex_cache_patches_; |
Alexey Frunze | 06a46c4 | 2016-07-19 15:00:40 -0700 | [diff] [blame] | 658 | // Deduplication map for boot string literals for kBootImageLinkTimeAddress. |
| 659 | BootStringToLiteralMap boot_image_string_patches_; |
Vladimir Marko | aad75c6 | 2016-10-03 08:46:48 +0000 | [diff] [blame] | 660 | // PC-relative String patch info; type depends on configuration (app .bss or boot image PIC). |
Alexey Frunze | 06a46c4 | 2016-07-19 15:00:40 -0700 | [diff] [blame] | 661 | ArenaDeque<PcRelativePatchInfo> pc_relative_string_patches_; |
| 662 | // Deduplication map for boot type literals for kBootImageLinkTimeAddress. |
| 663 | BootTypeToLiteralMap boot_image_type_patches_; |
Vladimir Marko | 1998cd0 | 2017-01-13 13:02:58 +0000 | [diff] [blame] | 664 | // PC-relative type patch info for kBootImageLinkTimePcRelative. |
Alexey Frunze | 06a46c4 | 2016-07-19 15:00:40 -0700 | [diff] [blame] | 665 | ArenaDeque<PcRelativePatchInfo> pc_relative_type_patches_; |
Vladimir Marko | 1998cd0 | 2017-01-13 13:02:58 +0000 | [diff] [blame] | 666 | // PC-relative type patch info for kBssEntry. |
| 667 | ArenaDeque<PcRelativePatchInfo> type_bss_entry_patches_; |
Alexey Frunze | 627c1a0 | 2017-01-30 19:28:14 -0800 | [diff] [blame] | 668 | // Patches for string root accesses in JIT compiled code. |
| 669 | ArenaDeque<JitPatchInfo> jit_string_patches_; |
| 670 | // Patches for class root accesses in JIT compiled code. |
| 671 | ArenaDeque<JitPatchInfo> jit_class_patches_; |
Alexey Frunze | 06a46c4 | 2016-07-19 15:00:40 -0700 | [diff] [blame] | 672 | |
| 673 | // PC-relative loads on R2 clobber RA, which may need to be preserved explicitly in leaf methods. |
| 674 | // This is a flag set by pc_relative_fixups_mips and dex_cache_array_fixups_mips optimizations. |
| 675 | bool clobbered_ra_; |
Alexey Frunze | e3fb245 | 2016-05-10 16:08:05 -0700 | [diff] [blame] | 676 | |
Goran Jakovljevic | f652cec | 2015-08-25 16:11:42 +0200 | [diff] [blame] | 677 | DISALLOW_COPY_AND_ASSIGN(CodeGeneratorMIPS); |
| 678 | }; |
| 679 | |
| 680 | } // namespace mips |
| 681 | } // namespace art |
| 682 | |
| 683 | #endif // ART_COMPILER_OPTIMIZING_CODE_GENERATOR_MIPS_H_ |