lvm.js

changeset 132
5a928c1478ad
parent 131
cd1ba419c808
child 133
afce5a550d18
equal deleted inserted replaced
131:cd1ba419c808 132:5a928c1478ad
449 frame.reg[INS_A(instruction)] = new LValue(this, "boolean", INS_B(instruction)!=0); 449 frame.reg[INS_A(instruction)] = new LValue(this, "boolean", INS_B(instruction)!=0);
450 if(INS_C(instruction)!=0) 450 if(INS_C(instruction)!=0)
451 frame.pc++; 451 frame.pc++;
452 break; 452 break;
453 case OP_GETUPVAL: 453 case OP_GETUPVAL:
454 frame.reg[INS_A(instruction)] = frame.f.upvalues[INS_B(instruction)]; 454 var upvalue = frame.f.upvalues[INS_B(instruction)];
455 frame.reg[INS_A(instruction)] = new LValue(this, upvalue.type, upvalue.value);
455 break; 456 break;
456 case OP_GETGLOBAL: 457 case OP_GETGLOBAL:
457 var name = frame.f.constants[INS_Bx(instruction)]; 458 var name = frame.f.constants[INS_Bx(instruction)];
458 frame.reg[INS_A(instruction)] = frame.f.environment.index(name); 459 frame.reg[INS_A(instruction)] = frame.f.environment.index(name);
459 break; 460 break;

mercurial