Don't use stack unwinding for lua_yield().

This commit is contained in:
Mike Pall
2012-10-09 13:19:57 +02:00
parent da682b0e91
commit eabfdfe1aa
6 changed files with 35 additions and 17 deletions

View File

@@ -294,10 +294,13 @@ static void build_subroutines(BuildCtx *ctx)
| stwu TMP1, FRAME_PC(RA) // Prepend true to results.
|
|->vm_returnc:
| andi. TMP0, PC, FRAME_TYPE
| addi RD, RD, 8 // RD = (nresults+1)*8.
| mr MULTRES, RD
| beq ->BC_RET_Z // Handle regular return to Lua.
| addi RD, RD, 8 // RD = (nresults+1)*8.
| andi. TMP0, PC, FRAME_TYPE
| cmpwi cr1, RD, 0
| li CRET1, LUA_YIELD
| beq cr1, ->vm_unwind_c_eh
| mr MULTRES, RD
| beq ->BC_RET_Z // Handle regular return to Lua.
|
|->vm_return:
| // BASE = base, RA = resultptr, RD/MULTRES = (nresults+1)*8, PC = return