diff options
| -rw-r--r-- | src/buildvm_ppc.dasc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/buildvm_ppc.dasc b/src/buildvm_ppc.dasc index a6ac25e2..d059843d 100644 --- a/src/buildvm_ppc.dasc +++ b/src/buildvm_ppc.dasc | |||
| @@ -37,6 +37,8 @@ | |||
| 37 | |.define TISTAB, r24 | 37 | |.define TISTAB, r24 |
| 38 | |.define TISFUNC, r25 | 38 | |.define TISFUNC, r25 |
| 39 | |.define TISNIL, r26 | 39 | |.define TISNIL, r26 |
| 40 | |.define TOBIT, r27 | ||
| 41 | |.define ZERO, TOBIT // Zero in lo word. | ||
| 40 | |.endif | 42 | |.endif |
| 41 | | | 43 | | |
| 42 | |// The following temporaries are not saved across C calls, except for RA. | 44 | |// The following temporaries are not saved across C calls, except for RA. |
| @@ -476,13 +478,16 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 476 | | lwz TMP1, L->top | 478 | | lwz TMP1, L->top |
| 477 | | evsplati TISFUNC, LJ_TFUNC | 479 | | evsplati TISFUNC, LJ_TFUNC |
| 478 | | add PC, PC, BASE | 480 | | add PC, PC, BASE |
| 479 | | li_vmstate INTERP | ||
| 480 | | evsplati TISTAB, LJ_TTAB | 481 | | evsplati TISTAB, LJ_TTAB |
| 482 | | lus TOBIT, 0x4338 | ||
| 483 | | li TMP0, 0 | ||
| 481 | | sub PC, PC, TMP2 // PC = frame delta + frame type | 484 | | sub PC, PC, TMP2 // PC = frame delta + frame type |
| 482 | | st_vmstate | ||
| 483 | | evsplati TISSTR, LJ_TSTR | 485 | | evsplati TISSTR, LJ_TSTR |
| 484 | | sub NARGS8:RC, TMP1, BASE | 486 | | sub NARGS8:RC, TMP1, BASE |
| 487 | | evmergelo TOBIT, TOBIT, TMP0 | ||
| 488 | | li_vmstate INTERP | ||
| 485 | | evsplati TISNIL, LJ_TNIL | 489 | | evsplati TISNIL, LJ_TNIL |
| 490 | | st_vmstate | ||
| 486 | | | 491 | | |
| 487 | |->vm_call_dispatch: | 492 | |->vm_call_dispatch: |
| 488 | | // TMP2 = old base, BASE = new base, RC = nargs*8, PC = caller PC | 493 | | // TMP2 = old base, BASE = new base, RC = nargs*8, PC = caller PC |
| @@ -500,7 +505,6 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 500 | | // (lua_State *L, lua_CFunction func, void *ud, lua_CPFunction cp) | 505 | | // (lua_State *L, lua_CFunction func, void *ud, lua_CPFunction cp) |
| 501 | | saveregs | 506 | | saveregs |
| 502 | | mr L, CARG1 | 507 | | mr L, CARG1 |
| 503 | | mtctr CARG4 | ||
| 504 | | lwz TMP0, L:CARG1->stack | 508 | | lwz TMP0, L:CARG1->stack |
| 505 | | stw CARG1, SAVE_L | 509 | | stw CARG1, SAVE_L |
| 506 | | lwz TMP1, L->top | 510 | | lwz TMP1, L->top |
| @@ -512,6 +516,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 512 | | stw TMP0, SAVE_NRES // Neg. delta means cframe w/o frame. | 516 | | stw TMP0, SAVE_NRES // Neg. delta means cframe w/o frame. |
| 513 | | stw TMP2, SAVE_ERRF // No error function. | 517 | | stw TMP2, SAVE_ERRF // No error function. |
| 514 | | stw TMP1, SAVE_CFRAME | 518 | | stw TMP1, SAVE_CFRAME |
| 519 | | mtctr CARG4 | ||
| 515 | | bctrl // (lua_State *L, lua_CFunction func, void *ud) | 520 | | bctrl // (lua_State *L, lua_CFunction func, void *ud) |
| 516 | | mr. BASE, CRET1 | 521 | | mr. BASE, CRET1 |
| 517 | | lwz DISPATCH, L->glref // Setup pointer to dispatch table. | 522 | | lwz DISPATCH, L->glref // Setup pointer to dispatch table. |
