diff options
Diffstat (limited to 'compiler/dex')
-rw-r--r-- | compiler/dex/mir_optimization.cc | 9 | ||||
-rw-r--r-- | compiler/dex/quick/arm/target_arm.cc | 19 | ||||
-rw-r--r-- | compiler/dex/quick/arm64/call_arm64.cc | 5 | ||||
-rw-r--r-- | compiler/dex/quick/arm64/target_arm64.cc | 19 | ||||
-rwxr-xr-x | compiler/dex/quick/x86/target_x86.cc | 2 |
5 files changed, 47 insertions, 7 deletions
diff --git a/compiler/dex/mir_optimization.cc b/compiler/dex/mir_optimization.cc index 05414b3..8718191 100644 --- a/compiler/dex/mir_optimization.cc +++ b/compiler/dex/mir_optimization.cc @@ -116,13 +116,14 @@ MIR* MIRGraph::AdvanceMIR(BasicBlock** p_bb, MIR* mir) { BasicBlock* bb = *p_bb; if (mir != NULL) { mir = mir->next; - if (mir == NULL) { + while (mir == NULL) { bb = GetBasicBlock(bb->fall_through); if ((bb == NULL) || Predecessors(bb) != 1) { - mir = NULL; + // mir is null and we cannot proceed further. + break; } else { - *p_bb = bb; - mir = bb->first_mir_insn; + *p_bb = bb; + mir = bb->first_mir_insn; } } } diff --git a/compiler/dex/quick/arm/target_arm.cc b/compiler/dex/quick/arm/target_arm.cc index 5538d79..13f9072 100644 --- a/compiler/dex/quick/arm/target_arm.cc +++ b/compiler/dex/quick/arm/target_arm.cc @@ -19,6 +19,7 @@ #include <inttypes.h> #include <string> +#include <sstream> #include "backend_arm.h" #include "base/logging.h" @@ -490,6 +491,24 @@ std::string ArmMir2Lir::BuildInsnString(const char* fmt, LIR* lir, unsigned char buf += *fmt++; } } + // Dump thread offset. + std::string fmt_str = GetTargetInstFmt(lir->opcode); + if (std::string::npos != fmt_str.find(", [!1C, #!2") && rARM_SELF == lir->operands[1] && + std::string::npos != buf.find(", [")) { + int offset = lir->operands[2]; + if (std::string::npos != fmt_str.find("#!2d")) { + } else if (std::string::npos != fmt_str.find("#!2E")) { + offset *= 4; + } else if (std::string::npos != fmt_str.find("#!2F")) { + offset *= 2; + } else { + LOG(FATAL) << "Should not reach here"; + } + std::ostringstream tmp_stream; + Thread::DumpThreadOffset<4>(tmp_stream, offset); + buf += " ; "; + buf += tmp_stream.str(); + } return buf; } diff --git a/compiler/dex/quick/arm64/call_arm64.cc b/compiler/dex/quick/arm64/call_arm64.cc index d2204f5..6492442 100644 --- a/compiler/dex/quick/arm64/call_arm64.cc +++ b/compiler/dex/quick/arm64/call_arm64.cc @@ -400,8 +400,9 @@ void Arm64Mir2Lir::GenSpecialExitSequence() { } static bool Arm64UseRelativeCall(CompilationUnit* cu, const MethodReference& target_method) { - // Emit relative calls anywhere in the image or within a dex file otherwise. - return cu->compiler_driver->IsImage() || cu->dex_file == target_method.dex_file; + UNUSED(cu, target_method); + // Always emit relative calls. + return true; } /* diff --git a/compiler/dex/quick/arm64/target_arm64.cc b/compiler/dex/quick/arm64/target_arm64.cc index 34662f2..136be94 100644 --- a/compiler/dex/quick/arm64/target_arm64.cc +++ b/compiler/dex/quick/arm64/target_arm64.cc @@ -19,6 +19,7 @@ #include <inttypes.h> #include <string> +#include <sstream> #include "backend_arm64.h" #include "base/logging.h" @@ -522,6 +523,24 @@ std::string Arm64Mir2Lir::BuildInsnString(const char* fmt, LIR* lir, unsigned ch buf += *fmt++; } } + // Dump thread offset. + std::string fmt_str = GetTargetInstFmt(lir->opcode); + if (std::string::npos != fmt_str.find(", [!1X, #!2") && rxSELF == lir->operands[1] && + std::string::npos != buf.find(", [")) { + int offset = lir->operands[2]; + if (std::string::npos != fmt_str.find("#!2d")) { + } else if (std::string::npos != fmt_str.find("#!2D")) { + offset *= (IS_WIDE(lir->opcode)) ? 8 : 4; + } else if (std::string::npos != fmt_str.find("#!2F")) { + offset *= 2; + } else { + LOG(FATAL) << "Should not reach here"; + } + std::ostringstream tmp_stream; + Thread::DumpThreadOffset<8>(tmp_stream, offset); + buf += " ; "; + buf += tmp_stream.str(); + } return buf; } diff --git a/compiler/dex/quick/x86/target_x86.cc b/compiler/dex/quick/x86/target_x86.cc index c04ae12..c4adb09 100755 --- a/compiler/dex/quick/x86/target_x86.cc +++ b/compiler/dex/quick/x86/target_x86.cc @@ -2303,9 +2303,9 @@ void X86Mir2Lir::GenReduceVector(MIR* mir) { StoreFinalValue(rl_dest, rl_result); } else { int displacement = SRegOffset(rl_result.s_reg_low); + ScopedMemRefType mem_ref_type(this, ResourceMask::kDalvikReg); LIR *l = NewLIR4(extr_opcode, rs_rX86_SP_32.GetReg(), displacement, vector_src.GetReg(), extract_index); - AnnotateDalvikRegAccess(l, displacement >> 2, true /* is_load */, is_wide /* is_64bit */); AnnotateDalvikRegAccess(l, displacement >> 2, false /* is_load */, is_wide /* is_64bit */); } } |