Mercurial > cpython-lru_cache-weakref
diff Python/ceval.c @ 31714:cc7a9fe80b1b legacy-trunk
Cancelled checkin, sorry.
| author | Armin Rigo <arigo@tunes.org> |
|---|---|
| date | Sat, 20 Mar 2004 21:50:13 +0000 |
| parents | ffae2f1fdd46 |
| children | 9817dee5d9df |
line wrap: on
line diff
--- a/Python/ceval.c Sat Mar 20 21:41:28 2004 +0000 +++ b/Python/ceval.c Sat Mar 20 21:50:13 2004 +0000 @@ -627,8 +627,7 @@ #define INSTR_OFFSET() (next_instr - first_instr) #define NEXTOP() (*next_instr++) -#define OPARG() (next_instr[0] + (next_instr[1]<<8)) -#define OPARG_SIZE 2 +#define NEXTARG() (next_instr += 2, (next_instr[-1]<<8) + next_instr[-2]) #define JUMPTO(x) (next_instr = first_instr + (x)) #define JUMPBY(x) (next_instr += (x)) @@ -659,7 +658,8 @@ #endif #define PREDICTED(op) PRED_##op: next_instr++ -#define PREDICTED_WITH_ARG(op) PRED_##op: next_instr++; oparg = OPARG(); next_instr += OPARG_SIZE +#define PREDICTED_WITH_ARG(op) PRED_##op: oparg = (next_instr[2]<<8) + \ + next_instr[1]; next_instr += 3 /* Stack manipulation macros */ @@ -862,11 +862,8 @@ /* Extract opcode and argument */ opcode = NEXTOP(); - if (HAS_ARG(opcode)) { - oparg = OPARG(); - next_instr += OPARG_SIZE; - } - + if (HAS_ARG(opcode)) + oparg = NEXTARG(); dispatch_opcode: #ifdef DYNAMIC_EXECUTION_PROFILE #ifdef DXPAIRS @@ -2252,8 +2249,7 @@ case EXTENDED_ARG: opcode = NEXTOP(); - oparg = oparg<<16 | OPARG(); - next_instr += OPARG_SIZE; + oparg = oparg<<16 | NEXTARG(); goto dispatch_opcode; default:
