Save and restore registers across calls to unlockClosure.

We may not assume that registers are saved across calls to unlockClosure because
it could call a C function on some platforms.
parent f9265dd3
......@@ -509,7 +509,12 @@ INFO_TABLE_RET ( stg_block_takemvar, RET_SMALL, W_ info_ptr, P_ mvar )
// code fragment executed just before we return to the scheduler
stg_block_takemvar_finally
{
W_ r1, r3;
r1 = R1;
r3 = R3;
unlockClosure(R3, stg_MVAR_DIRTY_info);
R1 = r1;
R3 = r3;
jump StgReturn [R1];
}
......@@ -532,7 +537,12 @@ INFO_TABLE_RET( stg_block_putmvar, RET_SMALL, W_ info_ptr,
// code fragment executed just before we return to the scheduler
stg_block_putmvar_finally
{
W_ r1, r3;
r1 = R1;
r3 = R3;
unlockClosure(R3, stg_MVAR_DIRTY_info);
R1 = r1;
R3 = r3;
jump StgReturn [R1];
}
......@@ -565,7 +575,10 @@ stg_block_throwto_finally
// unlocked. It may have been unlocked if we revoked the message
// due to an exception being raised during threadPaused().
if (StgHeader_info(StgTSO_block_info(CurrentTSO)) == stg_WHITEHOLE_info) {
W_ r1;
r1 = R1;
unlockClosure(StgTSO_block_info(CurrentTSO), stg_MSG_THROWTO_info);
R1 = r1;
}
jump StgReturn [R1];
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment