Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [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_MIPS64_H_ |
| 18 | #define ART_COMPILER_OPTIMIZING_CODE_GENERATOR_MIPS64_H_ |
| 19 | |
| 20 | #include "code_generator.h" |
| 21 | #include "dex/compiler_enums.h" |
| 22 | #include "driver/compiler_options.h" |
| 23 | #include "nodes.h" |
| 24 | #include "parallel_move_resolver.h" |
| 25 | #include "utils/mips64/assembler_mips64.h" |
| 26 | |
| 27 | namespace art { |
| 28 | namespace mips64 { |
| 29 | |
| 30 | // Use a local definition to prevent copying mistakes. |
| 31 | static constexpr size_t kMips64WordSize = kMips64PointerSize; |
| 32 | |
| 33 | |
| 34 | // InvokeDexCallingConvention registers |
| 35 | |
| 36 | static constexpr GpuRegister kParameterCoreRegisters[] = |
| 37 | { A1, A2, A3, A4, A5, A6, A7 }; |
| 38 | static constexpr size_t kParameterCoreRegistersLength = arraysize(kParameterCoreRegisters); |
| 39 | |
| 40 | static constexpr FpuRegister kParameterFpuRegisters[] = |
| 41 | { F13, F14, F15, F16, F17, F18, F19 }; |
| 42 | static constexpr size_t kParameterFpuRegistersLength = arraysize(kParameterFpuRegisters); |
| 43 | |
| 44 | |
| 45 | // InvokeRuntimeCallingConvention registers |
| 46 | |
| 47 | static constexpr GpuRegister kRuntimeParameterCoreRegisters[] = |
| 48 | { A0, A1, A2, A3, A4, A5, A6, A7 }; |
| 49 | static constexpr size_t kRuntimeParameterCoreRegistersLength = |
| 50 | arraysize(kRuntimeParameterCoreRegisters); |
| 51 | |
| 52 | static constexpr FpuRegister kRuntimeParameterFpuRegisters[] = |
| 53 | { F12, F13, F14, F15, F16, F17, F18, F19 }; |
| 54 | static constexpr size_t kRuntimeParameterFpuRegistersLength = |
| 55 | arraysize(kRuntimeParameterFpuRegisters); |
| 56 | |
| 57 | |
| 58 | static constexpr GpuRegister kCoreCalleeSaves[] = |
| 59 | { S0, S1, S2, S3, S4, S5, S6, S7, GP, S8, RA }; // TODO: review |
| 60 | static constexpr FpuRegister kFpuCalleeSaves[] = |
| 61 | { F24, F25, F26, F27, F28, F29, F30, F31 }; |
| 62 | |
| 63 | |
| 64 | class CodeGeneratorMIPS64; |
| 65 | |
| 66 | class InvokeDexCallingConvention : public CallingConvention<GpuRegister, FpuRegister> { |
| 67 | public: |
| 68 | InvokeDexCallingConvention() |
| 69 | : CallingConvention(kParameterCoreRegisters, |
| 70 | kParameterCoreRegistersLength, |
| 71 | kParameterFpuRegisters, |
| 72 | kParameterFpuRegistersLength, |
| 73 | kMips64PointerSize) {} |
| 74 | |
| 75 | private: |
| 76 | DISALLOW_COPY_AND_ASSIGN(InvokeDexCallingConvention); |
| 77 | }; |
| 78 | |
| 79 | class InvokeDexCallingConventionVisitorMIPS64 : public InvokeDexCallingConventionVisitor { |
| 80 | public: |
| 81 | InvokeDexCallingConventionVisitorMIPS64() {} |
| 82 | virtual ~InvokeDexCallingConventionVisitorMIPS64() {} |
| 83 | |
| 84 | Location GetNextLocation(Primitive::Type type) OVERRIDE; |
| 85 | Location GetReturnLocation(Primitive::Type type) const OVERRIDE; |
| 86 | Location GetMethodLocation() const OVERRIDE; |
| 87 | |
| 88 | private: |
| 89 | InvokeDexCallingConvention calling_convention; |
| 90 | |
| 91 | DISALLOW_COPY_AND_ASSIGN(InvokeDexCallingConventionVisitorMIPS64); |
| 92 | }; |
| 93 | |
| 94 | class InvokeRuntimeCallingConvention : public CallingConvention<GpuRegister, FpuRegister> { |
| 95 | public: |
| 96 | InvokeRuntimeCallingConvention() |
| 97 | : CallingConvention(kRuntimeParameterCoreRegisters, |
| 98 | kRuntimeParameterCoreRegistersLength, |
| 99 | kRuntimeParameterFpuRegisters, |
| 100 | kRuntimeParameterFpuRegistersLength, |
| 101 | kMips64PointerSize) {} |
| 102 | |
| 103 | Location GetReturnLocation(Primitive::Type return_type); |
| 104 | |
| 105 | private: |
| 106 | DISALLOW_COPY_AND_ASSIGN(InvokeRuntimeCallingConvention); |
| 107 | }; |
| 108 | |
Calin Juravle | e460d1d | 2015-09-29 04:52:17 +0100 | [diff] [blame] | 109 | class FieldAccessCallingConventionMIPS64 : public FieldAccessCallingConvention { |
| 110 | public: |
| 111 | FieldAccessCallingConventionMIPS64() {} |
| 112 | |
| 113 | Location GetObjectLocation() const OVERRIDE { |
| 114 | return Location::RegisterLocation(A1); |
| 115 | } |
| 116 | Location GetFieldIndexLocation() const OVERRIDE { |
| 117 | return Location::RegisterLocation(A0); |
| 118 | } |
| 119 | Location GetReturnLocation(Primitive::Type type ATTRIBUTE_UNUSED) const OVERRIDE { |
Goran Jakovljevic | 8c34ec1 | 2015-10-14 11:23:48 +0200 | [diff] [blame] | 120 | return Location::RegisterLocation(V0); |
Calin Juravle | e460d1d | 2015-09-29 04:52:17 +0100 | [diff] [blame] | 121 | } |
Alexey Frunze | 00580bd | 2015-11-11 13:31:12 -0800 | [diff] [blame] | 122 | Location GetSetValueLocation(Primitive::Type type, bool is_instance) const OVERRIDE { |
| 123 | return Primitive::Is64BitType(type) |
| 124 | ? Location::RegisterLocation(A2) |
| 125 | : (is_instance |
| 126 | ? Location::RegisterLocation(A2) |
| 127 | : Location::RegisterLocation(A1)); |
Calin Juravle | e460d1d | 2015-09-29 04:52:17 +0100 | [diff] [blame] | 128 | } |
| 129 | Location GetFpuLocation(Primitive::Type type ATTRIBUTE_UNUSED) const OVERRIDE { |
| 130 | return Location::FpuRegisterLocation(F0); |
| 131 | } |
| 132 | |
| 133 | private: |
| 134 | DISALLOW_COPY_AND_ASSIGN(FieldAccessCallingConventionMIPS64); |
| 135 | }; |
| 136 | |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 137 | class ParallelMoveResolverMIPS64 : public ParallelMoveResolverWithSwap { |
| 138 | public: |
| 139 | ParallelMoveResolverMIPS64(ArenaAllocator* allocator, CodeGeneratorMIPS64* codegen) |
| 140 | : ParallelMoveResolverWithSwap(allocator), codegen_(codegen) {} |
| 141 | |
| 142 | void EmitMove(size_t index) OVERRIDE; |
| 143 | void EmitSwap(size_t index) OVERRIDE; |
| 144 | void SpillScratch(int reg) OVERRIDE; |
| 145 | void RestoreScratch(int reg) OVERRIDE; |
| 146 | |
| 147 | void Exchange(int index1, int index2, bool double_slot); |
| 148 | |
| 149 | Mips64Assembler* GetAssembler() const; |
| 150 | |
| 151 | private: |
| 152 | CodeGeneratorMIPS64* const codegen_; |
| 153 | |
| 154 | DISALLOW_COPY_AND_ASSIGN(ParallelMoveResolverMIPS64); |
| 155 | }; |
| 156 | |
| 157 | class SlowPathCodeMIPS64 : public SlowPathCode { |
| 158 | public: |
| 159 | SlowPathCodeMIPS64() : entry_label_(), exit_label_() {} |
| 160 | |
Alexey Frunze | a0e87b0 | 2015-09-24 22:57:20 -0700 | [diff] [blame] | 161 | Mips64Label* GetEntryLabel() { return &entry_label_; } |
| 162 | Mips64Label* GetExitLabel() { return &exit_label_; } |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 163 | |
| 164 | private: |
Alexey Frunze | a0e87b0 | 2015-09-24 22:57:20 -0700 | [diff] [blame] | 165 | Mips64Label entry_label_; |
| 166 | Mips64Label exit_label_; |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 167 | |
| 168 | DISALLOW_COPY_AND_ASSIGN(SlowPathCodeMIPS64); |
| 169 | }; |
| 170 | |
| 171 | class LocationsBuilderMIPS64 : public HGraphVisitor { |
| 172 | public: |
| 173 | LocationsBuilderMIPS64(HGraph* graph, CodeGeneratorMIPS64* codegen) |
| 174 | : HGraphVisitor(graph), codegen_(codegen) {} |
| 175 | |
| 176 | #define DECLARE_VISIT_INSTRUCTION(name, super) \ |
Alexandre Rames | f39e064 | 2015-06-23 11:33:45 +0100 | [diff] [blame] | 177 | void Visit##name(H##name* instr) OVERRIDE; |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 178 | |
Alexandre Rames | f39e064 | 2015-06-23 11:33:45 +0100 | [diff] [blame] | 179 | FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION) |
| 180 | FOR_EACH_CONCRETE_INSTRUCTION_MIPS64(DECLARE_VISIT_INSTRUCTION) |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 181 | |
| 182 | #undef DECLARE_VISIT_INSTRUCTION |
| 183 | |
Alexandre Rames | f39e064 | 2015-06-23 11:33:45 +0100 | [diff] [blame] | 184 | void VisitInstruction(HInstruction* instruction) OVERRIDE { |
| 185 | LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() |
| 186 | << " (id " << instruction->GetId() << ")"; |
| 187 | } |
| 188 | |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 189 | private: |
| 190 | void HandleInvoke(HInvoke* invoke); |
| 191 | void HandleBinaryOp(HBinaryOperation* operation); |
Vladimir Marko | 5f7b58e | 2015-11-23 19:49:34 +0000 | [diff] [blame] | 192 | void HandleCondition(HCondition* instruction); |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 193 | void HandleShift(HBinaryOperation* operation); |
| 194 | void HandleFieldSet(HInstruction* instruction, const FieldInfo& field_info); |
| 195 | void HandleFieldGet(HInstruction* instruction, const FieldInfo& field_info); |
| 196 | |
| 197 | InvokeDexCallingConventionVisitorMIPS64 parameter_visitor_; |
| 198 | |
| 199 | CodeGeneratorMIPS64* const codegen_; |
| 200 | |
| 201 | DISALLOW_COPY_AND_ASSIGN(LocationsBuilderMIPS64); |
| 202 | }; |
| 203 | |
Aart Bik | 42249c3 | 2016-01-07 15:33:50 -0800 | [diff] [blame] | 204 | class InstructionCodeGeneratorMIPS64 : public InstructionCodeGenerator { |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 205 | public: |
| 206 | InstructionCodeGeneratorMIPS64(HGraph* graph, CodeGeneratorMIPS64* codegen); |
| 207 | |
| 208 | #define DECLARE_VISIT_INSTRUCTION(name, super) \ |
Alexandre Rames | f39e064 | 2015-06-23 11:33:45 +0100 | [diff] [blame] | 209 | void Visit##name(H##name* instr) OVERRIDE; |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 210 | |
Alexandre Rames | f39e064 | 2015-06-23 11:33:45 +0100 | [diff] [blame] | 211 | FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION) |
| 212 | FOR_EACH_CONCRETE_INSTRUCTION_MIPS64(DECLARE_VISIT_INSTRUCTION) |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 213 | |
| 214 | #undef DECLARE_VISIT_INSTRUCTION |
| 215 | |
Alexandre Rames | f39e064 | 2015-06-23 11:33:45 +0100 | [diff] [blame] | 216 | void VisitInstruction(HInstruction* instruction) OVERRIDE { |
| 217 | LOG(FATAL) << "Unreachable instruction " << instruction->DebugName() |
| 218 | << " (id " << instruction->GetId() << ")"; |
| 219 | } |
| 220 | |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 221 | Mips64Assembler* GetAssembler() const { return assembler_; } |
| 222 | |
| 223 | private: |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 224 | void GenerateClassInitializationCheck(SlowPathCodeMIPS64* slow_path, GpuRegister class_reg); |
| 225 | void GenerateMemoryBarrier(MemBarrierKind kind); |
| 226 | void GenerateSuspendCheck(HSuspendCheck* check, HBasicBlock* successor); |
| 227 | void HandleBinaryOp(HBinaryOperation* operation); |
Vladimir Marko | 5f7b58e | 2015-11-23 19:49:34 +0000 | [diff] [blame] | 228 | void HandleCondition(HCondition* instruction); |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 229 | void HandleShift(HBinaryOperation* operation); |
Goran Jakovljevic | 8ed1826 | 2016-01-22 13:01:00 +0100 | [diff] [blame] | 230 | void HandleFieldSet(HInstruction* instruction, |
| 231 | const FieldInfo& field_info, |
| 232 | bool value_can_be_null); |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 233 | void HandleFieldGet(HInstruction* instruction, const FieldInfo& field_info); |
| 234 | void GenerateImplicitNullCheck(HNullCheck* instruction); |
| 235 | void GenerateExplicitNullCheck(HNullCheck* instruction); |
| 236 | void GenerateTestAndBranch(HInstruction* instruction, |
David Brazdil | 0debae7 | 2015-11-12 18:37:00 +0000 | [diff] [blame] | 237 | size_t condition_input_index, |
Alexey Frunze | a0e87b0 | 2015-09-24 22:57:20 -0700 | [diff] [blame] | 238 | Mips64Label* true_target, |
| 239 | Mips64Label* false_target); |
Alexey Frunze | c857c74 | 2015-09-23 15:12:39 -0700 | [diff] [blame] | 240 | void DivRemOneOrMinusOne(HBinaryOperation* instruction); |
| 241 | void DivRemByPowerOfTwo(HBinaryOperation* instruction); |
| 242 | void GenerateDivRemWithAnyConstant(HBinaryOperation* instruction); |
| 243 | void GenerateDivRemIntegral(HBinaryOperation* instruction); |
Alexey Frunze | 299a939 | 2015-12-08 16:08:02 -0800 | [diff] [blame] | 244 | void GenerateIntLongCompare(IfCondition cond, bool is64bit, LocationSummary* locations); |
| 245 | void GenerateIntLongCompareAndBranch(IfCondition cond, |
| 246 | bool is64bit, |
| 247 | LocationSummary* locations, |
| 248 | Mips64Label* label); |
| 249 | void GenerateFpCompareAndBranch(IfCondition cond, |
| 250 | bool gt_bias, |
| 251 | Primitive::Type type, |
| 252 | LocationSummary* locations, |
| 253 | Mips64Label* label); |
David Brazdil | fc6a86a | 2015-06-26 10:33:45 +0000 | [diff] [blame] | 254 | void HandleGoto(HInstruction* got, HBasicBlock* successor); |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 255 | |
| 256 | Mips64Assembler* const assembler_; |
| 257 | CodeGeneratorMIPS64* const codegen_; |
| 258 | |
| 259 | DISALLOW_COPY_AND_ASSIGN(InstructionCodeGeneratorMIPS64); |
| 260 | }; |
| 261 | |
| 262 | class CodeGeneratorMIPS64 : public CodeGenerator { |
| 263 | public: |
| 264 | CodeGeneratorMIPS64(HGraph* graph, |
| 265 | const Mips64InstructionSetFeatures& isa_features, |
Serban Constantinescu | ecc4366 | 2015-08-13 13:33:12 +0100 | [diff] [blame] | 266 | const CompilerOptions& compiler_options, |
| 267 | OptimizingCompilerStats* stats = nullptr); |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 268 | virtual ~CodeGeneratorMIPS64() {} |
| 269 | |
| 270 | void GenerateFrameEntry() OVERRIDE; |
| 271 | void GenerateFrameExit() OVERRIDE; |
| 272 | |
| 273 | void Bind(HBasicBlock* block) OVERRIDE; |
| 274 | |
| 275 | void Move(HInstruction* instruction, Location location, HInstruction* move_for) OVERRIDE; |
| 276 | |
| 277 | size_t GetWordSize() const OVERRIDE { return kMips64WordSize; } |
| 278 | |
| 279 | size_t GetFloatingPointSpillSlotSize() const OVERRIDE { return kMips64WordSize; } |
| 280 | |
| 281 | uintptr_t GetAddressOf(HBasicBlock* block) const OVERRIDE { |
Alexey Frunze | a0e87b0 | 2015-09-24 22:57:20 -0700 | [diff] [blame] | 282 | return assembler_.GetLabelLocation(GetLabelOf(block)); |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 283 | } |
| 284 | |
| 285 | HGraphVisitor* GetLocationBuilder() OVERRIDE { return &location_builder_; } |
| 286 | HGraphVisitor* GetInstructionVisitor() OVERRIDE { return &instruction_visitor_; } |
| 287 | Mips64Assembler* GetAssembler() OVERRIDE { return &assembler_; } |
Alexandre Rames | eb7b739 | 2015-06-19 14:47:01 +0100 | [diff] [blame] | 288 | const Mips64Assembler& GetAssembler() const OVERRIDE { return assembler_; } |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 289 | |
Goran Jakovljevic | 8ed1826 | 2016-01-22 13:01:00 +0100 | [diff] [blame] | 290 | void MarkGCCard(GpuRegister object, GpuRegister value, bool value_can_be_null); |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 291 | |
| 292 | // Register allocation. |
| 293 | |
David Brazdil | 58282f4 | 2016-01-14 12:45:10 +0000 | [diff] [blame] | 294 | void SetupBlockedRegisters() const OVERRIDE; |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 295 | |
| 296 | Location GetStackLocation(HLoadLocal* load) const OVERRIDE; |
| 297 | |
| 298 | size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id); |
| 299 | size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id); |
| 300 | size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id); |
| 301 | size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id); |
| 302 | |
| 303 | void DumpCoreRegister(std::ostream& stream, int reg) const OVERRIDE; |
| 304 | void DumpFloatingPointRegister(std::ostream& stream, int reg) const OVERRIDE; |
| 305 | |
| 306 | InstructionSet GetInstructionSet() const OVERRIDE { return InstructionSet::kMips64; } |
| 307 | |
| 308 | const Mips64InstructionSetFeatures& GetInstructionSetFeatures() const { |
| 309 | return isa_features_; |
| 310 | } |
| 311 | |
Alexey Frunze | a0e87b0 | 2015-09-24 22:57:20 -0700 | [diff] [blame] | 312 | Mips64Label* GetLabelOf(HBasicBlock* block) const { |
| 313 | return CommonGetLabelOf<Mips64Label>(block_labels_, block); |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 314 | } |
| 315 | |
| 316 | void Initialize() OVERRIDE { |
Alexey Frunze | a0e87b0 | 2015-09-24 22:57:20 -0700 | [diff] [blame] | 317 | block_labels_ = CommonInitializeLabels<Mips64Label>(); |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 318 | } |
| 319 | |
| 320 | void Finalize(CodeAllocator* allocator) OVERRIDE; |
| 321 | |
| 322 | // Code generation helpers. |
Calin Juravle | e460d1d | 2015-09-29 04:52:17 +0100 | [diff] [blame] | 323 | void MoveLocation(Location dst, Location src, Primitive::Type dst_type) OVERRIDE; |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 324 | |
Calin Juravle | 175dc73 | 2015-08-25 15:42:32 +0100 | [diff] [blame] | 325 | void MoveConstant(Location destination, int32_t value) OVERRIDE; |
| 326 | |
Calin Juravle | e460d1d | 2015-09-29 04:52:17 +0100 | [diff] [blame] | 327 | void AddLocationAsTemp(Location location, LocationSummary* locations) OVERRIDE; |
| 328 | |
| 329 | |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 330 | void SwapLocations(Location loc1, Location loc2, Primitive::Type type); |
| 331 | |
| 332 | // Generate code to invoke a runtime entry point. |
Calin Juravle | 175dc73 | 2015-08-25 15:42:32 +0100 | [diff] [blame] | 333 | void InvokeRuntime(QuickEntrypointEnum entrypoint, |
| 334 | HInstruction* instruction, |
| 335 | uint32_t dex_pc, |
| 336 | SlowPathCode* slow_path) OVERRIDE; |
| 337 | |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 338 | void InvokeRuntime(int32_t offset, |
| 339 | HInstruction* instruction, |
| 340 | uint32_t dex_pc, |
| 341 | SlowPathCode* slow_path); |
| 342 | |
| 343 | ParallelMoveResolver* GetMoveResolver() OVERRIDE { return &move_resolver_; } |
| 344 | |
| 345 | bool NeedsTwoRegisters(Primitive::Type type ATTRIBUTE_UNUSED) const { return false; } |
| 346 | |
Vladimir Marko | dc151b2 | 2015-10-15 18:02:30 +0100 | [diff] [blame] | 347 | // Check if the desired_dispatch_info is supported. If it is, return it, |
| 348 | // otherwise return a fall-back info that should be used instead. |
| 349 | HInvokeStaticOrDirect::DispatchInfo GetSupportedInvokeStaticOrDirectDispatch( |
| 350 | const HInvokeStaticOrDirect::DispatchInfo& desired_dispatch_info, |
| 351 | MethodReference target_method) OVERRIDE; |
| 352 | |
Andreas Gampe | 85b62f2 | 2015-09-09 13:15:38 -0700 | [diff] [blame] | 353 | void GenerateStaticOrDirectCall(HInvokeStaticOrDirect* invoke, Location temp) OVERRIDE; |
Alexey Frunze | 53afca1 | 2015-11-05 16:34:23 -0800 | [diff] [blame] | 354 | void GenerateVirtualCall(HInvokeVirtual* invoke, Location temp) OVERRIDE; |
Andreas Gampe | 85b62f2 | 2015-09-09 13:15:38 -0700 | [diff] [blame] | 355 | |
| 356 | void MoveFromReturnRegister(Location trg ATTRIBUTE_UNUSED, |
| 357 | Primitive::Type type ATTRIBUTE_UNUSED) OVERRIDE { |
| 358 | UNIMPLEMENTED(FATAL); |
| 359 | } |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 360 | |
| 361 | private: |
| 362 | // Labels for each block that will be compiled. |
Alexey Frunze | a0e87b0 | 2015-09-24 22:57:20 -0700 | [diff] [blame] | 363 | Mips64Label* block_labels_; // Indexed by block id. |
| 364 | Mips64Label frame_entry_label_; |
Alexey Frunze | 4dda337 | 2015-06-01 18:31:49 -0700 | [diff] [blame] | 365 | LocationsBuilderMIPS64 location_builder_; |
| 366 | InstructionCodeGeneratorMIPS64 instruction_visitor_; |
| 367 | ParallelMoveResolverMIPS64 move_resolver_; |
| 368 | Mips64Assembler assembler_; |
| 369 | const Mips64InstructionSetFeatures& isa_features_; |
| 370 | |
| 371 | DISALLOW_COPY_AND_ASSIGN(CodeGeneratorMIPS64); |
| 372 | }; |
| 373 | |
| 374 | } // namespace mips64 |
| 375 | } // namespace art |
| 376 | |
| 377 | #endif // ART_COMPILER_OPTIMIZING_CODE_GENERATOR_MIPS64_H_ |