diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-08-04 16:15:05 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-08-04 16:15:05 -0300 |
| commit | dd1aa28390ca1acc389a91f5c64a916f0339e594 (patch) | |
| tree | b9b23515091875df7de6082a5e833774c9d434c9 /opcode.c | |
| parent | abbf14cd32bf83d5ea5ab70977e0653a03b455c5 (diff) | |
| download | lua-dd1aa28390ca1acc389a91f5c64a916f0339e594.tar.gz lua-dd1aa28390ca1acc389a91f5c64a916f0339e594.tar.bz2 lua-dd1aa28390ca1acc389a91f5c64a916f0339e594.zip | |
small optimization in opcodes for "and" and "or"
Diffstat (limited to 'opcode.c')
| -rw-r--r-- | opcode.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -3,7 +3,7 @@ | |||
| 3 | ** TecCGraf - PUC-Rio | 3 | ** TecCGraf - PUC-Rio |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | char *rcs_opcode="$Id: opcode.c,v 4.20 1997/07/30 22:00:50 roberto Exp roberto $"; | 6 | char *rcs_opcode="$Id: opcode.c,v 4.21 1997/07/31 19:37:37 roberto Exp roberto $"; |
| 7 | 7 | ||
| 8 | #include <setjmp.h> | 8 | #include <setjmp.h> |
| 9 | #include <stdio.h> | 9 | #include <stdio.h> |
| @@ -1384,6 +1384,7 @@ static StkId lua_execute (TFunc *func, StkId base) | |||
| 1384 | Word w; | 1384 | Word w; |
| 1385 | get_word(w,pc); | 1385 | get_word(w,pc); |
| 1386 | if (ttype(top-1) != LUA_T_NIL) pc += w; | 1386 | if (ttype(top-1) != LUA_T_NIL) pc += w; |
| 1387 | else top--; | ||
| 1387 | } | 1388 | } |
| 1388 | break; | 1389 | break; |
| 1389 | 1390 | ||
| @@ -1392,6 +1393,7 @@ static StkId lua_execute (TFunc *func, StkId base) | |||
| 1392 | Word w; | 1393 | Word w; |
| 1393 | get_word(w,pc); | 1394 | get_word(w,pc); |
| 1394 | if (ttype(top-1) == LUA_T_NIL) pc += w; | 1395 | if (ttype(top-1) == LUA_T_NIL) pc += w; |
| 1396 | else top--; | ||
| 1395 | } | 1397 | } |
| 1396 | break; | 1398 | break; |
| 1397 | 1399 | ||
| @@ -1429,8 +1431,6 @@ static StkId lua_execute (TFunc *func, StkId base) | |||
| 1429 | } | 1431 | } |
| 1430 | break; | 1432 | break; |
| 1431 | 1433 | ||
| 1432 | case POP: --top; break; | ||
| 1433 | |||
| 1434 | case CALLFUNC: | 1434 | case CALLFUNC: |
| 1435 | { | 1435 | { |
| 1436 | int nParams = *(pc++); | 1436 | int nParams = *(pc++); |
