blob: 067c1f940f8e71a40c013c89b67b90c5e480641a [file] [log] [blame]
Alexey Frunze4dda3372015-06-01 18:31:49 -07001/*
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"
Alexey Frunze4dda3372015-06-01 18:31:49 -070021#include "driver/compiler_options.h"
22#include "nodes.h"
23#include "parallel_move_resolver.h"
24#include "utils/mips64/assembler_mips64.h"
25
26namespace art {
27namespace mips64 {
28
Alexey Frunze4dda3372015-06-01 18:31:49 -070029// InvokeDexCallingConvention registers
30
31static constexpr GpuRegister kParameterCoreRegisters[] =
32 { A1, A2, A3, A4, A5, A6, A7 };
33static constexpr size_t kParameterCoreRegistersLength = arraysize(kParameterCoreRegisters);
34
35static constexpr FpuRegister kParameterFpuRegisters[] =
36 { F13, F14, F15, F16, F17, F18, F19 };
37static constexpr size_t kParameterFpuRegistersLength = arraysize(kParameterFpuRegisters);
38
39
40// InvokeRuntimeCallingConvention registers
41
42static constexpr GpuRegister kRuntimeParameterCoreRegisters[] =
43 { A0, A1, A2, A3, A4, A5, A6, A7 };
44static constexpr size_t kRuntimeParameterCoreRegistersLength =
45 arraysize(kRuntimeParameterCoreRegisters);
46
47static constexpr FpuRegister kRuntimeParameterFpuRegisters[] =
48 { F12, F13, F14, F15, F16, F17, F18, F19 };
49static constexpr size_t kRuntimeParameterFpuRegistersLength =
50 arraysize(kRuntimeParameterFpuRegisters);
51
52
53static constexpr GpuRegister kCoreCalleeSaves[] =
54 { S0, S1, S2, S3, S4, S5, S6, S7, GP, S8, RA }; // TODO: review
55static constexpr FpuRegister kFpuCalleeSaves[] =
56 { F24, F25, F26, F27, F28, F29, F30, F31 };
57
58
59class CodeGeneratorMIPS64;
60
61class InvokeDexCallingConvention : public CallingConvention<GpuRegister, FpuRegister> {
62 public:
63 InvokeDexCallingConvention()
64 : CallingConvention(kParameterCoreRegisters,
65 kParameterCoreRegistersLength,
66 kParameterFpuRegisters,
67 kParameterFpuRegistersLength,
68 kMips64PointerSize) {}
69
70 private:
71 DISALLOW_COPY_AND_ASSIGN(InvokeDexCallingConvention);
72};
73
74class InvokeDexCallingConventionVisitorMIPS64 : public InvokeDexCallingConventionVisitor {
75 public:
76 InvokeDexCallingConventionVisitorMIPS64() {}
77 virtual ~InvokeDexCallingConventionVisitorMIPS64() {}
78
79 Location GetNextLocation(Primitive::Type type) OVERRIDE;
80 Location GetReturnLocation(Primitive::Type type) const OVERRIDE;
81 Location GetMethodLocation() const OVERRIDE;
82
83 private:
84 InvokeDexCallingConvention calling_convention;
85
86 DISALLOW_COPY_AND_ASSIGN(InvokeDexCallingConventionVisitorMIPS64);
87};
88
89class InvokeRuntimeCallingConvention : public CallingConvention<GpuRegister, FpuRegister> {
90 public:
91 InvokeRuntimeCallingConvention()
92 : CallingConvention(kRuntimeParameterCoreRegisters,
93 kRuntimeParameterCoreRegistersLength,
94 kRuntimeParameterFpuRegisters,
95 kRuntimeParameterFpuRegistersLength,
96 kMips64PointerSize) {}
97
98 Location GetReturnLocation(Primitive::Type return_type);
99
100 private:
101 DISALLOW_COPY_AND_ASSIGN(InvokeRuntimeCallingConvention);
102};
103
Calin Juravlee460d1d2015-09-29 04:52:17 +0100104class FieldAccessCallingConventionMIPS64 : public FieldAccessCallingConvention {
105 public:
106 FieldAccessCallingConventionMIPS64() {}
107
108 Location GetObjectLocation() const OVERRIDE {
109 return Location::RegisterLocation(A1);
110 }
111 Location GetFieldIndexLocation() const OVERRIDE {
112 return Location::RegisterLocation(A0);
113 }
114 Location GetReturnLocation(Primitive::Type type ATTRIBUTE_UNUSED) const OVERRIDE {
Goran Jakovljevic8c34ec12015-10-14 11:23:48 +0200115 return Location::RegisterLocation(V0);
Calin Juravlee460d1d2015-09-29 04:52:17 +0100116 }
Alexey Frunze00580bd2015-11-11 13:31:12 -0800117 Location GetSetValueLocation(Primitive::Type type, bool is_instance) const OVERRIDE {
118 return Primitive::Is64BitType(type)
119 ? Location::RegisterLocation(A2)
120 : (is_instance
121 ? Location::RegisterLocation(A2)
122 : Location::RegisterLocation(A1));
Calin Juravlee460d1d2015-09-29 04:52:17 +0100123 }
124 Location GetFpuLocation(Primitive::Type type ATTRIBUTE_UNUSED) const OVERRIDE {
125 return Location::FpuRegisterLocation(F0);
126 }
127
128 private:
129 DISALLOW_COPY_AND_ASSIGN(FieldAccessCallingConventionMIPS64);
130};
131
Alexey Frunze4dda3372015-06-01 18:31:49 -0700132class ParallelMoveResolverMIPS64 : public ParallelMoveResolverWithSwap {
133 public:
134 ParallelMoveResolverMIPS64(ArenaAllocator* allocator, CodeGeneratorMIPS64* codegen)
135 : ParallelMoveResolverWithSwap(allocator), codegen_(codegen) {}
136
137 void EmitMove(size_t index) OVERRIDE;
138 void EmitSwap(size_t index) OVERRIDE;
139 void SpillScratch(int reg) OVERRIDE;
140 void RestoreScratch(int reg) OVERRIDE;
141
142 void Exchange(int index1, int index2, bool double_slot);
143
144 Mips64Assembler* GetAssembler() const;
145
146 private:
147 CodeGeneratorMIPS64* const codegen_;
148
149 DISALLOW_COPY_AND_ASSIGN(ParallelMoveResolverMIPS64);
150};
151
152class SlowPathCodeMIPS64 : public SlowPathCode {
153 public:
David Srbecky9cd6d372016-02-09 15:24:47 +0000154 explicit SlowPathCodeMIPS64(HInstruction* instruction)
155 : SlowPathCode(instruction), entry_label_(), exit_label_() {}
Alexey Frunze4dda3372015-06-01 18:31:49 -0700156
Alexey Frunzea0e87b02015-09-24 22:57:20 -0700157 Mips64Label* GetEntryLabel() { return &entry_label_; }
158 Mips64Label* GetExitLabel() { return &exit_label_; }
Alexey Frunze4dda3372015-06-01 18:31:49 -0700159
160 private:
Alexey Frunzea0e87b02015-09-24 22:57:20 -0700161 Mips64Label entry_label_;
162 Mips64Label exit_label_;
Alexey Frunze4dda3372015-06-01 18:31:49 -0700163
164 DISALLOW_COPY_AND_ASSIGN(SlowPathCodeMIPS64);
165};
166
167class LocationsBuilderMIPS64 : public HGraphVisitor {
168 public:
169 LocationsBuilderMIPS64(HGraph* graph, CodeGeneratorMIPS64* codegen)
170 : HGraphVisitor(graph), codegen_(codegen) {}
171
172#define DECLARE_VISIT_INSTRUCTION(name, super) \
Alexandre Ramesf39e0642015-06-23 11:33:45 +0100173 void Visit##name(H##name* instr) OVERRIDE;
Alexey Frunze4dda3372015-06-01 18:31:49 -0700174
Alexandre Ramesf39e0642015-06-23 11:33:45 +0100175 FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION)
176 FOR_EACH_CONCRETE_INSTRUCTION_MIPS64(DECLARE_VISIT_INSTRUCTION)
Alexey Frunze4dda3372015-06-01 18:31:49 -0700177
178#undef DECLARE_VISIT_INSTRUCTION
179
Alexandre Ramesf39e0642015-06-23 11:33:45 +0100180 void VisitInstruction(HInstruction* instruction) OVERRIDE {
181 LOG(FATAL) << "Unreachable instruction " << instruction->DebugName()
182 << " (id " << instruction->GetId() << ")";
183 }
184
Alexey Frunze4dda3372015-06-01 18:31:49 -0700185 private:
186 void HandleInvoke(HInvoke* invoke);
187 void HandleBinaryOp(HBinaryOperation* operation);
Vladimir Marko5f7b58e2015-11-23 19:49:34 +0000188 void HandleCondition(HCondition* instruction);
Alexey Frunze4dda3372015-06-01 18:31:49 -0700189 void HandleShift(HBinaryOperation* operation);
190 void HandleFieldSet(HInstruction* instruction, const FieldInfo& field_info);
191 void HandleFieldGet(HInstruction* instruction, const FieldInfo& field_info);
192
193 InvokeDexCallingConventionVisitorMIPS64 parameter_visitor_;
194
195 CodeGeneratorMIPS64* const codegen_;
196
197 DISALLOW_COPY_AND_ASSIGN(LocationsBuilderMIPS64);
198};
199
Aart Bik42249c32016-01-07 15:33:50 -0800200class InstructionCodeGeneratorMIPS64 : public InstructionCodeGenerator {
Alexey Frunze4dda3372015-06-01 18:31:49 -0700201 public:
202 InstructionCodeGeneratorMIPS64(HGraph* graph, CodeGeneratorMIPS64* codegen);
203
204#define DECLARE_VISIT_INSTRUCTION(name, super) \
Alexandre Ramesf39e0642015-06-23 11:33:45 +0100205 void Visit##name(H##name* instr) OVERRIDE;
Alexey Frunze4dda3372015-06-01 18:31:49 -0700206
Alexandre Ramesf39e0642015-06-23 11:33:45 +0100207 FOR_EACH_CONCRETE_INSTRUCTION_COMMON(DECLARE_VISIT_INSTRUCTION)
208 FOR_EACH_CONCRETE_INSTRUCTION_MIPS64(DECLARE_VISIT_INSTRUCTION)
Alexey Frunze4dda3372015-06-01 18:31:49 -0700209
210#undef DECLARE_VISIT_INSTRUCTION
211
Alexandre Ramesf39e0642015-06-23 11:33:45 +0100212 void VisitInstruction(HInstruction* instruction) OVERRIDE {
213 LOG(FATAL) << "Unreachable instruction " << instruction->DebugName()
214 << " (id " << instruction->GetId() << ")";
215 }
216
Alexey Frunze4dda3372015-06-01 18:31:49 -0700217 Mips64Assembler* GetAssembler() const { return assembler_; }
218
219 private:
Alexey Frunze4dda3372015-06-01 18:31:49 -0700220 void GenerateClassInitializationCheck(SlowPathCodeMIPS64* slow_path, GpuRegister class_reg);
221 void GenerateMemoryBarrier(MemBarrierKind kind);
222 void GenerateSuspendCheck(HSuspendCheck* check, HBasicBlock* successor);
223 void HandleBinaryOp(HBinaryOperation* operation);
Vladimir Marko5f7b58e2015-11-23 19:49:34 +0000224 void HandleCondition(HCondition* instruction);
Alexey Frunze4dda3372015-06-01 18:31:49 -0700225 void HandleShift(HBinaryOperation* operation);
Goran Jakovljevic8ed18262016-01-22 13:01:00 +0100226 void HandleFieldSet(HInstruction* instruction,
227 const FieldInfo& field_info,
228 bool value_can_be_null);
Alexey Frunze4dda3372015-06-01 18:31:49 -0700229 void HandleFieldGet(HInstruction* instruction, const FieldInfo& field_info);
Alexey Frunze4dda3372015-06-01 18:31:49 -0700230 void GenerateTestAndBranch(HInstruction* instruction,
David Brazdil0debae72015-11-12 18:37:00 +0000231 size_t condition_input_index,
Alexey Frunzea0e87b02015-09-24 22:57:20 -0700232 Mips64Label* true_target,
233 Mips64Label* false_target);
Alexey Frunzec857c742015-09-23 15:12:39 -0700234 void DivRemOneOrMinusOne(HBinaryOperation* instruction);
235 void DivRemByPowerOfTwo(HBinaryOperation* instruction);
236 void GenerateDivRemWithAnyConstant(HBinaryOperation* instruction);
237 void GenerateDivRemIntegral(HBinaryOperation* instruction);
Alexey Frunze299a9392015-12-08 16:08:02 -0800238 void GenerateIntLongCompare(IfCondition cond, bool is64bit, LocationSummary* locations);
239 void GenerateIntLongCompareAndBranch(IfCondition cond,
240 bool is64bit,
241 LocationSummary* locations,
242 Mips64Label* label);
243 void GenerateFpCompareAndBranch(IfCondition cond,
244 bool gt_bias,
245 Primitive::Type type,
246 LocationSummary* locations,
247 Mips64Label* label);
David Brazdilfc6a86a2015-06-26 10:33:45 +0000248 void HandleGoto(HInstruction* got, HBasicBlock* successor);
Alexey Frunze4dda3372015-06-01 18:31:49 -0700249
250 Mips64Assembler* const assembler_;
251 CodeGeneratorMIPS64* const codegen_;
252
253 DISALLOW_COPY_AND_ASSIGN(InstructionCodeGeneratorMIPS64);
254};
255
256class CodeGeneratorMIPS64 : public CodeGenerator {
257 public:
258 CodeGeneratorMIPS64(HGraph* graph,
259 const Mips64InstructionSetFeatures& isa_features,
Serban Constantinescuecc43662015-08-13 13:33:12 +0100260 const CompilerOptions& compiler_options,
261 OptimizingCompilerStats* stats = nullptr);
Alexey Frunze4dda3372015-06-01 18:31:49 -0700262 virtual ~CodeGeneratorMIPS64() {}
263
264 void GenerateFrameEntry() OVERRIDE;
265 void GenerateFrameExit() OVERRIDE;
266
267 void Bind(HBasicBlock* block) OVERRIDE;
268
Lazar Trsicd9672662015-09-03 17:33:01 +0200269 size_t GetWordSize() const OVERRIDE { return kMips64DoublewordSize; }
Alexey Frunze4dda3372015-06-01 18:31:49 -0700270
Lazar Trsicd9672662015-09-03 17:33:01 +0200271 size_t GetFloatingPointSpillSlotSize() const OVERRIDE { return kMips64DoublewordSize; }
Alexey Frunze4dda3372015-06-01 18:31:49 -0700272
Alexandre Ramesc01a6642016-04-15 11:54:06 +0100273 uintptr_t GetAddressOf(HBasicBlock* block) OVERRIDE {
Alexey Frunzea0e87b02015-09-24 22:57:20 -0700274 return assembler_.GetLabelLocation(GetLabelOf(block));
Alexey Frunze4dda3372015-06-01 18:31:49 -0700275 }
276
277 HGraphVisitor* GetLocationBuilder() OVERRIDE { return &location_builder_; }
278 HGraphVisitor* GetInstructionVisitor() OVERRIDE { return &instruction_visitor_; }
279 Mips64Assembler* GetAssembler() OVERRIDE { return &assembler_; }
Alexandre Rameseb7b7392015-06-19 14:47:01 +0100280 const Mips64Assembler& GetAssembler() const OVERRIDE { return assembler_; }
Alexey Frunze4dda3372015-06-01 18:31:49 -0700281
Alexey Frunze19f6c692016-11-30 19:19:55 -0800282 // Emit linker patches.
283 void EmitLinkerPatches(ArenaVector<LinkerPatch>* linker_patches) OVERRIDE;
284
Goran Jakovljevic8ed18262016-01-22 13:01:00 +0100285 void MarkGCCard(GpuRegister object, GpuRegister value, bool value_can_be_null);
Alexey Frunze4dda3372015-06-01 18:31:49 -0700286
287 // Register allocation.
288
David Brazdil58282f42016-01-14 12:45:10 +0000289 void SetupBlockedRegisters() const OVERRIDE;
Alexey Frunze4dda3372015-06-01 18:31:49 -0700290
Roland Levillainf41f9562016-09-14 19:26:48 +0100291 size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE;
292 size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE;
293 size_t SaveFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE;
294 size_t RestoreFloatingPointRegister(size_t stack_index, uint32_t reg_id) OVERRIDE;
Alexey Frunze4dda3372015-06-01 18:31:49 -0700295
296 void DumpCoreRegister(std::ostream& stream, int reg) const OVERRIDE;
297 void DumpFloatingPointRegister(std::ostream& stream, int reg) const OVERRIDE;
298
299 InstructionSet GetInstructionSet() const OVERRIDE { return InstructionSet::kMips64; }
300
301 const Mips64InstructionSetFeatures& GetInstructionSetFeatures() const {
302 return isa_features_;
303 }
304
Alexey Frunzea0e87b02015-09-24 22:57:20 -0700305 Mips64Label* GetLabelOf(HBasicBlock* block) const {
306 return CommonGetLabelOf<Mips64Label>(block_labels_, block);
Alexey Frunze4dda3372015-06-01 18:31:49 -0700307 }
308
309 void Initialize() OVERRIDE {
Alexey Frunzea0e87b02015-09-24 22:57:20 -0700310 block_labels_ = CommonInitializeLabels<Mips64Label>();
Alexey Frunze4dda3372015-06-01 18:31:49 -0700311 }
312
313 void Finalize(CodeAllocator* allocator) OVERRIDE;
314
315 // Code generation helpers.
Calin Juravlee460d1d2015-09-29 04:52:17 +0100316 void MoveLocation(Location dst, Location src, Primitive::Type dst_type) OVERRIDE;
Alexey Frunze4dda3372015-06-01 18:31:49 -0700317
Calin Juravle175dc732015-08-25 15:42:32 +0100318 void MoveConstant(Location destination, int32_t value) OVERRIDE;
319
Calin Juravlee460d1d2015-09-29 04:52:17 +0100320 void AddLocationAsTemp(Location location, LocationSummary* locations) OVERRIDE;
321
322
Alexey Frunze4dda3372015-06-01 18:31:49 -0700323 void SwapLocations(Location loc1, Location loc2, Primitive::Type type);
324
325 // Generate code to invoke a runtime entry point.
Calin Juravle175dc732015-08-25 15:42:32 +0100326 void InvokeRuntime(QuickEntrypointEnum entrypoint,
327 HInstruction* instruction,
328 uint32_t dex_pc,
Serban Constantinescufc734082016-07-19 17:18:07 +0100329 SlowPathCode* slow_path = nullptr) OVERRIDE;
Alexey Frunze4dda3372015-06-01 18:31:49 -0700330
331 ParallelMoveResolver* GetMoveResolver() OVERRIDE { return &move_resolver_; }
332
Roland Levillainf41f9562016-09-14 19:26:48 +0100333 bool NeedsTwoRegisters(Primitive::Type type ATTRIBUTE_UNUSED) const OVERRIDE { return false; }
Alexey Frunze4dda3372015-06-01 18:31:49 -0700334
Vladimir Markocac5a7e2016-02-22 10:39:50 +0000335 // Check if the desired_string_load_kind is supported. If it is, return it,
336 // otherwise return a fall-back kind that should be used instead.
337 HLoadString::LoadKind GetSupportedLoadStringKind(
338 HLoadString::LoadKind desired_string_load_kind) OVERRIDE;
339
Vladimir Markodbb7f5b2016-03-30 13:23:58 +0100340 // Check if the desired_class_load_kind is supported. If it is, return it,
341 // otherwise return a fall-back kind that should be used instead.
342 HLoadClass::LoadKind GetSupportedLoadClassKind(
343 HLoadClass::LoadKind desired_class_load_kind) OVERRIDE;
344
Vladimir Markodc151b22015-10-15 18:02:30 +0100345 // Check if the desired_dispatch_info is supported. If it is, return it,
346 // otherwise return a fall-back info that should be used instead.
347 HInvokeStaticOrDirect::DispatchInfo GetSupportedInvokeStaticOrDirectDispatch(
348 const HInvokeStaticOrDirect::DispatchInfo& desired_dispatch_info,
Nicolas Geoffray5e4e11e2016-09-22 13:17:41 +0100349 HInvokeStaticOrDirect* invoke) OVERRIDE;
Vladimir Markodc151b22015-10-15 18:02:30 +0100350
Andreas Gampe85b62f22015-09-09 13:15:38 -0700351 void GenerateStaticOrDirectCall(HInvokeStaticOrDirect* invoke, Location temp) OVERRIDE;
Alexey Frunze53afca12015-11-05 16:34:23 -0800352 void GenerateVirtualCall(HInvokeVirtual* invoke, Location temp) OVERRIDE;
Andreas Gampe85b62f22015-09-09 13:15:38 -0700353
354 void MoveFromReturnRegister(Location trg ATTRIBUTE_UNUSED,
355 Primitive::Type type ATTRIBUTE_UNUSED) OVERRIDE {
Chris Larsen3acee732015-11-18 13:31:08 -0800356 UNIMPLEMENTED(FATAL) << "Not implemented on MIPS64";
Andreas Gampe85b62f22015-09-09 13:15:38 -0700357 }
Alexey Frunze4dda3372015-06-01 18:31:49 -0700358
Roland Levillainf41f9562016-09-14 19:26:48 +0100359 void GenerateNop() OVERRIDE;
360 void GenerateImplicitNullCheck(HNullCheck* instruction) OVERRIDE;
361 void GenerateExplicitNullCheck(HNullCheck* instruction) OVERRIDE;
David Srbeckyc7098ff2016-02-09 14:30:11 +0000362
Alexey Frunze19f6c692016-11-30 19:19:55 -0800363 // The PcRelativePatchInfo is used for PC-relative addressing of dex cache arrays,
364 // boot image strings and method calls. The only difference is the interpretation of
365 // the offset_or_index.
366 struct PcRelativePatchInfo {
367 PcRelativePatchInfo(const DexFile& dex_file, uint32_t off_or_idx)
368 : target_dex_file(dex_file), offset_or_index(off_or_idx) { }
369 PcRelativePatchInfo(PcRelativePatchInfo&& other) = default;
370
371 const DexFile& target_dex_file;
372 // Either the dex cache array element offset or the string/type/method index.
373 uint32_t offset_or_index;
374 // Label for the auipc instruction.
375 Mips64Label pc_rel_label;
376 };
377
378 PcRelativePatchInfo* NewPcRelativeDexCacheArrayPatch(const DexFile& dex_file,
379 uint32_t element_offset);
380 PcRelativePatchInfo* NewPcRelativeCallPatch(const DexFile& dex_file,
381 uint32_t method_index);
382
383 void EmitPcRelativeAddressPlaceholderHigh(PcRelativePatchInfo* info, GpuRegister out);
384
Alexey Frunze4dda3372015-06-01 18:31:49 -0700385 private:
Alexey Frunze19f6c692016-11-30 19:19:55 -0800386 using Uint64ToLiteralMap = ArenaSafeMap<uint64_t, Literal*>;
387 using MethodToLiteralMap = ArenaSafeMap<MethodReference, Literal*, MethodReferenceComparator>;
388 Literal* DeduplicateUint64Literal(uint64_t value);
389 Literal* DeduplicateMethodLiteral(MethodReference target_method, MethodToLiteralMap* map);
390 Literal* DeduplicateMethodAddressLiteral(MethodReference target_method);
391 Literal* DeduplicateMethodCodeLiteral(MethodReference target_method);
392
393 PcRelativePatchInfo* NewPcRelativePatch(const DexFile& dex_file,
394 uint32_t offset_or_index,
395 ArenaDeque<PcRelativePatchInfo>* patches);
396
397 template <LinkerPatch (*Factory)(size_t, const DexFile*, uint32_t, uint32_t)>
398 void EmitPcRelativeLinkerPatches(const ArenaDeque<PcRelativePatchInfo>& infos,
399 ArenaVector<LinkerPatch>* linker_patches);
400
Alexey Frunze4dda3372015-06-01 18:31:49 -0700401 // Labels for each block that will be compiled.
Alexey Frunzea0e87b02015-09-24 22:57:20 -0700402 Mips64Label* block_labels_; // Indexed by block id.
403 Mips64Label frame_entry_label_;
Alexey Frunze4dda3372015-06-01 18:31:49 -0700404 LocationsBuilderMIPS64 location_builder_;
405 InstructionCodeGeneratorMIPS64 instruction_visitor_;
406 ParallelMoveResolverMIPS64 move_resolver_;
407 Mips64Assembler assembler_;
408 const Mips64InstructionSetFeatures& isa_features_;
409
Alexey Frunze19f6c692016-11-30 19:19:55 -0800410 // Deduplication map for 64-bit literals, used for non-patchable method address or method code
411 // address.
412 Uint64ToLiteralMap uint64_literals_;
413 // Method patch info, map MethodReference to a literal for method address and method code.
414 MethodToLiteralMap method_patches_;
415 MethodToLiteralMap call_patches_;
416 // PC-relative patch info.
417 ArenaDeque<PcRelativePatchInfo> pc_relative_dex_cache_patches_;
418 ArenaDeque<PcRelativePatchInfo> relative_call_patches_;
419
Alexey Frunze4dda3372015-06-01 18:31:49 -0700420 DISALLOW_COPY_AND_ASSIGN(CodeGeneratorMIPS64);
421};
422
423} // namespace mips64
424} // namespace art
425
426#endif // ART_COMPILER_OPTIMIZING_CODE_GENERATOR_MIPS64_H_