aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2010-03-15 19:00:16 +0100
committerMike Pall <mike>2010-03-15 19:00:16 +0100
commit1fea5cb822a4da746005e0cec35fc2fe2ed5880f (patch)
treef94b250dd73b2c990cc2e92d2515202aa7a42844 /src
parent871941a8404c4665e8c46cc1bb64040955a046f8 (diff)
downloadluajit-1fea5cb822a4da746005e0cec35fc2fe2ed5880f.tar.gz
luajit-1fea5cb822a4da746005e0cec35fc2fe2ed5880f.tar.bz2
luajit-1fea5cb822a4da746005e0cec35fc2fe2ed5880f.zip
Fix TSETM on x64/SSE builds when table is resized.
Diffstat (limited to 'src')
-rw-r--r--src/buildvm_x64.h289
-rw-r--r--src/buildvm_x64win.h291
-rw-r--r--src/buildvm_x86.dasc10
-rw-r--r--src/buildvm_x86.h283
4 files changed, 425 insertions, 448 deletions
diff --git a/src/buildvm_x64.h b/src/buildvm_x64.h
index 311679d2..c84ad50e 100644
--- a/src/buildvm_x64.h
+++ b/src/buildvm_x64.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 char build_actionlist[14049] = { 15static const unsigned char build_actionlist[14048] = {
16 254,1,248,10,252,247,195,237,15,132,244,11,131,227,252,248,41,218,72,141, 16 254,1,248,10,252,247,195,237,15,132,244,11,131,227,252,248,41,218,72,141,
17 76,25,252,248,139,90,252,252,199,68,10,4,237,248,12,131,192,1,137,68,36,4, 17 76,25,252,248,139,90,252,252,199,68,10,4,237,248,12,131,192,1,137,68,36,4,
18 252,247,195,237,15,132,244,13,248,14,252,247,195,237,15,132,244,10,65,199, 18 252,247,195,237,15,132,244,13,248,14,252,247,195,237,15,132,244,10,65,199,
@@ -615,83 +615,83 @@ static const unsigned char build_actionlist[14049] = {
615 232,131,195,4,193,232,16,65,252,255,36,252,238,248,3,131,189,233,0,15,132, 615 232,131,195,4,193,232,16,65,252,255,36,252,238,248,3,131,189,233,0,15,132,
616 244,1,255,139,141,233,252,246,129,233,235,15,132,244,38,15,182,75,252,253, 616 244,1,255,139,141,233,252,246,129,233,235,15,132,244,38,15,182,75,252,253,
617 252,233,244,1,248,7,128,165,233,235,65,139,142,233,65,137,174,233,137,141, 617 252,233,244,1,248,7,128,165,233,235,65,139,142,233,65,137,174,233,137,141,
618 233,15,182,75,252,253,252,233,244,2,255,68,137,60,36,255,248,1,141,12,202, 618 233,15,182,75,252,253,252,233,244,2,255,68,137,60,36,255,252,242,69,15,45,
619 139,105,252,248,252,246,133,233,235,15,133,244,253,248,2,139,68,36,4,255, 619 60,199,255,248,1,141,12,202,139,105,252,248,252,246,133,233,235,15,133,244,
620 252,242,68,15,45,252,248,255,131,232,1,15,132,244,250,68,1,252,248,59,133, 620 253,248,2,139,68,36,4,131,232,1,15,132,244,250,68,1,252,248,59,133,233,15,
621 233,15,131,244,251,68,41,252,248,65,193,231,3,68,3,189,233,248,3,139,41,65, 621 131,244,251,68,41,252,248,65,193,231,3,68,3,189,233,248,3,139,41,65,137,47,
622 137,47,139,105,4,131,193,8,65,137,111,4,65,131,199,8,131,232,1,15,133,244, 622 139,105,4,131,193,8,65,137,111,4,65,131,199,8,131,232,1,15,133,244,3,248,
623 3,248,4,68,139,60,36,139,3,15,182,204,15,182,232,131,195,4,193,232,16,65, 623 4,68,139,60,36,139,3,15,182,204,15,182,232,131,195,4,193,232,16,65,252,255,
624 252,255,36,252,238,248,5,139,124,36,24,137,151,233,137,252,238,137,194,137, 624 36,252,238,248,5,139,124,36,24,137,151,233,137,252,238,137,194,137,252,253,
625 252,253,137,92,36,28,232,251,1,33,139,149,233,15,182,75,252,253,252,233,244, 625 137,92,36,28,232,251,1,33,139,149,233,15,182,75,252,253,252,233,244,1,248,
626 1,248,7,128,165,233,235,65,139,134,233,65,137,174,233,255,137,133,233,252, 626 7,255,128,165,233,235,65,139,134,233,65,137,174,233,137,133,233,252,233,244,
627 233,244,2,255,3,68,36,4,255,129,124,253,202,4,239,139,44,202,15,133,244,51, 627 2,255,3,68,36,4,255,129,124,253,202,4,239,139,44,202,15,133,244,51,141,84,
628 141,84,202,8,137,90,252,252,139,157,233,139,11,15,182,252,233,15,182,205, 628 202,8,137,90,252,252,139,157,233,139,11,15,182,252,233,15,182,205,131,195,
629 131,195,4,65,252,255,36,252,238,255,141,76,202,8,65,137,215,139,105,252,248, 629 4,65,252,255,36,252,238,255,141,76,202,8,65,137,215,139,105,252,248,129,121,
630 129,121,253,252,252,239,15,133,244,28,248,52,139,90,252,252,252,247,195,237, 630 253,252,252,239,15,133,244,28,248,52,139,90,252,252,252,247,195,237,15,133,
631 15,133,244,253,248,1,137,106,252,248,137,68,36,4,131,232,1,15,132,244,249, 631 244,253,248,1,137,106,252,248,137,68,36,4,131,232,1,15,132,244,249,248,2,
632 248,2,139,41,65,137,47,139,105,4,65,137,111,4,65,131,199,8,131,193,8,131, 632 139,41,65,137,47,139,105,4,65,137,111,4,65,131,199,8,131,193,8,131,232,1,
633 232,1,15,133,244,2,139,106,252,248,248,3,139,68,36,4,128,189,233,1,15,135, 633 15,133,244,2,139,106,252,248,248,3,139,68,36,4,128,189,233,1,15,135,244,251,
634 244,251,248,4,139,157,233,139,11,15,182,252,233,15,182,205,131,195,4,65,252, 634 248,4,139,157,233,139,11,15,182,252,233,15,182,205,131,195,4,65,252,255,36,
635 255,36,252,238,248,5,255,252,247,195,237,15,133,244,4,15,182,75,252,253,72, 635 252,238,248,5,255,252,247,195,237,15,133,244,4,15,182,75,252,253,72,252,247,
636 252,247,209,141,12,202,68,139,121,252,248,69,139,191,233,69,139,191,233,252, 636 209,141,12,202,68,139,121,252,248,69,139,191,233,69,139,191,233,252,233,244,
637 233,244,4,248,7,15,139,244,1,131,227,252,248,41,218,65,137,215,139,90,252, 637 4,248,7,15,139,244,1,131,227,252,248,41,218,65,137,215,139,90,252,252,252,
638 252,252,233,244,1,255,141,76,202,8,139,105,232,139,65,252,236,137,41,137, 638 233,244,1,255,141,76,202,8,139,105,232,139,65,252,236,137,41,137,65,4,139,
639 65,4,139,105,252,240,139,65,252,244,137,105,8,137,65,12,139,105,224,139,65, 639 105,252,240,139,65,252,244,137,105,8,137,65,12,139,105,224,139,65,228,137,
640 228,137,105,252,248,137,65,252,252,129,252,248,239,184,237,15,133,244,28, 640 105,252,248,137,65,252,252,129,252,248,239,184,237,15,133,244,28,137,202,
641 137,202,137,90,252,252,139,157,233,139,11,15,182,252,233,15,182,205,131,195, 641 137,90,252,252,139,157,233,139,11,15,182,252,233,15,182,205,131,195,4,65,
642 4,65,252,255,36,252,238,255,15,182,252,236,139,66,252,248,141,12,202,139, 642 252,255,36,252,238,255,15,182,252,236,139,66,252,248,141,12,202,139,128,233,
643 128,233,15,182,128,233,68,137,60,36,68,141,188,253,194,233,68,43,122,252, 643 15,182,128,233,68,137,60,36,68,141,188,253,194,233,68,43,122,252,252,133,
644 252,133,252,237,15,132,244,251,141,108,252,233,252,248,65,57,215,15,131,244, 644 252,237,15,132,244,251,141,108,252,233,252,248,65,57,215,15,131,244,248,248,
645 248,248,1,65,139,71,252,248,137,1,65,139,71,252,252,65,131,199,8,137,65,4, 645 1,65,139,71,252,248,137,1,65,139,71,252,252,65,131,199,8,137,65,4,131,193,
646 131,193,8,57,252,233,15,131,244,249,65,57,215,15,130,244,1,248,2,199,65,4, 646 8,57,252,233,15,131,244,249,65,57,215,15,130,244,1,248,2,199,65,4,237,131,
647 237,131,193,8,57,252,233,15,130,244,2,248,3,68,139,60,36,139,3,15,182,204, 647 193,8,57,252,233,15,130,244,2,248,3,68,139,60,36,139,3,15,182,204,15,182,
648 15,182,232,131,195,4,193,232,16,65,252,255,36,252,238,248,5,199,68,36,4,1, 648 232,131,195,4,193,232,16,65,252,255,36,252,238,248,5,199,68,36,4,1,0,0,0,
649 0,0,0,137,208,68,41,252,248,15,134,244,3,255,137,197,193,252,237,3,131,197, 649 137,208,68,41,252,248,15,134,244,3,255,137,197,193,252,237,3,131,197,1,137,
650 1,137,108,36,4,139,108,36,24,1,200,59,133,233,15,135,244,253,248,6,65,139, 650 108,36,4,139,108,36,24,1,200,59,133,233,15,135,244,253,248,6,65,139,71,252,
651 71,252,248,137,1,65,139,71,252,252,65,131,199,8,137,65,4,131,193,8,65,57, 651 248,137,1,65,139,71,252,252,65,131,199,8,137,65,4,131,193,8,65,57,215,15,
652 215,15,130,244,6,252,233,244,3,248,7,137,149,233,137,141,233,137,92,36,28, 652 130,244,6,252,233,244,3,248,7,137,149,233,137,141,233,137,92,36,28,65,41,
653 65,41,215,139,116,36,4,131,252,238,1,137,252,239,232,251,1,0,139,149,233, 653 215,139,116,36,4,131,252,238,1,137,252,239,232,251,1,0,139,149,233,139,141,
654 139,141,233,65,1,215,252,233,244,6,255,193,225,3,255,248,1,139,90,252,252, 654 233,65,1,215,252,233,244,6,255,193,225,3,255,248,1,139,90,252,252,137,68,
655 137,68,36,4,252,247,195,237,15,133,244,253,255,248,13,65,137,215,131,232, 655 36,4,252,247,195,237,15,133,244,253,255,248,13,65,137,215,131,232,1,15,132,
656 1,15,132,244,249,248,2,65,139,44,15,65,137,111,252,248,65,139,108,15,4,65, 656 244,249,248,2,65,139,44,15,65,137,111,252,248,65,139,108,15,4,65,137,111,
657 137,111,252,252,65,131,199,8,131,232,1,15,133,244,2,248,3,139,68,36,4,15, 657 252,252,65,131,199,8,131,232,1,15,133,244,2,248,3,139,68,36,4,15,182,107,
658 182,107,252,255,248,5,57,197,15,135,244,252,255,139,108,10,4,137,106,252, 658 252,255,248,5,57,197,15,135,244,252,255,139,108,10,4,137,106,252,252,139,
659 252,139,44,10,137,106,252,248,255,248,5,56,67,252,255,15,135,244,252,255, 659 44,10,137,106,252,248,255,248,5,56,67,252,255,15,135,244,252,255,15,182,75,
660 15,182,75,252,253,72,252,247,209,141,20,202,68,139,122,252,248,69,139,191, 660 252,253,72,252,247,209,141,20,202,68,139,122,252,248,69,139,191,233,69,139,
661 233,69,139,191,233,139,3,15,182,204,15,182,232,131,195,4,193,232,16,65,252, 661 191,233,139,3,15,182,204,15,182,232,131,195,4,193,232,16,65,252,255,36,252,
662 255,36,252,238,248,6,255,65,199,71,252,252,237,65,131,199,8,255,199,68,194, 662 238,248,6,255,65,199,71,252,252,237,65,131,199,8,255,199,68,194,252,244,237,
663 252,244,237,255,131,192,1,252,233,244,5,248,7,15,139,244,14,131,227,252,248, 663 255,131,192,1,252,233,244,5,248,7,15,139,244,14,131,227,252,248,41,218,255,
664 41,218,255,1,217,255,137,221,209,252,237,129,229,239,102,65,131,172,253,46, 664 1,217,255,137,221,209,252,237,129,229,239,102,65,131,172,253,46,233,1,15,
665 233,1,15,132,244,140,255,141,12,202,255,129,121,253,4,239,15,135,244,53,129, 665 132,244,140,255,141,12,202,255,129,121,253,4,239,15,135,244,53,129,121,253,
666 121,253,12,239,15,135,244,53,255,139,105,20,255,129,252,253,239,15,135,244, 666 12,239,15,135,244,53,255,139,105,20,255,129,252,253,239,15,135,244,53,255,
667 53,255,252,242,15,16,1,252,242,15,16,73,8,255,252,242,15,88,65,16,252,242, 667 252,242,15,16,1,252,242,15,16,73,8,255,252,242,15,88,65,16,252,242,15,17,
668 15,17,1,133,252,237,15,136,244,249,255,15,140,244,249,255,102,15,46,200,248, 668 1,133,252,237,15,136,244,249,255,15,140,244,249,255,102,15,46,200,248,1,252,
669 1,252,242,15,17,65,24,255,221,65,8,221,1,255,220,65,16,221,17,221,81,24,133, 669 242,15,17,65,24,255,221,65,8,221,1,255,220,65,16,221,17,221,81,24,133,252,
670 252,237,15,136,244,247,255,221,81,24,15,140,244,247,255,217,201,248,1,255, 670 237,15,136,244,247,255,221,81,24,15,140,244,247,255,217,201,248,1,255,15,
671 15,183,67,252,254,255,15,131,244,248,141,156,253,131,233,255,141,156,253, 671 183,67,252,254,255,15,131,244,248,141,156,253,131,233,255,141,156,253,131,
672 131,233,15,183,67,252,254,15,131,245,255,15,130,244,248,141,156,253,131,233, 672 233,15,183,67,252,254,15,131,245,255,15,130,244,248,141,156,253,131,233,255,
673 255,248,3,102,15,46,193,252,233,244,1,255,141,12,202,139,105,4,129,252,253, 673 248,3,102,15,46,193,252,233,244,1,255,141,12,202,139,105,4,129,252,253,239,
674 239,15,132,244,247,255,137,105,252,252,139,41,137,105,252,248,252,233,245, 674 15,132,244,247,255,137,105,252,252,139,41,137,105,252,248,252,233,245,255,
675 255,141,156,253,131,233,139,1,137,105,252,252,137,65,252,248,255,65,139,142, 675 141,156,253,131,233,139,1,137,105,252,252,137,65,252,248,255,65,139,142,233,
676 233,139,4,193,72,139,128,233,139,108,36,24,65,137,150,233,65,137,174,233, 676 139,4,193,72,139,128,233,139,108,36,24,65,137,150,233,65,137,174,233,76,137,
677 76,137,36,36,76,137,108,36,8,72,131,252,236,16,252,255,224,255,141,156,253, 677 36,36,76,137,108,36,8,72,131,252,236,16,252,255,224,255,141,156,253,131,233,
678 131,233,139,3,15,182,204,15,182,232,131,195,4,193,232,16,65,252,255,36,252, 678 139,3,15,182,204,15,182,232,131,195,4,193,232,16,65,252,255,36,252,238,255,
679 238,255,137,221,209,252,237,129,229,239,102,65,131,172,253,46,233,1,15,132, 679 137,221,209,252,237,129,229,239,102,65,131,172,253,46,233,1,15,132,244,142,
680 244,142,255,68,139,187,233,139,108,36,24,141,12,202,59,141,233,15,135,244, 680 255,68,139,187,233,139,108,36,24,141,12,202,59,141,233,15,135,244,23,15,182,
681 23,15,182,139,233,57,200,15,134,244,249,248,2,255,15,183,67,252,254,252,233, 681 139,233,57,200,15,134,244,249,248,2,255,15,183,67,252,254,252,233,245,255,
682 245,255,248,3,199,68,194,252,252,237,131,192,1,57,200,15,134,244,3,252,233, 682 248,3,199,68,194,252,252,237,131,192,1,57,200,15,134,244,3,252,233,244,2,
683 244,2,255,141,44,197,237,141,4,194,68,139,122,252,248,137,104,252,252,68, 683 255,141,44,197,237,141,4,194,68,139,122,252,248,137,104,252,252,68,137,120,
684 137,120,252,248,139,108,36,24,141,12,200,59,141,233,15,135,244,22,137,209, 684 252,248,139,108,36,24,141,12,200,59,141,233,15,135,244,22,137,209,137,194,
685 137,194,15,182,171,233,133,252,237,15,132,244,248,248,1,131,193,8,57,209, 685 15,182,171,233,133,252,237,15,132,244,248,248,1,131,193,8,57,209,15,131,244,
686 15,131,244,249,68,139,121,252,248,68,137,56,68,139,121,252,252,68,137,120, 686 249,68,139,121,252,248,68,137,56,68,139,121,252,252,68,137,120,4,131,192,
687 4,131,192,8,199,65,252,252,237,131,252,237,1,15,133,244,1,248,2,255,68,139, 687 8,199,65,252,252,237,131,252,237,1,15,133,244,1,248,2,255,68,139,187,233,
688 187,233,139,3,15,182,204,15,182,232,131,195,4,193,232,16,65,252,255,36,252, 688 139,3,15,182,204,15,182,232,131,195,4,193,232,16,65,252,255,36,252,238,255,
689 238,255,248,3,199,64,4,237,131,192,8,131,252,237,1,15,133,244,3,252,233,244, 689 248,3,199,64,4,237,131,192,8,131,252,237,1,15,133,244,3,252,233,244,2,255,
690 2,255,139,106,252,248,76,139,189,233,139,108,36,24,141,68,194,252,248,137, 690 139,106,252,248,76,139,189,233,139,108,36,24,141,68,194,252,248,137,149,233,
691 149,233,141,136,233,59,141,233,137,133,233,255,137,252,239,255,76,137,252, 691 141,136,233,59,141,233,137,133,233,255,137,252,239,255,76,137,252,254,137,
692 254,137,252,239,255,15,135,244,21,65,199,134,233,237,255,65,252,255,215,255, 692 252,239,255,15,135,244,21,65,199,134,233,237,255,65,252,255,215,255,65,252,
693 65,252,255,150,233,255,65,199,134,233,237,139,149,233,141,12,194,252,247, 693 255,150,233,255,65,199,134,233,237,139,149,233,141,12,194,252,247,217,3,141,
694 217,3,141,233,139,90,252,252,252,233,244,12,255,254,0 694 233,139,90,252,252,252,233,244,12,255,254,0
695}; 695};
696 696
697enum { 697enum {
@@ -1960,16 +1960,11 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
1960 case BC_TSETM: 1960 case BC_TSETM:
1961 dasm_put(Dst, 12468); 1961 dasm_put(Dst, 12468);
1962 if (sse) { 1962 if (sse) {
1963 dasm_put(Dst, 10999); 1963 dasm_put(Dst, 12473);
1964 } else {
1965 }
1966 dasm_put(Dst, 12473, Dt6(->marked), LJ_GC_BLACK);
1967 if (sse) {
1968 dasm_put(Dst, 12498);
1969 } else { 1964 } else {
1970 } 1965 }
1971 dasm_put(Dst, 12506, Dt6(->asize), Dt6(->array), Dt1(->base), Dt1(->base), Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain)); 1966 dasm_put(Dst, 12481, Dt6(->marked), LJ_GC_BLACK, Dt6(->asize), Dt6(->array), Dt1(->base), Dt1(->base));
1972 dasm_put(Dst, 12642, Dt6(->gclist)); 1967 dasm_put(Dst, 12629, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist));
1973 break; 1968 break;
1974 1969
1975 /* -- Calls and vararg handling ----------------------------------------- */ 1970 /* -- Calls and vararg handling ----------------------------------------- */
@@ -1977,60 +1972,60 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
1977 case BC_CALL: case BC_CALLM: 1972 case BC_CALL: case BC_CALLM:
1978 dasm_put(Dst, 10079); 1973 dasm_put(Dst, 10079);
1979 if (op == BC_CALLM) { 1974 if (op == BC_CALLM) {
1980 dasm_put(Dst, 12650); 1975 dasm_put(Dst, 12649);
1981 } 1976 }
1982 dasm_put(Dst, 12655, LJ_TFUNC, Dt7(->pc)); 1977 dasm_put(Dst, 12654, LJ_TFUNC, Dt7(->pc));
1983 break; 1978 break;
1984 1979
1985 case BC_CALLMT: 1980 case BC_CALLMT:
1986 dasm_put(Dst, 12650); 1981 dasm_put(Dst, 12649);
1987 break; 1982 break;
1988 case BC_CALLT: 1983 case BC_CALLT:
1989 dasm_put(Dst, 12698, LJ_TFUNC, FRAME_TYPE, Dt7(->ffid), Dt7(->pc)); 1984 dasm_put(Dst, 12697, LJ_TFUNC, FRAME_TYPE, Dt7(->ffid), Dt7(->pc));
1990 dasm_put(Dst, 12822, FRAME_TYPE, Dt7(->pc), PC2PROTO(k)); 1985 dasm_put(Dst, 12821, FRAME_TYPE, Dt7(->pc), PC2PROTO(k));
1991 break; 1986 break;
1992 1987
1993 case BC_ITERC: 1988 case BC_ITERC:
1994 dasm_put(Dst, 12883, LJ_TFUNC, 2+1, Dt7(->pc)); 1989 dasm_put(Dst, 12882, LJ_TFUNC, 2+1, Dt7(->pc));
1995 break; 1990 break;
1996 1991
1997 case BC_VARG: 1992 case BC_VARG:
1998 dasm_put(Dst, 12965, Dt7(->pc), PC2PROTO(numparams), (8+FRAME_VARG), LJ_TNIL); 1993 dasm_put(Dst, 12964, Dt7(->pc), PC2PROTO(numparams), (8+FRAME_VARG), LJ_TNIL);
1999 dasm_put(Dst, 13119, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); 1994 dasm_put(Dst, 13118, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top));
2000 break; 1995 break;
2001 1996
2002 /* -- Returns ----------------------------------------------------------- */ 1997 /* -- Returns ----------------------------------------------------------- */
2003 1998
2004 case BC_RETM: 1999 case BC_RETM:
2005 dasm_put(Dst, 12650); 2000 dasm_put(Dst, 12649);
2006 break; 2001 break;
2007 2002
2008 case BC_RET: case BC_RET0: case BC_RET1: 2003 case BC_RET: case BC_RET0: case BC_RET1:
2009 if (op != BC_RET0) { 2004 if (op != BC_RET0) {
2010 dasm_put(Dst, 13224); 2005 dasm_put(Dst, 13223);
2011 } 2006 }
2012 dasm_put(Dst, 13228, FRAME_TYPE); 2007 dasm_put(Dst, 13227, FRAME_TYPE);
2013 switch (op) { 2008 switch (op) {
2014 case BC_RET: 2009 case BC_RET:
2015 dasm_put(Dst, 13247); 2010 dasm_put(Dst, 13246);
2016 break; 2011 break;
2017 case BC_RET1: 2012 case BC_RET1:
2018 dasm_put(Dst, 13311); 2013 dasm_put(Dst, 13310);
2019 /* fallthrough */ 2014 /* fallthrough */
2020 case BC_RET0: 2015 case BC_RET0:
2021 dasm_put(Dst, 13327); 2016 dasm_put(Dst, 13326);
2022 default: 2017 default:
2023 break; 2018 break;
2024 } 2019 }
2025 dasm_put(Dst, 13338, Dt7(->pc), PC2PROTO(k)); 2020 dasm_put(Dst, 13337, Dt7(->pc), PC2PROTO(k));
2026 if (op == BC_RET) { 2021 if (op == BC_RET) {
2027 dasm_put(Dst, 13386, LJ_TNIL); 2022 dasm_put(Dst, 13385, LJ_TNIL);
2028 } else { 2023 } else {
2029 dasm_put(Dst, 13397, LJ_TNIL); 2024 dasm_put(Dst, 13396, LJ_TNIL);
2030 } 2025 }
2031 dasm_put(Dst, 13404); 2026 dasm_put(Dst, 13403);
2032 if (op != BC_RET0) { 2027 if (op != BC_RET0) {
2033 dasm_put(Dst, 13424); 2028 dasm_put(Dst, 13423);
2034 } 2029 }
2035 dasm_put(Dst, 4596); 2030 dasm_put(Dst, 4596);
2036 break; 2031 break;
@@ -2040,7 +2035,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2040 2035
2041 case BC_FORL: 2036 case BC_FORL:
2042#if LJ_HASJIT 2037#if LJ_HASJIT
2043 dasm_put(Dst, 13427, HOTCOUNT_PCMASK, GG_DISP2HOT); 2038 dasm_put(Dst, 13426, HOTCOUNT_PCMASK, GG_DISP2HOT);
2044#endif 2039#endif
2045 break; 2040 break;
2046 2041
@@ -2052,57 +2047,57 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2052 case BC_FORI: 2047 case BC_FORI:
2053 case BC_IFORL: 2048 case BC_IFORL:
2054 vk = (op == BC_IFORL || op == BC_JFORL); 2049 vk = (op == BC_IFORL || op == BC_JFORL);
2055 dasm_put(Dst, 13448); 2050 dasm_put(Dst, 13447);
2056 if (!vk) { 2051 if (!vk) {
2057 dasm_put(Dst, 13452, LJ_TISNUM, LJ_TISNUM); 2052 dasm_put(Dst, 13451, LJ_TISNUM, LJ_TISNUM);
2058 } 2053 }
2059 dasm_put(Dst, 13471); 2054 dasm_put(Dst, 13470);
2060 if (!vk) { 2055 if (!vk) {
2061 dasm_put(Dst, 13475, LJ_TISNUM); 2056 dasm_put(Dst, 13474, LJ_TISNUM);
2062 } 2057 }
2063 if (sse) { 2058 if (sse) {
2064 dasm_put(Dst, 13484); 2059 dasm_put(Dst, 13483);
2065 if (vk) { 2060 if (vk) {
2066 dasm_put(Dst, 13496); 2061 dasm_put(Dst, 13495);
2067 } else { 2062 } else {
2068 dasm_put(Dst, 13515); 2063 dasm_put(Dst, 13514);
2069 } 2064 }
2070 dasm_put(Dst, 13520); 2065 dasm_put(Dst, 13519);
2071 } else { 2066 } else {
2072 dasm_put(Dst, 13533); 2067 dasm_put(Dst, 13532);
2073 if (vk) { 2068 if (vk) {
2074 dasm_put(Dst, 13539); 2069 dasm_put(Dst, 13538);
2075 } else { 2070 } else {
2076 dasm_put(Dst, 13555); 2071 dasm_put(Dst, 13554);
2077 } 2072 }
2078 dasm_put(Dst, 13563); 2073 dasm_put(Dst, 13562);
2079 if (cmov) { 2074 if (cmov) {
2080 dasm_put(Dst, 9494); 2075 dasm_put(Dst, 9494);
2081 } else { 2076 } else {
2082 dasm_put(Dst, 9500); 2077 dasm_put(Dst, 9500);
2083 } 2078 }
2084 if (!cmov) { 2079 if (!cmov) {
2085 dasm_put(Dst, 13568); 2080 dasm_put(Dst, 13567);
2086 } 2081 }
2087 } 2082 }
2088 if (op == BC_FORI) { 2083 if (op == BC_FORI) {
2089 dasm_put(Dst, 13574, -BCBIAS_J*4); 2084 dasm_put(Dst, 13573, -BCBIAS_J*4);
2090 } else if (op == BC_JFORI) { 2085 } else if (op == BC_JFORI) {
2091 dasm_put(Dst, 13584, -BCBIAS_J*4, BC_JLOOP); 2086 dasm_put(Dst, 13583, -BCBIAS_J*4, BC_JLOOP);
2092 } else if (op == BC_IFORL) { 2087 } else if (op == BC_IFORL) {
2093 dasm_put(Dst, 13598, -BCBIAS_J*4); 2088 dasm_put(Dst, 13597, -BCBIAS_J*4);
2094 } else { 2089 } else {
2095 dasm_put(Dst, 13594, BC_JLOOP); 2090 dasm_put(Dst, 13593, BC_JLOOP);
2096 } 2091 }
2097 dasm_put(Dst, 9529); 2092 dasm_put(Dst, 9529);
2098 if (sse) { 2093 if (sse) {
2099 dasm_put(Dst, 13608); 2094 dasm_put(Dst, 13607);
2100 } 2095 }
2101 break; 2096 break;
2102 2097
2103 case BC_ITERL: 2098 case BC_ITERL:
2104#if LJ_HASJIT 2099#if LJ_HASJIT
2105 dasm_put(Dst, 13427, HOTCOUNT_PCMASK, GG_DISP2HOT); 2100 dasm_put(Dst, 13426, HOTCOUNT_PCMASK, GG_DISP2HOT);
2106#endif 2101#endif
2107 break; 2102 break;
2108 2103
@@ -2111,18 +2106,18 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2111 break; 2106 break;
2112#endif 2107#endif
2113 case BC_IITERL: 2108 case BC_IITERL:
2114 dasm_put(Dst, 13619, LJ_TNIL); 2109 dasm_put(Dst, 13618, LJ_TNIL);
2115 if (op == BC_JITERL) { 2110 if (op == BC_JITERL) {
2116 dasm_put(Dst, 13634, BC_JLOOP); 2111 dasm_put(Dst, 13633, BC_JLOOP);
2117 } else { 2112 } else {
2118 dasm_put(Dst, 13648, -BCBIAS_J*4); 2113 dasm_put(Dst, 13647, -BCBIAS_J*4);
2119 } 2114 }
2120 dasm_put(Dst, 9833); 2115 dasm_put(Dst, 9833);
2121 break; 2116 break;
2122 2117
2123 case BC_LOOP: 2118 case BC_LOOP:
2124#if LJ_HASJIT 2119#if LJ_HASJIT
2125 dasm_put(Dst, 13427, HOTCOUNT_PCMASK, GG_DISP2HOT); 2120 dasm_put(Dst, 13426, HOTCOUNT_PCMASK, GG_DISP2HOT);
2126#endif 2121#endif
2127 break; 2122 break;
2128 2123
@@ -2132,12 +2127,12 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2132 2127
2133 case BC_JLOOP: 2128 case BC_JLOOP:
2134#if LJ_HASJIT 2129#if LJ_HASJIT
2135 dasm_put(Dst, 13664, DISPATCH_J(trace), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L)); 2130 dasm_put(Dst, 13663, DISPATCH_J(trace), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L));
2136#endif 2131#endif
2137 break; 2132 break;
2138 2133
2139 case BC_JMP: 2134 case BC_JMP:
2140 dasm_put(Dst, 13705, -BCBIAS_J*4); 2135 dasm_put(Dst, 13704, -BCBIAS_J*4);
2141 break; 2136 break;
2142 2137
2143 /* -- Function headers -------------------------------------------------- */ 2138 /* -- Function headers -------------------------------------------------- */
@@ -2151,7 +2146,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2151 2146
2152 case BC_FUNCF: 2147 case BC_FUNCF:
2153#if LJ_HASJIT 2148#if LJ_HASJIT
2154 dasm_put(Dst, 13731, HOTCOUNT_PCMASK, GG_DISP2HOT); 2149 dasm_put(Dst, 13730, HOTCOUNT_PCMASK, GG_DISP2HOT);
2155#endif 2150#endif
2156 case BC_FUNCV: /* NYI: compiled vararg functions. */ 2151 case BC_FUNCV: /* NYI: compiled vararg functions. */
2157 break; 2152 break;
@@ -2161,13 +2156,13 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2161 break; 2156 break;
2162#endif 2157#endif
2163 case BC_IFUNCF: 2158 case BC_IFUNCF:
2164 dasm_put(Dst, 13752, -4+PC2PROTO(k), Dt1(->maxstack), -4+PC2PROTO(numparams)); 2159 dasm_put(Dst, 13751, -4+PC2PROTO(k), Dt1(->maxstack), -4+PC2PROTO(numparams));
2165 if (op == BC_JFUNCF) { 2160 if (op == BC_JFUNCF) {
2166 dasm_put(Dst, 13783, BC_JLOOP); 2161 dasm_put(Dst, 13782, BC_JLOOP);
2167 } else { 2162 } else {
2168 dasm_put(Dst, 9531); 2163 dasm_put(Dst, 9531);
2169 } 2164 }
2170 dasm_put(Dst, 13792, LJ_TNIL); 2165 dasm_put(Dst, 13791, LJ_TNIL);
2171 break; 2166 break;
2172 2167
2173 case BC_JFUNCV: 2168 case BC_JFUNCV:
@@ -2178,30 +2173,30 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2178 break; /* NYI: compiled vararg functions. */ 2173 break; /* NYI: compiled vararg functions. */
2179 2174
2180 case BC_IFUNCV: 2175 case BC_IFUNCV:
2181 dasm_put(Dst, 13814, FRAME_VARG, Dt1(->maxstack), -4+PC2PROTO(numparams), LJ_TNIL); 2176 dasm_put(Dst, 13813, FRAME_VARG, Dt1(->maxstack), -4+PC2PROTO(numparams), LJ_TNIL);
2182 if (op == BC_JFUNCV) { 2177 if (op == BC_JFUNCV) {
2183 dasm_put(Dst, 13783, BC_JLOOP); 2178 dasm_put(Dst, 13782, BC_JLOOP);
2184 } else { 2179 } else {
2185 dasm_put(Dst, 13911, -4+PC2PROTO(k)); 2180 dasm_put(Dst, 13910, -4+PC2PROTO(k));
2186 } 2181 }
2187 dasm_put(Dst, 13936, LJ_TNIL); 2182 dasm_put(Dst, 13935, LJ_TNIL);
2188 break; 2183 break;
2189 2184
2190 case BC_FUNCC: 2185 case BC_FUNCC:
2191 case BC_FUNCCW: 2186 case BC_FUNCCW:
2192 dasm_put(Dst, 13958, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->top)); 2187 dasm_put(Dst, 13957, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->top));
2193 if (op == BC_FUNCC) { 2188 if (op == BC_FUNCC) {
2194 dasm_put(Dst, 13988); 2189 dasm_put(Dst, 13987);
2195 } else { 2190 } else {
2196 dasm_put(Dst, 13992); 2191 dasm_put(Dst, 13991);
2197 } 2192 }
2198 dasm_put(Dst, 14000, DISPATCH_GL(vmstate), ~LJ_VMST_C); 2193 dasm_put(Dst, 13999, DISPATCH_GL(vmstate), ~LJ_VMST_C);
2199 if (op == BC_FUNCC) { 2194 if (op == BC_FUNCC) {
2200 dasm_put(Dst, 14010); 2195 dasm_put(Dst, 14009);
2201 } else { 2196 } else {
2202 dasm_put(Dst, 14015, DISPATCH_GL(wrapf)); 2197 dasm_put(Dst, 14014, DISPATCH_GL(wrapf));
2203 } 2198 }
2204 dasm_put(Dst, 14021, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top)); 2199 dasm_put(Dst, 14020, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top));
2205 break; 2200 break;
2206 2201
2207 /* ---------------------------------------------------------------------- */ 2202 /* ---------------------------------------------------------------------- */
@@ -2229,7 +2224,7 @@ static int build_backend(BuildCtx *ctx)
2229 2224
2230 build_subroutines(ctx, cmov, sse); 2225 build_subroutines(ctx, cmov, sse);
2231 2226
2232 dasm_put(Dst, 14047); 2227 dasm_put(Dst, 14046);
2233 for (op = 0; op < BC__MAX; op++) 2228 for (op = 0; op < BC__MAX; op++)
2234 build_ins(ctx, (BCOp)op, op, cmov, sse); 2229 build_ins(ctx, (BCOp)op, op, cmov, sse);
2235 2230
diff --git a/src/buildvm_x64win.h b/src/buildvm_x64win.h
index a365810f..36bb4975 100644
--- a/src/buildvm_x64win.h
+++ b/src/buildvm_x64win.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 char build_actionlist[13997] = { 15static const unsigned char build_actionlist[13996] = {
16 254,1,248,10,252,247,198,237,15,132,244,11,131,230,252,248,41,252,242,72, 16 254,1,248,10,252,247,198,237,15,132,244,11,131,230,252,248,41,252,242,72,
17 141,76,49,252,248,139,114,252,252,199,68,10,4,237,248,12,131,192,1,137,68, 17 141,76,49,252,248,139,114,252,252,199,68,10,4,237,248,12,131,192,1,137,68,
18 36,84,252,247,198,237,15,132,244,13,248,14,252,247,198,237,15,132,244,10, 18 36,84,252,247,198,237,15,132,244,13,248,14,252,247,198,237,15,132,244,10,
@@ -614,84 +614,84 @@ static const unsigned char build_actionlist[13997] = {
614 15,182,232,131,198,4,193,232,16,252,255,36,252,235,248,3,131,189,233,0,15, 614 15,182,232,131,198,4,193,232,16,252,255,36,252,235,248,3,131,189,233,0,15,
615 132,244,1,255,139,141,233,252,246,129,233,235,15,132,244,38,15,182,78,252, 615 132,244,1,255,139,141,233,252,246,129,233,235,15,132,244,38,15,182,78,252,
616 253,252,233,244,1,248,7,128,165,233,235,139,139,233,137,171,233,137,141,233, 616 253,252,233,244,1,248,7,128,165,233,235,139,139,233,137,171,233,137,141,233,
617 15,182,78,252,253,252,233,244,2,255,137,124,36,80,255,248,1,141,12,202,139, 617 15,182,78,252,253,252,233,244,2,255,137,124,36,80,255,252,242,15,45,60,199,
618 105,252,248,252,246,133,233,235,15,133,244,253,248,2,139,68,36,84,255,252, 618 255,248,1,141,12,202,139,105,252,248,252,246,133,233,235,15,133,244,253,248,
619 242,15,45,252,248,255,131,232,1,15,132,244,250,1,252,248,59,133,233,15,131, 619 2,139,68,36,84,131,232,1,15,132,244,250,1,252,248,59,133,233,15,131,244,251,
620 244,251,41,252,248,193,231,3,3,189,233,248,3,139,41,137,47,139,105,4,131, 620 41,252,248,193,231,3,3,189,233,248,3,139,41,137,47,139,105,4,131,193,8,137,
621 193,8,137,111,4,131,199,8,131,232,1,15,133,244,3,248,4,139,124,36,80,139, 621 111,4,131,199,8,131,232,1,15,133,244,3,248,4,139,124,36,80,139,6,15,182,204,
622 6,15,182,204,15,182,232,131,198,4,193,232,16,252,255,36,252,235,248,5,139, 622 15,182,232,131,198,4,193,232,16,252,255,36,252,235,248,5,139,76,36,96,137,
623 76,36,96,137,145,233,137,252,234,65,137,192,137,205,137,116,36,100,232,251, 623 145,233,137,252,234,65,137,192,137,205,137,116,36,100,232,251,1,33,139,149,
624 1,33,139,149,233,15,182,78,252,253,252,233,244,1,248,7,128,165,233,235,139, 624 233,15,182,78,252,253,252,233,244,1,248,7,255,128,165,233,235,139,131,233,
625 131,233,137,171,233,255,137,133,233,252,233,244,2,255,3,68,36,84,255,129, 625 137,171,233,137,133,233,252,233,244,2,255,3,68,36,84,255,129,124,253,202,
626 124,253,202,4,239,139,44,202,15,133,244,51,141,84,202,8,137,114,252,252,139, 626 4,239,139,44,202,15,133,244,51,141,84,202,8,137,114,252,252,139,181,233,139,
627 181,233,139,14,15,182,252,233,15,182,205,131,198,4,252,255,36,252,235,255, 627 14,15,182,252,233,15,182,205,131,198,4,252,255,36,252,235,255,141,76,202,
628 141,76,202,8,137,215,139,105,252,248,129,121,253,252,252,239,15,133,244,28, 628 8,137,215,139,105,252,248,129,121,253,252,252,239,15,133,244,28,248,52,139,
629 248,52,139,114,252,252,252,247,198,237,15,133,244,253,248,1,137,106,252,248, 629 114,252,252,252,247,198,237,15,133,244,253,248,1,137,106,252,248,137,68,36,
630 137,68,36,84,131,232,1,15,132,244,249,248,2,139,41,137,47,139,105,4,137,111, 630 84,131,232,1,15,132,244,249,248,2,139,41,137,47,139,105,4,137,111,4,131,199,
631 4,131,199,8,131,193,8,131,232,1,15,133,244,2,139,106,252,248,248,3,139,68, 631 8,131,193,8,131,232,1,15,133,244,2,139,106,252,248,248,3,139,68,36,84,128,
632 36,84,128,189,233,1,15,135,244,251,248,4,139,181,233,139,14,15,182,252,233, 632 189,233,1,15,135,244,251,248,4,139,181,233,139,14,15,182,252,233,15,182,205,
633 15,182,205,131,198,4,252,255,36,252,235,248,5,255,252,247,198,237,15,133, 633 131,198,4,252,255,36,252,235,248,5,255,252,247,198,237,15,133,244,4,15,182,
634 244,4,15,182,78,252,253,72,252,247,209,141,12,202,139,121,252,248,139,191, 634 78,252,253,72,252,247,209,141,12,202,139,121,252,248,139,191,233,139,191,
635 233,139,191,233,252,233,244,4,248,7,15,139,244,1,131,230,252,248,41,252,242, 635 233,252,233,244,4,248,7,15,139,244,1,131,230,252,248,41,252,242,137,215,139,
636 137,215,139,114,252,252,252,233,244,1,255,141,76,202,8,139,105,232,139,65, 636 114,252,252,252,233,244,1,255,141,76,202,8,139,105,232,139,65,252,236,137,
637 252,236,137,41,137,65,4,139,105,252,240,139,65,252,244,137,105,8,137,65,12, 637 41,137,65,4,139,105,252,240,139,65,252,244,137,105,8,137,65,12,139,105,224,
638 139,105,224,139,65,228,137,105,252,248,137,65,252,252,129,252,248,239,184, 638 139,65,228,137,105,252,248,137,65,252,252,129,252,248,239,184,237,15,133,
639 237,15,133,244,28,137,202,137,114,252,252,139,181,233,139,14,15,182,252,233, 639 244,28,137,202,137,114,252,252,139,181,233,139,14,15,182,252,233,15,182,205,
640 15,182,205,131,198,4,252,255,36,252,235,255,15,182,252,236,139,66,252,248, 640 131,198,4,252,255,36,252,235,255,15,182,252,236,139,66,252,248,141,12,202,
641 141,12,202,139,128,233,15,182,128,233,137,124,36,80,141,188,253,194,233,43, 641 139,128,233,15,182,128,233,137,124,36,80,141,188,253,194,233,43,122,252,252,
642 122,252,252,133,252,237,15,132,244,251,141,108,252,233,252,248,57,215,15, 642 133,252,237,15,132,244,251,141,108,252,233,252,248,57,215,15,131,244,248,
643 131,244,248,248,1,139,71,252,248,137,1,139,71,252,252,131,199,8,137,65,4, 643 248,1,139,71,252,248,137,1,139,71,252,252,131,199,8,137,65,4,131,193,8,57,
644 131,193,8,57,252,233,15,131,244,249,57,215,15,130,244,1,248,2,199,65,4,237, 644 252,233,15,131,244,249,57,215,15,130,244,1,248,2,199,65,4,237,131,193,8,57,
645 131,193,8,57,252,233,15,130,244,2,248,3,139,124,36,80,139,6,15,182,204,15, 645 252,233,15,130,244,2,248,3,139,124,36,80,139,6,15,182,204,15,182,232,131,
646 182,232,131,198,4,193,232,16,252,255,36,252,235,248,5,199,68,36,84,1,0,0, 646 198,4,193,232,16,252,255,36,252,235,248,5,199,68,36,84,1,0,0,0,137,208,41,
647 0,137,208,41,252,248,15,134,244,3,255,137,197,193,252,237,3,131,197,1,137, 647 252,248,15,134,244,3,255,137,197,193,252,237,3,131,197,1,137,108,36,84,139,
648 108,36,84,139,108,36,96,1,200,59,133,233,15,135,244,253,248,6,139,71,252, 648 108,36,96,1,200,59,133,233,15,135,244,253,248,6,139,71,252,248,137,1,139,
649 248,137,1,139,71,252,252,131,199,8,137,65,4,131,193,8,57,215,15,130,244,6, 649 71,252,252,131,199,8,137,65,4,131,193,8,57,215,15,130,244,6,252,233,244,3,
650 252,233,244,3,248,7,137,149,233,137,141,233,137,116,36,100,41,215,139,84, 650 248,7,137,149,233,137,141,233,137,116,36,100,41,215,139,84,36,84,131,252,
651 36,84,131,252,234,1,137,252,233,232,251,1,0,139,149,233,139,141,233,1,215, 651 234,1,137,252,233,232,251,1,0,139,149,233,139,141,233,1,215,252,233,244,6,
652 252,233,244,6,255,193,225,3,255,248,1,139,114,252,252,137,68,36,84,252,247, 652 255,193,225,3,255,248,1,139,114,252,252,137,68,36,84,252,247,198,237,15,133,
653 198,237,15,133,244,253,255,248,13,137,215,131,232,1,15,132,244,249,248,2, 653 244,253,255,248,13,137,215,131,232,1,15,132,244,249,248,2,139,44,15,137,111,
654 139,44,15,137,111,252,248,139,108,15,4,137,111,252,252,131,199,8,131,232, 654 252,248,139,108,15,4,137,111,252,252,131,199,8,131,232,1,15,133,244,2,248,
655 1,15,133,244,2,248,3,139,68,36,84,15,182,110,252,255,248,5,57,197,15,135, 655 3,139,68,36,84,15,182,110,252,255,248,5,57,197,15,135,244,252,255,139,108,
656 244,252,255,139,108,10,4,137,106,252,252,139,44,10,137,106,252,248,255,248, 656 10,4,137,106,252,252,139,44,10,137,106,252,248,255,248,5,56,70,252,255,15,
657 5,56,70,252,255,15,135,244,252,255,15,182,78,252,253,72,252,247,209,141,20, 657 135,244,252,255,15,182,78,252,253,72,252,247,209,141,20,202,139,122,252,248,
658 202,139,122,252,248,139,191,233,139,191,233,139,6,15,182,204,15,182,232,131, 658 139,191,233,139,191,233,139,6,15,182,204,15,182,232,131,198,4,193,232,16,
659 198,4,193,232,16,252,255,36,252,235,248,6,255,199,71,252,252,237,131,199, 659 252,255,36,252,235,248,6,255,199,71,252,252,237,131,199,8,255,199,68,194,
660 8,255,199,68,194,252,244,237,255,131,192,1,252,233,244,5,248,7,15,139,244, 660 252,244,237,255,131,192,1,252,233,244,5,248,7,15,139,244,14,131,230,252,248,
661 14,131,230,252,248,41,252,242,255,1,252,241,255,137,252,245,209,252,237,129, 661 41,252,242,255,1,252,241,255,137,252,245,209,252,237,129,229,239,102,131,
662 229,239,102,131,172,253,43,233,1,15,132,244,140,255,141,12,202,255,129,121, 662 172,253,43,233,1,15,132,244,140,255,141,12,202,255,129,121,253,4,239,15,135,
663 253,4,239,15,135,244,53,129,121,253,12,239,15,135,244,53,255,139,105,20,255, 663 244,53,129,121,253,12,239,15,135,244,53,255,139,105,20,255,129,252,253,239,
664 129,252,253,239,15,135,244,53,255,252,242,15,16,1,252,242,15,16,73,8,255, 664 15,135,244,53,255,252,242,15,16,1,252,242,15,16,73,8,255,252,242,15,88,65,
665 252,242,15,88,65,16,252,242,15,17,1,133,252,237,15,136,244,249,255,15,140, 665 16,252,242,15,17,1,133,252,237,15,136,244,249,255,15,140,244,249,255,102,
666 244,249,255,102,15,46,200,248,1,252,242,15,17,65,24,255,221,65,8,221,1,255, 666 15,46,200,248,1,252,242,15,17,65,24,255,221,65,8,221,1,255,220,65,16,221,
667 220,65,16,221,17,221,81,24,133,252,237,15,136,244,247,255,221,81,24,15,140, 667 17,221,81,24,133,252,237,15,136,244,247,255,221,81,24,15,140,244,247,255,
668 244,247,255,217,201,248,1,255,15,183,70,252,254,255,15,131,244,248,141,180, 668 217,201,248,1,255,15,183,70,252,254,255,15,131,244,248,141,180,253,134,233,
669 253,134,233,255,141,180,253,134,233,15,183,70,252,254,15,131,245,255,15,130, 669 255,141,180,253,134,233,15,183,70,252,254,15,131,245,255,15,130,244,248,141,
670 244,248,141,180,253,134,233,255,248,3,102,15,46,193,252,233,244,1,255,141, 670 180,253,134,233,255,248,3,102,15,46,193,252,233,244,1,255,141,12,202,139,
671 12,202,139,105,4,129,252,253,239,15,132,244,247,255,137,105,252,252,139,41, 671 105,4,129,252,253,239,15,132,244,247,255,137,105,252,252,139,41,137,105,252,
672 137,105,252,248,252,233,245,255,141,180,253,134,233,139,1,137,105,252,252, 672 248,252,233,245,255,141,180,253,134,233,139,1,137,105,252,252,137,65,252,
673 137,65,252,248,255,139,139,233,139,4,193,72,139,128,233,139,108,36,96,137, 673 248,255,139,139,233,139,4,193,72,139,128,233,139,108,36,96,137,147,233,137,
674 147,233,137,171,233,76,137,100,36,80,76,137,108,36,32,76,137,116,36,24,76, 674 171,233,76,137,100,36,80,76,137,108,36,32,76,137,116,36,24,76,137,124,36,
675 137,124,36,16,72,137,225,72,129,252,236,239,102,15,127,49,102,15,127,185, 675 16,72,137,225,72,129,252,236,239,102,15,127,49,102,15,127,185,233,102,68,
676 233,102,68,15,127,129,233,102,68,15,127,137,233,102,68,15,127,145,233,102, 676 15,127,129,233,102,68,15,127,137,233,102,68,15,127,145,233,102,68,15,127,
677 68,15,127,153,233,102,68,15,127,161,233,102,68,15,127,169,233,102,68,15,127, 677 153,233,102,68,15,127,161,233,102,68,15,127,169,233,102,68,15,127,177,233,
678 177,233,102,68,15,127,185,233,252,255,224,255,141,180,253,134,233,139,6,15, 678 102,68,15,127,185,233,252,255,224,255,141,180,253,134,233,139,6,15,182,204,
679 182,204,15,182,232,131,198,4,193,232,16,252,255,36,252,235,255,137,252,245, 679 15,182,232,131,198,4,193,232,16,252,255,36,252,235,255,137,252,245,209,252,
680 209,252,237,129,229,239,102,131,172,253,43,233,1,15,132,244,142,255,139,190, 680 237,129,229,239,102,131,172,253,43,233,1,15,132,244,142,255,139,190,233,139,
681 233,139,108,36,96,141,12,202,59,141,233,15,135,244,23,15,182,142,233,57,200, 681 108,36,96,141,12,202,59,141,233,15,135,244,23,15,182,142,233,57,200,15,134,
682 15,134,244,249,248,2,255,15,183,70,252,254,252,233,245,255,248,3,199,68,194, 682 244,249,248,2,255,15,183,70,252,254,252,233,245,255,248,3,199,68,194,252,
683 252,252,237,131,192,1,57,200,15,134,244,3,252,233,244,2,255,141,44,197,237, 683 252,237,131,192,1,57,200,15,134,244,3,252,233,244,2,255,141,44,197,237,141,
684 141,4,194,139,122,252,248,137,104,252,252,137,120,252,248,139,108,36,96,141, 684 4,194,139,122,252,248,137,104,252,252,137,120,252,248,139,108,36,96,141,12,
685 12,200,59,141,233,15,135,244,22,137,209,137,194,15,182,174,233,133,252,237, 685 200,59,141,233,15,135,244,22,137,209,137,194,15,182,174,233,133,252,237,15,
686 15,132,244,248,248,1,131,193,8,57,209,15,131,244,249,139,121,252,248,137, 686 132,244,248,248,1,131,193,8,57,209,15,131,244,249,139,121,252,248,137,56,
687 56,139,121,252,252,137,120,4,131,192,8,199,65,252,252,237,131,252,237,1,15, 687 139,121,252,252,137,120,4,131,192,8,199,65,252,252,237,131,252,237,1,15,133,
688 133,244,1,248,2,255,139,190,233,139,6,15,182,204,15,182,232,131,198,4,193, 688 244,1,248,2,255,139,190,233,139,6,15,182,204,15,182,232,131,198,4,193,232,
689 232,16,252,255,36,252,235,255,248,3,199,64,4,237,131,192,8,131,252,237,1, 689 16,252,255,36,252,235,255,248,3,199,64,4,237,131,192,8,131,252,237,1,15,133,
690 15,133,244,3,252,233,244,2,255,139,106,252,248,72,139,189,233,139,108,36, 690 244,3,252,233,244,2,255,139,106,252,248,72,139,189,233,139,108,36,96,141,
691 96,141,68,194,252,248,137,149,233,141,136,233,59,141,233,137,133,233,255, 691 68,194,252,248,137,149,233,141,136,233,59,141,233,137,133,233,255,137,252,
692 137,252,233,255,72,137,252,250,137,252,233,255,15,135,244,21,199,131,233, 692 233,255,72,137,252,250,137,252,233,255,15,135,244,21,199,131,233,237,255,
693 237,255,252,255,215,255,252,255,147,233,255,199,131,233,237,139,149,233,141, 693 252,255,215,255,252,255,147,233,255,199,131,233,237,139,149,233,141,12,194,
694 12,194,252,247,217,3,141,233,139,114,252,252,252,233,244,12,255,254,0 694 252,247,217,3,141,233,139,114,252,252,252,233,244,12,255,254,0
695}; 695};
696 696
697enum { 697enum {
@@ -1960,16 +1960,11 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
1960 case BC_TSETM: 1960 case BC_TSETM:
1961 dasm_put(Dst, 12408); 1961 dasm_put(Dst, 12408);
1962 if (sse) { 1962 if (sse) {
1963 dasm_put(Dst, 10963); 1963 dasm_put(Dst, 12413);
1964 } else {
1965 }
1966 dasm_put(Dst, 12413, Dt6(->marked), LJ_GC_BLACK);
1967 if (sse) {
1968 dasm_put(Dst, 12438);
1969 } else { 1964 } else {
1970 } 1965 }
1971 dasm_put(Dst, 12445, Dt6(->asize), Dt6(->array), Dt1(->base), Dt1(->base), Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain)); 1966 dasm_put(Dst, 12420, Dt6(->marked), LJ_GC_BLACK, Dt6(->asize), Dt6(->array), Dt1(->base), Dt1(->base));
1972 dasm_put(Dst, 12571, Dt6(->gclist)); 1967 dasm_put(Dst, 12560, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist));
1973 break; 1968 break;
1974 1969
1975 /* -- Calls and vararg handling ----------------------------------------- */ 1970 /* -- Calls and vararg handling ----------------------------------------- */
@@ -1977,60 +1972,60 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
1977 case BC_CALL: case BC_CALLM: 1972 case BC_CALL: case BC_CALLM:
1978 dasm_put(Dst, 10079); 1973 dasm_put(Dst, 10079);
1979 if (op == BC_CALLM) { 1974 if (op == BC_CALLM) {
1980 dasm_put(Dst, 12579); 1975 dasm_put(Dst, 12578);
1981 } 1976 }
1982 dasm_put(Dst, 12584, LJ_TFUNC, Dt7(->pc)); 1977 dasm_put(Dst, 12583, LJ_TFUNC, Dt7(->pc));
1983 break; 1978 break;
1984 1979
1985 case BC_CALLMT: 1980 case BC_CALLMT:
1986 dasm_put(Dst, 12579); 1981 dasm_put(Dst, 12578);
1987 break; 1982 break;
1988 case BC_CALLT: 1983 case BC_CALLT:
1989 dasm_put(Dst, 12626, LJ_TFUNC, FRAME_TYPE, Dt7(->ffid), Dt7(->pc)); 1984 dasm_put(Dst, 12625, LJ_TFUNC, FRAME_TYPE, Dt7(->ffid), Dt7(->pc));
1990 dasm_put(Dst, 12745, FRAME_TYPE, Dt7(->pc), PC2PROTO(k)); 1985 dasm_put(Dst, 12744, FRAME_TYPE, Dt7(->pc), PC2PROTO(k));
1991 break; 1986 break;
1992 1987
1993 case BC_ITERC: 1988 case BC_ITERC:
1994 dasm_put(Dst, 12803, LJ_TFUNC, 2+1, Dt7(->pc)); 1989 dasm_put(Dst, 12802, LJ_TFUNC, 2+1, Dt7(->pc));
1995 break; 1990 break;
1996 1991
1997 case BC_VARG: 1992 case BC_VARG:
1998 dasm_put(Dst, 12884, Dt7(->pc), PC2PROTO(numparams), (8+FRAME_VARG), LJ_TNIL); 1993 dasm_put(Dst, 12883, Dt7(->pc), PC2PROTO(numparams), (8+FRAME_VARG), LJ_TNIL);
1999 dasm_put(Dst, 13029, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); 1994 dasm_put(Dst, 13028, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top));
2000 break; 1995 break;
2001 1996
2002 /* -- Returns ----------------------------------------------------------- */ 1997 /* -- Returns ----------------------------------------------------------- */
2003 1998
2004 case BC_RETM: 1999 case BC_RETM:
2005 dasm_put(Dst, 12579); 2000 dasm_put(Dst, 12578);
2006 break; 2001 break;
2007 2002
2008 case BC_RET: case BC_RET0: case BC_RET1: 2003 case BC_RET: case BC_RET0: case BC_RET1:
2009 if (op != BC_RET0) { 2004 if (op != BC_RET0) {
2010 dasm_put(Dst, 13128); 2005 dasm_put(Dst, 13127);
2011 } 2006 }
2012 dasm_put(Dst, 13132, FRAME_TYPE); 2007 dasm_put(Dst, 13131, FRAME_TYPE);
2013 switch (op) { 2008 switch (op) {
2014 case BC_RET: 2009 case BC_RET:
2015 dasm_put(Dst, 13151); 2010 dasm_put(Dst, 13150);
2016 break; 2011 break;
2017 case BC_RET1: 2012 case BC_RET1:
2018 dasm_put(Dst, 13209); 2013 dasm_put(Dst, 13208);
2019 /* fallthrough */ 2014 /* fallthrough */
2020 case BC_RET0: 2015 case BC_RET0:
2021 dasm_put(Dst, 13225); 2016 dasm_put(Dst, 13224);
2022 default: 2017 default:
2023 break; 2018 break;
2024 } 2019 }
2025 dasm_put(Dst, 13236, Dt7(->pc), PC2PROTO(k)); 2020 dasm_put(Dst, 13235, Dt7(->pc), PC2PROTO(k));
2026 if (op == BC_RET) { 2021 if (op == BC_RET) {
2027 dasm_put(Dst, 13280, LJ_TNIL); 2022 dasm_put(Dst, 13279, LJ_TNIL);
2028 } else { 2023 } else {
2029 dasm_put(Dst, 13289, LJ_TNIL); 2024 dasm_put(Dst, 13288, LJ_TNIL);
2030 } 2025 }
2031 dasm_put(Dst, 13296); 2026 dasm_put(Dst, 13295);
2032 if (op != BC_RET0) { 2027 if (op != BC_RET0) {
2033 dasm_put(Dst, 13317); 2028 dasm_put(Dst, 13316);
2034 } 2029 }
2035 dasm_put(Dst, 4570); 2030 dasm_put(Dst, 4570);
2036 break; 2031 break;
@@ -2040,7 +2035,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2040 2035
2041 case BC_FORL: 2036 case BC_FORL:
2042#if LJ_HASJIT 2037#if LJ_HASJIT
2043 dasm_put(Dst, 13321, HOTCOUNT_PCMASK, GG_DISP2HOT); 2038 dasm_put(Dst, 13320, HOTCOUNT_PCMASK, GG_DISP2HOT);
2044#endif 2039#endif
2045 break; 2040 break;
2046 2041
@@ -2052,57 +2047,57 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2052 case BC_FORI: 2047 case BC_FORI:
2053 case BC_IFORL: 2048 case BC_IFORL:
2054 vk = (op == BC_IFORL || op == BC_JFORL); 2049 vk = (op == BC_IFORL || op == BC_JFORL);
2055 dasm_put(Dst, 13342); 2050 dasm_put(Dst, 13341);
2056 if (!vk) { 2051 if (!vk) {
2057 dasm_put(Dst, 13346, LJ_TISNUM, LJ_TISNUM); 2052 dasm_put(Dst, 13345, LJ_TISNUM, LJ_TISNUM);
2058 } 2053 }
2059 dasm_put(Dst, 13365); 2054 dasm_put(Dst, 13364);
2060 if (!vk) { 2055 if (!vk) {
2061 dasm_put(Dst, 13369, LJ_TISNUM); 2056 dasm_put(Dst, 13368, LJ_TISNUM);
2062 } 2057 }
2063 if (sse) { 2058 if (sse) {
2064 dasm_put(Dst, 13378); 2059 dasm_put(Dst, 13377);
2065 if (vk) { 2060 if (vk) {
2066 dasm_put(Dst, 13390); 2061 dasm_put(Dst, 13389);
2067 } else { 2062 } else {
2068 dasm_put(Dst, 13409); 2063 dasm_put(Dst, 13408);
2069 } 2064 }
2070 dasm_put(Dst, 13414); 2065 dasm_put(Dst, 13413);
2071 } else { 2066 } else {
2072 dasm_put(Dst, 13427); 2067 dasm_put(Dst, 13426);
2073 if (vk) { 2068 if (vk) {
2074 dasm_put(Dst, 13433); 2069 dasm_put(Dst, 13432);
2075 } else { 2070 } else {
2076 dasm_put(Dst, 13449); 2071 dasm_put(Dst, 13448);
2077 } 2072 }
2078 dasm_put(Dst, 13457); 2073 dasm_put(Dst, 13456);
2079 if (cmov) { 2074 if (cmov) {
2080 dasm_put(Dst, 9502); 2075 dasm_put(Dst, 9502);
2081 } else { 2076 } else {
2082 dasm_put(Dst, 9508); 2077 dasm_put(Dst, 9508);
2083 } 2078 }
2084 if (!cmov) { 2079 if (!cmov) {
2085 dasm_put(Dst, 13462); 2080 dasm_put(Dst, 13461);
2086 } 2081 }
2087 } 2082 }
2088 if (op == BC_FORI) { 2083 if (op == BC_FORI) {
2089 dasm_put(Dst, 13468, -BCBIAS_J*4); 2084 dasm_put(Dst, 13467, -BCBIAS_J*4);
2090 } else if (op == BC_JFORI) { 2085 } else if (op == BC_JFORI) {
2091 dasm_put(Dst, 13478, -BCBIAS_J*4, BC_JLOOP); 2086 dasm_put(Dst, 13477, -BCBIAS_J*4, BC_JLOOP);
2092 } else if (op == BC_IFORL) { 2087 } else if (op == BC_IFORL) {
2093 dasm_put(Dst, 13492, -BCBIAS_J*4); 2088 dasm_put(Dst, 13491, -BCBIAS_J*4);
2094 } else { 2089 } else {
2095 dasm_put(Dst, 13488, BC_JLOOP); 2090 dasm_put(Dst, 13487, BC_JLOOP);
2096 } 2091 }
2097 dasm_put(Dst, 9537); 2092 dasm_put(Dst, 9537);
2098 if (sse) { 2093 if (sse) {
2099 dasm_put(Dst, 13502); 2094 dasm_put(Dst, 13501);
2100 } 2095 }
2101 break; 2096 break;
2102 2097
2103 case BC_ITERL: 2098 case BC_ITERL:
2104#if LJ_HASJIT 2099#if LJ_HASJIT
2105 dasm_put(Dst, 13321, HOTCOUNT_PCMASK, GG_DISP2HOT); 2100 dasm_put(Dst, 13320, HOTCOUNT_PCMASK, GG_DISP2HOT);
2106#endif 2101#endif
2107 break; 2102 break;
2108 2103
@@ -2111,18 +2106,18 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2111 break; 2106 break;
2112#endif 2107#endif
2113 case BC_IITERL: 2108 case BC_IITERL:
2114 dasm_put(Dst, 13513, LJ_TNIL); 2109 dasm_put(Dst, 13512, LJ_TNIL);
2115 if (op == BC_JITERL) { 2110 if (op == BC_JITERL) {
2116 dasm_put(Dst, 13528, BC_JLOOP); 2111 dasm_put(Dst, 13527, BC_JLOOP);
2117 } else { 2112 } else {
2118 dasm_put(Dst, 13542, -BCBIAS_J*4); 2113 dasm_put(Dst, 13541, -BCBIAS_J*4);
2119 } 2114 }
2120 dasm_put(Dst, 9837); 2115 dasm_put(Dst, 9837);
2121 break; 2116 break;
2122 2117
2123 case BC_LOOP: 2118 case BC_LOOP:
2124#if LJ_HASJIT 2119#if LJ_HASJIT
2125 dasm_put(Dst, 13321, HOTCOUNT_PCMASK, GG_DISP2HOT); 2120 dasm_put(Dst, 13320, HOTCOUNT_PCMASK, GG_DISP2HOT);
2126#endif 2121#endif
2127 break; 2122 break;
2128 2123
@@ -2132,12 +2127,12 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2132 2127
2133 case BC_JLOOP: 2128 case BC_JLOOP:
2134#if LJ_HASJIT 2129#if LJ_HASJIT
2135 dasm_put(Dst, 13558, DISPATCH_J(trace), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L), 9*16+4*8, -1*16, -2*16, -3*16, -4*16, -5*16, -6*16, -7*16, -8*16, -9*16); 2130 dasm_put(Dst, 13557, DISPATCH_J(trace), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L), 9*16+4*8, -1*16, -2*16, -3*16, -4*16, -5*16, -6*16, -7*16, -8*16, -9*16);
2136#endif 2131#endif
2137 break; 2132 break;
2138 2133
2139 case BC_JMP: 2134 case BC_JMP:
2140 dasm_put(Dst, 13667, -BCBIAS_J*4); 2135 dasm_put(Dst, 13666, -BCBIAS_J*4);
2141 break; 2136 break;
2142 2137
2143 /* -- Function headers -------------------------------------------------- */ 2138 /* -- Function headers -------------------------------------------------- */
@@ -2151,7 +2146,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2151 2146
2152 case BC_FUNCF: 2147 case BC_FUNCF:
2153#if LJ_HASJIT 2148#if LJ_HASJIT
2154 dasm_put(Dst, 13692, HOTCOUNT_PCMASK, GG_DISP2HOT); 2149 dasm_put(Dst, 13691, HOTCOUNT_PCMASK, GG_DISP2HOT);
2155#endif 2150#endif
2156 case BC_FUNCV: /* NYI: compiled vararg functions. */ 2151 case BC_FUNCV: /* NYI: compiled vararg functions. */
2157 break; 2152 break;
@@ -2161,13 +2156,13 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2161 break; 2156 break;
2162#endif 2157#endif
2163 case BC_IFUNCF: 2158 case BC_IFUNCF:
2164 dasm_put(Dst, 13713, -4+PC2PROTO(k), Dt1(->maxstack), -4+PC2PROTO(numparams)); 2159 dasm_put(Dst, 13712, -4+PC2PROTO(k), Dt1(->maxstack), -4+PC2PROTO(numparams));
2165 if (op == BC_JFUNCF) { 2160 if (op == BC_JFUNCF) {
2166 dasm_put(Dst, 13743, BC_JLOOP); 2161 dasm_put(Dst, 13742, BC_JLOOP);
2167 } else { 2162 } else {
2168 dasm_put(Dst, 9539); 2163 dasm_put(Dst, 9539);
2169 } 2164 }
2170 dasm_put(Dst, 13752, LJ_TNIL); 2165 dasm_put(Dst, 13751, LJ_TNIL);
2171 break; 2166 break;
2172 2167
2173 case BC_JFUNCV: 2168 case BC_JFUNCV:
@@ -2178,30 +2173,30 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2178 break; /* NYI: compiled vararg functions. */ 2173 break; /* NYI: compiled vararg functions. */
2179 2174
2180 case BC_IFUNCV: 2175 case BC_IFUNCV:
2181 dasm_put(Dst, 13774, FRAME_VARG, Dt1(->maxstack), -4+PC2PROTO(numparams), LJ_TNIL); 2176 dasm_put(Dst, 13773, FRAME_VARG, Dt1(->maxstack), -4+PC2PROTO(numparams), LJ_TNIL);
2182 if (op == BC_JFUNCV) { 2177 if (op == BC_JFUNCV) {
2183 dasm_put(Dst, 13743, BC_JLOOP); 2178 dasm_put(Dst, 13742, BC_JLOOP);
2184 } else { 2179 } else {
2185 dasm_put(Dst, 13865, -4+PC2PROTO(k)); 2180 dasm_put(Dst, 13864, -4+PC2PROTO(k));
2186 } 2181 }
2187 dasm_put(Dst, 13888, LJ_TNIL); 2182 dasm_put(Dst, 13887, LJ_TNIL);
2188 break; 2183 break;
2189 2184
2190 case BC_FUNCC: 2185 case BC_FUNCC:
2191 case BC_FUNCCW: 2186 case BC_FUNCCW:
2192 dasm_put(Dst, 13910, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->top)); 2187 dasm_put(Dst, 13909, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->top));
2193 if (op == BC_FUNCC) { 2188 if (op == BC_FUNCC) {
2194 dasm_put(Dst, 13940); 2189 dasm_put(Dst, 13939);
2195 } else { 2190 } else {
2196 dasm_put(Dst, 13944); 2191 dasm_put(Dst, 13943);
2197 } 2192 }
2198 dasm_put(Dst, 13952, DISPATCH_GL(vmstate), ~LJ_VMST_C); 2193 dasm_put(Dst, 13951, DISPATCH_GL(vmstate), ~LJ_VMST_C);
2199 if (op == BC_FUNCC) { 2194 if (op == BC_FUNCC) {
2200 dasm_put(Dst, 13961); 2195 dasm_put(Dst, 13960);
2201 } else { 2196 } else {
2202 dasm_put(Dst, 13965, DISPATCH_GL(wrapf)); 2197 dasm_put(Dst, 13964, DISPATCH_GL(wrapf));
2203 } 2198 }
2204 dasm_put(Dst, 13970, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top)); 2199 dasm_put(Dst, 13969, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top));
2205 break; 2200 break;
2206 2201
2207 /* ---------------------------------------------------------------------- */ 2202 /* ---------------------------------------------------------------------- */
@@ -2229,7 +2224,7 @@ static int build_backend(BuildCtx *ctx)
2229 2224
2230 build_subroutines(ctx, cmov, sse); 2225 build_subroutines(ctx, cmov, sse);
2231 2226
2232 dasm_put(Dst, 13995); 2227 dasm_put(Dst, 13994);
2233 for (op = 0; op < BC__MAX; op++) 2228 for (op = 0; op < BC__MAX; op++)
2234 build_ins(ctx, (BCOp)op, op, cmov, sse); 2229 build_ins(ctx, (BCOp)op, op, cmov, sse);
2235 2230
diff --git a/src/buildvm_x86.dasc b/src/buildvm_x86.dasc
index 4a2194a5..23a98c21 100644
--- a/src/buildvm_x86.dasc
+++ b/src/buildvm_x86.dasc
@@ -4284,11 +4284,12 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
4284 | ins_AD // RA = base (table at base-1), RD = num const (start index) 4284 | ins_AD // RA = base (table at base-1), RD = num const (start index)
4285 | mov TMP1, KBASE // Need one more free register. 4285 | mov TMP1, KBASE // Need one more free register.
4286 if (sse) { 4286 if (sse) {
4287 | movsd xmm0, qword [KBASE+RD*8] 4287 | cvtsd2si KBASE, qword [KBASE+RD*8]
4288 } else { 4288 } else {
4289 |.if not X64 4289 |.if not X64
4290 | fld qword [KBASE+RD*8] 4290 | fld qword [KBASE+RD*8]
4291 | fistp ARG4 // Const is guaranteed to be an int. 4291 | fistp ARG4 // Const is guaranteed to be an int.
4292 | mov KBASE, ARG4
4292 |.endif 4293 |.endif
4293 } 4294 }
4294 |1: 4295 |1:
@@ -4298,13 +4299,6 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
4298 | jnz >7 4299 | jnz >7
4299 |2: 4300 |2:
4300 | mov RD, MULTRES 4301 | mov RD, MULTRES
4301 if (sse) {
4302 | cvtsd2si KBASE, xmm0 // Const is guaranteed to be an int.
4303 } else {
4304 |.if not X64
4305 | mov KBASE, ARG4
4306 |.endif
4307 }
4308 | sub RD, 1 4302 | sub RD, 1
4309 | jz >4 // Nothing to copy? 4303 | jz >4 // Nothing to copy?
4310 | add RD, KBASE // Compute needed size. 4304 | add RD, KBASE // Compute needed size.
diff --git a/src/buildvm_x86.h b/src/buildvm_x86.h
index eaf6aafe..83cff68a 100644
--- a/src/buildvm_x86.h
+++ b/src/buildvm_x86.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 char build_actionlist[15198] = { 15static const unsigned char build_actionlist[15196] = {
16 254,1,248,10,252,247,198,237,15,132,244,11,131,230,252,248,41,252,242,141, 16 254,1,248,10,252,247,198,237,15,132,244,11,131,230,252,248,41,252,242,141,
17 76,49,252,248,139,114,252,252,199,68,10,4,237,248,12,131,192,1,137,68,36, 17 76,49,252,248,139,114,252,252,199,68,10,4,237,248,12,131,192,1,137,68,36,
18 20,252,247,198,237,15,132,244,13,248,14,252,247,198,237,15,132,244,10,199, 18 20,252,247,198,237,15,132,244,13,248,14,252,247,198,237,15,132,244,10,199,
@@ -672,80 +672,79 @@ static const unsigned char build_actionlist[15198] = {
672 255,36,171,248,3,131,189,233,0,15,132,244,1,255,139,141,233,252,246,129,233, 672 255,36,171,248,3,131,189,233,0,15,132,244,1,255,139,141,233,252,246,129,233,
673 235,15,132,244,38,15,182,78,252,253,252,233,244,1,248,7,128,165,233,235,139, 673 235,15,132,244,38,15,182,78,252,253,252,233,244,1,248,7,128,165,233,235,139,
674 139,233,137,171,233,137,141,233,15,182,78,252,253,252,233,244,2,255,137,124, 674 139,233,137,171,233,137,141,233,15,182,78,252,253,252,233,244,2,255,137,124,
675 36,16,255,221,4,199,219,92,36,12,255,248,1,141,12,202,139,105,252,248,252, 675 36,16,255,252,242,15,45,60,199,255,221,4,199,219,92,36,12,139,124,36,12,255,
676 246,133,233,235,15,133,244,253,248,2,139,68,36,20,255,252,242,15,45,252,248, 676 248,1,141,12,202,139,105,252,248,252,246,133,233,235,15,133,244,253,248,2,
677 255,139,124,36,12,255,131,232,1,15,132,244,250,1,252,248,59,133,233,15,131, 677 139,68,36,20,131,232,1,15,132,244,250,1,252,248,59,133,233,15,131,244,251,
678 244,251,41,252,248,193,231,3,3,189,233,248,3,139,41,137,47,139,105,4,131, 678 41,252,248,193,231,3,3,189,233,248,3,139,41,137,47,139,105,4,131,193,8,137,
679 193,8,137,111,4,131,199,8,131,232,1,15,133,244,3,248,4,139,124,36,16,139, 679 111,4,131,199,8,131,232,1,15,133,244,3,248,4,139,124,36,16,139,6,15,182,204,
680 6,15,182,204,15,182,232,131,198,4,193,232,16,252,255,36,171,248,5,137,108, 680 15,182,232,131,198,4,193,232,16,252,255,36,171,248,5,137,108,36,4,139,108,
681 36,4,139,108,36,48,137,149,233,137,68,36,8,137,44,36,137,116,36,24,232,251, 681 36,48,137,149,233,137,68,36,8,137,44,36,137,116,36,24,232,251,1,33,139,149,
682 1,33,139,149,233,15,182,78,252,253,252,233,244,1,248,7,128,165,233,235,139, 682 233,15,182,78,252,253,252,233,244,1,248,7,255,128,165,233,235,139,131,233,
683 131,233,137,171,233,255,137,133,233,252,233,244,2,255,3,68,36,20,255,129, 683 137,171,233,137,133,233,252,233,244,2,255,3,68,36,20,255,129,124,253,202,
684 124,253,202,4,239,139,44,202,15,133,244,51,141,84,202,8,137,114,252,252,139, 684 4,239,139,44,202,15,133,244,51,141,84,202,8,137,114,252,252,139,181,233,139,
685 181,233,139,14,15,182,252,233,15,182,205,131,198,4,252,255,36,171,255,141, 685 14,15,182,252,233,15,182,205,131,198,4,252,255,36,171,255,141,76,202,8,137,
686 76,202,8,137,215,139,105,252,248,129,121,253,252,252,239,15,133,244,28,248, 686 215,139,105,252,248,129,121,253,252,252,239,15,133,244,28,248,52,139,114,
687 52,139,114,252,252,252,247,198,237,15,133,244,253,248,1,137,106,252,248,137, 687 252,252,252,247,198,237,15,133,244,253,248,1,137,106,252,248,137,68,36,20,
688 68,36,20,131,232,1,15,132,244,249,248,2,139,41,137,47,139,105,4,137,111,4, 688 131,232,1,15,132,244,249,248,2,139,41,137,47,139,105,4,137,111,4,131,199,
689 131,199,8,131,193,8,131,232,1,15,133,244,2,139,106,252,248,248,3,139,68,36, 689 8,131,193,8,131,232,1,15,133,244,2,139,106,252,248,248,3,139,68,36,20,128,
690 20,128,189,233,1,15,135,244,251,248,4,139,181,233,139,14,15,182,252,233,15, 690 189,233,1,15,135,244,251,248,4,139,181,233,139,14,15,182,252,233,15,182,205,
691 182,205,131,198,4,252,255,36,171,248,5,255,252,247,198,237,15,133,244,4,15, 691 131,198,4,252,255,36,171,248,5,255,252,247,198,237,15,133,244,4,15,182,78,
692 182,78,252,253,252,247,209,141,12,202,139,121,252,248,139,191,233,139,191, 692 252,253,252,247,209,141,12,202,139,121,252,248,139,191,233,139,191,233,252,
693 233,252,233,244,4,248,7,15,139,244,1,131,230,252,248,41,252,242,137,215,139, 693 233,244,4,248,7,15,139,244,1,131,230,252,248,41,252,242,137,215,139,114,252,
694 114,252,252,252,233,244,1,255,141,76,202,8,139,105,232,139,65,252,236,137, 694 252,252,233,244,1,255,141,76,202,8,139,105,232,139,65,252,236,137,41,137,
695 41,137,65,4,139,105,252,240,139,65,252,244,137,105,8,137,65,12,139,105,224, 695 65,4,139,105,252,240,139,65,252,244,137,105,8,137,65,12,139,105,224,139,65,
696 139,65,228,137,105,252,248,137,65,252,252,129,252,248,239,184,237,15,133, 696 228,137,105,252,248,137,65,252,252,129,252,248,239,184,237,15,133,244,28,
697 244,28,137,202,137,114,252,252,139,181,233,139,14,15,182,252,233,15,182,205, 697 137,202,137,114,252,252,139,181,233,139,14,15,182,252,233,15,182,205,131,
698 131,198,4,252,255,36,171,255,15,182,252,236,139,66,252,248,141,12,202,139, 698 198,4,252,255,36,171,255,15,182,252,236,139,66,252,248,141,12,202,139,128,
699 128,233,15,182,128,233,137,124,36,16,141,188,253,194,233,43,122,252,252,133, 699 233,15,182,128,233,137,124,36,16,141,188,253,194,233,43,122,252,252,133,252,
700 252,237,15,132,244,251,141,108,252,233,252,248,57,215,15,131,244,248,248, 700 237,15,132,244,251,141,108,252,233,252,248,57,215,15,131,244,248,248,1,139,
701 1,139,71,252,248,137,1,139,71,252,252,131,199,8,137,65,4,131,193,8,57,252, 701 71,252,248,137,1,139,71,252,252,131,199,8,137,65,4,131,193,8,57,252,233,15,
702 233,15,131,244,249,57,215,15,130,244,1,248,2,199,65,4,237,131,193,8,57,252, 702 131,244,249,57,215,15,130,244,1,248,2,199,65,4,237,131,193,8,57,252,233,15,
703 233,15,130,244,2,248,3,139,124,36,16,139,6,15,182,204,15,182,232,131,198, 703 130,244,2,248,3,139,124,36,16,139,6,15,182,204,15,182,232,131,198,4,193,232,
704 4,193,232,16,252,255,36,171,248,5,199,68,36,20,1,0,0,0,137,208,41,252,248, 704 16,252,255,36,171,248,5,199,68,36,20,1,0,0,0,137,208,41,252,248,15,134,244,
705 15,134,244,3,255,137,197,193,252,237,3,131,197,1,137,108,36,20,139,108,36, 705 3,255,137,197,193,252,237,3,131,197,1,137,108,36,20,139,108,36,48,1,200,59,
706 48,1,200,59,133,233,15,135,244,253,248,6,139,71,252,248,137,1,139,71,252, 706 133,233,15,135,244,253,248,6,139,71,252,248,137,1,139,71,252,252,131,199,
707 252,131,199,8,137,65,4,131,193,8,57,215,15,130,244,6,252,233,244,3,248,7, 707 8,137,65,4,131,193,8,57,215,15,130,244,6,252,233,244,3,248,7,137,149,233,
708 137,149,233,137,141,233,137,116,36,24,41,215,139,84,36,20,131,252,234,1,137, 708 137,141,233,137,116,36,24,41,215,139,84,36,20,131,252,234,1,137,252,233,232,
709 252,233,232,251,1,0,139,149,233,139,141,233,1,215,252,233,244,6,255,193,225, 709 251,1,0,139,149,233,139,141,233,1,215,252,233,244,6,255,193,225,3,255,248,
710 3,255,248,1,139,114,252,252,137,68,36,20,252,247,198,237,15,133,244,253,255, 710 1,139,114,252,252,137,68,36,20,252,247,198,237,15,133,244,253,255,248,13,
711 248,13,137,215,131,232,1,15,132,244,249,248,2,139,44,15,137,111,252,248,139, 711 137,215,131,232,1,15,132,244,249,248,2,139,44,15,137,111,252,248,139,108,
712 108,15,4,137,111,252,252,131,199,8,131,232,1,15,133,244,2,248,3,139,68,36, 712 15,4,137,111,252,252,131,199,8,131,232,1,15,133,244,2,248,3,139,68,36,20,
713 20,15,182,110,252,255,248,5,57,197,15,135,244,252,255,139,108,10,4,137,106, 713 15,182,110,252,255,248,5,57,197,15,135,244,252,255,139,108,10,4,137,106,252,
714 252,252,139,44,10,137,106,252,248,255,248,5,56,70,252,255,15,135,244,252, 714 252,139,44,10,137,106,252,248,255,248,5,56,70,252,255,15,135,244,252,255,
715 255,15,182,78,252,253,252,247,209,141,20,202,139,122,252,248,139,191,233, 715 15,182,78,252,253,252,247,209,141,20,202,139,122,252,248,139,191,233,139,
716 139,191,233,139,6,15,182,204,15,182,232,131,198,4,193,232,16,252,255,36,171, 716 191,233,139,6,15,182,204,15,182,232,131,198,4,193,232,16,252,255,36,171,248,
717 248,6,255,199,71,252,252,237,131,199,8,255,199,68,194,252,244,237,255,131, 717 6,255,199,71,252,252,237,131,199,8,255,199,68,194,252,244,237,255,131,192,
718 192,1,252,233,244,5,248,7,15,139,244,14,131,230,252,248,41,252,242,255,1, 718 1,252,233,244,5,248,7,15,139,244,14,131,230,252,248,41,252,242,255,1,252,
719 252,241,255,137,252,245,209,252,237,129,229,239,102,131,172,253,43,233,1, 719 241,255,137,252,245,209,252,237,129,229,239,102,131,172,253,43,233,1,15,132,
720 15,132,244,140,255,141,12,202,255,129,121,253,4,239,15,135,244,53,129,121, 720 244,140,255,141,12,202,255,129,121,253,4,239,15,135,244,53,129,121,253,12,
721 253,12,239,15,135,244,53,255,139,105,20,255,129,252,253,239,15,135,244,53, 721 239,15,135,244,53,255,139,105,20,255,129,252,253,239,15,135,244,53,255,252,
722 255,252,242,15,16,1,252,242,15,16,73,8,255,252,242,15,88,65,16,252,242,15, 722 242,15,16,1,252,242,15,16,73,8,255,252,242,15,88,65,16,252,242,15,17,1,133,
723 17,1,133,252,237,15,136,244,249,255,15,140,244,249,255,102,15,46,200,248, 723 252,237,15,136,244,249,255,15,140,244,249,255,102,15,46,200,248,1,252,242,
724 1,252,242,15,17,65,24,255,221,65,8,221,1,255,220,65,16,221,17,221,81,24,133, 724 15,17,65,24,255,221,65,8,221,1,255,220,65,16,221,17,221,81,24,133,252,237,
725 252,237,15,136,244,247,255,221,81,24,15,140,244,247,255,217,201,248,1,255, 725 15,136,244,247,255,221,81,24,15,140,244,247,255,217,201,248,1,255,15,183,
726 15,183,70,252,254,255,15,131,244,248,141,180,253,134,233,255,141,180,253, 726 70,252,254,255,15,131,244,248,141,180,253,134,233,255,141,180,253,134,233,
727 134,233,15,183,70,252,254,15,131,245,255,15,130,244,248,141,180,253,134,233, 727 15,183,70,252,254,15,131,245,255,15,130,244,248,141,180,253,134,233,255,248,
728 255,248,3,102,15,46,193,252,233,244,1,255,141,12,202,139,105,4,129,252,253, 728 3,102,15,46,193,252,233,244,1,255,141,12,202,139,105,4,129,252,253,239,15,
729 239,15,132,244,247,255,137,105,252,252,139,41,137,105,252,248,252,233,245, 729 132,244,247,255,137,105,252,252,139,41,137,105,252,248,252,233,245,255,141,
730 255,141,180,253,134,233,139,1,137,105,252,252,137,65,252,248,255,139,139, 730 180,253,134,233,139,1,137,105,252,252,137,65,252,248,255,139,139,233,139,
731 233,139,4,129,139,128,233,139,108,36,48,137,147,233,137,171,233,252,255,224, 731 4,129,139,128,233,139,108,36,48,137,147,233,137,171,233,252,255,224,255,141,
732 255,141,180,253,134,233,139,6,15,182,204,15,182,232,131,198,4,193,232,16, 732 180,253,134,233,139,6,15,182,204,15,182,232,131,198,4,193,232,16,252,255,
733 252,255,36,171,255,137,252,245,209,252,237,129,229,239,102,131,172,253,43, 733 36,171,255,137,252,245,209,252,237,129,229,239,102,131,172,253,43,233,1,15,
734 233,1,15,132,244,142,255,139,190,233,139,108,36,48,141,12,202,59,141,233, 734 132,244,142,255,139,190,233,139,108,36,48,141,12,202,59,141,233,15,135,244,
735 15,135,244,23,15,182,142,233,57,200,15,134,244,249,248,2,255,15,183,70,252, 735 23,15,182,142,233,57,200,15,134,244,249,248,2,255,15,183,70,252,254,252,233,
736 254,252,233,245,255,248,3,199,68,194,252,252,237,131,192,1,57,200,15,134, 736 245,255,248,3,199,68,194,252,252,237,131,192,1,57,200,15,134,244,3,252,233,
737 244,3,252,233,244,2,255,141,44,197,237,141,4,194,139,122,252,248,137,104, 737 244,2,255,141,44,197,237,141,4,194,139,122,252,248,137,104,252,252,137,120,
738 252,252,137,120,252,248,139,108,36,48,141,12,200,59,141,233,15,135,244,22, 738 252,248,139,108,36,48,141,12,200,59,141,233,15,135,244,22,137,209,137,194,
739 137,209,137,194,15,182,174,233,133,252,237,15,132,244,248,248,1,131,193,8, 739 15,182,174,233,133,252,237,15,132,244,248,248,1,131,193,8,57,209,15,131,244,
740 57,209,15,131,244,249,139,121,252,248,137,56,139,121,252,252,137,120,4,131, 740 249,139,121,252,248,137,56,139,121,252,252,137,120,4,131,192,8,199,65,252,
741 192,8,199,65,252,252,237,131,252,237,1,15,133,244,1,248,2,255,139,190,233, 741 252,237,131,252,237,1,15,133,244,1,248,2,255,139,190,233,139,6,15,182,204,
742 139,6,15,182,204,15,182,232,131,198,4,193,232,16,252,255,36,171,255,248,3, 742 15,182,232,131,198,4,193,232,16,252,255,36,171,255,248,3,199,64,4,237,131,
743 199,64,4,237,131,192,8,131,252,237,1,15,133,244,3,252,233,244,2,255,139,106, 743 192,8,131,252,237,1,15,133,244,3,252,233,244,2,255,139,106,252,248,139,189,
744 252,248,139,189,233,139,108,36,48,141,68,194,252,248,137,149,233,141,136, 744 233,139,108,36,48,141,68,194,252,248,137,149,233,141,136,233,59,141,233,137,
745 233,59,141,233,137,133,233,255,137,44,36,255,137,124,36,4,137,44,36,255,15, 745 133,233,255,137,44,36,255,137,124,36,4,137,44,36,255,15,135,244,21,199,131,
746 135,244,21,199,131,233,237,255,252,255,215,255,252,255,147,233,255,199,131, 746 233,237,255,252,255,215,255,252,255,147,233,255,199,131,233,237,139,149,233,
747 233,237,139,149,233,141,12,194,252,247,217,3,141,233,139,114,252,252,252, 747 141,12,194,252,247,217,3,141,233,139,114,252,252,252,233,244,12,255,254,0
748 233,244,12,255,254,0
749}; 748};
750 749
751enum { 750enum {
@@ -2086,18 +2085,12 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2086 case BC_TSETM: 2085 case BC_TSETM:
2087 dasm_put(Dst, 13690); 2086 dasm_put(Dst, 13690);
2088 if (sse) { 2087 if (sse) {
2089 dasm_put(Dst, 12241);
2090 } else {
2091 dasm_put(Dst, 13695); 2088 dasm_put(Dst, 13695);
2092 }
2093 dasm_put(Dst, 13703, Dt6(->marked), LJ_GC_BLACK);
2094 if (sse) {
2095 dasm_put(Dst, 13728);
2096 } else { 2089 } else {
2097 dasm_put(Dst, 13735); 2090 dasm_put(Dst, 13702);
2098 } 2091 }
2099 dasm_put(Dst, 13740, Dt6(->asize), Dt6(->array), Dt1(->base), Dt1(->base), Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain)); 2092 dasm_put(Dst, 13714, Dt6(->marked), LJ_GC_BLACK, Dt6(->asize), Dt6(->array), Dt1(->base), Dt1(->base));
2100 dasm_put(Dst, 13868, Dt6(->gclist)); 2093 dasm_put(Dst, 13856, Dt6(->marked), cast_byte(~LJ_GC_BLACK), DISPATCH_GL(gc.grayagain), DISPATCH_GL(gc.grayagain), Dt6(->gclist));
2101 break; 2094 break;
2102 2095
2103 /* -- Calls and vararg handling ----------------------------------------- */ 2096 /* -- Calls and vararg handling ----------------------------------------- */
@@ -2105,60 +2098,60 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2105 case BC_CALL: case BC_CALLM: 2098 case BC_CALL: case BC_CALLM:
2106 dasm_put(Dst, 11362); 2099 dasm_put(Dst, 11362);
2107 if (op == BC_CALLM) { 2100 if (op == BC_CALLM) {
2108 dasm_put(Dst, 13876); 2101 dasm_put(Dst, 13874);
2109 } 2102 }
2110 dasm_put(Dst, 13881, LJ_TFUNC, Dt7(->pc)); 2103 dasm_put(Dst, 13879, LJ_TFUNC, Dt7(->pc));
2111 break; 2104 break;
2112 2105
2113 case BC_CALLMT: 2106 case BC_CALLMT:
2114 dasm_put(Dst, 13876); 2107 dasm_put(Dst, 13874);
2115 break; 2108 break;
2116 case BC_CALLT: 2109 case BC_CALLT:
2117 dasm_put(Dst, 13922, LJ_TFUNC, FRAME_TYPE, Dt7(->ffid), Dt7(->pc)); 2110 dasm_put(Dst, 13920, LJ_TFUNC, FRAME_TYPE, Dt7(->ffid), Dt7(->pc));
2118 dasm_put(Dst, 14040, FRAME_TYPE, Dt7(->pc), PC2PROTO(k)); 2111 dasm_put(Dst, 14038, FRAME_TYPE, Dt7(->pc), PC2PROTO(k));
2119 break; 2112 break;
2120 2113
2121 case BC_ITERC: 2114 case BC_ITERC:
2122 dasm_put(Dst, 14097, LJ_TFUNC, 2+1, Dt7(->pc)); 2115 dasm_put(Dst, 14095, LJ_TFUNC, 2+1, Dt7(->pc));
2123 break; 2116 break;
2124 2117
2125 case BC_VARG: 2118 case BC_VARG:
2126 dasm_put(Dst, 14177, Dt7(->pc), PC2PROTO(numparams), (8+FRAME_VARG), LJ_TNIL); 2119 dasm_put(Dst, 14175, Dt7(->pc), PC2PROTO(numparams), (8+FRAME_VARG), LJ_TNIL);
2127 dasm_put(Dst, 14321, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top)); 2120 dasm_put(Dst, 14319, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top));
2128 break; 2121 break;
2129 2122
2130 /* -- Returns ----------------------------------------------------------- */ 2123 /* -- Returns ----------------------------------------------------------- */
2131 2124
2132 case BC_RETM: 2125 case BC_RETM:
2133 dasm_put(Dst, 13876); 2126 dasm_put(Dst, 13874);
2134 break; 2127 break;
2135 2128
2136 case BC_RET: case BC_RET0: case BC_RET1: 2129 case BC_RET: case BC_RET0: case BC_RET1:
2137 if (op != BC_RET0) { 2130 if (op != BC_RET0) {
2138 dasm_put(Dst, 14420); 2131 dasm_put(Dst, 14418);
2139 } 2132 }
2140 dasm_put(Dst, 14424, FRAME_TYPE); 2133 dasm_put(Dst, 14422, FRAME_TYPE);
2141 switch (op) { 2134 switch (op) {
2142 case BC_RET: 2135 case BC_RET:
2143 dasm_put(Dst, 14443); 2136 dasm_put(Dst, 14441);
2144 break; 2137 break;
2145 case BC_RET1: 2138 case BC_RET1:
2146 dasm_put(Dst, 14501); 2139 dasm_put(Dst, 14499);
2147 /* fallthrough */ 2140 /* fallthrough */
2148 case BC_RET0: 2141 case BC_RET0:
2149 dasm_put(Dst, 14517); 2142 dasm_put(Dst, 14515);
2150 default: 2143 default:
2151 break; 2144 break;
2152 } 2145 }
2153 dasm_put(Dst, 14528, Dt7(->pc), PC2PROTO(k)); 2146 dasm_put(Dst, 14526, Dt7(->pc), PC2PROTO(k));
2154 if (op == BC_RET) { 2147 if (op == BC_RET) {
2155 dasm_put(Dst, 14570, LJ_TNIL); 2148 dasm_put(Dst, 14568, LJ_TNIL);
2156 } else { 2149 } else {
2157 dasm_put(Dst, 14579, LJ_TNIL); 2150 dasm_put(Dst, 14577, LJ_TNIL);
2158 } 2151 }
2159 dasm_put(Dst, 14586); 2152 dasm_put(Dst, 14584);
2160 if (op != BC_RET0) { 2153 if (op != BC_RET0) {
2161 dasm_put(Dst, 14607); 2154 dasm_put(Dst, 14605);
2162 } 2155 }
2163 dasm_put(Dst, 4680); 2156 dasm_put(Dst, 4680);
2164 break; 2157 break;
@@ -2168,7 +2161,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2168 2161
2169 case BC_FORL: 2162 case BC_FORL:
2170#if LJ_HASJIT 2163#if LJ_HASJIT
2171 dasm_put(Dst, 14611, HOTCOUNT_PCMASK, GG_DISP2HOT); 2164 dasm_put(Dst, 14609, HOTCOUNT_PCMASK, GG_DISP2HOT);
2172#endif 2165#endif
2173 break; 2166 break;
2174 2167
@@ -2180,57 +2173,57 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2180 case BC_FORI: 2173 case BC_FORI:
2181 case BC_IFORL: 2174 case BC_IFORL:
2182 vk = (op == BC_IFORL || op == BC_JFORL); 2175 vk = (op == BC_IFORL || op == BC_JFORL);
2183 dasm_put(Dst, 14632); 2176 dasm_put(Dst, 14630);
2184 if (!vk) { 2177 if (!vk) {
2185 dasm_put(Dst, 14636, LJ_TISNUM, LJ_TISNUM); 2178 dasm_put(Dst, 14634, LJ_TISNUM, LJ_TISNUM);
2186 } 2179 }
2187 dasm_put(Dst, 14655); 2180 dasm_put(Dst, 14653);
2188 if (!vk) { 2181 if (!vk) {
2189 dasm_put(Dst, 14659, LJ_TISNUM); 2182 dasm_put(Dst, 14657, LJ_TISNUM);
2190 } 2183 }
2191 if (sse) { 2184 if (sse) {
2192 dasm_put(Dst, 14668); 2185 dasm_put(Dst, 14666);
2193 if (vk) { 2186 if (vk) {
2194 dasm_put(Dst, 14680); 2187 dasm_put(Dst, 14678);
2195 } else { 2188 } else {
2196 dasm_put(Dst, 14699); 2189 dasm_put(Dst, 14697);
2197 } 2190 }
2198 dasm_put(Dst, 14704); 2191 dasm_put(Dst, 14702);
2199 } else { 2192 } else {
2200 dasm_put(Dst, 14717); 2193 dasm_put(Dst, 14715);
2201 if (vk) { 2194 if (vk) {
2202 dasm_put(Dst, 14723); 2195 dasm_put(Dst, 14721);
2203 } else { 2196 } else {
2204 dasm_put(Dst, 14739); 2197 dasm_put(Dst, 14737);
2205 } 2198 }
2206 dasm_put(Dst, 14747); 2199 dasm_put(Dst, 14745);
2207 if (cmov) { 2200 if (cmov) {
2208 dasm_put(Dst, 10777); 2201 dasm_put(Dst, 10777);
2209 } else { 2202 } else {
2210 dasm_put(Dst, 10783); 2203 dasm_put(Dst, 10783);
2211 } 2204 }
2212 if (!cmov) { 2205 if (!cmov) {
2213 dasm_put(Dst, 14752); 2206 dasm_put(Dst, 14750);
2214 } 2207 }
2215 } 2208 }
2216 if (op == BC_FORI) { 2209 if (op == BC_FORI) {
2217 dasm_put(Dst, 14758, -BCBIAS_J*4); 2210 dasm_put(Dst, 14756, -BCBIAS_J*4);
2218 } else if (op == BC_JFORI) { 2211 } else if (op == BC_JFORI) {
2219 dasm_put(Dst, 14768, -BCBIAS_J*4, BC_JLOOP); 2212 dasm_put(Dst, 14766, -BCBIAS_J*4, BC_JLOOP);
2220 } else if (op == BC_IFORL) { 2213 } else if (op == BC_IFORL) {
2221 dasm_put(Dst, 14782, -BCBIAS_J*4); 2214 dasm_put(Dst, 14780, -BCBIAS_J*4);
2222 } else { 2215 } else {
2223 dasm_put(Dst, 14778, BC_JLOOP); 2216 dasm_put(Dst, 14776, BC_JLOOP);
2224 } 2217 }
2225 dasm_put(Dst, 10812); 2218 dasm_put(Dst, 10812);
2226 if (sse) { 2219 if (sse) {
2227 dasm_put(Dst, 14792); 2220 dasm_put(Dst, 14790);
2228 } 2221 }
2229 break; 2222 break;
2230 2223
2231 case BC_ITERL: 2224 case BC_ITERL:
2232#if LJ_HASJIT 2225#if LJ_HASJIT
2233 dasm_put(Dst, 14611, HOTCOUNT_PCMASK, GG_DISP2HOT); 2226 dasm_put(Dst, 14609, HOTCOUNT_PCMASK, GG_DISP2HOT);
2234#endif 2227#endif
2235 break; 2228 break;
2236 2229
@@ -2239,18 +2232,18 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2239 break; 2232 break;
2240#endif 2233#endif
2241 case BC_IITERL: 2234 case BC_IITERL:
2242 dasm_put(Dst, 14803, LJ_TNIL); 2235 dasm_put(Dst, 14801, LJ_TNIL);
2243 if (op == BC_JITERL) { 2236 if (op == BC_JITERL) {
2244 dasm_put(Dst, 14818, BC_JLOOP); 2237 dasm_put(Dst, 14816, BC_JLOOP);
2245 } else { 2238 } else {
2246 dasm_put(Dst, 14832, -BCBIAS_J*4); 2239 dasm_put(Dst, 14830, -BCBIAS_J*4);
2247 } 2240 }
2248 dasm_put(Dst, 11109); 2241 dasm_put(Dst, 11109);
2249 break; 2242 break;
2250 2243
2251 case BC_LOOP: 2244 case BC_LOOP:
2252#if LJ_HASJIT 2245#if LJ_HASJIT
2253 dasm_put(Dst, 14611, HOTCOUNT_PCMASK, GG_DISP2HOT); 2246 dasm_put(Dst, 14609, HOTCOUNT_PCMASK, GG_DISP2HOT);
2254#endif 2247#endif
2255 break; 2248 break;
2256 2249
@@ -2260,12 +2253,12 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2260 2253
2261 case BC_JLOOP: 2254 case BC_JLOOP:
2262#if LJ_HASJIT 2255#if LJ_HASJIT
2263 dasm_put(Dst, 14848, DISPATCH_J(trace), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L)); 2256 dasm_put(Dst, 14846, DISPATCH_J(trace), DtD(->mcode), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L));
2264#endif 2257#endif
2265 break; 2258 break;
2266 2259
2267 case BC_JMP: 2260 case BC_JMP:
2268 dasm_put(Dst, 14871, -BCBIAS_J*4); 2261 dasm_put(Dst, 14869, -BCBIAS_J*4);
2269 break; 2262 break;
2270 2263
2271 /* -- Function headers -------------------------------------------------- */ 2264 /* -- Function headers -------------------------------------------------- */
@@ -2279,7 +2272,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2279 2272
2280 case BC_FUNCF: 2273 case BC_FUNCF:
2281#if LJ_HASJIT 2274#if LJ_HASJIT
2282 dasm_put(Dst, 14895, HOTCOUNT_PCMASK, GG_DISP2HOT); 2275 dasm_put(Dst, 14893, HOTCOUNT_PCMASK, GG_DISP2HOT);
2283#endif 2276#endif
2284 case BC_FUNCV: /* NYI: compiled vararg functions. */ 2277 case BC_FUNCV: /* NYI: compiled vararg functions. */
2285 break; 2278 break;
@@ -2289,13 +2282,13 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2289 break; 2282 break;
2290#endif 2283#endif
2291 case BC_IFUNCF: 2284 case BC_IFUNCF:
2292 dasm_put(Dst, 14916, -4+PC2PROTO(k), Dt1(->maxstack), -4+PC2PROTO(numparams)); 2285 dasm_put(Dst, 14914, -4+PC2PROTO(k), Dt1(->maxstack), -4+PC2PROTO(numparams));
2293 if (op == BC_JFUNCF) { 2286 if (op == BC_JFUNCF) {
2294 dasm_put(Dst, 14946, BC_JLOOP); 2287 dasm_put(Dst, 14944, BC_JLOOP);
2295 } else { 2288 } else {
2296 dasm_put(Dst, 10814); 2289 dasm_put(Dst, 10814);
2297 } 2290 }
2298 dasm_put(Dst, 14955, LJ_TNIL); 2291 dasm_put(Dst, 14953, LJ_TNIL);
2299 break; 2292 break;
2300 2293
2301 case BC_JFUNCV: 2294 case BC_JFUNCV:
@@ -2306,30 +2299,30 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop, int cmov, int sse)
2306 break; /* NYI: compiled vararg functions. */ 2299 break; /* NYI: compiled vararg functions. */
2307 2300
2308 case BC_IFUNCV: 2301 case BC_IFUNCV:
2309 dasm_put(Dst, 14977, FRAME_VARG, Dt1(->maxstack), -4+PC2PROTO(numparams), LJ_TNIL); 2302 dasm_put(Dst, 14975, FRAME_VARG, Dt1(->maxstack), -4+PC2PROTO(numparams), LJ_TNIL);
2310 if (op == BC_JFUNCV) { 2303 if (op == BC_JFUNCV) {
2311 dasm_put(Dst, 14946, BC_JLOOP); 2304 dasm_put(Dst, 14944, BC_JLOOP);
2312 } else { 2305 } else {
2313 dasm_put(Dst, 15068, -4+PC2PROTO(k)); 2306 dasm_put(Dst, 15066, -4+PC2PROTO(k));
2314 } 2307 }
2315 dasm_put(Dst, 15090, LJ_TNIL); 2308 dasm_put(Dst, 15088, LJ_TNIL);
2316 break; 2309 break;
2317 2310
2318 case BC_FUNCC: 2311 case BC_FUNCC:
2319 case BC_FUNCCW: 2312 case BC_FUNCCW:
2320 dasm_put(Dst, 15112, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->top)); 2313 dasm_put(Dst, 15110, Dt8(->f), Dt1(->base), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->top));
2321 if (op == BC_FUNCC) { 2314 if (op == BC_FUNCC) {
2322 dasm_put(Dst, 15141); 2315 dasm_put(Dst, 15139);
2323 } else { 2316 } else {
2324 dasm_put(Dst, 15145); 2317 dasm_put(Dst, 15143);
2325 } 2318 }
2326 dasm_put(Dst, 15153, DISPATCH_GL(vmstate), ~LJ_VMST_C); 2319 dasm_put(Dst, 15151, DISPATCH_GL(vmstate), ~LJ_VMST_C);
2327 if (op == BC_FUNCC) { 2320 if (op == BC_FUNCC) {
2328 dasm_put(Dst, 15162); 2321 dasm_put(Dst, 15160);
2329 } else { 2322 } else {
2330 dasm_put(Dst, 15166, DISPATCH_GL(wrapf)); 2323 dasm_put(Dst, 15164, DISPATCH_GL(wrapf));
2331 } 2324 }
2332 dasm_put(Dst, 15171, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top)); 2325 dasm_put(Dst, 15169, DISPATCH_GL(vmstate), ~LJ_VMST_INTERP, Dt1(->base), Dt1(->top));
2333 break; 2326 break;
2334 2327
2335 /* ---------------------------------------------------------------------- */ 2328 /* ---------------------------------------------------------------------- */
@@ -2357,7 +2350,7 @@ static int build_backend(BuildCtx *ctx)
2357 2350
2358 build_subroutines(ctx, cmov, sse); 2351 build_subroutines(ctx, cmov, sse);
2359 2352
2360 dasm_put(Dst, 15196); 2353 dasm_put(Dst, 15194);
2361 for (op = 0; op < BC__MAX; op++) 2354 for (op = 0; op < BC__MAX; op++)
2362 build_ins(ctx, (BCOp)op, op, cmov, sse); 2355 build_ins(ctx, (BCOp)op, op, cmov, sse);
2363 2356