diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-03-17 10:20:19 +0000 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-03-18 11:20:20 +0000 |
commit | 787c3076635cf117eb646c5a89a9014b2072fb44 (patch) | |
tree | 3c9c6c6d56e3900cf2255a5d1ade008ec6a40681 /compiler/optimizing/code_generator_arm.h | |
parent | b9d50a9829b795932eac4cc50a99b4ce80b0ecb4 (diff) | |
download | art-787c3076635cf117eb646c5a89a9014b2072fb44.zip art-787c3076635cf117eb646c5a89a9014b2072fb44.tar.gz art-787c3076635cf117eb646c5a89a9014b2072fb44.tar.bz2 |
Plug new optimizing compiler in compilation pipeline.
Also rename accessors to ART's conventions.
Change-Id: I344807055b98aa4b27215704ec362191464acecc
Diffstat (limited to 'compiler/optimizing/code_generator_arm.h')
-rw-r--r-- | compiler/optimizing/code_generator_arm.h | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/compiler/optimizing/code_generator_arm.h b/compiler/optimizing/code_generator_arm.h index 33d8e62..52a7bf4 100644 --- a/compiler/optimizing/code_generator_arm.h +++ b/compiler/optimizing/code_generator_arm.h @@ -19,6 +19,7 @@ #include "code_generator.h" #include "nodes.h" +#include "utils/arm/assembler_arm.h" namespace art { @@ -42,12 +43,13 @@ class LocationsBuilderARM : public HGraphVisitor { DISALLOW_COPY_AND_ASSIGN(LocationsBuilderARM); }; -class CodeGeneratorARM : public CodeGenerator { +class InstructionCodeGeneratorARM : public HGraphVisitor { public: - CodeGeneratorARM(Assembler* assembler, HGraph* graph) - : CodeGenerator(assembler, graph), location_builder_(graph) { } + explicit InstructionCodeGeneratorARM(HGraph* graph, CodeGenerator* codegen) + : HGraphVisitor(graph), + assembler_(codegen->GetAssembler()), + codegen_(codegen) { } - // Visit functions for instruction classes. #define DECLARE_VISIT_INSTRUCTION(name) \ virtual void Visit##name(H##name* instr); @@ -55,6 +57,23 @@ class CodeGeneratorARM : public CodeGenerator { #undef DECLARE_VISIT_INSTRUCTION + Assembler* GetAssembler() const { return assembler_; } + + private: + Assembler* const assembler_; + CodeGenerator* const codegen_; + + DISALLOW_COPY_AND_ASSIGN(InstructionCodeGeneratorARM); +}; + +class CodeGeneratorARM : public CodeGenerator { + public: + explicit CodeGeneratorARM(HGraph* graph) + : CodeGenerator(graph), + location_builder_(graph), + instruction_visitor_(graph, this) { } + virtual ~CodeGeneratorARM() { } + protected: virtual void GenerateFrameEntry() OVERRIDE; virtual void GenerateFrameExit() OVERRIDE; @@ -66,8 +85,19 @@ class CodeGeneratorARM : public CodeGenerator { return &location_builder_; } + virtual HGraphVisitor* GetInstructionVisitor() OVERRIDE { + return &instruction_visitor_; + } + + virtual Assembler* GetAssembler() OVERRIDE { + return &assembler_; + } + private: LocationsBuilderARM location_builder_; + InstructionCodeGeneratorARM instruction_visitor_; + ArmAssembler assembler_; + DISALLOW_COPY_AND_ASSIGN(CodeGeneratorARM); }; |