diff options
author | Goran Jakovljevic <goran.jakovljevic@mips.com> | 2018-02-08 10:20:14 +0100 |
---|---|---|
committer | Goran Jakovljevic <goran.jakovljevic@mips.com> | 2018-02-08 10:20:14 +0100 |
commit | feec1679fa9281f3e18916cbd01216bf6388c6af (patch) | |
tree | 54b17519484f68be2b5b7575e90507a398e29e3b /compiler/optimizing/code_generator_mips.cc | |
parent | 9b9458ae0bd76341b3f444ce27bb5f661188012c (diff) |
Add support for counting hotness in compiled code for MIPS
This is a follow up to I0f63c644527b74f6ef2649f481c2a1c731bb9f21.
This fixes 674-hotness-compiled test failures for MIPS32 and MIPS64.
Test: ./testrunner.py --target --optimizing in QEMU
Change-Id: I22eb02594518f315d9e3a3e5fa895a6833574bba
Diffstat (limited to 'compiler/optimizing/code_generator_mips.cc')
-rw-r--r-- | compiler/optimizing/code_generator_mips.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler/optimizing/code_generator_mips.cc b/compiler/optimizing/code_generator_mips.cc index 855da2b18f..eb122b7781 100644 --- a/compiler/optimizing/code_generator_mips.cc +++ b/compiler/optimizing/code_generator_mips.cc @@ -1281,7 +1281,9 @@ void CodeGeneratorMIPS::GenerateFrameEntry() { __ Bind(&frame_entry_label_); if (GetCompilerOptions().CountHotnessInCompiledCode()) { - LOG(WARNING) << "Unimplemented hotness update in mips backend"; + __ Lhu(TMP, kMethodRegisterArgument, ArtMethod::HotnessCountOffset().Int32Value()); + __ Addiu(TMP, TMP, 1); + __ Sh(TMP, kMethodRegisterArgument, ArtMethod::HotnessCountOffset().Int32Value()); } bool do_overflow_check = @@ -4027,6 +4029,12 @@ void InstructionCodeGeneratorMIPS::HandleGoto(HInstruction* got, HBasicBlock* su HLoopInformation* info = block->GetLoopInformation(); if (info != nullptr && info->IsBackEdge(*block) && info->HasSuspendCheck()) { + if (codegen_->GetCompilerOptions().CountHotnessInCompiledCode()) { + __ Lw(AT, SP, kCurrentMethodStackOffset); + __ Lhu(TMP, AT, ArtMethod::HotnessCountOffset().Int32Value()); + __ Addiu(TMP, TMP, 1); + __ Sh(TMP, AT, ArtMethod::HotnessCountOffset().Int32Value()); + } GenerateSuspendCheck(info->GetSuspendCheck(), successor); return; } |