From Lua 5.2: Add string.rep(s, n, sep).

This commit is contained in:
Mike Pall
2012-10-07 17:11:39 +02:00
parent 0561a56938
commit 2f5ed5d0df
6 changed files with 40 additions and 13 deletions

View File

@@ -2437,8 +2437,9 @@ static void build_subroutines(BuildCtx *ctx)
| xor RC, RC // Zero length. Any ptr in RB is ok.
| jmp <4
|
|.ffunc_2 string_rep // Only handle the 1-char case inline.
|.ffunc string_rep // Only handle the 1-char case inline.
| ffgccheck
| cmp NARGS:RD, 2+1; jne ->fff_fallback // Exactly 2 arguments.
| cmp dword [BASE+4], LJ_TSTR; jne ->fff_fallback
| cmp dword [BASE+12], LJ_TISNUM
| mov STR:RB, [BASE]