From 80191dcab7cd9f226cf6db190d43161c361b65d6 Mon Sep 17 00:00:00 2001 From: Michael Munday Date: Wed, 4 Jan 2017 15:34:30 -0500 Subject: [PATCH] Implement cont_cat. Required to pass cat tests. --- src/vm_s390x.dasc | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/vm_s390x.dasc b/src/vm_s390x.dasc index 7e369f0b..51c60024 100644 --- a/src/vm_s390x.dasc +++ b/src/vm_s390x.dasc @@ -651,8 +651,21 @@ static void build_subroutines(BuildCtx *ctx) |.endif | |->cont_cat: // BASE = base, RC = result, RB = mbase - | stg r0, 0(r0) - | stg r0, 0(r0) + | llgc RA, PC_RB + | sllg RA, RA, 3(r0) + | aghi RB, -32 + | la RA, 0(RA, BASE) + | sgr RA, RB + | je ->cont_ra + | lcgr RA, RA + | srlg RA, RA, 3(r0) + | lg L:CARG1, SAVE_L + | stg BASE, L:CARG1->base + | lgfr CARG3, RA + | lg RA, 0(RC) + | stg RA, 0(RB) + | lgr CARG2, RB + | j ->BC_CAT_Z | |//-- Table indexing metamethods ----------------------------------------- | @@ -1347,8 +1360,15 @@ static void build_subroutines(BuildCtx *ctx) | j ->vm_call_dispatch | |.ffunc_2 xpcall - | stg r0, 0(r0) - | stg r0, 0(r0) + | lg LFUNC:RA, 8(BASE) + | checktp_nc LFUNC:RA, LJ_TFUNC, ->fff_fallback + | lg LFUNC:RB, 0(BASE) // Swap function and traceback. + | stg LFUNC:RA, 0(BASE) + | stg LFUNC:RB, 8(BASE) + | la RA, 24(BASE) + | aghi NARGS:RD, -2 + | lghi PC, 24+FRAME_PCALL + | j <1 | |//-- Coroutine library -------------------------------------------------- |