Mercurial > cpython-lru_cache-weakref
diff Python/ceval.c @ 24232:e06b1ab0bdb8 legacy-trunk
SF patch # 580411, move frame macros from frameobject.h into ceval.c
remove unused macros
use co alias instead of f->f_code in macros
| author | Neal Norwitz <nnorwitz@gmail.com> |
|---|---|
| date | Sun, 14 Jul 2002 00:27:26 +0000 |
| parents | a2bcb00dcbd5 |
| children | d98b0cdf7e51 |
line wrap: on
line diff
--- a/Python/ceval.c Sat Jul 13 14:31:51 2002 +0000 +++ b/Python/ceval.c Sun Jul 14 00:27:26 2002 +0000 @@ -521,11 +521,18 @@ char *filename; #endif +/* Tuple access macros */ + +#ifndef Py_DEBUG +#define GETITEM(v, i) PyTuple_GET_ITEM((PyTupleObject *)(v), (i)) +#else +#define GETITEM(v, i) PyTuple_GetItem((v), (i)) +#endif + /* Code access macros */ -#define GETCONST(i) Getconst(f, i) -#define GETNAME(i) Getname(f, i) -#define GETNAMEV(i) Getnamev(f, i) +#define GETCONST(i) (GETITEM(co->co_consts, (i))) +#define GETNAMEV(i) (GETITEM(co->co_names, (i))) #define INSTR_OFFSET() (next_instr - first_instr) #define NEXTOP() (*next_instr++) #define NEXTARG() (next_instr += 2, (next_instr[-1]<<8) + next_instr[-2])
