628 var RB = RK(frame, INS_B(instruction)); |
629 var RB = RK(frame, INS_B(instruction)); |
629 var RC = RK(frame, INS_C(instruction)); |
630 var RC = RK(frame, INS_C(instruction)); |
630 if(RB.value <= RC.value != (A!=0)) |
631 if(RB.value <= RC.value != (A!=0)) |
631 frame.pc++; |
632 frame.pc++; |
632 break; |
633 break; |
|
634 case OP_SETLIST: |
|
635 var A = INS_A(instruction); |
|
636 var RA = frame.reg[A]; |
|
637 var B = INS_B(instruction); |
|
638 var C = INS_C(instruction); |
|
639 if(C == 0) |
|
640 throw "Dynamic table construction not yet implemented"; |
|
641 // #define LFIELDS_PER_FLUSH 50 // Lua 5.1 |
|
642 var baseindex = (C-1)*50; |
|
643 var index = new LValue(this, "number", 1); |
|
644 for(var i = 1; i<=B; index.value=(baseindex+(++i))) |
|
645 RA.setIndex(index, frame.reg[A+i]); |
|
646 break; |
633 default: |
647 default: |
634 throw "Unhandled opcode: "+INS_OPCODE(instruction); |
648 throw "Unhandled opcode: "+INS_OPCODE(instruction); |
635 } |
649 } |
636 } |
650 } |
637 }, |
651 }, |