summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator_arm.h
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2015-05-06 14:12:42 +0100
committerVladimir Marko <vmarko@google.com>2015-08-19 12:23:37 +0100
commit9b688a095afbae21112df5d495487ac5231b12d0 (patch)
treee5e881d4d124803e66f1e90c1e0a0e4c90d22e13 /compiler/optimizing/code_generator_arm.h
parent009c34cba875885d9540696f33255a9b355d6e15 (diff)
Optimizing: Better invoke-static/-direct dispatch.
Add framework for different types of loading ArtMethod* and code pointer retrieval. Implement invoke-static and invoke-direct calls the same way as Quick. Document the dispatch kinds in HInvokeStaticOrDirect's new enumerations MethodLoadKind and CodePtrLocation. PC-relative loads from dex cache arrays are used only for x86-64 and arm64. The implementation for other architectures will be done in separate CLs. Change-Id: I468ca4d422dbd14748e1ba6b45289f0d31734d94
Diffstat (limited to 'compiler/optimizing/code_generator_arm.h')
-rw-r--r--compiler/optimizing/code_generator_arm.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/optimizing/code_generator_arm.h b/compiler/optimizing/code_generator_arm.h
index 53bd766dd4..9528cca36f 100644
--- a/compiler/optimizing/code_generator_arm.h
+++ b/compiler/optimizing/code_generator_arm.h
@@ -328,7 +328,15 @@ class CodeGeneratorARM : public CodeGenerator {
void GenerateStaticOrDirectCall(HInvokeStaticOrDirect* invoke, Location temp);
+ void EmitLinkerPatches(ArenaVector<LinkerPatch>* linker_patches) OVERRIDE;
+
private:
+ using MethodToLiteralMap = ArenaSafeMap<MethodReference, Literal*, MethodReferenceComparator>;
+
+ Literal* DeduplicateMethodLiteral(MethodReference target_method, MethodToLiteralMap* map);
+ Literal* DeduplicateMethodAddressLiteral(MethodReference target_method);
+ Literal* DeduplicateMethodCodeLiteral(MethodReference target_method);
+
// Labels for each block that will be compiled.
GrowableArray<Label> block_labels_;
Label frame_entry_label_;
@@ -338,6 +346,13 @@ class CodeGeneratorARM : public CodeGenerator {
Thumb2Assembler assembler_;
const ArmInstructionSetFeatures& isa_features_;
+ // Method patch info, map MethodReference to a literal for method address and method code.
+ MethodToLiteralMap method_patches_;
+ MethodToLiteralMap call_patches_;
+ // Relative call patch info.
+ // Using ArenaDeque<> which retains element addresses on push/emplace_back().
+ ArenaDeque<MethodPatchInfo<Label>> relative_call_patches_;
+
DISALLOW_COPY_AND_ASSIGN(CodeGeneratorARM);
};