summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/code_generator_arm.h
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2014-11-05 12:46:03 +0000
committerNicolas Geoffray <ngeoffray@google.com>2014-11-06 16:49:52 +0000
commitde58ab2c03ff8112b07ab827c8fa38f670dfc656 (patch)
treec872bfbcad1e90845008140bbddcc43e56dc19d2 /compiler/optimizing/code_generator_arm.h
parent3ed86e4e98dfe1b05c9a03aa2aee42c145a018c3 (diff)
downloadart-de58ab2c03ff8112b07ab827c8fa38f670dfc656.tar.gz
art-de58ab2c03ff8112b07ab827c8fa38f670dfc656.tar.bz2
art-de58ab2c03ff8112b07ab827c8fa38f670dfc656.zip
Implement try/catch/throw in optimizing.
- We currently don't run optimizations in the presence of a try/catch. - We therefore implement Quick's mapping table. - Also fix a missing null check on array-length. Change-Id: I6917dfcb868e75c1cf6eff32b7cbb60b6cfbd68f
Diffstat (limited to 'compiler/optimizing/code_generator_arm.h')
-rw-r--r--compiler/optimizing/code_generator_arm.h52
1 files changed, 28 insertions, 24 deletions
diff --git a/compiler/optimizing/code_generator_arm.h b/compiler/optimizing/code_generator_arm.h
index 5076a4bc38..5d519937f4 100644
--- a/compiler/optimizing/code_generator_arm.h
+++ b/compiler/optimizing/code_generator_arm.h
@@ -77,10 +77,10 @@ class ParallelMoveResolverARM : public ParallelMoveResolver {
ParallelMoveResolverARM(ArenaAllocator* allocator, CodeGeneratorARM* codegen)
: ParallelMoveResolver(allocator), codegen_(codegen) {}
- virtual void EmitMove(size_t index) OVERRIDE;
- virtual void EmitSwap(size_t index) OVERRIDE;
- virtual void SpillScratch(int reg) OVERRIDE;
- virtual void RestoreScratch(int reg) OVERRIDE;
+ void EmitMove(size_t index) OVERRIDE;
+ void EmitSwap(size_t index) OVERRIDE;
+ void SpillScratch(int reg) OVERRIDE;
+ void RestoreScratch(int reg) OVERRIDE;
ArmAssembler* GetAssembler() const;
@@ -99,7 +99,7 @@ class LocationsBuilderARM : public HGraphVisitor {
: HGraphVisitor(graph), codegen_(codegen) {}
#define DECLARE_VISIT_INSTRUCTION(name, super) \
- virtual void Visit##name(H##name* instr);
+ void Visit##name(H##name* instr);
FOR_EACH_CONCRETE_INSTRUCTION(DECLARE_VISIT_INSTRUCTION)
@@ -119,7 +119,7 @@ class InstructionCodeGeneratorARM : public HGraphVisitor {
InstructionCodeGeneratorARM(HGraph* graph, CodeGeneratorARM* codegen);
#define DECLARE_VISIT_INSTRUCTION(name, super) \
- virtual void Visit##name(H##name* instr);
+ void Visit##name(H##name* instr);
FOR_EACH_CONCRETE_INSTRUCTION(DECLARE_VISIT_INSTRUCTION)
@@ -145,39 +145,43 @@ class CodeGeneratorARM : public CodeGenerator {
explicit CodeGeneratorARM(HGraph* graph);
virtual ~CodeGeneratorARM() {}
- virtual void GenerateFrameEntry() OVERRIDE;
- virtual void GenerateFrameExit() OVERRIDE;
- virtual void Bind(HBasicBlock* block) OVERRIDE;
- virtual void Move(HInstruction* instruction, Location location, HInstruction* move_for) OVERRIDE;
- virtual size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE;
- virtual size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE;
+ void GenerateFrameEntry() OVERRIDE;
+ void GenerateFrameExit() OVERRIDE;
+ void Bind(HBasicBlock* block) OVERRIDE;
+ void Move(HInstruction* instruction, Location location, HInstruction* move_for) OVERRIDE;
+ size_t SaveCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE;
+ size_t RestoreCoreRegister(size_t stack_index, uint32_t reg_id) OVERRIDE;
- virtual size_t GetWordSize() const OVERRIDE {
+ size_t GetWordSize() const OVERRIDE {
return kArmWordSize;
}
- virtual size_t FrameEntrySpillSize() const OVERRIDE;
+ size_t FrameEntrySpillSize() const OVERRIDE;
- virtual HGraphVisitor* GetLocationBuilder() OVERRIDE {
+ HGraphVisitor* GetLocationBuilder() OVERRIDE {
return &location_builder_;
}
- virtual HGraphVisitor* GetInstructionVisitor() OVERRIDE {
+ HGraphVisitor* GetInstructionVisitor() OVERRIDE {
return &instruction_visitor_;
}
- virtual ArmAssembler* GetAssembler() OVERRIDE {
+ ArmAssembler* GetAssembler() OVERRIDE {
return &assembler_;
}
- virtual void SetupBlockedRegisters() const OVERRIDE;
+ uintptr_t GetAddressOf(HBasicBlock* block) const OVERRIDE {
+ return GetLabelOf(block)->Position();
+ }
+
+ void SetupBlockedRegisters() const OVERRIDE;
- virtual Location AllocateFreeRegister(Primitive::Type type) const OVERRIDE;
+ Location AllocateFreeRegister(Primitive::Type type) const OVERRIDE;
- virtual Location GetStackLocation(HLoadLocal* load) const OVERRIDE;
+ Location GetStackLocation(HLoadLocal* load) const OVERRIDE;
- virtual void DumpCoreRegister(std::ostream& stream, int reg) const OVERRIDE;
- virtual void DumpFloatingPointRegister(std::ostream& stream, int reg) const OVERRIDE;
+ void DumpCoreRegister(std::ostream& stream, int reg) const OVERRIDE;
+ void DumpFloatingPointRegister(std::ostream& stream, int reg) const OVERRIDE;
// Blocks all register pairs made out of blocked core registers.
void UpdateBlockedPairRegisters() const;
@@ -186,7 +190,7 @@ class CodeGeneratorARM : public CodeGenerator {
return &move_resolver_;
}
- virtual InstructionSet GetInstructionSet() const OVERRIDE {
+ InstructionSet GetInstructionSet() const OVERRIDE {
return InstructionSet::kThumb2;
}
@@ -208,7 +212,7 @@ class CodeGeneratorARM : public CodeGenerator {
return block_labels_.GetRawStorage() + block->GetBlockId();
}
- virtual void Initialize() OVERRIDE {
+ void Initialize() OVERRIDE {
block_labels_.SetSize(GetGraph()->GetBlocks().Size());
}