mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-12 17:24:09 +00:00
PPC: Add next() and pairs() fast functions.
This commit is contained in:
parent
dcf006bfa2
commit
61d498be87
@ -939,14 +939,43 @@ static void build_subroutines(BuildCtx *ctx)
|
|||||||
|
|
|
|
||||||
|//-- Base library: iterators -------------------------------------------
|
|//-- Base library: iterators -------------------------------------------
|
||||||
|
|
|
|
||||||
|.ffunc_1 next
|
|.ffunc next
|
||||||
| NYI
|
| cmplwi NARGS8:RC, 8
|
||||||
|
|
| evldd CARG2, 0(BASE)
|
||||||
|->fff_res2:
|
| blt ->fff_fallback
|
||||||
| NYI
|
| evstddx TISNIL, BASE, NARGS8:RC // Set missing 2nd arg to nil.
|
||||||
|
| checktab TAB:CARG2
|
||||||
|
| lwz PC, FRAME_PC(BASE)
|
||||||
|
| checkfail ->fff_fallback
|
||||||
|
| stw BASE, L->base // Add frame since C call can throw.
|
||||||
|
| mr CARG1, L
|
||||||
|
| stw BASE, L->top // Dummy frame length is ok.
|
||||||
|
| la CARG3, 8(BASE)
|
||||||
|
| stw PC, SAVE_PC
|
||||||
|
| bl extern lj_tab_next // (lua_State *L, GCtab *t, TValue *key)
|
||||||
|
| // Returns 0 at end of traversal.
|
||||||
|
| cmplwi CRET1, 0
|
||||||
|
| evmr CRET1, TISNIL
|
||||||
|
| beq ->fff_restv // End of traversal: return nil.
|
||||||
|
| evldd TMP0, 8(BASE) // Copy key and value to results.
|
||||||
|
| la RA, -8(BASE)
|
||||||
|
| evldd TMP1, 16(BASE)
|
||||||
|
| evstdd TMP0, 0(RA)
|
||||||
|
| li RD, (2+1)*8
|
||||||
|
| evstdd TMP1, 8(RA)
|
||||||
|
| b ->fff_res
|
||||||
|
|
|
|
||||||
|.ffunc_1 pairs
|
|.ffunc_1 pairs
|
||||||
| NYI
|
| checktab TAB:CARG1
|
||||||
|
| lwz PC, FRAME_PC(BASE)
|
||||||
|
| checkfail ->fff_fallback
|
||||||
|
| evldd CFUNC:TMP0, CFUNC:RB->upvalue[0]
|
||||||
|
| la RA, -8(BASE)
|
||||||
|
| evstdd TAB:CARG1, 0(BASE)
|
||||||
|
| evstdd TISNIL, 8(BASE)
|
||||||
|
| li RD, (3+1)*8
|
||||||
|
| evstdd CFUNC:TMP0, 0(RA)
|
||||||
|
| b ->fff_res
|
||||||
|
|
|
|
||||||
|.ffunc_1 ipairs_aux
|
|.ffunc_1 ipairs_aux
|
||||||
| NYI
|
| NYI
|
||||||
|
Loading…
Reference in New Issue
Block a user