diff options
Diffstat (limited to 'src/lj_ffrecord.c')
-rw-r--r-- | src/lj_ffrecord.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/lj_ffrecord.c b/src/lj_ffrecord.c index 31f9b390..fcc46319 100644 --- a/src/lj_ffrecord.c +++ b/src/lj_ffrecord.c | |||
@@ -119,6 +119,13 @@ static void LJ_FASTCALL recff_c(jit_State *J, RecordFFData *rd) | |||
119 | UNUSED(rd); | 119 | UNUSED(rd); |
120 | } | 120 | } |
121 | 121 | ||
122 | /* Emit BUFHDR for the global temporary buffer. */ | ||
123 | static TRef recff_bufhdr(jit_State *J) | ||
124 | { | ||
125 | return emitir(IRT(IR_BUFHDR, IRT_P32), | ||
126 | lj_ir_kptr(J, &J2G(J)->tmpbuf), IRBUFHDR_RESET); | ||
127 | } | ||
128 | |||
122 | /* -- Base library fast functions ----------------------------------------- */ | 129 | /* -- Base library fast functions ----------------------------------------- */ |
123 | 130 | ||
124 | static void LJ_FASTCALL recff_assert(jit_State *J, RecordFFData *rd) | 131 | static void LJ_FASTCALL recff_assert(jit_State *J, RecordFFData *rd) |
@@ -645,15 +652,19 @@ static void LJ_FASTCALL recff_bit_shift(jit_State *J, RecordFFData *rd) | |||
645 | } | 652 | } |
646 | } | 653 | } |
647 | 654 | ||
648 | /* -- String library fast functions --------------------------------------- */ | 655 | static void LJ_FASTCALL recff_bit_tohex(jit_State *J, RecordFFData *rd) |
649 | |||
650 | /* Emit BUFHDR for the global temporary buffer. */ | ||
651 | static TRef recff_bufhdr(jit_State *J) | ||
652 | { | 656 | { |
653 | return emitir(IRT(IR_BUFHDR, IRT_P32), | 657 | #if LJ_HASFFI |
654 | lj_ir_kptr(J, &J2G(J)->tmpbuf), IRBUFHDR_RESET); | 658 | TRef hdr = recff_bufhdr(J); |
659 | TRef tr = recff_bit64_tohex(J, rd, hdr); | ||
660 | J->base[0] = emitir(IRT(IR_BUFSTR, IRT_STR), tr, hdr); | ||
661 | #else | ||
662 | recff_nyiu(J); /* Don't bother working around this NYI. */ | ||
663 | #endif | ||
655 | } | 664 | } |
656 | 665 | ||
666 | /* -- String library fast functions --------------------------------------- */ | ||
667 | |||
657 | /* Specialize to relative starting position for string. */ | 668 | /* Specialize to relative starting position for string. */ |
658 | static TRef recff_string_start(jit_State *J, GCstr *s, int32_t *st, TRef tr, | 669 | static TRef recff_string_start(jit_State *J, GCstr *s, int32_t *st, TRef tr, |
659 | TRef trlen, TRef tr0) | 670 | TRef trlen, TRef tr0) |