diff options
author | 2015-03-16 10:49:25 +0000 | |
---|---|---|
committer | 2015-03-16 10:49:25 +0000 | |
commit | 24ce79ebb11b7ea2947a35d447e0df1ab39b24bf (patch) | |
tree | 9158e658688255fdc2b647986c7cdea37397f9b5 /compiler/optimizing/code_generator.h | |
parent | 573a0267dfa69b8e7dd656504361b45d0f328e00 (diff) | |
parent | eeefa1276e83776f08704a3db4237423b0627e20 (diff) |
Merge "Update locations of registers after slow paths spilling."
Diffstat (limited to 'compiler/optimizing/code_generator.h')
-rw-r--r-- | compiler/optimizing/code_generator.h | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h index 81efc03d4c..667f686059 100644 --- a/compiler/optimizing/code_generator.h +++ b/compiler/optimizing/code_generator.h @@ -66,7 +66,13 @@ struct PcInfo { class SlowPathCode : public ArenaObject<kArenaAllocSlowPaths> { public: - SlowPathCode() {} + SlowPathCode() { + for (size_t i = 0; i < kMaximumNumberOfExpectedRegisters; ++i) { + saved_core_stack_offsets_[i] = kRegisterNotSaved; + saved_fpu_stack_offsets_[i] = kRegisterNotSaved; + } + } + virtual ~SlowPathCode() {} virtual void EmitNativeCode(CodeGenerator* codegen) = 0; @@ -75,7 +81,27 @@ class SlowPathCode : public ArenaObject<kArenaAllocSlowPaths> { void RestoreLiveRegisters(CodeGenerator* codegen, LocationSummary* locations); void RecordPcInfo(CodeGenerator* codegen, HInstruction* instruction, uint32_t dex_pc); + bool IsCoreRegisterSaved(int reg) const { + return saved_core_stack_offsets_[reg] != kRegisterNotSaved; + } + + bool IsFpuRegisterSaved(int reg) const { + return saved_fpu_stack_offsets_[reg] != kRegisterNotSaved; + } + + uint32_t GetStackOffsetOfCoreRegister(int reg) const { + return saved_core_stack_offsets_[reg]; + } + + uint32_t GetStackOffsetOfFpuRegister(int reg) const { + return saved_fpu_stack_offsets_[reg]; + } + private: + static constexpr size_t kMaximumNumberOfExpectedRegisters = 32; + static constexpr uint32_t kRegisterNotSaved = -1; + uint32_t saved_core_stack_offsets_[kMaximumNumberOfExpectedRegisters]; + uint32_t saved_fpu_stack_offsets_[kMaximumNumberOfExpectedRegisters]; DISALLOW_COPY_AND_ASSIGN(SlowPathCode); }; @@ -171,7 +197,7 @@ class CodeGenerator { return (fpu_callee_save_mask_ & (1 << reg)) != 0; } - void RecordPcInfo(HInstruction* instruction, uint32_t dex_pc); + void RecordPcInfo(HInstruction* instruction, uint32_t dex_pc, SlowPathCode* slow_path = nullptr); bool CanMoveNullCheckToUser(HNullCheck* null_check); void MaybeRecordImplicitNullCheck(HInstruction* instruction); |