diff options
| author | 2015-03-13 18:52:59 +0000 | |
|---|---|---|
| committer | 2015-03-16 10:48:21 +0000 | |
| commit | eeefa1276e83776f08704a3db4237423b0627e20 (patch) | |
| tree | d7c647ca77703f3712f567704f40b00d59a125de /compiler/optimizing/code_generator.h | |
| parent | 02c0bac34c246c1bd974dbb86d292d4b52ba98e4 (diff) | |
Update locations of registers after slow paths spilling.
Change-Id: Id9aafcc13c1a085c17ce65d704c67b73f9de695d
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); |