Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 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_ARM64_H_ |
| 18 | #define ART_COMPILER_OPTIMIZING_CODE_GENERATOR_ARM64_H_ |
| 19 | |
| 20 | #include "code_generator.h" |
Serban Constantinescu | 02d81cc | 2015-01-05 16:08:49 +0000 | [diff] [blame] | 21 | #include "dex/compiler_enums.h" |
Calin Juravle | cd6dffe | 2015-01-08 17:35:35 +0000 | [diff] [blame] | 22 | #include "driver/compiler_options.h" |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 23 | #include "nodes.h" |
| 24 | #include "parallel_move_resolver.h" |
| 25 | #include "utils/arm64/assembler_arm64.h" |
| 26 | #include "a64/disasm-a64.h" |
| 27 | #include "a64/macro-assembler-a64.h" |
| 28 | #include "arch/arm64/quick_method_frame_info_arm64.h" |
| 29 | |
| 30 | namespace art { |
| 31 | namespace arm64 { |
| 32 | |
| 33 | class CodeGeneratorARM64; |
Andreas Gampe | 878d58c | 2015-01-15 23:24:00 -0800 | [diff] [blame^] | 34 | |
| 35 | // TODO: Tune the use of Load-Acquire, Store-Release vs Data Memory Barriers. |
| 36 | // For now we prefer the use of load-acquire, store-release over explicit memory barriers. |
| 37 | static constexpr bool kUseAcquireRelease = true; |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 38 | |
Nicolas Geoffray | 86a8d7a | 2014-11-19 08:47:18 +0000 | [diff] [blame] | 39 | // Use a local definition to prevent copying mistakes. |
| 40 | static constexpr size_t kArm64WordSize = kArm64PointerSize; |
| 41 | |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 42 | static const vixl::Register kParameterCoreRegisters[] = { |
| 43 | vixl::x1, vixl::x2, vixl::x3, vixl::x4, vixl::x5, vixl::x6, vixl::x7 |
| 44 | }; |
| 45 | static constexpr size_t kParameterCoreRegistersLength = arraysize(kParameterCoreRegisters); |
| 46 | static const vixl::FPRegister kParameterFPRegisters[] = { |
| 47 | vixl::d0, vixl::d1, vixl::d2, vixl::d3, vixl::d4, vixl::d5, vixl::d6, vixl::d7 |
| 48 | }; |
| 49 | static constexpr size_t kParameterFPRegistersLength = arraysize(kParameterFPRegisters); |
| 50 | |
Andreas Gampe | 878d58c | 2015-01-15 23:24:00 -0800 | [diff] [blame^] | 51 | const vixl::Register tr = vixl::x18; // Thread Register |
| 52 | static const vixl::Register kArtMethodRegister = vixl::w0; // Method register on invoke. |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 53 | |
| 54 | const vixl::CPURegList vixl_reserved_core_registers(vixl::ip0, vixl::ip1); |
Alexandre Rames | a89086e | 2014-11-07 17:13:25 +0000 | [diff] [blame] | 55 | const vixl::CPURegList vixl_reserved_fp_registers(vixl::d31); |
Serban Constantinescu | 02164b3 | 2014-11-13 14:05:07 +0000 | [diff] [blame] | 56 | const vixl::CPURegList runtime_reserved_core_registers(tr, vixl::lr); |
Nicolas Geoffray | 5b4b898 | 2014-12-18 17:45:56 +0000 | [diff] [blame] | 57 | const vixl::CPURegList quick_callee_saved_registers(vixl::CPURegister::kRegister, |
| 58 | vixl::kXRegSize, |
| 59 | kArm64CalleeSaveRefSpills); |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 60 | |
Alexandre Rames | a89086e | 2014-11-07 17:13:25 +0000 | [diff] [blame] | 61 | Location ARM64ReturnLocation(Primitive::Type return_type); |
| 62 | |
Andreas Gampe | 878d58c | 2015-01-15 23:24:00 -0800 | [diff] [blame^] | 63 | class SlowPathCodeARM64 : public SlowPathCode { |
| 64 | public: |
| 65 | SlowPathCodeARM64() : entry_label_(), exit_label_() {} |
| 66 | |
| 67 | vixl::Label* GetEntryLabel() { return &entry_label_; } |
| 68 | vixl::Label* GetExitLabel() { return &exit_label_; } |
| 69 | |
| 70 | private: |
| 71 | vixl::Label entry_label_; |
| 72 | vixl::Label exit_label_; |
| 73 | |
| 74 | DISALLOW_COPY_AND_ASSIGN(SlowPathCodeARM64); |
| 75 | }; |
| 76 | |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 77 | class InvokeDexCallingConvention : public CallingConvention<vixl::Register, vixl::FPRegister> { |
| 78 | public: |
| 79 | InvokeDexCallingConvention() |
| 80 | : CallingConvention(kParameterCoreRegisters, |
| 81 | kParameterCoreRegistersLength, |
| 82 | kParameterFPRegisters, |
| 83 | kParameterFPRegistersLength) {} |
| 84 | |
| 85 | Location GetReturnLocation(Primitive::Type return_type) { |
Alexandre Rames | a89086e | 2014-11-07 17:13:25 +0000 | [diff] [blame] | 86 | return ARM64ReturnLocation(return_type); |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 87 | } |
| 88 | |
| 89 | |
| 90 | private: |
| 91 | DISALLOW_COPY_AND_ASSIGN(InvokeDexCallingConvention); |
| 92 | }; |
| 93 | |
| 94 | class InvokeDexCallingConventionVisitor { |
| 95 | public: |
Alexandre Rames | a89086e | 2014-11-07 17:13:25 +0000 | [diff] [blame] | 96 | InvokeDexCallingConventionVisitor() : gp_index_(0), fp_index_(0), stack_index_(0) {} |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 97 | |
| 98 | Location GetNextLocation(Primitive::Type type); |
| 99 | Location GetReturnLocation(Primitive::Type return_type) { |
| 100 | return calling_convention.GetReturnLocation(return_type); |
| 101 | } |
| 102 | |
| 103 | private: |
| 104 | InvokeDexCallingConvention calling_convention; |
| 105 | // The current index for core registers. |
| 106 | uint32_t gp_index_; |
Alexandre Rames | a89086e | 2014-11-07 17:13:25 +0000 | [diff] [blame] | 107 | // The current index for floating-point registers. |
| 108 | uint32_t fp_index_; |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 109 | // The current stack index. |
| 110 | uint32_t stack_index_; |
| 111 | |
| 112 | DISALLOW_COPY_AND_ASSIGN(InvokeDexCallingConventionVisitor); |
| 113 | }; |
| 114 | |
| 115 | class InstructionCodeGeneratorARM64 : public HGraphVisitor { |
| 116 | public: |
| 117 | InstructionCodeGeneratorARM64(HGraph* graph, CodeGeneratorARM64* codegen); |
| 118 | |
| 119 | #define DECLARE_VISIT_INSTRUCTION(name, super) \ |
Nicolas Geoffray | de58ab2 | 2014-11-05 12:46:03 +0000 | [diff] [blame] | 120 | void Visit##name(H##name* instr) OVERRIDE; |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 121 | FOR_EACH_CONCRETE_INSTRUCTION(DECLARE_VISIT_INSTRUCTION) |
| 122 | #undef DECLARE_VISIT_INSTRUCTION |
| 123 | |
| 124 | void LoadCurrentMethod(XRegister reg); |
| 125 | |
| 126 | Arm64Assembler* GetAssembler() const { return assembler_; } |
Alexandre Rames | 67555f7 | 2014-11-18 10:55:16 +0000 | [diff] [blame] | 127 | vixl::MacroAssembler* GetVIXLAssembler() { return GetAssembler()->vixl_masm_; } |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 128 | |
| 129 | private: |
Alexandre Rames | 67555f7 | 2014-11-18 10:55:16 +0000 | [diff] [blame] | 130 | void GenerateClassInitializationCheck(SlowPathCodeARM64* slow_path, vixl::Register class_reg); |
Serban Constantinescu | 02d81cc | 2015-01-05 16:08:49 +0000 | [diff] [blame] | 131 | void GenerateMemoryBarrier(MemBarrierKind kind); |
Serban Constantinescu | 02164b3 | 2014-11-13 14:05:07 +0000 | [diff] [blame] | 132 | void GenerateSuspendCheck(HSuspendCheck* instruction, HBasicBlock* successor); |
Alexandre Rames | 67555f7 | 2014-11-18 10:55:16 +0000 | [diff] [blame] | 133 | void HandleBinaryOp(HBinaryOperation* instr); |
Serban Constantinescu | 02164b3 | 2014-11-13 14:05:07 +0000 | [diff] [blame] | 134 | void HandleShift(HBinaryOperation* instr); |
Calin Juravle | cd6dffe | 2015-01-08 17:35:35 +0000 | [diff] [blame] | 135 | void GenerateImplicitNullCheck(HNullCheck* instruction); |
| 136 | void GenerateExplicitNullCheck(HNullCheck* instruction); |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 137 | |
| 138 | Arm64Assembler* const assembler_; |
| 139 | CodeGeneratorARM64* const codegen_; |
| 140 | |
| 141 | DISALLOW_COPY_AND_ASSIGN(InstructionCodeGeneratorARM64); |
| 142 | }; |
| 143 | |
| 144 | class LocationsBuilderARM64 : public HGraphVisitor { |
| 145 | public: |
| 146 | explicit LocationsBuilderARM64(HGraph* graph, CodeGeneratorARM64* codegen) |
| 147 | : HGraphVisitor(graph), codegen_(codegen) {} |
| 148 | |
| 149 | #define DECLARE_VISIT_INSTRUCTION(name, super) \ |
Nicolas Geoffray | de58ab2 | 2014-11-05 12:46:03 +0000 | [diff] [blame] | 150 | void Visit##name(H##name* instr) OVERRIDE; |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 151 | FOR_EACH_CONCRETE_INSTRUCTION(DECLARE_VISIT_INSTRUCTION) |
| 152 | #undef DECLARE_VISIT_INSTRUCTION |
| 153 | |
| 154 | private: |
Alexandre Rames | 67555f7 | 2014-11-18 10:55:16 +0000 | [diff] [blame] | 155 | void HandleBinaryOp(HBinaryOperation* instr); |
Serban Constantinescu | 02164b3 | 2014-11-13 14:05:07 +0000 | [diff] [blame] | 156 | void HandleShift(HBinaryOperation* instr); |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 157 | void HandleInvoke(HInvoke* instr); |
| 158 | |
| 159 | CodeGeneratorARM64* const codegen_; |
| 160 | InvokeDexCallingConventionVisitor parameter_visitor_; |
| 161 | |
| 162 | DISALLOW_COPY_AND_ASSIGN(LocationsBuilderARM64); |
| 163 | }; |
| 164 | |
Alexandre Rames | 3e69f16 | 2014-12-10 10:36:50 +0000 | [diff] [blame] | 165 | class ParallelMoveResolverARM64 : public ParallelMoveResolver { |
| 166 | public: |
| 167 | ParallelMoveResolverARM64(ArenaAllocator* allocator, CodeGeneratorARM64* codegen) |
| 168 | : ParallelMoveResolver(allocator), codegen_(codegen) {} |
| 169 | |
| 170 | void EmitMove(size_t index) OVERRIDE; |
| 171 | void EmitSwap(size_t index) OVERRIDE; |
| 172 | void RestoreScratch(int reg) OVERRIDE; |
| 173 | void SpillScratch(int reg) OVERRIDE; |
| 174 | |
| 175 | private: |
| 176 | Arm64Assembler* GetAssembler() const; |
| 177 | vixl::MacroAssembler* GetVIXLAssembler() const { |
| 178 | return GetAssembler()->vixl_masm_; |
| 179 | } |
| 180 | |
| 181 | CodeGeneratorARM64* const codegen_; |
| 182 | |
| 183 | DISALLOW_COPY_AND_ASSIGN(ParallelMoveResolverARM64); |
| 184 | }; |
| 185 | |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 186 | class CodeGeneratorARM64 : public CodeGenerator { |
| 187 | public: |
Calin Juravle | cd6dffe | 2015-01-08 17:35:35 +0000 | [diff] [blame] | 188 | CodeGeneratorARM64(HGraph* graph, const CompilerOptions& compiler_options); |
Nicolas Geoffray | de58ab2 | 2014-11-05 12:46:03 +0000 | [diff] [blame] | 189 | virtual ~CodeGeneratorARM64() {} |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 190 | |
Nicolas Geoffray | de58ab2 | 2014-11-05 12:46:03 +0000 | [diff] [blame] | 191 | void GenerateFrameEntry() OVERRIDE; |
| 192 | void GenerateFrameExit() OVERRIDE; |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 193 | |
| 194 | static const vixl::CPURegList& GetFramePreservedRegisters() { |
| 195 | static const vixl::CPURegList frame_preserved_regs = |
| 196 | vixl::CPURegList(vixl::CPURegister::kRegister, vixl::kXRegSize, vixl::lr.Bit()); |
| 197 | return frame_preserved_regs; |
| 198 | } |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 199 | |
Nicolas Geoffray | de58ab2 | 2014-11-05 12:46:03 +0000 | [diff] [blame] | 200 | void Bind(HBasicBlock* block) OVERRIDE; |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 201 | |
| 202 | vixl::Label* GetLabelOf(HBasicBlock* block) const { |
| 203 | return block_labels_ + block->GetBlockId(); |
| 204 | } |
| 205 | |
Nicolas Geoffray | de58ab2 | 2014-11-05 12:46:03 +0000 | [diff] [blame] | 206 | void Move(HInstruction* instruction, Location location, HInstruction* move_for) OVERRIDE; |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 207 | |
Nicolas Geoffray | de58ab2 | 2014-11-05 12:46:03 +0000 | [diff] [blame] | 208 | size_t GetWordSize() const OVERRIDE { |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 209 | return kArm64WordSize; |
| 210 | } |
| 211 | |
Mark Mendell | f85a9ca | 2015-01-13 09:20:58 -0500 | [diff] [blame] | 212 | size_t GetFloatingPointSpillSlotSize() const OVERRIDE { |
| 213 | // Allocated in D registers, which are word sized. |
| 214 | return kArm64WordSize; |
| 215 | } |
| 216 | |
Alexandre Rames | 67555f7 | 2014-11-18 10:55:16 +0000 | [diff] [blame] | 217 | uintptr_t GetAddressOf(HBasicBlock* block) const OVERRIDE { |
| 218 | vixl::Label* block_entry_label = GetLabelOf(block); |
| 219 | DCHECK(block_entry_label->IsBound()); |
| 220 | return block_entry_label->location(); |
Nicolas Geoffray | de58ab2 | 2014-11-05 12:46:03 +0000 | [diff] [blame] | 221 | } |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 222 | |
Nicolas Geoffray | de58ab2 | 2014-11-05 12:46:03 +0000 | [diff] [blame] | 223 | HGraphVisitor* GetLocationBuilder() OVERRIDE { return &location_builder_; } |
| 224 | HGraphVisitor* GetInstructionVisitor() OVERRIDE { return &instruction_visitor_; } |
| 225 | Arm64Assembler* GetAssembler() OVERRIDE { return &assembler_; } |
Alexandre Rames | 67555f7 | 2014-11-18 10:55:16 +0000 | [diff] [blame] | 226 | vixl::MacroAssembler* GetVIXLAssembler() { return GetAssembler()->vixl_masm_; } |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 227 | |
| 228 | // Emit a write barrier. |
| 229 | void MarkGCCard(vixl::Register object, vixl::Register value); |
| 230 | |
| 231 | // Register allocation. |
| 232 | |
Nicolas Geoffray | 9889396 | 2015-01-21 12:32:32 +0000 | [diff] [blame] | 233 | void SetupBlockedRegisters(bool is_baseline) const OVERRIDE; |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 234 | // AllocateFreeRegister() is only used when allocating registers locally |
| 235 | // during CompileBaseline(). |
Nicolas Geoffray | de58ab2 | 2014-11-05 12:46:03 +0000 | [diff] [blame] | 236 | Location AllocateFreeRegister(Primitive::Type type) const OVERRIDE; |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 237 | |
Nicolas Geoffray | de58ab2 | 2014-11-05 12:46:03 +0000 | [diff] [blame] | 238 | Location GetStackLocation(HLoadLocal* load) const OVERRIDE; |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 239 | |
Alexandre Rames | 3e69f16 | 2014-12-10 10:36:50 +0000 | [diff] [blame] | 240 | size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id); |
| 241 | size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id); |
| 242 | size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id); |
| 243 | size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id); |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 244 | |
| 245 | // The number of registers that can be allocated. The register allocator may |
| 246 | // decide to reserve and not use a few of them. |
| 247 | // We do not consider registers sp, xzr, wzr. They are either not allocatable |
| 248 | // (xzr, wzr), or make for poor allocatable registers (sp alignment |
| 249 | // requirements, etc.). This also facilitates our task as all other registers |
| 250 | // can easily be mapped via to or from their type and index or code. |
Alexandre Rames | a89086e | 2014-11-07 17:13:25 +0000 | [diff] [blame] | 251 | static const int kNumberOfAllocatableRegisters = vixl::kNumberOfRegisters - 1; |
| 252 | static const int kNumberOfAllocatableFPRegisters = vixl::kNumberOfFPRegisters; |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 253 | static constexpr int kNumberOfAllocatableRegisterPairs = 0; |
| 254 | |
Nicolas Geoffray | de58ab2 | 2014-11-05 12:46:03 +0000 | [diff] [blame] | 255 | void DumpCoreRegister(std::ostream& stream, int reg) const OVERRIDE; |
| 256 | void DumpFloatingPointRegister(std::ostream& stream, int reg) const OVERRIDE; |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 257 | |
Nicolas Geoffray | de58ab2 | 2014-11-05 12:46:03 +0000 | [diff] [blame] | 258 | InstructionSet GetInstructionSet() const OVERRIDE { |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 259 | return InstructionSet::kArm64; |
| 260 | } |
| 261 | |
Nicolas Geoffray | de58ab2 | 2014-11-05 12:46:03 +0000 | [diff] [blame] | 262 | void Initialize() OVERRIDE { |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 263 | HGraph* graph = GetGraph(); |
| 264 | int length = graph->GetBlocks().Size(); |
| 265 | block_labels_ = graph->GetArena()->AllocArray<vixl::Label>(length); |
| 266 | for (int i = 0; i < length; ++i) { |
| 267 | new(block_labels_ + i) vixl::Label(); |
| 268 | } |
| 269 | } |
| 270 | |
Serban Constantinescu | 32f5b4d | 2014-11-25 20:05:46 +0000 | [diff] [blame] | 271 | void Finalize(CodeAllocator* allocator) OVERRIDE; |
| 272 | |
Alexandre Rames | fc19de8 | 2014-11-07 17:13:31 +0000 | [diff] [blame] | 273 | // Code generation helpers. |
Alexandre Rames | 67555f7 | 2014-11-18 10:55:16 +0000 | [diff] [blame] | 274 | void MoveConstant(vixl::CPURegister destination, HConstant* constant); |
Alexandre Rames | 3e69f16 | 2014-12-10 10:36:50 +0000 | [diff] [blame] | 275 | // The type is optional. When specified it must be coherent with the |
| 276 | // locations, and is used for optimisation and debugging. |
| 277 | void MoveLocation(Location destination, Location source, |
| 278 | Primitive::Type type = Primitive::kPrimVoid); |
| 279 | void SwapLocations(Location loc_1, Location loc_2); |
Alexandre Rames | 67555f7 | 2014-11-18 10:55:16 +0000 | [diff] [blame] | 280 | void Load(Primitive::Type type, vixl::CPURegister dst, const vixl::MemOperand& src); |
| 281 | void Store(Primitive::Type type, vixl::CPURegister rt, const vixl::MemOperand& dst); |
| 282 | void LoadCurrentMethod(vixl::Register current_method); |
Calin Juravle | 77520bc | 2015-01-12 18:45:46 +0000 | [diff] [blame] | 283 | void LoadAcquire(HInstruction* instruction, vixl::CPURegister dst, const vixl::MemOperand& src); |
Serban Constantinescu | 02d81cc | 2015-01-05 16:08:49 +0000 | [diff] [blame] | 284 | void StoreRelease(Primitive::Type type, vixl::CPURegister rt, const vixl::MemOperand& dst); |
Alexandre Rames | 67555f7 | 2014-11-18 10:55:16 +0000 | [diff] [blame] | 285 | |
| 286 | // Generate code to invoke a runtime entry point. |
| 287 | void InvokeRuntime(int32_t offset, HInstruction* instruction, uint32_t dex_pc); |
Alexandre Rames | fc19de8 | 2014-11-07 17:13:31 +0000 | [diff] [blame] | 288 | |
Alexandre Rames | 3e69f16 | 2014-12-10 10:36:50 +0000 | [diff] [blame] | 289 | ParallelMoveResolverARM64* GetMoveResolver() { return &move_resolver_; } |
Nicolas Geoffray | f0e3937 | 2014-11-12 17:50:07 +0000 | [diff] [blame] | 290 | |
Nicolas Geoffray | 840e546 | 2015-01-07 16:01:24 +0000 | [diff] [blame] | 291 | bool NeedsTwoRegisters(Primitive::Type type ATTRIBUTE_UNUSED) const OVERRIDE { |
| 292 | return false; |
| 293 | } |
| 294 | |
Andreas Gampe | 878d58c | 2015-01-15 23:24:00 -0800 | [diff] [blame^] | 295 | void GenerateStaticOrDirectCall(HInvokeStaticOrDirect* invoke, vixl::Register temp); |
| 296 | |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 297 | private: |
| 298 | // Labels for each block that will be compiled. |
| 299 | vixl::Label* block_labels_; |
| 300 | |
| 301 | LocationsBuilderARM64 location_builder_; |
| 302 | InstructionCodeGeneratorARM64 instruction_visitor_; |
Alexandre Rames | 3e69f16 | 2014-12-10 10:36:50 +0000 | [diff] [blame] | 303 | ParallelMoveResolverARM64 move_resolver_; |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 304 | Arm64Assembler assembler_; |
| 305 | |
| 306 | DISALLOW_COPY_AND_ASSIGN(CodeGeneratorARM64); |
| 307 | }; |
| 308 | |
Alexandre Rames | 3e69f16 | 2014-12-10 10:36:50 +0000 | [diff] [blame] | 309 | inline Arm64Assembler* ParallelMoveResolverARM64::GetAssembler() const { |
| 310 | return codegen_->GetAssembler(); |
| 311 | } |
| 312 | |
Alexandre Rames | 5319def | 2014-10-23 10:03:10 +0100 | [diff] [blame] | 313 | } // namespace arm64 |
| 314 | } // namespace art |
| 315 | |
| 316 | #endif // ART_COMPILER_OPTIMIZING_CODE_GENERATOR_ARM64_H_ |