diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2015-03-13 16:36:36 +0000 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2015-03-13 16:47:44 +0000 |
commit | a8ac9130b872c080299afacf5dcaab513d13ea87 (patch) | |
tree | 2bd0a2a88cbb6e7a3ae79dff84c466bed9189eb5 /compiler/optimizing/code_generator.h | |
parent | cc22e3946baf035c8732e9417ab132bfe663aa45 (diff) |
Refactor code in preparation of correct stack maps in slow path.
Move the logic of saving/restoring live registers in slow path
in the SlowPathCode method. Also add a RecordPcInfo helper to
SlowPathCode, that will act as the placeholder of saving correct
stack maps.
Change-Id: I25c2bc7a642ef854bbc8a3eb570e5c8c8d2d030c
Diffstat (limited to 'compiler/optimizing/code_generator.h')
-rw-r--r-- | compiler/optimizing/code_generator.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h index b8f4572abd..81fc684ccf 100644 --- a/compiler/optimizing/code_generator.h +++ b/compiler/optimizing/code_generator.h @@ -73,6 +73,10 @@ class SlowPathCode : public ArenaObject<kArenaAllocSlowPaths> { virtual void EmitNativeCode(CodeGenerator* codegen) = 0; + void SaveLiveRegisters(CodeGenerator* codegen, LocationSummary* locations); + void RestoreLiveRegisters(CodeGenerator* codegen, LocationSummary* locations); + void RecordPcInfo(CodeGenerator* codegen, HInstruction* instruction, uint32_t dex_pc); + private: DISALLOW_COPY_AND_ASSIGN(SlowPathCode); }; @@ -182,8 +186,6 @@ class CodeGenerator { void BuildNativeGCMap( std::vector<uint8_t>* vector, const DexCompilationUnit& dex_compilation_unit) const; void BuildStackMaps(std::vector<uint8_t>* vector); - void SaveLiveRegisters(LocationSummary* locations); - void RestoreLiveRegisters(LocationSummary* locations); bool IsLeafMethod() const { return is_leaf_; @@ -267,6 +269,15 @@ class CodeGenerator { } } + size_t GetFirstRegisterSlotInSlowPath() const { + return first_register_slot_in_slow_path_; + } + + uint32_t FrameEntrySpillSize() const { + return GetFpuSpillSize() + GetCoreSpillSize(); + } + + protected: CodeGenerator(HGraph* graph, size_t number_of_core_registers, @@ -326,10 +337,6 @@ class CodeGenerator { return POPCOUNT(core_spill_mask_) * GetWordSize(); } - uint32_t FrameEntrySpillSize() const { - return GetFpuSpillSize() + GetCoreSpillSize(); - } - bool HasAllocatedCalleeSaveRegisters() const { // We check the core registers against 1 because it always comprises the return PC. return (POPCOUNT(allocated_registers_.GetCoreRegisters() & core_callee_save_mask_) != 1) |