summaryrefslogtreecommitdiffstats
path: root/compiler/dex/quick/x86/call_x86.cc
diff options
context:
space:
mode:
authorChao-ying Fu <chao-ying.fu@intel.com>2014-07-01 17:43:41 -0700
committerAndreas Gampe <agampe@google.com>2014-07-03 14:44:01 -0700
commita77ee5103532abb197f492c14a9e6fb437054e2a (patch)
treeb8758c0d0a0ecd2f902a53a0fbb1b5014a153c6f /compiler/dex/quick/x86/call_x86.cc
parent3ee86bcbbc29f17b0243954a52dcda96b09411e0 (diff)
downloadandroid_art-a77ee5103532abb197f492c14a9e6fb437054e2a.tar.gz
android_art-a77ee5103532abb197f492c14a9e6fb437054e2a.tar.bz2
android_art-a77ee5103532abb197f492c14a9e6fb437054e2a.zip
x86_64: TargetReg update for x86
Also includes changes in common code. Elimination of use of TargetReg with one parameter and direct access to special target registers. Change-Id: Ied2c1f87d4d1e4345248afe74bca40487a46a371 Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com> Signed-off-by: Chao-ying Fu <chao-ying.fu@intel.com>
Diffstat (limited to 'compiler/dex/quick/x86/call_x86.cc')
-rw-r--r--compiler/dex/quick/x86/call_x86.cc29
1 files changed, 17 insertions, 12 deletions
diff --git a/compiler/dex/quick/x86/call_x86.cc b/compiler/dex/quick/x86/call_x86.cc
index bfbfa0e49a..6ca220cb2e 100644
--- a/compiler/dex/quick/x86/call_x86.cc
+++ b/compiler/dex/quick/x86/call_x86.cc
@@ -158,29 +158,33 @@ void X86Mir2Lir::GenFillArrayData(DexOffset table_offset, RegLocation rl_src) {
// Making a call - use explicit registers
FlushAllRegs(); /* Everything to home location */
- LoadValueDirectFixed(rl_src, rs_rX86_ARG0);
+ RegStorage array_ptr = TargetRefReg(kArg0);
+ RegStorage payload = TargetPtrReg(kArg1);
+ RegStorage method_start = TargetPtrReg(kArg2);
+
+ LoadValueDirectFixed(rl_src, array_ptr);
// Materialize a pointer to the fill data image
if (base_of_code_ != nullptr) {
// We can use the saved value.
RegLocation rl_method = mir_graph_->GetRegLocation(base_of_code_->s_reg_low);
if (rl_method.wide) {
- LoadValueDirectWide(rl_method, rs_rX86_ARG2);
+ LoadValueDirectWide(rl_method, method_start);
} else {
- LoadValueDirect(rl_method, rs_rX86_ARG2);
+ LoadValueDirect(rl_method, method_start);
}
store_method_addr_used_ = true;
} else {
// TODO(64) force to be 64-bit
- NewLIR1(kX86StartOfMethod, rs_rX86_ARG2.GetReg());
+ NewLIR1(kX86StartOfMethod, method_start.GetReg());
}
- NewLIR2(kX86PcRelAdr, rs_rX86_ARG1.GetReg(), WrapPointer(tab_rec));
- NewLIR2(cu_->target64 ? kX86Add64RR : kX86Add32RR, rs_rX86_ARG1.GetReg(), rs_rX86_ARG2.GetReg());
+ NewLIR2(kX86PcRelAdr, payload.GetReg(), WrapPointer(tab_rec));
+ OpRegReg(kOpAdd, payload, method_start);
if (cu_->target64) {
- CallRuntimeHelperRegReg(QUICK_ENTRYPOINT_OFFSET(8, pHandleFillArrayData), rs_rX86_ARG0,
- rs_rX86_ARG1, true);
+ CallRuntimeHelperRegReg(QUICK_ENTRYPOINT_OFFSET(8, pHandleFillArrayData), array_ptr,
+ payload, true);
} else {
- CallRuntimeHelperRegReg(QUICK_ENTRYPOINT_OFFSET(4, pHandleFillArrayData), rs_rX86_ARG0,
- rs_rX86_ARG1, true);
+ CallRuntimeHelperRegReg(QUICK_ENTRYPOINT_OFFSET(4, pHandleFillArrayData), array_ptr,
+ payload, true);
}
}
@@ -291,11 +295,12 @@ void X86Mir2Lir::GenEntrySequence(RegLocation* ArgLocs, RegLocation rl_method) {
FlushIns(ArgLocs, rl_method);
if (base_of_code_ != nullptr) {
+ RegStorage method_start = TargetPtrReg(kArg0);
// We have been asked to save the address of the method start for later use.
- setup_method_address_[0] = NewLIR1(kX86StartOfMethod, rs_rX86_ARG0.GetReg());
+ setup_method_address_[0] = NewLIR1(kX86StartOfMethod, method_start.GetReg());
int displacement = SRegOffset(base_of_code_->s_reg_low);
// Native pointer - must be natural word size.
- setup_method_address_[1] = StoreBaseDisp(rs_rX86_SP, displacement, rs_rX86_ARG0,
+ setup_method_address_[1] = StoreBaseDisp(rs_rX86_SP, displacement, method_start,
cu_->target64 ? k64 : k32, kNotVolatile);
}