aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-03-10 11:09:45 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-03-10 11:09:45 -0300
commit26794616374fee54532d0030ae006abb77dfb7ba (patch)
treeebc4595695eb616e66b4f63779404e8ea6644b48 /lvm.c
parent0870a2d1d8a1434eecae1923886ba219c4e699c7 (diff)
downloadlua-26794616374fee54532d0030ae006abb77dfb7ba.tar.gz
lua-26794616374fee54532d0030ae006abb77dfb7ba.tar.bz2
lua-26794616374fee54532d0030ae006abb77dfb7ba.zip
no more assignment expressions (they don't fit in Lua...)
Diffstat (limited to 'lvm.c')
-rw-r--r--lvm.c32
1 files changed, 1 insertions, 31 deletions
diff --git a/lvm.c b/lvm.c
index 8a80aebf..814eba82 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 1.52 1999/03/04 21:15:50 roberto Exp roberto $ 2** $Id: lvm.c,v 1.53 1999/03/05 21:16:07 roberto Exp roberto $
3** Lua virtual machine 3** Lua virtual machine
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -356,11 +356,6 @@ StkId luaV_execute (Closure *cl, TProtoFunc *tf, StkId base) {
356 S->top -= aux; 356 S->top -= aux;
357 break; 357 break;
358 358
359 case POPDUP: aux = *pc++;
360 *(S->top-aux-1) = *(S->top-1);
361 S->top -= aux;
362 break;
363
364 case PUSHNUMBERW: aux += highbyte(*pc++); 359 case PUSHNUMBERW: aux += highbyte(*pc++);
365 case PUSHNUMBER: aux += *pc++; 360 case PUSHNUMBER: aux += *pc++;
366 ttype(S->top) = LUA_T_NUMBER; 361 ttype(S->top) = LUA_T_NUMBER;
@@ -424,45 +419,20 @@ StkId luaV_execute (Closure *cl, TProtoFunc *tf, StkId base) {
424 *((S->stack+base) + aux) = *(--S->top); 419 *((S->stack+base) + aux) = *(--S->top);
425 break; 420 break;
426 421
427 case SETLOCALDUP: aux = *pc++;
428 *((S->stack+base) + aux) = *(S->top-1);
429 break;
430
431 case SETGLOBALW: aux += highbyte(*pc++); 422 case SETGLOBALW: aux += highbyte(*pc++);
432 case SETGLOBAL: aux += *pc++; 423 case SETGLOBAL: aux += *pc++;
433 luaV_setglobal(tsvalue(&consts[aux])); 424 luaV_setglobal(tsvalue(&consts[aux]));
434 break; 425 break;
435 426
436 case SETGLOBALDUPW: aux += highbyte(*pc++);
437 case SETGLOBALDUP: aux += *pc++;
438 *S->top = *(S->top-1);
439 S->top++;
440 luaV_setglobal(tsvalue(&consts[aux]));
441 break;
442
443 case SETTABLEPOP: 427 case SETTABLEPOP:
444 luaV_settable(S->top-3); 428 luaV_settable(S->top-3);
445 S->top -= 2; /* pop table and index */ 429 S->top -= 2; /* pop table and index */
446 break; 430 break;
447 431
448 case SETTABLEPOPDUP: {
449 TObject temp = *(S->top-1);
450 luaV_settable(S->top-3);
451 S->top--; /* pop index (temp goes into "table" position) */
452 *(S->top-1) = temp;
453 break;
454 }
455
456 case SETTABLE: 432 case SETTABLE:
457 luaV_settable(S->top-3-(*pc++)); 433 luaV_settable(S->top-3-(*pc++));
458 break; 434 break;
459 435
460 case SETTABLEDUP:
461 *S->top = *(S->top-1);
462 S->top++;
463 luaV_settable(S->top-(3+1)-(*pc++));
464 break;
465
466 case SETLISTW: aux += highbyte(*pc++); 436 case SETLISTW: aux += highbyte(*pc++);
467 case SETLIST: aux += *pc++; { 437 case SETLIST: aux += *pc++; {
468 int n = *(pc++); 438 int n = *(pc++);