Merge "Rename ClobberCalleeSave to *Caller*, fix it for x86."
diff --git a/compiler/dex/quick/arm/call_arm.cc b/compiler/dex/quick/arm/call_arm.cc
index 51aca85..23ea407 100644
--- a/compiler/dex/quick/arm/call_arm.cc
+++ b/compiler/dex/quick/arm/call_arm.cc
@@ -434,7 +434,7 @@
rARM_LR);
// Materialize a pointer to the fill data image
NewLIR3(kThumb2Adr, r1, 0, WrapPointer(tab_rec));
- ClobberCalleeSave();
+ ClobberCallerSave();
LIR* call_inst = OpReg(kOpBlx, rARM_LR);
MarkSafepointPC(call_inst);
}
@@ -471,7 +471,7 @@
// TODO: move to a slow path.
// Go expensive route - artLockObjectFromCode(obj);
LoadWordDisp(rARM_SELF, QUICK_ENTRYPOINT_OFFSET(pLockObject).Int32Value(), rARM_LR);
- ClobberCalleeSave();
+ ClobberCallerSave();
LIR* call_inst = OpReg(kOpBlx, rARM_LR);
MarkSafepointPC(call_inst);
@@ -490,7 +490,7 @@
OpIT(kCondNe, "T");
// Go expensive route - artLockObjectFromCode(self, obj);
LoadWordDisp/*ne*/(rARM_SELF, QUICK_ENTRYPOINT_OFFSET(pLockObject).Int32Value(), rARM_LR);
- ClobberCalleeSave();
+ ClobberCallerSave();
LIR* call_inst = OpReg(kOpBlx/*ne*/, rARM_LR);
MarkSafepointPC(call_inst);
GenMemBarrier(kLoadLoad);
@@ -530,7 +530,7 @@
// TODO: move to a slow path.
// Go expensive route - artUnlockObjectFromCode(obj);
LoadWordDisp(rARM_SELF, QUICK_ENTRYPOINT_OFFSET(pUnlockObject).Int32Value(), rARM_LR);
- ClobberCalleeSave();
+ ClobberCallerSave();
LIR* call_inst = OpReg(kOpBlx, rARM_LR);
MarkSafepointPC(call_inst);
@@ -549,7 +549,7 @@
StoreWordDisp/*eq*/(r0, mirror::Object::MonitorOffset().Int32Value(), r3);
// Go expensive route - UnlockObjectFromCode(obj);
LoadWordDisp/*ne*/(rARM_SELF, QUICK_ENTRYPOINT_OFFSET(pUnlockObject).Int32Value(), rARM_LR);
- ClobberCalleeSave();
+ ClobberCallerSave();
LIR* call_inst = OpReg(kOpBlx/*ne*/, rARM_LR);
MarkSafepointPC(call_inst);
GenMemBarrier(kStoreLoad);
diff --git a/compiler/dex/quick/arm/codegen_arm.h b/compiler/dex/quick/arm/codegen_arm.h
index de3223a..25ddc94 100644
--- a/compiler/dex/quick/arm/codegen_arm.h
+++ b/compiler/dex/quick/arm/codegen_arm.h
@@ -60,7 +60,7 @@
uint32_t FpRegMask();
uint64_t GetRegMaskCommon(int reg);
void AdjustSpillMask();
- void ClobberCalleeSave();
+ void ClobberCallerSave();
void FlushReg(int reg);
void FlushRegWide(int reg1, int reg2);
void FreeCallTemps();
diff --git a/compiler/dex/quick/arm/fp_arm.cc b/compiler/dex/quick/arm/fp_arm.cc
index 1575ece..dc2e0d0 100644
--- a/compiler/dex/quick/arm/fp_arm.cc
+++ b/compiler/dex/quick/arm/fp_arm.cc
@@ -315,7 +315,7 @@
S2d(rl_result.low_reg, rl_result.high_reg));
NewLIR0(kThumb2Fmstat);
branch = NewLIR2(kThumbBCond, 0, kArmCondEq);
- ClobberCalleeSave();
+ ClobberCallerSave();
LockCallTemps(); // Using fixed registers
int r_tgt = LoadHelper(QUICK_ENTRYPOINT_OFFSET(pSqrt));
NewLIR3(kThumb2Fmrrd, r0, r1, S2d(rl_src.low_reg, rl_src.high_reg));
diff --git a/compiler/dex/quick/arm/target_arm.cc b/compiler/dex/quick/arm/target_arm.cc
index 52aba9b..48c9af5 100644
--- a/compiler/dex/quick/arm/target_arm.cc
+++ b/compiler/dex/quick/arm/target_arm.cc
@@ -653,7 +653,7 @@
}
/* Clobber all regs that might be used by an external C call */
-void ArmMir2Lir::ClobberCalleeSave() {
+void ArmMir2Lir::ClobberCallerSave() {
Clobber(r0);
Clobber(r1);
Clobber(r2);
diff --git a/compiler/dex/quick/gen_common.cc b/compiler/dex/quick/gen_common.cc
index df6493d..a426cc7 100644
--- a/compiler/dex/quick/gen_common.cc
+++ b/compiler/dex/quick/gen_common.cc
@@ -611,7 +611,7 @@
default:
LOG(FATAL) << "Unexpected throw kind: " << lab->operands[0];
}
- ClobberCalleeSave();
+ ClobberCallerSave();
int r_tgt = CallHelperSetup(func_offset);
CallHelper(r_tgt, func_offset, true /* MarkSafepointPC */);
}
@@ -1026,7 +1026,7 @@
}
}
// TODO: only clobber when type isn't final?
- ClobberCalleeSave();
+ ClobberCallerSave();
/* branch targets here */
LIR* target = NewLIR0(kPseudoTargetLabel);
StoreValue(rl_dest, rl_result);
diff --git a/compiler/dex/quick/gen_invoke.cc b/compiler/dex/quick/gen_invoke.cc
index 9992499..e66d4ea 100644
--- a/compiler/dex/quick/gen_invoke.cc
+++ b/compiler/dex/quick/gen_invoke.cc
@@ -62,14 +62,14 @@
void Mir2Lir::CallRuntimeHelperImm(ThreadOffset helper_offset, int arg0, bool safepoint_pc) {
int r_tgt = CallHelperSetup(helper_offset);
LoadConstant(TargetReg(kArg0), arg0);
- ClobberCalleeSave();
+ ClobberCallerSave();
CallHelper(r_tgt, helper_offset, safepoint_pc);
}
void Mir2Lir::CallRuntimeHelperReg(ThreadOffset helper_offset, int arg0, bool safepoint_pc) {
int r_tgt = CallHelperSetup(helper_offset);
OpRegCopy(TargetReg(kArg0), arg0);
- ClobberCalleeSave();
+ ClobberCallerSave();
CallHelper(r_tgt, helper_offset, safepoint_pc);
}
@@ -81,7 +81,7 @@
} else {
LoadValueDirectWideFixed(arg0, TargetReg(kArg0), TargetReg(kArg1));
}
- ClobberCalleeSave();
+ ClobberCallerSave();
CallHelper(r_tgt, helper_offset, safepoint_pc);
}
@@ -90,7 +90,7 @@
int r_tgt = CallHelperSetup(helper_offset);
LoadConstant(TargetReg(kArg0), arg0);
LoadConstant(TargetReg(kArg1), arg1);
- ClobberCalleeSave();
+ ClobberCallerSave();
CallHelper(r_tgt, helper_offset, safepoint_pc);
}
@@ -103,7 +103,7 @@
LoadValueDirectWideFixed(arg1, TargetReg(kArg1), TargetReg(kArg2));
}
LoadConstant(TargetReg(kArg0), arg0);
- ClobberCalleeSave();
+ ClobberCallerSave();
CallHelper(r_tgt, helper_offset, safepoint_pc);
}
@@ -112,7 +112,7 @@
int r_tgt = CallHelperSetup(helper_offset);
LoadValueDirectFixed(arg0, TargetReg(kArg0));
LoadConstant(TargetReg(kArg1), arg1);
- ClobberCalleeSave();
+ ClobberCallerSave();
CallHelper(r_tgt, helper_offset, safepoint_pc);
}
@@ -121,7 +121,7 @@
int r_tgt = CallHelperSetup(helper_offset);
OpRegCopy(TargetReg(kArg1), arg1);
LoadConstant(TargetReg(kArg0), arg0);
- ClobberCalleeSave();
+ ClobberCallerSave();
CallHelper(r_tgt, helper_offset, safepoint_pc);
}
@@ -130,7 +130,7 @@
int r_tgt = CallHelperSetup(helper_offset);
OpRegCopy(TargetReg(kArg0), arg0);
LoadConstant(TargetReg(kArg1), arg1);
- ClobberCalleeSave();
+ ClobberCallerSave();
CallHelper(r_tgt, helper_offset, safepoint_pc);
}
@@ -138,7 +138,7 @@
int r_tgt = CallHelperSetup(helper_offset);
LoadCurrMethodDirect(TargetReg(kArg1));
LoadConstant(TargetReg(kArg0), arg0);
- ClobberCalleeSave();
+ ClobberCallerSave();
CallHelper(r_tgt, helper_offset, safepoint_pc);
}
@@ -168,7 +168,7 @@
LoadValueDirectWideFixed(arg1, arg1.fp ? TargetReg(kFArg2) : TargetReg(kArg2), arg1.fp ? TargetReg(kFArg3) : TargetReg(kArg3));
}
}
- ClobberCalleeSave();
+ ClobberCallerSave();
CallHelper(r_tgt, helper_offset, safepoint_pc);
}
@@ -178,7 +178,7 @@
DCHECK_NE(TargetReg(kArg0), arg1); // check copy into arg0 won't clobber arg1
OpRegCopy(TargetReg(kArg0), arg0);
OpRegCopy(TargetReg(kArg1), arg1);
- ClobberCalleeSave();
+ ClobberCallerSave();
CallHelper(r_tgt, helper_offset, safepoint_pc);
}
@@ -189,7 +189,7 @@
OpRegCopy(TargetReg(kArg0), arg0);
OpRegCopy(TargetReg(kArg1), arg1);
LoadConstant(TargetReg(kArg2), arg2);
- ClobberCalleeSave();
+ ClobberCallerSave();
CallHelper(r_tgt, helper_offset, safepoint_pc);
}
@@ -199,7 +199,7 @@
LoadValueDirectFixed(arg2, TargetReg(kArg2));
LoadCurrMethodDirect(TargetReg(kArg1));
LoadConstant(TargetReg(kArg0), arg0);
- ClobberCalleeSave();
+ ClobberCallerSave();
CallHelper(r_tgt, helper_offset, safepoint_pc);
}
@@ -209,7 +209,7 @@
LoadCurrMethodDirect(TargetReg(kArg1));
LoadConstant(TargetReg(kArg2), arg2);
LoadConstant(TargetReg(kArg0), arg0);
- ClobberCalleeSave();
+ ClobberCallerSave();
CallHelper(r_tgt, helper_offset, safepoint_pc);
}
@@ -225,7 +225,7 @@
LoadValueDirectWideFixed(arg2, TargetReg(kArg2), TargetReg(kArg3));
}
LoadConstant(TargetReg(kArg0), arg0);
- ClobberCalleeSave();
+ ClobberCallerSave();
CallHelper(r_tgt, helper_offset, safepoint_pc);
}
@@ -240,7 +240,7 @@
LoadValueDirectFixed(arg1, TargetReg(kArg1));
DCHECK_EQ(arg1.wide, 0U);
LoadValueDirectFixed(arg2, TargetReg(kArg2));
- ClobberCalleeSave();
+ ClobberCallerSave();
CallHelper(r_tgt, helper_offset, safepoint_pc);
}
@@ -1083,7 +1083,7 @@
// TODO - add Mips implementation
return false;
}
- ClobberCalleeSave();
+ ClobberCallerSave();
LockCallTemps(); // Using fixed registers
int reg_ptr = TargetReg(kArg0);
int reg_char = TargetReg(kArg1);
@@ -1126,7 +1126,7 @@
// TODO - add Mips implementation
return false;
}
- ClobberCalleeSave();
+ ClobberCallerSave();
LockCallTemps(); // Using fixed registers
int reg_this = TargetReg(kArg0);
int reg_cmp = TargetReg(kArg1);
@@ -1341,7 +1341,7 @@
}
MarkSafepointPC(call_inst);
- ClobberCalleeSave();
+ ClobberCallerSave();
if (info->result.location != kLocInvalid) {
// We have a following MOVE_RESULT - do it now.
if (info->result.wide) {
diff --git a/compiler/dex/quick/mips/call_mips.cc b/compiler/dex/quick/mips/call_mips.cc
index 18c8cf8..21d5563 100644
--- a/compiler/dex/quick/mips/call_mips.cc
+++ b/compiler/dex/quick/mips/call_mips.cc
@@ -253,7 +253,7 @@
NewLIR4(kMipsDelta, rMIPS_ARG1, 0, WrapPointer(base_label), WrapPointer(tab_rec));
// And go...
- ClobberCalleeSave();
+ ClobberCallerSave();
LIR* call_inst = OpReg(kOpBlx, r_tgt); // ( array*, fill_data* )
MarkSafepointPC(call_inst);
}
diff --git a/compiler/dex/quick/mips/codegen_mips.h b/compiler/dex/quick/mips/codegen_mips.h
index 5dda445..450a44f 100644
--- a/compiler/dex/quick/mips/codegen_mips.h
+++ b/compiler/dex/quick/mips/codegen_mips.h
@@ -61,7 +61,7 @@
uint32_t FpRegMask();
uint64_t GetRegMaskCommon(int reg);
void AdjustSpillMask();
- void ClobberCalleeSave();
+ void ClobberCallerSave();
void FlushReg(int reg);
void FlushRegWide(int reg1, int reg2);
void FreeCallTemps();
diff --git a/compiler/dex/quick/mips/target_mips.cc b/compiler/dex/quick/mips/target_mips.cc
index 9c598e6..869706f 100644
--- a/compiler/dex/quick/mips/target_mips.cc
+++ b/compiler/dex/quick/mips/target_mips.cc
@@ -346,7 +346,7 @@
}
/* Clobber all regs that might be used by an external C call */
-void MipsMir2Lir::ClobberCalleeSave() {
+void MipsMir2Lir::ClobberCallerSave() {
Clobber(r_ZERO);
Clobber(r_AT);
Clobber(r_V0);
diff --git a/compiler/dex/quick/mir_to_lir.h b/compiler/dex/quick/mir_to_lir.h
index fae6c4c..06cec53 100644
--- a/compiler/dex/quick/mir_to_lir.h
+++ b/compiler/dex/quick/mir_to_lir.h
@@ -621,7 +621,7 @@
virtual uint32_t FpRegMask() = 0;
virtual uint64_t GetRegMaskCommon(int reg) = 0;
virtual void AdjustSpillMask() = 0;
- virtual void ClobberCalleeSave() = 0;
+ virtual void ClobberCallerSave() = 0;
virtual void FlushReg(int reg) = 0;
virtual void FlushRegWide(int reg1, int reg2) = 0;
virtual void FreeCallTemps() = 0;
diff --git a/compiler/dex/quick/x86/codegen_x86.h b/compiler/dex/quick/x86/codegen_x86.h
index ffe2d67..805ef29 100644
--- a/compiler/dex/quick/x86/codegen_x86.h
+++ b/compiler/dex/quick/x86/codegen_x86.h
@@ -61,7 +61,7 @@
uint32_t FpRegMask();
uint64_t GetRegMaskCommon(int reg);
void AdjustSpillMask();
- void ClobberCalleeSave();
+ void ClobberCallerSave();
void FlushReg(int reg);
void FlushRegWide(int reg1, int reg2);
void FreeCallTemps();
diff --git a/compiler/dex/quick/x86/target_x86.cc b/compiler/dex/quick/x86/target_x86.cc
index 878fa76..cbd0f15 100644
--- a/compiler/dex/quick/x86/target_x86.cc
+++ b/compiler/dex/quick/x86/target_x86.cc
@@ -350,10 +350,11 @@
}
/* Clobber all regs that might be used by an external C call */
-void X86Mir2Lir::ClobberCalleeSave() {
+void X86Mir2Lir::ClobberCallerSave() {
Clobber(rAX);
Clobber(rCX);
Clobber(rDX);
+ Clobber(rBX);
}
RegLocation X86Mir2Lir::GetReturnWideAlt() {