Use r15 instead of r13 in generic return dec-refs

This avoids a bad interaction with LinearScan, which saves the return
value in r13 and r14 around GenericRetDecRefs.  Effectively, this diff
ends up saving a push, a pop, and some stack adjustment in
GenericRetDecRefs.
Esse commit está contido em:
Guilherme Ottoni
2013-05-23 17:52:39 -07:00
commit de Sara Golemon
commit 975afed427
2 arquivos alterados com 9 adições e 9 exclusões
+7 -7
Ver Arquivo
@@ -2706,13 +2706,13 @@ void CodeGenerator::cgGenericRetDecRefs(IRInstruction* inst) {
if (numLocals == 0) return;
// The helpers called below use a special ABI, in which r13 is not saved.
// So save r13 on the stack if it's live.
bool saveR13 = m_state.liveRegs[inst].contains(r13);
// The helpers called below use a special ABI, in which r15 is not saved.
// So save r15 on the stack if it's live.
bool saveR15 = m_state.liveRegs[inst].contains(r15);
int stackAdjust = 8;
if (saveR13) {
a.push(r13);
if (saveR15) {
a.push(r15);
stackAdjust = 16;
}
@@ -2725,9 +2725,9 @@ void CodeGenerator::cgGenericRetDecRefs(IRInstruction* inst) {
a.call(target);
recordSyncPoint(a);
if (saveR13) {
if (saveR15) {
a.addq(8, rsp);
a.pop(r13);
a.pop(r15);
}
}
+2 -2
Ver Arquivo
@@ -11000,12 +11000,12 @@ void TranslatorX64::emitFreeLocalsHelpers() {
Label loopHead;
/*
* Note: the IR currently requires that we preserve r14/r15 across
* Note: the IR currently requires that we preserve r13/r14 across
* calls to these free locals helpers.
*/
static_assert(rVmSp == rbx, "");
auto const rIter = rbx;
auto const rFinished = r13;
auto const rFinished = r15;
auto const rType = esi;
auto const rData = rdi;