aboutsummaryrefslogtreecommitdiff
path: root/src/lj_ffrecord.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lj_ffrecord.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/lj_ffrecord.c b/src/lj_ffrecord.c
index 24432d84..01e53fb6 100644
--- a/src/lj_ffrecord.c
+++ b/src/lj_ffrecord.c
@@ -521,6 +521,40 @@ static void LJ_FASTCALL recff_getfenv(jit_State *J, RecordFFData *rd)
521 recff_nyiu(J, rd); 521 recff_nyiu(J, rd);
522} 522}
523 523
524static void LJ_FASTCALL recff_next(jit_State *J, RecordFFData *rd)
525{
526#if LJ_BE
527 /* YAGNI: Disabled on big-endian due to issues with lj_vm_next,
528 ** IR_HIOP, RID_RETLO/RID_RETHI and ra_destpair.
529 */
530 recff_nyi(J, rd);
531#else
532 TRef tab = J->base[0];
533 if (tref_istab(tab)) {
534 RecordIndex ix;
535 cTValue *keyv;
536 ix.tab = tab;
537 if (tref_isnil(J->base[1])) { /* Shortcut for start of traversal. */
538 ix.key = lj_ir_kint(J, 0);
539 keyv = niltvg(J2G(J));
540 } else {
541 TRef tmp = recff_tmpref(J, J->base[1], IRTMPREF_IN1);
542 ix.key = lj_ir_call(J, IRCALL_lj_tab_keyindex, tab, tmp);
543 keyv = &rd->argv[1];
544 }
545 copyTV(J->L, &ix.tabv, &rd->argv[0]);
546 ix.keyv.u32.lo = lj_tab_keyindex(tabV(&ix.tabv), keyv);
547 /* Omit the value, if not used by the caller. */
548 ix.idxchain = (J->framedepth && frame_islua(J->L->base-1) &&
549 bc_b(frame_pc(J->L->base-1)[-1]) <= 2);
550 ix.mobj = 0; /* We don't need the next index. */
551 rd->nres = lj_record_next(J, &ix);
552 J->base[0] = ix.key;
553 J->base[1] = ix.val;
554 } /* else: Interpreter will throw. */
555#endif
556}
557
524/* -- Math library fast functions ----------------------------------------- */ 558/* -- Math library fast functions ----------------------------------------- */
525 559
526static void LJ_FASTCALL recff_math_abs(jit_State *J, RecordFFData *rd) 560static void LJ_FASTCALL recff_math_abs(jit_State *J, RecordFFData *rd)