aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2011-07-25 10:06:06 +0200
committerMike Pall <mike>2011-07-25 10:06:06 +0200
commit26106759d422438b1b3e974c43fd9f38ea055bdf (patch)
tree45bbc15d45908fc0c1658928b4eea69e6ecde300 /src
parent551f09cebd4c6e0e9722d52346ffd9b45d459d25 (diff)
downloadluajit-26106759d422438b1b3e974c43fd9f38ea055bdf.tar.gz
luajit-26106759d422438b1b3e974c43fd9f38ea055bdf.tar.bz2
luajit-26106759d422438b1b3e974c43fd9f38ea055bdf.zip
PPC: Fix floor/ceil for dual-number mode.
Diffstat (limited to 'src')
-rw-r--r--src/buildvm_ppc.dasc1
-rw-r--r--src/buildvm_ppc.h958
2 files changed, 481 insertions, 478 deletions
diff --git a/src/buildvm_ppc.dasc b/src/buildvm_ppc.dasc
index 9130ee41..90163e9d 100644
--- a/src/buildvm_ppc.dasc
+++ b/src/buildvm_ppc.dasc
@@ -1608,6 +1608,7 @@ static void build_subroutines(BuildCtx *ctx)
1608 | lus CARG1, 0x8000 // -(2^31). 1608 | lus CARG1, 0x8000 // -(2^31).
1609 | beq ->fff_resi 1609 | beq ->fff_resi
1610 |5: 1610 |5:
1611 | lfd FARG1, 0(BASE)
1611 | bl extern func 1612 | bl extern func
1612 | b ->fff_resn 1613 | b ->fff_resn
1613 |.endmacro 1614 |.endmacro
diff --git a/src/buildvm_ppc.h b/src/buildvm_ppc.h
index ba8d2862..fbe943ed 100644
--- a/src/buildvm_ppc.h
+++ b/src/buildvm_ppc.h
@@ -12,7 +12,7 @@
12#define DASM_SECTION_CODE_OP 0 12#define DASM_SECTION_CODE_OP 0
13#define DASM_SECTION_CODE_SUB 1 13#define DASM_SECTION_CODE_SUB 1
14#define DASM_MAXSECTION 2 14#define DASM_MAXSECTION 2
15static const unsigned int build_actionlist[7101] = { 15static const unsigned int build_actionlist[7103] = {
160x00010001, 160x00010001,
170x00060014, 170x00060014,
180x72000000, 180x72000000,
@@ -2047,6 +2047,7 @@ static const unsigned int build_actionlist[7101] = {
20470x41820000, 20470x41820000,
20480x0005085d, 20480x0005085d,
20490x0006000f, 20490x0006000f,
20500xc82e0000,
20500x48000001, 20510x48000001,
20510x00030010, 20520x00030010,
20520x48000000, 20530x48000000,
@@ -2117,6 +2118,7 @@ static const unsigned int build_actionlist[7101] = {
21170x41820000, 21180x41820000,
21180x0005085d, 21190x0005085d,
21190x0006000f, 21200x0006000f,
21210xc82e0000,
21200x48000001, 21220x48000001,
21210x00030011, 21230x00030011,
21220x48000000, 21240x48000000,
@@ -7638,243 +7640,243 @@ static void build_subroutines(BuildCtx *ctx)
7638 dasm_put(Dst, 1933, (1+1)*8, FRAME_TYPE); 7640 dasm_put(Dst, 1933, (1+1)*8, FRAME_TYPE);
7639 if (LJ_DUALNUM) { 7641 if (LJ_DUALNUM) {
7640 dasm_put(Dst, 1975, 31-11, 32-21, 31-11); 7642 dasm_put(Dst, 1975, 31-11, 32-21, 31-11);
7641 dasm_put(Dst, 2056, 31-11, 32-21, 31-11); 7643 dasm_put(Dst, 2057, 31-11, 32-21, 31-11);
7642 } else { 7644 } else {
7643 dasm_put(Dst, 2109); 7645 dasm_put(Dst, 2111);
7644 } 7646 }
7645 dasm_put(Dst, 2136); 7647 dasm_put(Dst, 2138);
7646 dasm_put(Dst, 2195); 7648 dasm_put(Dst, 2197);
7647 dasm_put(Dst, 2253); 7649 dasm_put(Dst, 2255);
7648 dasm_put(Dst, 2309, Dt8(->upvalue[0])); 7650 dasm_put(Dst, 2311, Dt8(->upvalue[0]));
7649 dasm_put(Dst, 2375); 7651 dasm_put(Dst, 2377);
7650 if (LJ_DUALNUM) { 7652 if (LJ_DUALNUM) {
7651 dasm_put(Dst, 2379); 7653 dasm_put(Dst, 2381);
7652 } else { 7654 } else {
7653 dasm_put(Dst, 2394); 7655 dasm_put(Dst, 2396);
7654 } 7656 }
7655 dasm_put(Dst, 2412, DISPATCH_GL(tmptv), DISPATCH_GL(tmptv)); 7657 dasm_put(Dst, 2414, DISPATCH_GL(tmptv), DISPATCH_GL(tmptv));
7656 if (!LJ_DUALNUM) { 7658 if (!LJ_DUALNUM) {
7657 dasm_put(Dst, 2434); 7659 dasm_put(Dst, 2436);
7658 } 7660 }
7659 dasm_put(Dst, 2439, (2+1)*8); 7661 dasm_put(Dst, 2441, (2+1)*8);
7660 if (LJ_DUALNUM) { 7662 if (LJ_DUALNUM) {
7661 dasm_put(Dst, 2443); 7663 dasm_put(Dst, 2445);
7662 } else { 7664 } else {
7663 dasm_put(Dst, 2446); 7665 dasm_put(Dst, 2448);
7664 } 7666 }
7665 dasm_put(Dst, 2448, (2+1)*8); 7667 dasm_put(Dst, 2450, (2+1)*8);
7666 if (LJ_DUALNUM) { 7668 if (LJ_DUALNUM) {
7667 dasm_put(Dst, 2470); 7669 dasm_put(Dst, 2472);
7668 } else { 7670 } else {
7669 dasm_put(Dst, 2539); 7671 dasm_put(Dst, 2541);
7670 } 7672 }
7671 if (LJ_DUALNUM) { 7673 if (LJ_DUALNUM) {
7672 dasm_put(Dst, 2564); 7674 dasm_put(Dst, 2566);
7673 } else { 7675 } else {
7674 dasm_put(Dst, 2633); 7676 dasm_put(Dst, 2635);
7675 } 7677 }
7676 dasm_put(Dst, 2658, LJ_TSTR, Dt5(->len), LJ_TSTR, Dt5(->len)); 7678 dasm_put(Dst, 2660, LJ_TSTR, Dt5(->len), LJ_TSTR, Dt5(->len));
7677 if (LJ_DUALNUM) { 7679 if (LJ_DUALNUM) {
7678 dasm_put(Dst, 2685, Dt5([1]), (0+1)*8); 7680 dasm_put(Dst, 2687, Dt5([1]), (0+1)*8);
7679 } else { 7681 } else {
7680 dasm_put(Dst, 2697, Dt5([1]), 31-3); 7682 dasm_put(Dst, 2699, Dt5([1]), 31-3);
7681 } 7683 }
7682 dasm_put(Dst, 2713, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold)); 7684 dasm_put(Dst, 2715, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold));
7683 if (LJ_DUALNUM) { 7685 if (LJ_DUALNUM) {
7684 dasm_put(Dst, 2724); 7686 dasm_put(Dst, 2726);
7685 } else { 7687 } else {
7686 dasm_put(Dst, 2732); 7688 dasm_put(Dst, 2734);
7687 } 7689 }
7688 dasm_put(Dst, 2743, Dt1(->base), Dt1(->base), LJ_TSTR, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold)); 7690 dasm_put(Dst, 2745, Dt1(->base), Dt1(->base), LJ_TSTR, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold));
7689 if (!LJ_DUALNUM) { 7691 if (!LJ_DUALNUM) {
7690 dasm_put(Dst, 2771); 7692 dasm_put(Dst, 2773);
7691 } 7693 }
7692 dasm_put(Dst, 2773); 7694 dasm_put(Dst, 2775);
7693 if (LJ_DUALNUM) { 7695 if (LJ_DUALNUM) {
7694 dasm_put(Dst, 2779);
7695 } else {
7696 dasm_put(Dst, 2781); 7696 dasm_put(Dst, 2781);
7697 } else {
7698 dasm_put(Dst, 2783);
7697 } 7699 }
7698 dasm_put(Dst, 2783); 7700 dasm_put(Dst, 2785);
7699 if (LJ_DUALNUM) { 7701 if (LJ_DUALNUM) {
7700 dasm_put(Dst, 2787); 7702 dasm_put(Dst, 2789);
7701 } else { 7703 } else {
7702 dasm_put(Dst, 2796); 7704 dasm_put(Dst, 2798);
7703 } 7705 }
7704 dasm_put(Dst, 2807, LJ_TSTR); 7706 dasm_put(Dst, 2809, LJ_TSTR);
7705 if (!LJ_DUALNUM) { 7707 if (!LJ_DUALNUM) {
7706 dasm_put(Dst, 2812); 7708 dasm_put(Dst, 2814);
7707 } 7709 }
7708 dasm_put(Dst, 2816, Dt5(->len), sizeof(GCstr)-1, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold)); 7710 dasm_put(Dst, 2818, Dt5(->len), sizeof(GCstr)-1, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold));
7709 if (LJ_DUALNUM) { 7711 if (LJ_DUALNUM) {
7710 dasm_put(Dst, 2866);
7711 } else {
7712 dasm_put(Dst, 2868); 7712 dasm_put(Dst, 2868);
7713 } else {
7714 dasm_put(Dst, 2870);
7713 } 7715 }
7714 dasm_put(Dst, 2870, LJ_TSTR); 7716 dasm_put(Dst, 2872, LJ_TSTR);
7715 if (LJ_DUALNUM) { 7717 if (LJ_DUALNUM) {
7716 dasm_put(Dst, 2877); 7718 dasm_put(Dst, 2879);
7717 } else { 7719 } else {
7718 dasm_put(Dst, 2881); 7720 dasm_put(Dst, 2883);
7719 } 7721 }
7720 dasm_put(Dst, 2888, Dt5(->len), DISPATCH_GL(tmpbuf.sz), Dt5([1]), DISPATCH_GL(tmpbuf.buf), DISPATCH_GL(strempty), LJ_TSTR, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), LJ_TSTR, DISPATCH_GL(tmpbuf.sz)); 7722 dasm_put(Dst, 2890, Dt5(->len), DISPATCH_GL(tmpbuf.sz), Dt5([1]), DISPATCH_GL(tmpbuf.buf), DISPATCH_GL(strempty), LJ_TSTR, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), LJ_TSTR, DISPATCH_GL(tmpbuf.sz));
7721 dasm_put(Dst, 2941, Dt5(->len), sizeof(GCstr), DISPATCH_GL(tmpbuf.buf), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), LJ_TSTR, DISPATCH_GL(tmpbuf.sz), Dt5(->len), sizeof(GCstr), DISPATCH_GL(tmpbuf.buf)); 7723 dasm_put(Dst, 2943, Dt5(->len), sizeof(GCstr), DISPATCH_GL(tmpbuf.buf), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), LJ_TSTR, DISPATCH_GL(tmpbuf.sz), Dt5(->len), sizeof(GCstr), DISPATCH_GL(tmpbuf.buf));
7722 dasm_put(Dst, 2999, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), LJ_TSTR, DISPATCH_GL(tmpbuf.sz), Dt5(->len), sizeof(GCstr), DISPATCH_GL(tmpbuf.buf), LJ_TTAB); 7724 dasm_put(Dst, 3001, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), LJ_TSTR, DISPATCH_GL(tmpbuf.sz), Dt5(->len), sizeof(GCstr), DISPATCH_GL(tmpbuf.buf), LJ_TTAB);
7723 if (LJ_DUALNUM) { 7725 if (LJ_DUALNUM) {
7724 dasm_put(Dst, 3068); 7726 dasm_put(Dst, 3070);
7725 } else { 7727 } else {
7726 dasm_put(Dst, 3078); 7728 dasm_put(Dst, 3080);
7727 } 7729 }
7728 dasm_put(Dst, 3091); 7730 dasm_put(Dst, 3093);
7729 if (LJ_DUALNUM) { 7731 if (LJ_DUALNUM) {
7730 dasm_put(Dst, 3097);
7731 } else {
7732 dasm_put(Dst, 3099); 7732 dasm_put(Dst, 3099);
7733 } 7733 } else {
7734 dasm_put(Dst, 3101); 7734 dasm_put(Dst, 3101);
7735 }
7736 dasm_put(Dst, 3103);
7735 if (LJ_DUALNUM) { 7737 if (LJ_DUALNUM) {
7736 dasm_put(Dst, 3105); 7738 dasm_put(Dst, 3107);
7737 } else { 7739 } else {
7738 dasm_put(Dst, 3108); 7740 dasm_put(Dst, 3110);
7739 } 7741 }
7740 dasm_put(Dst, 3114); 7742 dasm_put(Dst, 3116);
7741 if (LJ_DUALNUM) { 7743 if (LJ_DUALNUM) {
7742 dasm_put(Dst, 3119); 7744 dasm_put(Dst, 3121);
7743 } else { 7745 } else {
7744 dasm_put(Dst, 3129); 7746 dasm_put(Dst, 3131);
7745 } 7747 }
7746 dasm_put(Dst, 3142); 7748 dasm_put(Dst, 3144);
7747 if (LJ_DUALNUM) { 7749 if (LJ_DUALNUM) {
7748 dasm_put(Dst, 3148);
7749 } else {
7750 dasm_put(Dst, 3150); 7750 dasm_put(Dst, 3150);
7751 } 7751 } else {
7752 dasm_put(Dst, 3152); 7752 dasm_put(Dst, 3152);
7753 }
7754 dasm_put(Dst, 3154);
7753 if (LJ_DUALNUM) { 7755 if (LJ_DUALNUM) {
7754 dasm_put(Dst, 3156); 7756 dasm_put(Dst, 3158);
7755 } else { 7757 } else {
7756 dasm_put(Dst, 3159); 7758 dasm_put(Dst, 3161);
7757 } 7759 }
7758 dasm_put(Dst, 3165); 7760 dasm_put(Dst, 3167);
7759 if (LJ_DUALNUM) { 7761 if (LJ_DUALNUM) {
7760 dasm_put(Dst, 3170); 7762 dasm_put(Dst, 3172);
7761 } else { 7763 } else {
7762 dasm_put(Dst, 3180); 7764 dasm_put(Dst, 3182);
7763 } 7765 }
7764 dasm_put(Dst, 3193); 7766 dasm_put(Dst, 3195);
7765 if (LJ_DUALNUM) { 7767 if (LJ_DUALNUM) {
7766 dasm_put(Dst, 3199);
7767 } else {
7768 dasm_put(Dst, 3201); 7768 dasm_put(Dst, 3201);
7769 } 7769 } else {
7770 dasm_put(Dst, 3203); 7770 dasm_put(Dst, 3203);
7771 }
7772 dasm_put(Dst, 3205);
7771 if (LJ_DUALNUM) { 7773 if (LJ_DUALNUM) {
7772 dasm_put(Dst, 3207); 7774 dasm_put(Dst, 3209);
7773 } else { 7775 } else {
7774 dasm_put(Dst, 3210); 7776 dasm_put(Dst, 3212);
7775 } 7777 }
7776 dasm_put(Dst, 3216); 7778 dasm_put(Dst, 3218);
7777 if (LJ_DUALNUM) { 7779 if (LJ_DUALNUM) {
7778 dasm_put(Dst, 3221); 7780 dasm_put(Dst, 3223);
7779 } else { 7781 } else {
7780 dasm_put(Dst, 3231); 7782 dasm_put(Dst, 3233);
7781 } 7783 }
7782 dasm_put(Dst, 3244); 7784 dasm_put(Dst, 3246);
7783 if (LJ_DUALNUM) { 7785 if (LJ_DUALNUM) {
7784 dasm_put(Dst, 3251); 7786 dasm_put(Dst, 3253);
7785 } else { 7787 } else {
7786 dasm_put(Dst, 3261); 7788 dasm_put(Dst, 3263);
7787 } 7789 }
7788 dasm_put(Dst, 3274); 7790 dasm_put(Dst, 3276);
7789 if (LJ_DUALNUM) { 7791 if (LJ_DUALNUM) {
7790 dasm_put(Dst, 3278); 7792 dasm_put(Dst, 3280);
7791 } else { 7793 } else {
7792 dasm_put(Dst, 3293); 7794 dasm_put(Dst, 3295);
7793 } 7795 }
7794 dasm_put(Dst, 3314); 7796 dasm_put(Dst, 3316);
7795 if (LJ_DUALNUM) { 7797 if (LJ_DUALNUM) {
7796 dasm_put(Dst, 3319); 7798 dasm_put(Dst, 3321);
7797 } else { 7799 } else {
7798 dasm_put(Dst, 3334); 7800 dasm_put(Dst, 3336);
7799 } 7801 }
7800 dasm_put(Dst, 3355); 7802 dasm_put(Dst, 3357);
7801 if (LJ_DUALNUM) { 7803 if (LJ_DUALNUM) {
7802 dasm_put(Dst, 3360); 7804 dasm_put(Dst, 3362);
7803 } else { 7805 } else {
7804 dasm_put(Dst, 3375); 7806 dasm_put(Dst, 3377);
7805 } 7807 }
7806 dasm_put(Dst, 3396); 7808 dasm_put(Dst, 3398);
7807 if (LJ_DUALNUM) { 7809 if (LJ_DUALNUM) {
7808 dasm_put(Dst, 3401); 7810 dasm_put(Dst, 3403);
7809 } else { 7811 } else {
7810 dasm_put(Dst, 3416); 7812 dasm_put(Dst, 3418);
7811 } 7813 }
7812 dasm_put(Dst, 3437); 7814 dasm_put(Dst, 3439);
7813 if (LJ_DUALNUM) { 7815 if (LJ_DUALNUM) {
7814 dasm_put(Dst, 3441); 7816 dasm_put(Dst, 3443);
7815 } else { 7817 } else {
7816 dasm_put(Dst, 3456); 7818 dasm_put(Dst, 3458);
7817 } 7819 }
7818 dasm_put(Dst, 3477); 7820 dasm_put(Dst, 3479);
7819 if (LJ_DUALNUM) { 7821 if (LJ_DUALNUM) {
7820 dasm_put(Dst, 3482); 7822 dasm_put(Dst, 3484);
7821 } else { 7823 } else {
7822 dasm_put(Dst, 3492); 7824 dasm_put(Dst, 3494);
7823 } 7825 }
7824 if (LJ_DUALNUM) { 7826 if (LJ_DUALNUM) {
7825 dasm_put(Dst, 3505); 7827 dasm_put(Dst, 3507);
7826 } else { 7828 } else {
7827 dasm_put(Dst, 3508); 7829 dasm_put(Dst, 3510);
7828 } 7830 }
7829 dasm_put(Dst, 3514); 7831 dasm_put(Dst, 3516);
7830 if (LJ_DUALNUM) { 7832 if (LJ_DUALNUM) {
7831 dasm_put(Dst, 3522); 7833 dasm_put(Dst, 3524);
7832 } 7834 }
7833 dasm_put(Dst, 3530); 7835 dasm_put(Dst, 3532);
7834 if (LJ_DUALNUM) { 7836 if (LJ_DUALNUM) {
7835 dasm_put(Dst, 3532); 7837 dasm_put(Dst, 3534);
7836 } 7838 }
7837 dasm_put(Dst, 3540, Dt8(->f), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), 31-3, Dt1(->top), Dt7(->pc), FRAME_TYPE, LUA_MINSTACK); 7839 dasm_put(Dst, 3542, Dt8(->f), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), 31-3, Dt1(->top), Dt7(->pc), FRAME_TYPE, LUA_MINSTACK);
7838 dasm_put(Dst, 3603, Dt1(->base), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); 7840 dasm_put(Dst, 3605, Dt1(->base), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top));
7839#if LJ_HASJIT 7841#if LJ_HASJIT
7840 dasm_put(Dst, 3629); 7842 dasm_put(Dst, 3631);
7841#endif 7843#endif
7842 dasm_put(Dst, 3631, DISPATCH_GL(hookmask), HOOK_ACTIVE, GG_DISP2STATIC, DISPATCH_GL(hookmask), DISPATCH_GL(hookcount), HOOK_ACTIVE, 31-LUA_HOOKLINE, DISPATCH_GL(hookcount), Dt1(->base), Dt1(->base)); 7844 dasm_put(Dst, 3633, DISPATCH_GL(hookmask), HOOK_ACTIVE, GG_DISP2STATIC, DISPATCH_GL(hookmask), DISPATCH_GL(hookcount), HOOK_ACTIVE, 31-LUA_HOOKLINE, DISPATCH_GL(hookcount), Dt1(->base), Dt1(->base));
7843 dasm_put(Dst, 3678, GG_DISP2STATIC); 7845 dasm_put(Dst, 3680, GG_DISP2STATIC);
7844#if LJ_HASJIT 7846#if LJ_HASJIT
7845 dasm_put(Dst, 3696);
7846#endif
7847 dasm_put(Dst, 3698); 7847 dasm_put(Dst, 3698);
7848#if LJ_HASJIT
7849 dasm_put(Dst, 3701);
7850#endif 7848#endif
7851 dasm_put(Dst, 3704); 7849 dasm_put(Dst, 3700);
7852#if LJ_HASJIT 7850#if LJ_HASJIT
7853 dasm_put(Dst, 3706); 7851 dasm_put(Dst, 3703);
7854#endif 7852#endif
7855 dasm_put(Dst, 3709, Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); 7853 dasm_put(Dst, 3706);
7856#if LJ_HASJIT 7854#if LJ_HASJIT
7857 dasm_put(Dst, 3731); 7855 dasm_put(Dst, 3708);
7858#endif 7856#endif
7859 dasm_put(Dst, 3733); 7857 dasm_put(Dst, 3711, Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top));
7860#if LJ_HASJIT 7858#if LJ_HASJIT
7861 dasm_put(Dst, 3735); 7859 dasm_put(Dst, 3733);
7862#endif 7860#endif
7863 dasm_put(Dst, 3737); 7861 dasm_put(Dst, 3735);
7864#if LJ_HASJIT 7862#if LJ_HASJIT
7865 dasm_put(Dst, 3745); 7863 dasm_put(Dst, 3737);
7866#endif 7864#endif
7867 dasm_put(Dst, 3748); 7865 dasm_put(Dst, 3739);
7868#if LJ_HASJIT 7866#if LJ_HASJIT
7869 dasm_put(Dst, 3761); 7867 dasm_put(Dst, 3747);
7870#endif 7868#endif
7871 dasm_put(Dst, 3763); 7869 dasm_put(Dst, 3750);
7872#if LJ_HASJIT 7870#if LJ_HASJIT
7873 dasm_put(Dst, 3765); 7871 dasm_put(Dst, 3763);
7874#endif 7872#endif
7873 dasm_put(Dst, 3765);
7874#if LJ_HASJIT
7875 dasm_put(Dst, 3767); 7875 dasm_put(Dst, 3767);
7876#endif
7877 dasm_put(Dst, 3769);
7876#if LJ_HASFFI 7878#if LJ_HASFFI
7877 dasm_put(Dst, 3831); 7879 dasm_put(Dst, 3833);
7878#endif 7880#endif
7879} 7881}
7880 7882
@@ -7882,7 +7884,7 @@ static void build_subroutines(BuildCtx *ctx)
7882static void build_ins(BuildCtx *ctx, BCOp op, int defop) 7884static void build_ins(BuildCtx *ctx, BCOp op, int defop)
7883{ 7885{
7884 int vk = 0; 7886 int vk = 0;
7885 dasm_put(Dst, 3833, defop); 7887 dasm_put(Dst, 3835, defop);
7886 7888
7887 switch (op) { 7889 switch (op) {
7888 7890
@@ -7892,197 +7894,197 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
7892 7894
7893 case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT: 7895 case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT:
7894 if (LJ_DUALNUM) { 7896 if (LJ_DUALNUM) {
7895 dasm_put(Dst, 3835, -(BCBIAS_J*4 >> 16)); 7897 dasm_put(Dst, 3837, -(BCBIAS_J*4 >> 16));
7896 if (op == BC_ISLT) { 7898 if (op == BC_ISLT) {
7897 dasm_put(Dst, 3852); 7899 dasm_put(Dst, 3854);
7898 } else if (op == BC_ISGE) { 7900 } else if (op == BC_ISGE) {
7899 dasm_put(Dst, 3855); 7901 dasm_put(Dst, 3857);
7900 } else if (op == BC_ISLE) { 7902 } else if (op == BC_ISLE) {
7901 dasm_put(Dst, 3858); 7903 dasm_put(Dst, 3860);
7902 } else { 7904 } else {
7903 dasm_put(Dst, 3861); 7905 dasm_put(Dst, 3863);
7904 } 7906 }
7905 dasm_put(Dst, 3864); 7907 dasm_put(Dst, 3866);
7906 if (op == BC_ISLT) { 7908 if (op == BC_ISLT) {
7907 dasm_put(Dst, 3901); 7909 dasm_put(Dst, 3903);
7908 } else if (op == BC_ISGE) { 7910 } else if (op == BC_ISGE) {
7909 dasm_put(Dst, 3904); 7911 dasm_put(Dst, 3906);
7910 } else if (op == BC_ISLE) { 7912 } else if (op == BC_ISLE) {
7911 dasm_put(Dst, 3907); 7913 dasm_put(Dst, 3909);
7912 } else { 7914 } else {
7913 dasm_put(Dst, 3911); 7915 dasm_put(Dst, 3913);
7914 } 7916 }
7915 dasm_put(Dst, 3915); 7917 dasm_put(Dst, 3917);
7916 } else { 7918 } else {
7917 dasm_put(Dst, 3918, -(BCBIAS_J*4 >> 16)); 7919 dasm_put(Dst, 3920, -(BCBIAS_J*4 >> 16));
7918 if (op == BC_ISLT) { 7920 if (op == BC_ISLT) {
7919 dasm_put(Dst, 3935); 7921 dasm_put(Dst, 3937);
7920 } else if (op == BC_ISGE) { 7922 } else if (op == BC_ISGE) {
7921 dasm_put(Dst, 3938); 7923 dasm_put(Dst, 3940);
7922 } else if (op == BC_ISLE) { 7924 } else if (op == BC_ISLE) {
7923 dasm_put(Dst, 3941); 7925 dasm_put(Dst, 3943);
7924 } else { 7926 } else {
7925 dasm_put(Dst, 3945); 7927 dasm_put(Dst, 3947);
7926 } 7928 }
7927 dasm_put(Dst, 3949); 7929 dasm_put(Dst, 3951);
7928 } 7930 }
7929 break; 7931 break;
7930 7932
7931 case BC_ISEQV: case BC_ISNEV: 7933 case BC_ISEQV: case BC_ISNEV:
7932 vk = op == BC_ISEQV; 7934 vk = op == BC_ISEQV;
7933 if (LJ_DUALNUM) { 7935 if (LJ_DUALNUM) {
7934 dasm_put(Dst, 3962, -(BCBIAS_J*4 >> 16)); 7936 dasm_put(Dst, 3964, -(BCBIAS_J*4 >> 16));
7935 if (vk) { 7937 if (vk) {
7936 dasm_put(Dst, 3975); 7938 dasm_put(Dst, 3977);
7937 } else { 7939 } else {
7938 dasm_put(Dst, 3978); 7940 dasm_put(Dst, 3980);
7939 } 7941 }
7940 } else { 7942 } else {
7941 dasm_put(Dst, 3981, -(BCBIAS_J*4 >> 16)); 7943 dasm_put(Dst, 3983, -(BCBIAS_J*4 >> 16));
7942 if (vk) { 7944 if (vk) {
7943 dasm_put(Dst, 3998); 7945 dasm_put(Dst, 4000);
7944 } else { 7946 } else {
7945 dasm_put(Dst, 4002); 7947 dasm_put(Dst, 4004);
7946 } 7948 }
7947 dasm_put(Dst, 4006); 7949 dasm_put(Dst, 4008);
7948 } 7950 }
7949 dasm_put(Dst, 4018); 7951 dasm_put(Dst, 4020);
7950 if (!LJ_DUALNUM) { 7952 if (!LJ_DUALNUM) {
7951 dasm_put(Dst, 4020); 7953 dasm_put(Dst, 4022);
7952 } 7954 }
7953 dasm_put(Dst, 4023, ~LJ_TISPRI, ~LJ_TISTABUD); 7955 dasm_put(Dst, 4025, ~LJ_TISPRI, ~LJ_TISTABUD);
7954 if (vk) { 7956 if (vk) {
7955 dasm_put(Dst, 4037); 7957 dasm_put(Dst, 4039);
7956 } else { 7958 } else {
7957 dasm_put(Dst, 4042); 7959 dasm_put(Dst, 4044);
7958 } 7960 }
7959 if (LJ_DUALNUM) { 7961 if (LJ_DUALNUM) {
7960 dasm_put(Dst, 4047); 7962 dasm_put(Dst, 4049);
7961 } else { 7963 } else {
7962 dasm_put(Dst, 4062); 7964 dasm_put(Dst, 4064);
7963 } 7965 }
7964 dasm_put(Dst, 4065, Dt6(->metatable), 1-vk, Dt6(->nomm), 1<<MM_eq); 7966 dasm_put(Dst, 4067, Dt6(->metatable), 1-vk, Dt6(->nomm), 1<<MM_eq);
7965 break; 7967 break;
7966 7968
7967 case BC_ISEQS: case BC_ISNES: 7969 case BC_ISEQS: case BC_ISNES:
7968 vk = op == BC_ISEQS; 7970 vk = op == BC_ISEQS;
7969 dasm_put(Dst, 4084, 32-1, LJ_TSTR, -(BCBIAS_J*4 >> 16)); 7971 dasm_put(Dst, 4086, 32-1, LJ_TSTR, -(BCBIAS_J*4 >> 16));
7970 if (vk) { 7972 if (vk) {
7971 dasm_put(Dst, 4102);
7972 } else {
7973 dasm_put(Dst, 4104); 7973 dasm_put(Dst, 4104);
7974 } else {
7975 dasm_put(Dst, 4106);
7974 } 7976 }
7975 dasm_put(Dst, 4106); 7977 dasm_put(Dst, 4108);
7976 break; 7978 break;
7977 7979
7978 case BC_ISEQN: case BC_ISNEN: 7980 case BC_ISEQN: case BC_ISNEN:
7979 vk = op == BC_ISEQN; 7981 vk = op == BC_ISEQN;
7980 if (LJ_DUALNUM) { 7982 if (LJ_DUALNUM) {
7981 dasm_put(Dst, 4118, -(BCBIAS_J*4 >> 16)); 7983 dasm_put(Dst, 4120, -(BCBIAS_J*4 >> 16));
7982 if (vk) { 7984 if (vk) {
7983 dasm_put(Dst, 4130);
7984 } else {
7985 dasm_put(Dst, 4132); 7985 dasm_put(Dst, 4132);
7986 } else {
7987 dasm_put(Dst, 4134);
7986 } 7988 }
7987 dasm_put(Dst, 4134); 7989 dasm_put(Dst, 4136);
7988 } else { 7990 } else {
7989 if (vk) { 7991 if (vk) {
7990 dasm_put(Dst, 4141);
7991 } else {
7992 dasm_put(Dst, 4143); 7992 dasm_put(Dst, 4143);
7993 } else {
7994 dasm_put(Dst, 4145);
7993 } 7995 }
7994 dasm_put(Dst, 4145, -(BCBIAS_J*4 >> 16)); 7996 dasm_put(Dst, 4147, -(BCBIAS_J*4 >> 16));
7995 } 7997 }
7996 if (vk) { 7998 if (vk) {
7997 dasm_put(Dst, 4158); 7999 dasm_put(Dst, 4160);
7998 if (!LJ_HASFFI) { 8000 if (!LJ_HASFFI) {
7999 dasm_put(Dst, 4163); 8001 dasm_put(Dst, 4165);
8000 } 8002 }
8001 } else { 8003 } else {
8002 dasm_put(Dst, 4165); 8004 dasm_put(Dst, 4167);
8003 if (!LJ_HASFFI) { 8005 if (!LJ_HASFFI) {
8004 dasm_put(Dst, 4169); 8006 dasm_put(Dst, 4171);
8005 } 8007 }
8006 dasm_put(Dst, 4171); 8008 dasm_put(Dst, 4173);
8007 } 8009 }
8008 dasm_put(Dst, 4174); 8010 dasm_put(Dst, 4176);
8009 if (LJ_HASFFI) { 8011 if (LJ_HASFFI) {
8010 dasm_put(Dst, 4185, LJ_TCDATA); 8012 dasm_put(Dst, 4187, LJ_TCDATA);
8011 } 8013 }
8012 if (LJ_DUALNUM) { 8014 if (LJ_DUALNUM) {
8013 dasm_put(Dst, 4193); 8015 dasm_put(Dst, 4195);
8014 } 8016 }
8015 break; 8017 break;
8016 8018
8017 case BC_ISEQP: case BC_ISNEP: 8019 case BC_ISEQP: case BC_ISNEP:
8018 vk = op == BC_ISEQP; 8020 vk = op == BC_ISEQP;
8019 dasm_put(Dst, 4217, 32-3, -(BCBIAS_J*4 >> 16)); 8021 dasm_put(Dst, 4219, 32-3, -(BCBIAS_J*4 >> 16));
8020 if (vk) { 8022 if (vk) {
8021 dasm_put(Dst, 4230);
8022 } else {
8023 dasm_put(Dst, 4232); 8023 dasm_put(Dst, 4232);
8024 } else {
8025 dasm_put(Dst, 4234);
8024 } 8026 }
8025 dasm_put(Dst, 4234); 8027 dasm_put(Dst, 4236);
8026 break; 8028 break;
8027 8029
8028 /* -- Unary test and copy ops ------------------------------------------- */ 8030 /* -- Unary test and copy ops ------------------------------------------- */
8029 8031
8030 case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF: 8032 case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF:
8031 dasm_put(Dst, 4246); 8033 dasm_put(Dst, 4248);
8032 if (op == BC_IST || op == BC_ISF) { 8034 if (op == BC_IST || op == BC_ISF) {
8033 dasm_put(Dst, 4250, LJ_TTRUE, -(BCBIAS_J*4 >> 16)); 8035 dasm_put(Dst, 4252, LJ_TTRUE, -(BCBIAS_J*4 >> 16));
8034 if (op == BC_IST) { 8036 if (op == BC_IST) {
8035 dasm_put(Dst, 4257);
8036 } else {
8037 dasm_put(Dst, 4259); 8037 dasm_put(Dst, 4259);
8038 } else {
8039 dasm_put(Dst, 4261);
8038 } 8040 }
8039 dasm_put(Dst, 4261); 8041 dasm_put(Dst, 4263);
8040 } else { 8042 } else {
8041 dasm_put(Dst, 4263, LJ_TFALSE); 8043 dasm_put(Dst, 4265, LJ_TFALSE);
8042 if (op == BC_ISTC) { 8044 if (op == BC_ISTC) {
8043 dasm_put(Dst, 4268); 8045 dasm_put(Dst, 4270);
8044 } else { 8046 } else {
8045 dasm_put(Dst, 4271); 8047 dasm_put(Dst, 4273);
8046 } 8048 }
8047 dasm_put(Dst, 4274, -(BCBIAS_J*4 >> 16)); 8049 dasm_put(Dst, 4276, -(BCBIAS_J*4 >> 16));
8048 } 8050 }
8049 dasm_put(Dst, 4281); 8051 dasm_put(Dst, 4283);
8050 break; 8052 break;
8051 8053
8052 /* -- Unary ops --------------------------------------------------------- */ 8054 /* -- Unary ops --------------------------------------------------------- */
8053 8055
8054 case BC_MOV: 8056 case BC_MOV:
8055 dasm_put(Dst, 4292); 8057 dasm_put(Dst, 4294);
8056 break; 8058 break;
8057 case BC_NOT: 8059 case BC_NOT:
8058 dasm_put(Dst, 4305, LJ_TTRUE); 8060 dasm_put(Dst, 4307, LJ_TTRUE);
8059 break; 8061 break;
8060 case BC_UNM: 8062 case BC_UNM:
8061 dasm_put(Dst, 4321); 8063 dasm_put(Dst, 4323);
8062 if (LJ_DUALNUM) { 8064 if (LJ_DUALNUM) {
8063 dasm_put(Dst, 4325); 8065 dasm_put(Dst, 4327);
8064 } 8066 }
8065 dasm_put(Dst, 4353); 8067 dasm_put(Dst, 4355);
8066 if (LJ_DUALNUM) { 8068 if (LJ_DUALNUM) {
8067 dasm_put(Dst, 4363); 8069 dasm_put(Dst, 4365);
8068 } else { 8070 } else {
8069 dasm_put(Dst, 4366); 8071 dasm_put(Dst, 4368);
8070 } 8072 }
8071 break; 8073 break;
8072 case BC_LEN: 8074 case BC_LEN:
8073 dasm_put(Dst, 4375, LJ_TSTR, Dt5(->len)); 8075 dasm_put(Dst, 4377, LJ_TSTR, Dt5(->len));
8074 if (LJ_DUALNUM) { 8076 if (LJ_DUALNUM) {
8075 dasm_put(Dst, 4385); 8077 dasm_put(Dst, 4387);
8076 } else { 8078 } else {
8077 dasm_put(Dst, 4390); 8079 dasm_put(Dst, 4392);
8078 } 8080 }
8079 dasm_put(Dst, 4397, LJ_TTAB); 8081 dasm_put(Dst, 4399, LJ_TTAB);
8080#ifdef LUAJIT_ENABLE_LUA52COMPAT 8082#ifdef LUAJIT_ENABLE_LUA52COMPAT
8081 dasm_put(Dst, 4411, Dt6(->metatable)); 8083 dasm_put(Dst, 4413, Dt6(->metatable));
8082#endif 8084#endif
8083 dasm_put(Dst, 4418); 8085 dasm_put(Dst, 4420);
8084#ifdef LUAJIT_ENABLE_LUA52COMPAT 8086#ifdef LUAJIT_ENABLE_LUA52COMPAT
8085 dasm_put(Dst, 4424, Dt6(->nomm), 1<<MM_len); 8087 dasm_put(Dst, 4426, Dt6(->nomm), 1<<MM_len);
8086#endif 8088#endif
8087 break; 8089 break;
8088 8090
@@ -8094,77 +8096,77 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
8094 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 8096 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
8095 switch (vk) { 8097 switch (vk) {
8096 case 0: 8098 case 0:
8097 dasm_put(Dst, 4434); 8099 dasm_put(Dst, 4436);
8098 break; 8100 break;
8099 case 1: 8101 case 1:
8100 dasm_put(Dst, 4440); 8102 dasm_put(Dst, 4442);
8101 break; 8103 break;
8102 default: 8104 default:
8103 dasm_put(Dst, 4446); 8105 dasm_put(Dst, 4448);
8104 break; 8106 break;
8105 } 8107 }
8106 dasm_put(Dst, 4452); 8108 dasm_put(Dst, 4454);
8107 switch (vk) { 8109 switch (vk) {
8108 case 0: 8110 case 0:
8109 dasm_put(Dst, 4478); 8111 dasm_put(Dst, 4480);
8110 break; 8112 break;
8111 case 1: 8113 case 1:
8112 dasm_put(Dst, 4481); 8114 dasm_put(Dst, 4483);
8113 break; 8115 break;
8114 default: 8116 default:
8115 dasm_put(Dst, 4484); 8117 dasm_put(Dst, 4486);
8116 break; 8118 break;
8117 } 8119 }
8118 dasm_put(Dst, 4487);
8119 if (vk == 1) {
8120 dasm_put(Dst, 4489); 8120 dasm_put(Dst, 4489);
8121 if (vk == 1) {
8122 dasm_put(Dst, 4491);
8121 } else { 8123 } else {
8122 dasm_put(Dst, 4493); 8124 dasm_put(Dst, 4495);
8123 } 8125 }
8124 switch (vk) { 8126 switch (vk) {
8125 case 0: 8127 case 0:
8126 dasm_put(Dst, 4497); 8128 dasm_put(Dst, 4499);
8127 break; 8129 break;
8128 case 1: 8130 case 1:
8129 dasm_put(Dst, 4500); 8131 dasm_put(Dst, 4502);
8130 break; 8132 break;
8131 default: 8133 default:
8132 dasm_put(Dst, 4503); 8134 dasm_put(Dst, 4505);
8133 break; 8135 break;
8134 } 8136 }
8135 dasm_put(Dst, 4506); 8137 dasm_put(Dst, 4508);
8136 } else { 8138 } else {
8137 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 8139 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
8138 switch (vk) { 8140 switch (vk) {
8139 case 0: 8141 case 0:
8140 dasm_put(Dst, 4513);
8141 if (LJ_DUALNUM) {
8142 dasm_put(Dst, 4515); 8142 dasm_put(Dst, 4515);
8143 } 8143 if (LJ_DUALNUM) {
8144 dasm_put(Dst, 4517); 8144 dasm_put(Dst, 4517);
8145 }
8146 dasm_put(Dst, 4519);
8145 if (LJ_DUALNUM) { 8147 if (LJ_DUALNUM) {
8146 dasm_put(Dst, 4520); 8148 dasm_put(Dst, 4522);
8147 } else { 8149 } else {
8148 dasm_put(Dst, 4526); 8150 dasm_put(Dst, 4528);
8149 } 8151 }
8150 break; 8152 break;
8151 case 1: 8153 case 1:
8152 dasm_put(Dst, 4530);
8153 if (LJ_DUALNUM) {
8154 dasm_put(Dst, 4532); 8154 dasm_put(Dst, 4532);
8155 } 8155 if (LJ_DUALNUM) {
8156 dasm_put(Dst, 4534); 8156 dasm_put(Dst, 4534);
8157 }
8158 dasm_put(Dst, 4536);
8157 if (LJ_DUALNUM) { 8159 if (LJ_DUALNUM) {
8158 dasm_put(Dst, 4537); 8160 dasm_put(Dst, 4539);
8159 } else { 8161 } else {
8160 dasm_put(Dst, 4543); 8162 dasm_put(Dst, 4545);
8161 } 8163 }
8162 break; 8164 break;
8163 default: 8165 default:
8164 dasm_put(Dst, 4547); 8166 dasm_put(Dst, 4549);
8165 break; 8167 break;
8166 } 8168 }
8167 dasm_put(Dst, 4557); 8169 dasm_put(Dst, 4559);
8168 } 8170 }
8169 break; 8171 break;
8170 case BC_SUBVN: case BC_SUBNV: case BC_SUBVV: 8172 case BC_SUBVN: case BC_SUBNV: case BC_SUBVV:
@@ -8172,77 +8174,77 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
8172 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 8174 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
8173 switch (vk) { 8175 switch (vk) {
8174 case 0: 8176 case 0:
8175 dasm_put(Dst, 4570); 8177 dasm_put(Dst, 4572);
8176 break; 8178 break;
8177 case 1: 8179 case 1:
8178 dasm_put(Dst, 4576); 8180 dasm_put(Dst, 4578);
8179 break; 8181 break;
8180 default: 8182 default:
8181 dasm_put(Dst, 4582); 8183 dasm_put(Dst, 4584);
8182 break; 8184 break;
8183 } 8185 }
8184 dasm_put(Dst, 4588); 8186 dasm_put(Dst, 4590);
8185 switch (vk) { 8187 switch (vk) {
8186 case 0: 8188 case 0:
8187 dasm_put(Dst, 4614); 8189 dasm_put(Dst, 4616);
8188 break; 8190 break;
8189 case 1: 8191 case 1:
8190 dasm_put(Dst, 4617); 8192 dasm_put(Dst, 4619);
8191 break; 8193 break;
8192 default: 8194 default:
8193 dasm_put(Dst, 4620); 8195 dasm_put(Dst, 4622);
8194 break; 8196 break;
8195 } 8197 }
8196 dasm_put(Dst, 4623);
8197 if (vk == 1) {
8198 dasm_put(Dst, 4625); 8198 dasm_put(Dst, 4625);
8199 if (vk == 1) {
8200 dasm_put(Dst, 4627);
8199 } else { 8201 } else {
8200 dasm_put(Dst, 4629); 8202 dasm_put(Dst, 4631);
8201 } 8203 }
8202 switch (vk) { 8204 switch (vk) {
8203 case 0: 8205 case 0:
8204 dasm_put(Dst, 4633); 8206 dasm_put(Dst, 4635);
8205 break; 8207 break;
8206 case 1: 8208 case 1:
8207 dasm_put(Dst, 4636); 8209 dasm_put(Dst, 4638);
8208 break; 8210 break;
8209 default: 8211 default:
8210 dasm_put(Dst, 4639); 8212 dasm_put(Dst, 4641);
8211 break; 8213 break;
8212 } 8214 }
8213 dasm_put(Dst, 4642); 8215 dasm_put(Dst, 4644);
8214 } else { 8216 } else {
8215 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 8217 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
8216 switch (vk) { 8218 switch (vk) {
8217 case 0: 8219 case 0:
8218 dasm_put(Dst, 4649);
8219 if (LJ_DUALNUM) {
8220 dasm_put(Dst, 4651); 8220 dasm_put(Dst, 4651);
8221 } 8221 if (LJ_DUALNUM) {
8222 dasm_put(Dst, 4653); 8222 dasm_put(Dst, 4653);
8223 }
8224 dasm_put(Dst, 4655);
8223 if (LJ_DUALNUM) { 8225 if (LJ_DUALNUM) {
8224 dasm_put(Dst, 4656); 8226 dasm_put(Dst, 4658);
8225 } else { 8227 } else {
8226 dasm_put(Dst, 4662); 8228 dasm_put(Dst, 4664);
8227 } 8229 }
8228 break; 8230 break;
8229 case 1: 8231 case 1:
8230 dasm_put(Dst, 4666);
8231 if (LJ_DUALNUM) {
8232 dasm_put(Dst, 4668); 8232 dasm_put(Dst, 4668);
8233 } 8233 if (LJ_DUALNUM) {
8234 dasm_put(Dst, 4670); 8234 dasm_put(Dst, 4670);
8235 }
8236 dasm_put(Dst, 4672);
8235 if (LJ_DUALNUM) { 8237 if (LJ_DUALNUM) {
8236 dasm_put(Dst, 4673); 8238 dasm_put(Dst, 4675);
8237 } else { 8239 } else {
8238 dasm_put(Dst, 4679); 8240 dasm_put(Dst, 4681);
8239 } 8241 }
8240 break; 8242 break;
8241 default: 8243 default:
8242 dasm_put(Dst, 4683); 8244 dasm_put(Dst, 4685);
8243 break; 8245 break;
8244 } 8246 }
8245 dasm_put(Dst, 4693); 8247 dasm_put(Dst, 4695);
8246 } 8248 }
8247 break; 8249 break;
8248 case BC_MULVN: case BC_MULNV: case BC_MULVV: 8250 case BC_MULVN: case BC_MULNV: case BC_MULVV:
@@ -8250,481 +8252,481 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
8250 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 8252 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
8251 switch (vk) { 8253 switch (vk) {
8252 case 0: 8254 case 0:
8253 dasm_put(Dst, 4706); 8255 dasm_put(Dst, 4708);
8254 break; 8256 break;
8255 case 1: 8257 case 1:
8256 dasm_put(Dst, 4712); 8258 dasm_put(Dst, 4714);
8257 break; 8259 break;
8258 default: 8260 default:
8259 dasm_put(Dst, 4718); 8261 dasm_put(Dst, 4720);
8260 break; 8262 break;
8261 } 8263 }
8262 dasm_put(Dst, 4724); 8264 dasm_put(Dst, 4726);
8263 switch (vk) { 8265 switch (vk) {
8264 case 0: 8266 case 0:
8265 dasm_put(Dst, 4750); 8267 dasm_put(Dst, 4752);
8266 break; 8268 break;
8267 case 1: 8269 case 1:
8268 dasm_put(Dst, 4753); 8270 dasm_put(Dst, 4755);
8269 break; 8271 break;
8270 default: 8272 default:
8271 dasm_put(Dst, 4756); 8273 dasm_put(Dst, 4758);
8272 break; 8274 break;
8273 } 8275 }
8274 dasm_put(Dst, 4759);
8275 if (vk == 1) {
8276 dasm_put(Dst, 4761); 8276 dasm_put(Dst, 4761);
8277 if (vk == 1) {
8278 dasm_put(Dst, 4763);
8277 } else { 8279 } else {
8278 dasm_put(Dst, 4765); 8280 dasm_put(Dst, 4767);
8279 } 8281 }
8280 switch (vk) { 8282 switch (vk) {
8281 case 0: 8283 case 0:
8282 dasm_put(Dst, 4769); 8284 dasm_put(Dst, 4771);
8283 break; 8285 break;
8284 case 1: 8286 case 1:
8285 dasm_put(Dst, 4772); 8287 dasm_put(Dst, 4774);
8286 break; 8288 break;
8287 default: 8289 default:
8288 dasm_put(Dst, 4775); 8290 dasm_put(Dst, 4777);
8289 break; 8291 break;
8290 } 8292 }
8291 dasm_put(Dst, 4778); 8293 dasm_put(Dst, 4780);
8292 } else { 8294 } else {
8293 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 8295 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
8294 switch (vk) { 8296 switch (vk) {
8295 case 0: 8297 case 0:
8296 dasm_put(Dst, 4785);
8297 if (LJ_DUALNUM) {
8298 dasm_put(Dst, 4787); 8298 dasm_put(Dst, 4787);
8299 } 8299 if (LJ_DUALNUM) {
8300 dasm_put(Dst, 4789); 8300 dasm_put(Dst, 4789);
8301 }
8302 dasm_put(Dst, 4791);
8301 if (LJ_DUALNUM) { 8303 if (LJ_DUALNUM) {
8302 dasm_put(Dst, 4792); 8304 dasm_put(Dst, 4794);
8303 } else { 8305 } else {
8304 dasm_put(Dst, 4798); 8306 dasm_put(Dst, 4800);
8305 } 8307 }
8306 break; 8308 break;
8307 case 1: 8309 case 1:
8308 dasm_put(Dst, 4802);
8309 if (LJ_DUALNUM) {
8310 dasm_put(Dst, 4804); 8310 dasm_put(Dst, 4804);
8311 } 8311 if (LJ_DUALNUM) {
8312 dasm_put(Dst, 4806); 8312 dasm_put(Dst, 4806);
8313 }
8314 dasm_put(Dst, 4808);
8313 if (LJ_DUALNUM) { 8315 if (LJ_DUALNUM) {
8314 dasm_put(Dst, 4809); 8316 dasm_put(Dst, 4811);
8315 } else { 8317 } else {
8316 dasm_put(Dst, 4815); 8318 dasm_put(Dst, 4817);
8317 } 8319 }
8318 break; 8320 break;
8319 default: 8321 default:
8320 dasm_put(Dst, 4819); 8322 dasm_put(Dst, 4821);
8321 break; 8323 break;
8322 } 8324 }
8323 dasm_put(Dst, 4829); 8325 dasm_put(Dst, 4831);
8324 } 8326 }
8325 break; 8327 break;
8326 case BC_DIVVN: case BC_DIVNV: case BC_DIVVV: 8328 case BC_DIVVN: case BC_DIVNV: case BC_DIVVV:
8327 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 8329 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
8328 switch (vk) { 8330 switch (vk) {
8329 case 0: 8331 case 0:
8330 dasm_put(Dst, 4842);
8331 if (LJ_DUALNUM) {
8332 dasm_put(Dst, 4844); 8332 dasm_put(Dst, 4844);
8333 } 8333 if (LJ_DUALNUM) {
8334 dasm_put(Dst, 4846); 8334 dasm_put(Dst, 4846);
8335 }
8336 dasm_put(Dst, 4848);
8335 if (LJ_DUALNUM) { 8337 if (LJ_DUALNUM) {
8336 dasm_put(Dst, 4849); 8338 dasm_put(Dst, 4851);
8337 } else { 8339 } else {
8338 dasm_put(Dst, 4855); 8340 dasm_put(Dst, 4857);
8339 } 8341 }
8340 break; 8342 break;
8341 case 1: 8343 case 1:
8342 dasm_put(Dst, 4859);
8343 if (LJ_DUALNUM) {
8344 dasm_put(Dst, 4861); 8344 dasm_put(Dst, 4861);
8345 } 8345 if (LJ_DUALNUM) {
8346 dasm_put(Dst, 4863); 8346 dasm_put(Dst, 4863);
8347 }
8348 dasm_put(Dst, 4865);
8347 if (LJ_DUALNUM) { 8349 if (LJ_DUALNUM) {
8348 dasm_put(Dst, 4866); 8350 dasm_put(Dst, 4868);
8349 } else { 8351 } else {
8350 dasm_put(Dst, 4872); 8352 dasm_put(Dst, 4874);
8351 } 8353 }
8352 break; 8354 break;
8353 default: 8355 default:
8354 dasm_put(Dst, 4876); 8356 dasm_put(Dst, 4878);
8355 break; 8357 break;
8356 } 8358 }
8357 dasm_put(Dst, 4886); 8359 dasm_put(Dst, 4888);
8358 break; 8360 break;
8359 case BC_MODVN: 8361 case BC_MODVN:
8360 if (LJ_DUALNUM) { 8362 if (LJ_DUALNUM) {
8361 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 8363 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
8362 switch (vk) { 8364 switch (vk) {
8363 case 0: 8365 case 0:
8364 dasm_put(Dst, 4899); 8366 dasm_put(Dst, 4901);
8365 break; 8367 break;
8366 case 1: 8368 case 1:
8367 dasm_put(Dst, 4905); 8369 dasm_put(Dst, 4907);
8368 break; 8370 break;
8369 default: 8371 default:
8370 dasm_put(Dst, 4911); 8372 dasm_put(Dst, 4913);
8371 break; 8373 break;
8372 } 8374 }
8373 dasm_put(Dst, 4917); 8375 dasm_put(Dst, 4919);
8374 switch (vk) { 8376 switch (vk) {
8375 case 0: 8377 case 0:
8376 dasm_put(Dst, 4945); 8378 dasm_put(Dst, 4947);
8377 break; 8379 break;
8378 case 1: 8380 case 1:
8379 dasm_put(Dst, 4948); 8381 dasm_put(Dst, 4950);
8380 break; 8382 break;
8381 default: 8383 default:
8382 dasm_put(Dst, 4951); 8384 dasm_put(Dst, 4953);
8383 break; 8385 break;
8384 } 8386 }
8385 dasm_put(Dst, 4954);
8386 if (vk == 1) {
8387 dasm_put(Dst, 4956); 8387 dasm_put(Dst, 4956);
8388 if (vk == 1) {
8389 dasm_put(Dst, 4958);
8388 } else { 8390 } else {
8389 dasm_put(Dst, 4960); 8391 dasm_put(Dst, 4962);
8390 } 8392 }
8391 switch (vk) { 8393 switch (vk) {
8392 case 0: 8394 case 0:
8393 dasm_put(Dst, 4964); 8395 dasm_put(Dst, 4966);
8394 break; 8396 break;
8395 case 1: 8397 case 1:
8396 dasm_put(Dst, 4967); 8398 dasm_put(Dst, 4969);
8397 break; 8399 break;
8398 default: 8400 default:
8399 dasm_put(Dst, 4970); 8401 dasm_put(Dst, 4972);
8400 break; 8402 break;
8401 } 8403 }
8402 if (!LJ_DUALNUM) { 8404 if (!LJ_DUALNUM) {
8403 dasm_put(Dst, 4973);
8404 }
8405 dasm_put(Dst, 4975); 8405 dasm_put(Dst, 4975);
8406 }
8407 dasm_put(Dst, 4977);
8406 } else { 8408 } else {
8407 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 8409 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
8408 switch (vk) { 8410 switch (vk) {
8409 case 0: 8411 case 0:
8410 dasm_put(Dst, 4987);
8411 if (LJ_DUALNUM) {
8412 dasm_put(Dst, 4989); 8412 dasm_put(Dst, 4989);
8413 } 8413 if (LJ_DUALNUM) {
8414 dasm_put(Dst, 4991); 8414 dasm_put(Dst, 4991);
8415 }
8416 dasm_put(Dst, 4993);
8415 if (LJ_DUALNUM) { 8417 if (LJ_DUALNUM) {
8416 dasm_put(Dst, 4994); 8418 dasm_put(Dst, 4996);
8417 } else { 8419 } else {
8418 dasm_put(Dst, 5000); 8420 dasm_put(Dst, 5002);
8419 } 8421 }
8420 break; 8422 break;
8421 case 1: 8423 case 1:
8422 dasm_put(Dst, 5004);
8423 if (LJ_DUALNUM) {
8424 dasm_put(Dst, 5006); 8424 dasm_put(Dst, 5006);
8425 } 8425 if (LJ_DUALNUM) {
8426 dasm_put(Dst, 5008); 8426 dasm_put(Dst, 5008);
8427 }
8428 dasm_put(Dst, 5010);
8427 if (LJ_DUALNUM) { 8429 if (LJ_DUALNUM) {
8428 dasm_put(Dst, 5011); 8430 dasm_put(Dst, 5013);
8429 } else { 8431 } else {
8430 dasm_put(Dst, 5017); 8432 dasm_put(Dst, 5019);
8431 } 8433 }
8432 break; 8434 break;
8433 default: 8435 default:
8434 dasm_put(Dst, 5021); 8436 dasm_put(Dst, 5023);
8435 break; 8437 break;
8436 } 8438 }
8437 if (!LJ_DUALNUM) { 8439 if (!LJ_DUALNUM) {
8438 dasm_put(Dst, 5031);
8439 }
8440 dasm_put(Dst, 5033); 8440 dasm_put(Dst, 5033);
8441 } 8441 }
8442 dasm_put(Dst, 5035);
8443 }
8442 break; 8444 break;
8443 case BC_MODNV: case BC_MODVV: 8445 case BC_MODNV: case BC_MODVV:
8444 if (LJ_DUALNUM) { 8446 if (LJ_DUALNUM) {
8445 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 8447 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
8446 switch (vk) { 8448 switch (vk) {
8447 case 0: 8449 case 0:
8448 dasm_put(Dst, 5051); 8450 dasm_put(Dst, 5053);
8449 break; 8451 break;
8450 case 1: 8452 case 1:
8451 dasm_put(Dst, 5057); 8453 dasm_put(Dst, 5059);
8452 break; 8454 break;
8453 default: 8455 default:
8454 dasm_put(Dst, 5063); 8456 dasm_put(Dst, 5065);
8455 break; 8457 break;
8456 } 8458 }
8457 dasm_put(Dst, 5069); 8459 dasm_put(Dst, 5071);
8458 if (vk == 1) { 8460 if (vk == 1) {
8459 dasm_put(Dst, 5077); 8461 dasm_put(Dst, 5079);
8460 } else { 8462 } else {
8461 dasm_put(Dst, 5081); 8463 dasm_put(Dst, 5083);
8462 } 8464 }
8463 switch (vk) { 8465 switch (vk) {
8464 case 0: 8466 case 0:
8465 dasm_put(Dst, 5085); 8467 dasm_put(Dst, 5087);
8466 break; 8468 break;
8467 case 1: 8469 case 1:
8468 dasm_put(Dst, 5088); 8470 dasm_put(Dst, 5090);
8469 break; 8471 break;
8470 default: 8472 default:
8471 dasm_put(Dst, 5091); 8473 dasm_put(Dst, 5093);
8472 break; 8474 break;
8473 } 8475 }
8474 dasm_put(Dst, 5094); 8476 dasm_put(Dst, 5096);
8475 } else { 8477 } else {
8476 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN); 8478 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
8477 switch (vk) { 8479 switch (vk) {
8478 case 0: 8480 case 0:
8479 dasm_put(Dst, 5097);
8480 if (LJ_DUALNUM) {
8481 dasm_put(Dst, 5099); 8481 dasm_put(Dst, 5099);
8482 } 8482 if (LJ_DUALNUM) {
8483 dasm_put(Dst, 5101); 8483 dasm_put(Dst, 5101);
8484 }
8485 dasm_put(Dst, 5103);
8484 if (LJ_DUALNUM) { 8486 if (LJ_DUALNUM) {
8485 dasm_put(Dst, 5104); 8487 dasm_put(Dst, 5106);
8486 } else { 8488 } else {
8487 dasm_put(Dst, 5110); 8489 dasm_put(Dst, 5112);
8488 } 8490 }
8489 break; 8491 break;
8490 case 1: 8492 case 1:
8491 dasm_put(Dst, 5114);
8492 if (LJ_DUALNUM) {
8493 dasm_put(Dst, 5116); 8493 dasm_put(Dst, 5116);
8494 } 8494 if (LJ_DUALNUM) {
8495 dasm_put(Dst, 5118); 8495 dasm_put(Dst, 5118);
8496 }
8497 dasm_put(Dst, 5120);
8496 if (LJ_DUALNUM) { 8498 if (LJ_DUALNUM) {
8497 dasm_put(Dst, 5121); 8499 dasm_put(Dst, 5123);
8498 } else { 8500 } else {
8499 dasm_put(Dst, 5127); 8501 dasm_put(Dst, 5129);
8500 } 8502 }
8501 break; 8503 break;
8502 default: 8504 default:
8503 dasm_put(Dst, 5131); 8505 dasm_put(Dst, 5133);
8504 break; 8506 break;
8505 } 8507 }
8506 dasm_put(Dst, 5141); 8508 dasm_put(Dst, 5143);
8507 } 8509 }
8508 break; 8510 break;
8509 case BC_POW: 8511 case BC_POW:
8510 dasm_put(Dst, 5144); 8512 dasm_put(Dst, 5146);
8511 break; 8513 break;
8512 8514
8513 case BC_CAT: 8515 case BC_CAT:
8514 dasm_put(Dst, 5167, Dt1(->base), 32-3, Dt1(->base)); 8516 dasm_put(Dst, 5169, Dt1(->base), 32-3, Dt1(->base));
8515 break; 8517 break;
8516 8518
8517 /* -- Constant ops ------------------------------------------------------ */ 8519 /* -- Constant ops ------------------------------------------------------ */
8518 8520
8519 case BC_KSTR: 8521 case BC_KSTR:
8520 dasm_put(Dst, 5197, 32-1, LJ_TSTR); 8522 dasm_put(Dst, 5199, 32-1, LJ_TSTR);
8521 break; 8523 break;
8522 case BC_KCDATA: 8524 case BC_KCDATA:
8523#if LJ_HASFFI 8525#if LJ_HASFFI
8524 dasm_put(Dst, 5216, 32-1, LJ_TCDATA); 8526 dasm_put(Dst, 5218, 32-1, LJ_TCDATA);
8525#endif 8527#endif
8526 break; 8528 break;
8527 case BC_KSHORT: 8529 case BC_KSHORT:
8528 if (LJ_DUALNUM) { 8530 if (LJ_DUALNUM) {
8529 dasm_put(Dst, 5235, 31-13); 8531 dasm_put(Dst, 5237, 31-13);
8530 } else { 8532 } else {
8531 dasm_put(Dst, 5251, 31-13); 8533 dasm_put(Dst, 5253, 31-13);
8532 } 8534 }
8533 break; 8535 break;
8534 case BC_KNUM: 8536 case BC_KNUM:
8535 dasm_put(Dst, 5270); 8537 dasm_put(Dst, 5272);
8536 break; 8538 break;
8537 case BC_KPRI: 8539 case BC_KPRI:
8538 dasm_put(Dst, 5283, 32-3); 8540 dasm_put(Dst, 5285, 32-3);
8539 break; 8541 break;
8540 case BC_KNIL: 8542 case BC_KNIL:
8541 dasm_put(Dst, 5298); 8543 dasm_put(Dst, 5300);
8542 break; 8544 break;
8543 8545
8544 /* -- Upvalue and function ops ------------------------------------------ */ 8546 /* -- Upvalue and function ops ------------------------------------------ */
8545 8547
8546 case BC_UGET: 8548 case BC_UGET:
8547 dasm_put(Dst, 5317, 32-1, offsetof(GCfuncL, uvptr), DtA(->v)); 8549 dasm_put(Dst, 5319, 32-1, offsetof(GCfuncL, uvptr), DtA(->v));
8548 break; 8550 break;
8549 case BC_USETV: 8551 case BC_USETV:
8550 dasm_put(Dst, 5338, 32-1, offsetof(GCfuncL, uvptr), DtA(->marked), DtA(->v), LJ_GC_BLACK, DtA(->closed), -(LJ_TISNUM+1), LJ_TISGCV - (LJ_TISNUM+1), Dt4(->gch.marked), LJ_GC_WHITES, GG_DISP2G); 8552 dasm_put(Dst, 5340, 32-1, offsetof(GCfuncL, uvptr), DtA(->marked), DtA(->v), LJ_GC_BLACK, DtA(->closed), -(LJ_TISNUM+1), LJ_TISGCV - (LJ_TISNUM+1), Dt4(->gch.marked), LJ_GC_WHITES, GG_DISP2G);
8551 break; 8553 break;
8552 case BC_USETS: 8554 case BC_USETS:
8553 dasm_put(Dst, 5391, 32-1, 32-1, offsetof(GCfuncL, uvptr), DtA(->marked), DtA(->v), LJ_GC_BLACK, Dt5(->marked), DtA(->closed), LJ_TSTR, LJ_GC_WHITES, GG_DISP2G); 8555 dasm_put(Dst, 5393, 32-1, 32-1, offsetof(GCfuncL, uvptr), DtA(->marked), DtA(->v), LJ_GC_BLACK, Dt5(->marked), DtA(->closed), LJ_TSTR, LJ_GC_WHITES, GG_DISP2G);
8554 break; 8556 break;
8555 case BC_USETN: 8557 case BC_USETN:
8556 dasm_put(Dst, 5442, 32-1, offsetof(GCfuncL, uvptr), DtA(->v)); 8558 dasm_put(Dst, 5444, 32-1, offsetof(GCfuncL, uvptr), DtA(->v));
8557 break; 8559 break;
8558 case BC_USETP: 8560 case BC_USETP:
8559 dasm_put(Dst, 5463, 32-1, offsetof(GCfuncL, uvptr), 32-3, DtA(->v)); 8561 dasm_put(Dst, 5465, 32-1, offsetof(GCfuncL, uvptr), 32-3, DtA(->v));
8560 break; 8562 break;
8561 8563
8562 case BC_UCLO: 8564 case BC_UCLO:
8563 dasm_put(Dst, 5486, Dt1(->openupval), 32-1, -(BCBIAS_J*4 >> 16), Dt1(->base), Dt1(->base)); 8565 dasm_put(Dst, 5488, Dt1(->openupval), 32-1, -(BCBIAS_J*4 >> 16), Dt1(->base), Dt1(->base));
8564 break; 8566 break;
8565 8567
8566 case BC_FNEW: 8568 case BC_FNEW:
8567 dasm_put(Dst, 5516, 32-1, Dt1(->base), Dt1(->base), LJ_TFUNC); 8569 dasm_put(Dst, 5518, 32-1, Dt1(->base), Dt1(->base), LJ_TFUNC);
8568 break; 8570 break;
8569 8571
8570 /* -- Table ops --------------------------------------------------------- */ 8572 /* -- Table ops --------------------------------------------------------- */
8571 8573
8572 case BC_TNEW: 8574 case BC_TNEW:
8573 case BC_TDUP: 8575 case BC_TDUP:
8574 dasm_put(Dst, 5544, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base)); 8576 dasm_put(Dst, 5546, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base));
8575 if (op == BC_TNEW) { 8577 if (op == BC_TNEW) {
8576 dasm_put(Dst, 5557); 8578 dasm_put(Dst, 5559);
8577 } else { 8579 } else {
8578 dasm_put(Dst, 5566, 32-1); 8580 dasm_put(Dst, 5568, 32-1);
8579 } 8581 }
8580 dasm_put(Dst, 5573, Dt1(->base), LJ_TTAB); 8582 dasm_put(Dst, 5575, Dt1(->base), LJ_TTAB);
8581 if (op == BC_TNEW) { 8583 if (op == BC_TNEW) {
8582 dasm_put(Dst, 5590); 8584 dasm_put(Dst, 5592);
8583 } 8585 }
8584 dasm_put(Dst, 5595); 8586 dasm_put(Dst, 5597);
8585 break; 8587 break;
8586 8588
8587 case BC_GGET: 8589 case BC_GGET:
8588 case BC_GSET: 8590 case BC_GSET:
8589 dasm_put(Dst, 5604, 32-1, Dt7(->env)); 8591 dasm_put(Dst, 5606, 32-1, Dt7(->env));
8590 if (op == BC_GGET) { 8592 if (op == BC_GGET) {
8591 dasm_put(Dst, 5612); 8593 dasm_put(Dst, 5614);
8592 } else { 8594 } else {
8593 dasm_put(Dst, 5615); 8595 dasm_put(Dst, 5617);
8594 } 8596 }
8595 break; 8597 break;
8596 8598
8597 case BC_TGETV: 8599 case BC_TGETV:
8598 dasm_put(Dst, 5618); 8600 dasm_put(Dst, 5620);
8599 if (LJ_DUALNUM) { 8601 if (LJ_DUALNUM) {
8600 dasm_put(Dst, 5622);
8601 } else {
8602 dasm_put(Dst, 5624); 8602 dasm_put(Dst, 5624);
8603 } else {
8604 dasm_put(Dst, 5626);
8603 } 8605 }
8604 dasm_put(Dst, 5626, LJ_TTAB); 8606 dasm_put(Dst, 5628, LJ_TTAB);
8605 if (LJ_DUALNUM) { 8607 if (LJ_DUALNUM) {
8606 dasm_put(Dst, 5632, Dt6(->asize), Dt6(->array), 31-3); 8608 dasm_put(Dst, 5634, Dt6(->asize), Dt6(->array), 31-3);
8607 } else { 8609 } else {
8608 dasm_put(Dst, 5642, Dt6(->asize), Dt6(->array), 31-3); 8610 dasm_put(Dst, 5644, Dt6(->asize), Dt6(->array), 31-3);
8609 } 8611 }
8610 dasm_put(Dst, 5659, LJ_TNIL, Dt6(->metatable), Dt6(->nomm), 1<<MM_index, LJ_TSTR); 8612 dasm_put(Dst, 5661, LJ_TNIL, Dt6(->metatable), Dt6(->nomm), 1<<MM_index, LJ_TSTR);
8611 if (!LJ_DUALNUM) { 8613 if (!LJ_DUALNUM) {
8612 dasm_put(Dst, 5699); 8614 dasm_put(Dst, 5701);
8613 } 8615 }
8614 dasm_put(Dst, 5701); 8616 dasm_put(Dst, 5703);
8615 break; 8617 break;
8616 case BC_TGETS: 8618 case BC_TGETS:
8617 dasm_put(Dst, 5704, 32-1, LJ_TTAB, Dt6(->hmask), Dt5(->hash), Dt6(->node), 31-5, 31-3, DtB(->key), 4+offsetof(Node, key), DtB(->val), 4+offsetof(Node, val), LJ_TSTR, LJ_TNIL, DtB(->next)); 8619 dasm_put(Dst, 5706, 32-1, LJ_TTAB, Dt6(->hmask), Dt5(->hash), Dt6(->node), 31-5, 31-3, DtB(->key), 4+offsetof(Node, key), DtB(->val), 4+offsetof(Node, val), LJ_TSTR, LJ_TNIL, DtB(->next));
8618 dasm_put(Dst, 5765, LJ_TNIL, Dt6(->metatable), Dt6(->nomm), 1<<MM_index); 8620 dasm_put(Dst, 5767, LJ_TNIL, Dt6(->metatable), Dt6(->nomm), 1<<MM_index);
8619 break; 8621 break;
8620 case BC_TGETB: 8622 case BC_TGETB:
8621 dasm_put(Dst, 5785, 32-3, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->nomm), 1<<MM_index); 8623 dasm_put(Dst, 5787, 32-3, LJ_TTAB, Dt6(->asize), Dt6(->array), LJ_TNIL, Dt6(->metatable), Dt6(->nomm), 1<<MM_index);
8622 break; 8624 break;
8623 8625
8624 case BC_TSETV: 8626 case BC_TSETV:
8625 dasm_put(Dst, 5833); 8627 dasm_put(Dst, 5835);
8626 if (LJ_DUALNUM) { 8628 if (LJ_DUALNUM) {
8627 dasm_put(Dst, 5837);
8628 } else {
8629 dasm_put(Dst, 5839); 8629 dasm_put(Dst, 5839);
8630 } else {
8631 dasm_put(Dst, 5841);
8630 } 8632 }
8631 dasm_put(Dst, 5841, LJ_TTAB); 8633 dasm_put(Dst, 5843, LJ_TTAB);
8632 if (LJ_DUALNUM) { 8634 if (LJ_DUALNUM) {
8633 dasm_put(Dst, 5847, Dt6(->asize), Dt6(->array), 31-3); 8635 dasm_put(Dst, 5849, Dt6(->asize), Dt6(->array), 31-3);
8634 } else { 8636 } else {
8635 dasm_put(Dst, 5857, Dt6(->asize), Dt6(->array), 31-3); 8637 dasm_put(Dst, 5859, Dt6(->asize), Dt6(->array), 31-3);
8636 } 8638 }
8637 dasm_put(Dst, 5874, Dt6(->marked), LJ_TNIL, LJ_GC_BLACK, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, LJ_TSTR); 8639 dasm_put(Dst, 5876, Dt6(->marked), LJ_TNIL, LJ_GC_BLACK, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, LJ_TSTR);
8638 if (!LJ_DUALNUM) { 8640 if (!LJ_DUALNUM) {
8639 dasm_put(Dst, 5921); 8641 dasm_put(Dst, 5923);
8640 } 8642 }
8641 dasm_put(Dst, 5923, DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist)); 8643 dasm_put(Dst, 5925, DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist));
8642 break; 8644 break;
8643 dasm_put(Dst, 5938, LJ_TSTR, LJ_TNIL); 8645 dasm_put(Dst, 5940, LJ_TSTR, LJ_TNIL);
8644 case BC_TSETS: 8646 case BC_TSETS:
8645 dasm_put(Dst, 5964, 32-1, LJ_TTAB, Dt6(->hmask), Dt5(->hash), Dt6(->node), Dt6(->nomm), 31-5, 31-3, Dt6(->marked), DtB(->key), 4+offsetof(Node, key), DtB(->val), 4+offsetof(Node, val), LJ_TSTR, LJ_TNIL); 8647 dasm_put(Dst, 5966, 32-1, LJ_TTAB, Dt6(->hmask), Dt5(->hash), Dt6(->node), Dt6(->nomm), 31-5, 31-3, Dt6(->marked), DtB(->key), 4+offsetof(Node, key), DtB(->val), 4+offsetof(Node, val), LJ_TSTR, LJ_TNIL);
8646 dasm_put(Dst, 6015, LJ_GC_BLACK, DtB(->val), Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DtB(->next), Dt6(->metatable), DISPATCH_GL(tmptv), Dt1(->base), Dt6(->nomm), 1<<MM_newindex); 8648 dasm_put(Dst, 6017, LJ_GC_BLACK, DtB(->val), Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DtB(->next), Dt6(->metatable), DISPATCH_GL(tmptv), Dt1(->base), Dt6(->nomm), 1<<MM_newindex);
8647 dasm_put(Dst, 6071, LJ_TSTR, Dt1(->base), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist)); 8649 dasm_put(Dst, 6073, LJ_TSTR, Dt1(->base), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist));
8648 break; 8650 break;
8649 case BC_TSETB: 8651 case BC_TSETB:
8650 dasm_put(Dst, 6096, 32-3, LJ_TTAB, Dt6(->asize), Dt6(->array), Dt6(->marked), LJ_TNIL, LJ_GC_BLACK, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DISPATCH_GL(gc.grayagain)); 8652 dasm_put(Dst, 6098, 32-3, LJ_TTAB, Dt6(->asize), Dt6(->array), Dt6(->marked), LJ_TNIL, LJ_GC_BLACK, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DISPATCH_GL(gc.grayagain));
8651 dasm_put(Dst, 6154, DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist)); 8653 dasm_put(Dst, 6156, DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist));
8652 break; 8654 break;
8653 8655
8654 case BC_TSETM: 8656 case BC_TSETM:
8655 dasm_put(Dst, 6164, 32-3, Dt6(->asize), 31-3, Dt6(->marked), Dt6(->array), LJ_GC_BLACK, Dt1(->base), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist)); 8657 dasm_put(Dst, 6166, 32-3, Dt6(->asize), 31-3, Dt6(->marked), Dt6(->array), LJ_GC_BLACK, Dt1(->base), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist));
8656 dasm_put(Dst, 6233); 8658 dasm_put(Dst, 6235);
8657 break; 8659 break;
8658 8660
8659 /* -- Calls and vararg handling ----------------------------------------- */ 8661 /* -- Calls and vararg handling ----------------------------------------- */
8660 8662
8661 case BC_CALLM: 8663 case BC_CALLM:
8662 dasm_put(Dst, 6236); 8664 dasm_put(Dst, 6238);
8663 break; 8665 break;
8664 case BC_CALL: 8666 case BC_CALL:
8665 dasm_put(Dst, 6238, LJ_TFUNC, Dt7(->pc)); 8667 dasm_put(Dst, 6240, LJ_TFUNC, Dt7(->pc));
8666 break; 8668 break;
8667 8669
8668 case BC_CALLMT: 8670 case BC_CALLMT:
8669 dasm_put(Dst, 6259); 8671 dasm_put(Dst, 6261);
8670 break; 8672 break;
8671 case BC_CALLT: 8673 case BC_CALLT:
8672 dasm_put(Dst, 6261, LJ_TFUNC, FRAME_TYPE, Dt7(->ffid), FRAME_VARG, Dt7(->pc), -4-8, Dt7(->pc), PC2PROTO(k), FRAME_TYPEP); 8674 dasm_put(Dst, 6263, LJ_TFUNC, FRAME_TYPE, Dt7(->ffid), FRAME_VARG, Dt7(->pc), -4-8, Dt7(->pc), PC2PROTO(k), FRAME_TYPEP);
8673 dasm_put(Dst, 6325, FRAME_TYPE); 8675 dasm_put(Dst, 6327, FRAME_TYPE);
8674 break; 8676 break;
8675 8677
8676 case BC_ITERC: 8678 case BC_ITERC:
8677 dasm_put(Dst, 6334, LJ_TFUNC, Dt7(->pc)); 8679 dasm_put(Dst, 6336, LJ_TFUNC, Dt7(->pc));
8678 break; 8680 break;
8679 8681
8680 case BC_ITERN: 8682 case BC_ITERN:
8681#if LJ_HASJIT 8683#if LJ_HASJIT
8682#endif 8684#endif
8683 dasm_put(Dst, 6361, Dt6(->asize), Dt6(->array), 31-3, LJ_TNIL); 8685 dasm_put(Dst, 6363, Dt6(->asize), Dt6(->array), 31-3, LJ_TNIL);
8684 if (LJ_DUALNUM) { 8686 if (LJ_DUALNUM) {
8685 dasm_put(Dst, 6383); 8687 dasm_put(Dst, 6385);
8686 } else { 8688 } else {
8687 dasm_put(Dst, 6386); 8689 dasm_put(Dst, 6388);
8688 } 8690 }
8689 dasm_put(Dst, 6390, -(BCBIAS_J*4 >> 16)); 8691 dasm_put(Dst, 6392, -(BCBIAS_J*4 >> 16));
8690 if (!LJ_DUALNUM) { 8692 if (!LJ_DUALNUM) {
8691 dasm_put(Dst, 6398); 8693 dasm_put(Dst, 6400);
8692 } 8694 }
8693 dasm_put(Dst, 6400, Dt6(->hmask), Dt6(->node), 31-5, 31-3, LJ_TNIL, DtB(->key), -(BCBIAS_J*4 >> 16)); 8695 dasm_put(Dst, 6402, Dt6(->hmask), Dt6(->node), 31-5, 31-3, LJ_TNIL, DtB(->key), -(BCBIAS_J*4 >> 16));
8694 break; 8696 break;
8695 8697
8696 case BC_ISNEXT: 8698 case BC_ISNEXT:
8697 dasm_put(Dst, 6456, LJ_TTAB, LJ_TFUNC, LJ_TNIL, Dt8(->ffid), FF_next_N, 32-1, -(BCBIAS_J*4 >> 16), BC_JMP, BC_ITERC, -(BCBIAS_J*4 >> 16)); 8699 dasm_put(Dst, 6458, LJ_TTAB, LJ_TFUNC, LJ_TNIL, Dt8(->ffid), FF_next_N, 32-1, -(BCBIAS_J*4 >> 16), BC_JMP, BC_ITERC, -(BCBIAS_J*4 >> 16));
8698 break; 8700 break;
8699 8701
8700 case BC_VARG: 8702 case BC_VARG:
8701 dasm_put(Dst, 6506, FRAME_VARG, Dt1(->maxstack), Dt1(->top), Dt1(->base), 32-3, Dt1(->base)); 8703 dasm_put(Dst, 6508, FRAME_VARG, Dt1(->maxstack), Dt1(->top), Dt1(->base), 32-3, Dt1(->base));
8702 dasm_put(Dst, 6586); 8704 dasm_put(Dst, 6588);
8703 break; 8705 break;
8704 8706
8705 /* -- Returns ----------------------------------------------------------- */ 8707 /* -- Returns ----------------------------------------------------------- */
8706 8708
8707 case BC_RETM: 8709 case BC_RETM:
8708 dasm_put(Dst, 6592); 8710 dasm_put(Dst, 6594);
8709 break; 8711 break;
8710 8712
8711 case BC_RET: 8713 case BC_RET:
8712 dasm_put(Dst, 6594, FRAME_TYPE, FRAME_VARG, Dt7(->pc), PC2PROTO(k), FRAME_TYPEP); 8714 dasm_put(Dst, 6596, FRAME_TYPE, FRAME_VARG, Dt7(->pc), PC2PROTO(k), FRAME_TYPEP);
8713 break; 8715 break;
8714 8716
8715 case BC_RET0: case BC_RET1: 8717 case BC_RET0: case BC_RET1:
8716 dasm_put(Dst, 6664, FRAME_TYPE, FRAME_VARG); 8718 dasm_put(Dst, 6666, FRAME_TYPE, FRAME_VARG);
8717 if (op == BC_RET1) { 8719 if (op == BC_RET1) {
8718 dasm_put(Dst, 6677); 8720 dasm_put(Dst, 6679);
8719 } 8721 }
8720 dasm_put(Dst, 6680, Dt7(->pc), PC2PROTO(k)); 8722 dasm_put(Dst, 6682, Dt7(->pc), PC2PROTO(k));
8721 break; 8723 break;
8722 8724
8723 /* -- Loops and branches ------------------------------------------------ */ 8725 /* -- Loops and branches ------------------------------------------------ */
8724 8726
8725 case BC_FORL: 8727 case BC_FORL:
8726#if LJ_HASJIT 8728#if LJ_HASJIT
8727 dasm_put(Dst, 6708); 8729 dasm_put(Dst, 6710);
8728#endif 8730#endif
8729 break; 8731 break;
8730 8732
@@ -8737,93 +8739,93 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
8737 case BC_IFORL: 8739 case BC_IFORL:
8738 vk = (op == BC_IFORL || op == BC_JFORL); 8740 vk = (op == BC_IFORL || op == BC_JFORL);
8739 if (LJ_DUALNUM) { 8741 if (LJ_DUALNUM) {
8740 dasm_put(Dst, 6710, FORL_IDX*8+4); 8742 dasm_put(Dst, 6712, FORL_IDX*8+4);
8741 if (vk) { 8743 if (vk) {
8742 dasm_put(Dst, 6715, FORL_STEP*8+4, FORL_STOP*8+4, FORL_IDX*8+4); 8744 dasm_put(Dst, 6717, FORL_STEP*8+4, FORL_STOP*8+4, FORL_IDX*8+4);
8743 } else { 8745 } else {
8744 dasm_put(Dst, 6729, FORL_STEP*8, FORL_STEP*8+4, FORL_STOP*8, FORL_STOP*8+4); 8746 dasm_put(Dst, 6731, FORL_STEP*8, FORL_STEP*8+4, FORL_STOP*8, FORL_STOP*8+4);
8745 } 8747 }
8746 dasm_put(Dst, 6745, FORL_EXT*8); 8748 dasm_put(Dst, 6747, FORL_EXT*8);
8747 if (op != BC_JFORL) { 8749 if (op != BC_JFORL) {
8748 dasm_put(Dst, 6752, 32-1); 8750 dasm_put(Dst, 6754, 32-1);
8749 } 8751 }
8750 dasm_put(Dst, 6755, FORL_EXT*8+4); 8752 dasm_put(Dst, 6757, FORL_EXT*8+4);
8751 if (op != BC_JFORL) { 8753 if (op != BC_JFORL) {
8752 dasm_put(Dst, 6758); 8754 dasm_put(Dst, 6760);
8753 } 8755 }
8754 if (op == BC_FORI) { 8756 if (op == BC_FORI) {
8755 dasm_put(Dst, 6760); 8757 dasm_put(Dst, 6762);
8756 } else if (op == BC_JFORI) { 8758 } else if (op == BC_JFORI) {
8757 dasm_put(Dst, 6763, -(BCBIAS_J*4 >> 16), BC_JLOOP); 8759 dasm_put(Dst, 6765, -(BCBIAS_J*4 >> 16), BC_JLOOP);
8758 } else if (op == BC_IFORL) { 8760 } else if (op == BC_IFORL) {
8759 dasm_put(Dst, 6768, -(BCBIAS_J*4 >> 16)); 8761 dasm_put(Dst, 6770, -(BCBIAS_J*4 >> 16));
8760 } else { 8762 } else {
8761 dasm_put(Dst, 6773, BC_JLOOP); 8763 dasm_put(Dst, 6775, BC_JLOOP);
8762 } 8764 }
8763 dasm_put(Dst, 6776); 8765 dasm_put(Dst, 6778);
8764 if (vk) { 8766 if (vk) {
8765 dasm_put(Dst, 6792); 8767 dasm_put(Dst, 6794);
8766 } 8768 }
8767 } 8769 }
8768 if (vk) { 8770 if (vk) {
8769 if (LJ_DUALNUM) { 8771 if (LJ_DUALNUM) {
8770 dasm_put(Dst, 6799, FORL_IDX*8); 8772 dasm_put(Dst, 6801, FORL_IDX*8);
8771 } else { 8773 } else {
8772 dasm_put(Dst, 6803); 8774 dasm_put(Dst, 6805);
8773 } 8775 }
8774 dasm_put(Dst, 6805, FORL_STEP*8, FORL_STOP*8, FORL_STEP*8, FORL_IDX*8); 8776 dasm_put(Dst, 6807, FORL_STEP*8, FORL_STOP*8, FORL_STEP*8, FORL_IDX*8);
8775 } else { 8777 } else {
8776 if (LJ_DUALNUM) { 8778 if (LJ_DUALNUM) {
8777 dasm_put(Dst, 6815); 8779 dasm_put(Dst, 6817);
8778 } else { 8780 } else {
8779 dasm_put(Dst, 6817, FORL_STEP*8, FORL_STOP*8); 8781 dasm_put(Dst, 6819, FORL_STEP*8, FORL_STOP*8);
8780 } 8782 }
8781 dasm_put(Dst, 6826, FORL_IDX*8, FORL_STEP*8, FORL_STOP*8); 8783 dasm_put(Dst, 6828, FORL_IDX*8, FORL_STEP*8, FORL_STOP*8);
8782 } 8784 }
8783 dasm_put(Dst, 6837); 8785 dasm_put(Dst, 6839);
8784 if (op != BC_JFORL) { 8786 if (op != BC_JFORL) {
8785 dasm_put(Dst, 6839, 32-1); 8787 dasm_put(Dst, 6841, 32-1);
8786 } 8788 }
8787 dasm_put(Dst, 6842, FORL_EXT*8); 8789 dasm_put(Dst, 6844, FORL_EXT*8);
8788 if (op != BC_JFORL) { 8790 if (op != BC_JFORL) {
8789 dasm_put(Dst, 6845); 8791 dasm_put(Dst, 6847);
8790 } 8792 }
8791 dasm_put(Dst, 6847); 8793 dasm_put(Dst, 6849);
8792 if (op == BC_JFORI) { 8794 if (op == BC_JFORI) {
8793 dasm_put(Dst, 6849, -(BCBIAS_J*4 >> 16)); 8795 dasm_put(Dst, 6851, -(BCBIAS_J*4 >> 16));
8794 } 8796 }
8795 dasm_put(Dst, 6852); 8797 dasm_put(Dst, 6854);
8796 if (op == BC_FORI) { 8798 if (op == BC_FORI) {
8797 dasm_put(Dst, 6855); 8799 dasm_put(Dst, 6857);
8798 } else if (op == BC_IFORL) { 8800 } else if (op == BC_IFORL) {
8799 if (LJ_DUALNUM) { 8801 if (LJ_DUALNUM) {
8800 dasm_put(Dst, 6858); 8802 dasm_put(Dst, 6860);
8801 } else { 8803 } else {
8802 dasm_put(Dst, 6861); 8804 dasm_put(Dst, 6863);
8803 } 8805 }
8804 dasm_put(Dst, 6864, -(BCBIAS_J*4 >> 16)); 8806 dasm_put(Dst, 6866, -(BCBIAS_J*4 >> 16));
8805 } else { 8807 } else {
8806 dasm_put(Dst, 6868, BC_JLOOP); 8808 dasm_put(Dst, 6870, BC_JLOOP);
8807 } 8809 }
8808 if (LJ_DUALNUM) { 8810 if (LJ_DUALNUM) {
8809 dasm_put(Dst, 6871); 8811 dasm_put(Dst, 6873);
8810 } else { 8812 } else {
8811 dasm_put(Dst, 6874); 8813 dasm_put(Dst, 6876);
8812 } 8814 }
8813 dasm_put(Dst, 6886); 8815 dasm_put(Dst, 6888);
8814 if (op == BC_FORI) { 8816 if (op == BC_FORI) {
8815 dasm_put(Dst, 6888, -(BCBIAS_J*4 >> 16)); 8817 dasm_put(Dst, 6890, -(BCBIAS_J*4 >> 16));
8816 } else if (op == BC_IFORL) { 8818 } else if (op == BC_IFORL) {
8817 dasm_put(Dst, 6894); 8819 dasm_put(Dst, 6896);
8818 } else { 8820 } else {
8819 dasm_put(Dst, 6897, BC_JLOOP); 8821 dasm_put(Dst, 6899, BC_JLOOP);
8820 } 8822 }
8821 dasm_put(Dst, 6900); 8823 dasm_put(Dst, 6902);
8822 break; 8824 break;
8823 8825
8824 case BC_ITERL: 8826 case BC_ITERL:
8825#if LJ_HASJIT 8827#if LJ_HASJIT
8826 dasm_put(Dst, 6903); 8828 dasm_put(Dst, 6905);
8827#endif 8829#endif
8828 break; 8830 break;
8829 8831
@@ -8832,40 +8834,40 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
8832 break; 8834 break;
8833#endif 8835#endif
8834 case BC_IITERL: 8836 case BC_IITERL:
8835 dasm_put(Dst, 6905, LJ_TNIL); 8837 dasm_put(Dst, 6907, LJ_TNIL);
8836 if (op == BC_JITERL) { 8838 if (op == BC_JITERL) {
8837 dasm_put(Dst, 6912); 8839 dasm_put(Dst, 6914);
8838 } else { 8840 } else {
8839 dasm_put(Dst, 6914, 32-1, -(BCBIAS_J*4 >> 16)); 8841 dasm_put(Dst, 6916, 32-1, -(BCBIAS_J*4 >> 16));
8840 } 8842 }
8841 dasm_put(Dst, 6922); 8843 dasm_put(Dst, 6924);
8842 break; 8844 break;
8843 8845
8844 case BC_LOOP: 8846 case BC_LOOP:
8845#if LJ_HASJIT 8847#if LJ_HASJIT
8846 dasm_put(Dst, 6934); 8848 dasm_put(Dst, 6936);
8847#endif 8849#endif
8848 break; 8850 break;
8849 8851
8850 case BC_ILOOP: 8852 case BC_ILOOP:
8851 dasm_put(Dst, 6936); 8853 dasm_put(Dst, 6938);
8852 break; 8854 break;
8853 8855
8854 case BC_JLOOP: 8856 case BC_JLOOP:
8855#if LJ_HASJIT 8857#if LJ_HASJIT
8856 dasm_put(Dst, 6947); 8858 dasm_put(Dst, 6949);
8857#endif 8859#endif
8858 break; 8860 break;
8859 8861
8860 case BC_JMP: 8862 case BC_JMP:
8861 dasm_put(Dst, 6949, 32-1, -(BCBIAS_J*4 >> 16)); 8863 dasm_put(Dst, 6951, 32-1, -(BCBIAS_J*4 >> 16));
8862 break; 8864 break;
8863 8865
8864 /* -- Function headers -------------------------------------------------- */ 8866 /* -- Function headers -------------------------------------------------- */
8865 8867
8866 case BC_FUNCF: 8868 case BC_FUNCF:
8867#if LJ_HASJIT 8869#if LJ_HASJIT
8868 dasm_put(Dst, 6965); 8870 dasm_put(Dst, 6967);
8869#endif 8871#endif
8870 case BC_FUNCV: /* NYI: compiled vararg functions. */ 8872 case BC_FUNCV: /* NYI: compiled vararg functions. */
8871 break; 8873 break;
@@ -8875,38 +8877,38 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
8875 break; 8877 break;
8876#endif 8878#endif
8877 case BC_IFUNCF: 8879 case BC_IFUNCF:
8878 dasm_put(Dst, 6967, Dt1(->maxstack), -4+PC2PROTO(numparams), -4+PC2PROTO(k), 31-3); 8880 dasm_put(Dst, 6969, Dt1(->maxstack), -4+PC2PROTO(numparams), -4+PC2PROTO(k), 31-3);
8879 if (op == BC_JFUNCF) { 8881 if (op == BC_JFUNCF) {
8880 dasm_put(Dst, 6985);
8881 } else {
8882 dasm_put(Dst, 6987); 8882 dasm_put(Dst, 6987);
8883 } else {
8884 dasm_put(Dst, 6989);
8883 } 8885 }
8884 dasm_put(Dst, 6996); 8886 dasm_put(Dst, 6998);
8885 break; 8887 break;
8886 8888
8887 case BC_JFUNCV: 8889 case BC_JFUNCV:
8888#if !LJ_HASJIT 8890#if !LJ_HASJIT
8889 break; 8891 break;
8890#endif 8892#endif
8891 dasm_put(Dst, 7002); 8893 dasm_put(Dst, 7004);
8892 break; /* NYI: compiled vararg functions. */ 8894 break; /* NYI: compiled vararg functions. */
8893 8895
8894 case BC_IFUNCV: 8896 case BC_IFUNCV:
8895 dasm_put(Dst, 7004, Dt1(->maxstack), 8+FRAME_VARG, -4+PC2PROTO(k), -4+PC2PROTO(numparams), LJ_TNIL); 8897 dasm_put(Dst, 7006, Dt1(->maxstack), 8+FRAME_VARG, -4+PC2PROTO(k), -4+PC2PROTO(numparams), LJ_TNIL);
8896 break; 8898 break;
8897 8899
8898 case BC_FUNCC: 8900 case BC_FUNCC:
8899 case BC_FUNCCW: 8901 case BC_FUNCCW:
8900 if (op == BC_FUNCC) { 8902 if (op == BC_FUNCC) {
8901 dasm_put(Dst, 7057, Dt8(->f)); 8903 dasm_put(Dst, 7059, Dt8(->f));
8902 } else { 8904 } else {
8903 dasm_put(Dst, 7060, DISPATCH_GL(wrapf)); 8905 dasm_put(Dst, 7062, DISPATCH_GL(wrapf));
8904 } 8906 }
8905 dasm_put(Dst, 7063, Dt1(->maxstack), Dt1(->base), Dt1(->top), ~LJ_VMST_C); 8907 dasm_put(Dst, 7065, Dt1(->maxstack), Dt1(->base), Dt1(->top), ~LJ_VMST_C);
8906 if (op == BC_FUNCCW) { 8908 if (op == BC_FUNCCW) {
8907 dasm_put(Dst, 7076, Dt8(->f)); 8909 dasm_put(Dst, 7078, Dt8(->f));
8908 } 8910 }
8909 dasm_put(Dst, 7079, DISPATCH_GL(vmstate), Dt1(->top), 31-3, Dt1(->base), ~LJ_VMST_INTERP, DISPATCH_GL(vmstate)); 8911 dasm_put(Dst, 7081, DISPATCH_GL(vmstate), Dt1(->top), 31-3, Dt1(->base), ~LJ_VMST_INTERP, DISPATCH_GL(vmstate));
8910 break; 8912 break;
8911 8913
8912 /* ---------------------------------------------------------------------- */ 8914 /* ---------------------------------------------------------------------- */
@@ -8926,7 +8928,7 @@ static int build_backend(BuildCtx *ctx)
8926 8928
8927 build_subroutines(ctx); 8929 build_subroutines(ctx);
8928 8930
8929 dasm_put(Dst, 7100); 8931 dasm_put(Dst, 7102);
8930 for (op = 0; op < BC__MAX; op++) 8932 for (op = 0; op < BC__MAX; op++)
8931 build_ins(ctx, (BCOp)op, op); 8933 build_ins(ctx, (BCOp)op, op);
8932 8934