diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 1477af4e9cf318..403d673f843325 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -3954,9 +3954,9 @@ save(PicklerObject *self, PyObject *obj, int pers_save) #ifdef STACKLESS /* but we save the stack after a fixed watermark */ { - /* use a variable, because CSTACK_SAVE_NOW evaluates ts several times. */ + /* use a variable, because SLP_CSTACK_SAVE_NOW evaluates ts several times. */ PyThreadState *ts = PyThreadState_GET(); - if (CSTACK_SAVE_NOW(ts, self)) { + if (SLP_CSTACK_SAVE_NOW(ts, self)) { int res; if (Py_EnterRecursiveCall(" while pickling an object")) return -1; diff --git a/Python/ceval.c b/Python/ceval.c index 7950de0e6640c0..e2bcf8369ddb58 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4032,7 +4032,7 @@ PyEval_EvalFrameEx_slp(PyFrameObject *f, int throwflag, PyObject *retval) * PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) */ - if (CSTACK_SAVE_NOW(tstate, f)) + if (SLP_CSTACK_SAVE_NOW(tstate, f)) return slp_eval_frame_newstack(f, throwflag, retval); /* push frame */ diff --git a/Stackless/core/cframeobject.c b/Stackless/core/cframeobject.c index 4fd2567a57cf9d..913938fa4c4c75 100644 --- a/Stackless/core/cframeobject.c +++ b/Stackless/core/cframeobject.c @@ -247,7 +247,7 @@ static PyObject * run_cframe(PyFrameObject *f, int exc, PyObject *retval) return retval; } -DEF_INVALID_EXEC(run_cframe) +SLP_DEF_INVALID_EXEC(run_cframe) PyCFrameObject * slp_cframe_newfunc(PyObject *func, PyObject *args, PyObject *kwds, unsigned int linked) @@ -326,7 +326,7 @@ int slp_init_cframetype(void) return -1; /* register the cframe exec func */ return slp_register_execute(&PyCFrame_Type, "run_cframe", - run_cframe, REF_INVALID_EXEC(run_cframe)); + run_cframe, SLP_REF_INVALID_EXEC(run_cframe)); } /* Clear out the free list */ diff --git a/Stackless/core/slp_transfer.c b/Stackless/core/slp_transfer.c index da7774c633d9c6..2bfcf8e0cb8ac3 100644 --- a/Stackless/core/slp_transfer.c +++ b/Stackless/core/slp_transfer.c @@ -19,7 +19,7 @@ #define SLP_SAVE_STATE(stackref, stsizediff) \ intptr_t stsizeb; \ - stackref += STACK_MAGIC; \ + stackref += SLP_STACK_MAGIC; \ if (_cstprev != NULL) { \ if (slp_cstack_new(_cstprev, (intptr_t *)stackref, _prev) == NULL) __return(-1); \ stsizeb = slp_cstack_save(*_cstprev); \ @@ -52,10 +52,10 @@ or disable the STACKLESS flag. SLP_DO_NOT_OPTIMIZE_AWAY_DEFINITIONS -#ifdef EXTERNAL_ASM +#ifdef SLP_EXTERNAL_ASM /* CCP addition: Make these functions, to be called from assembler. * The token include file for the given platform should enable the - * EXTERNAL_ASM define so that this is included. + * SLP_EXTERNAL_ASM define so that this is included. */ /* There are two cases where slp_save_state would return 0, the diff --git a/Stackless/core/stackless_impl.h b/Stackless/core/stackless_impl.h index f64e01fb409bc4..69656f10c07a90 100644 --- a/Stackless/core/stackless_impl.h +++ b/Stackless/core/stackless_impl.h @@ -25,7 +25,7 @@ extern "C" { #undef STACKLESS_SPY /* * if a platform wants to support self-inspection via _peek, - * it must provide a function or macro CANNOT_READ_MEM(adr, len) + * it must provide a function or macro SLP_CANNOT_READ_MEM(adr, len) * which allows to spy at memory without causing exceptions. * This would usually be done in place with the assembly macros. */ diff --git a/Stackless/core/stackless_pystate.h b/Stackless/core/stackless_pystate.h index 4efe04c8a6300d..f3ae2f4d50a5e8 100644 --- a/Stackless/core/stackless_pystate.h +++ b/Stackless/core/stackless_pystate.h @@ -16,7 +16,7 @@ /* This include file is included from internal/pystate.h only */ -#include "platf/slp_platformselect.h" /* for CSTACK_SLOTS */ +#include "platf/slp_platformselect.h" /* for SLP_CSTACK_SLOTS */ /* * Stackless runtime state @@ -40,7 +40,7 @@ struct _stackless_runtime_state { /* Used to manage free C-stack objects, see stacklesseval.c */ int cstack_cachecount; - struct _cstack *cstack_cache[CSTACK_SLOTS]; + struct _cstack *cstack_cache[SLP_CSTACK_SLOTS]; /* * Used during a hard switch. diff --git a/Stackless/core/stackless_structs.h b/Stackless/core/stackless_structs.h index bb05bca2526e93..076fcd322a43c6 100644 --- a/Stackless/core/stackless_structs.h +++ b/Stackless/core/stackless_structs.h @@ -149,7 +149,7 @@ typedef struct _cstack { struct _tasklet *task; int nesting_level; PyThreadState *tstate; -#ifdef _SEH32 +#ifdef SLP_SEH32 /* SEH handler on Win32 * The correct type is DWORD, but we do not want to include . * Instead we use a compile time assertion to ensure, that we use an @@ -159,7 +159,7 @@ typedef struct _cstack { #endif intptr_t *startaddr; intptr_t stack[ -#if defined(_WINDOWS_) && defined(_SEH32) +#if defined(_WINDOWS_) && defined(SLP_SEH32) /* Assert the equivalence of DWORD and unsigned long. If * is included, _WINDOWS_ is defined. * Py_BUILD_ASSERT_EXPR needs an expression and this is the only one. diff --git a/Stackless/core/stacklesseval.c b/Stackless/core/stacklesseval.c index b4741c95088d39..946d58dae08950 100644 --- a/Stackless/core/stacklesseval.c +++ b/Stackless/core/stacklesseval.c @@ -28,7 +28,7 @@ static void slp_cstack_cacheclear(void) int i; PyCStackObject *stack; - for (i=0; i < CSTACK_SLOTS; i++) { + for (i=0; i < SLP_CSTACK_SLOTS; i++) { while ((_PyRuntime.st.cstack_cache)[i] != NULL) { stack = (_PyRuntime.st.cstack_cache)[i]; (_PyRuntime.st.cstack_cache)[i] = (PyCStackObject *) stack->startaddr; @@ -48,11 +48,11 @@ cstack_dealloc(PyCStackObject *cst) #ifdef Py_REF_DEBUG PyObject_Del(cst); #else - if (Py_SIZE(cst) >= CSTACK_SLOTS) { + if (Py_SIZE(cst) >= SLP_CSTACK_SLOTS) { PyObject_Del(cst); } else { - if ((_PyRuntime.st.cstack_cachecount) >= CSTACK_MAXCACHE) + if ((_PyRuntime.st.cstack_cachecount) >= SLP_CSTACK_MAXCACHE) slp_cstack_cacheclear(); cst->startaddr = (intptr_t *) (_PyRuntime.st.cstack_cache)[Py_SIZE(cst)]; (_PyRuntime.st.cstack_cache)[Py_SIZE(cst)] = cst; @@ -91,7 +91,7 @@ slp_cstack_new(PyCStackObject **cst, intptr_t *stackref, PyTaskletObject *task) (*cst)->task = NULL; Py_DECREF(*cst); } - if (size < CSTACK_SLOTS && ((*cst) = (_PyRuntime.st.cstack_cache)[size])) { + if (size < SLP_CSTACK_SLOTS && ((*cst) = (_PyRuntime.st.cstack_cache)[size])) { /* take stack from cache */ (_PyRuntime.st.cstack_cache)[size] = (PyCStackObject *) (*cst)->startaddr; --(_PyRuntime.st.cstack_cachecount); @@ -108,7 +108,7 @@ slp_cstack_new(PyCStackObject **cst, intptr_t *stackref, PyTaskletObject *task) (*cst)->task = task; (*cst)->tstate = ts; (*cst)->nesting_level = ts->st.nesting_level; -#ifdef _SEH32 +#ifdef SLP_SEH32 //save the SEH handler (*cst)->exception_list = 0; #endif @@ -122,7 +122,7 @@ slp_cstack_save(PyCStackObject *cstprev) memcpy((cstprev)->stack, (cstprev)->startaddr - Py_SIZE(cstprev), stsizeb); -#ifdef _SEH32 +#ifdef SLP_SEH32 //save the SEH handler cstprev->exception_list = (DWORD) __readfsdword(FIELD_OFFSET(NT_TIB, ExceptionList)); @@ -132,7 +132,7 @@ slp_cstack_save(PyCStackObject *cstprev) } void -#ifdef _SEH32 +#ifdef SLP_SEH32 #pragma warning(disable:4733) /* disable warning about modifying FS[0] */ #endif slp_cstack_restore(PyCStackObject *cst) @@ -142,7 +142,7 @@ slp_cstack_restore(PyCStackObject *cst) cst->task = NULL; memcpy(cst->startaddr - Py_SIZE(cst), &cst->stack, Py_SIZE(cst) * sizeof(intptr_t)); -#ifdef _SEH32 +#ifdef SLP_SEH32 //restore the SEH handler assert(cst->exception_list); __writefsdword(FIELD_OFFSET(NT_TIB, ExceptionList), (DWORD)(cst->exception_list)); @@ -343,9 +343,9 @@ slp_eval_frame(PyFrameObject *f) } /* mark the stack base */ - stackref = STACK_REFPLUS + (intptr_t *) &f; + stackref = SLP_STACK_REFPLUS + (intptr_t *) &f; if (ts->st.cstack_base == NULL) - ts->st.cstack_base = stackref - CSTACK_GOODGAP; + ts->st.cstack_base = stackref - SLP_CSTACK_GOODGAP; if (stackref > ts->st.cstack_base) { PyCStackObject *cst; retval = climb_stack_and_eval_frame(f); @@ -863,7 +863,7 @@ eval_frame_callback(PyFrameObject *f, int exc, PyObject *retval) * ourselves in an infinite loop of stack spilling. */ saved_base = ts->st.cstack_root; - ts->st.cstack_root = STACK_REFPLUS + (intptr_t *) &f; + ts->st.cstack_root = SLP_STACK_REFPLUS + (intptr_t *) &f; /* pull in the right retval and tempval from the arguments */ Py_SETREF(retval, cf->ob1); @@ -926,14 +926,14 @@ slp_eval_frame_newstack(PyFrameObject *f, int exc, PyObject *retval) * magic here will clear that exception. */ intptr_t *old = ts->st.cstack_root; - ts->st.cstack_root = STACK_REFPLUS + (intptr_t *) &f; + ts->st.cstack_root = SLP_STACK_REFPLUS + (intptr_t *) &f; retval = PyEval_EvalFrameEx_slp(f, exc, retval); ts->st.cstack_root = old; return retval; } if (ts->st.cstack_root == NULL) { /* this is a toplevel call. Store the root of stack spilling */ - ts->st.cstack_root = STACK_REFPLUS + (intptr_t *) &f; + ts->st.cstack_root = SLP_STACK_REFPLUS + (intptr_t *) &f; retval = PyEval_EvalFrameEx_slp(f, exc, retval); /* and reset it. We may reenter stackless at a completely different * depth later diff --git a/Stackless/module/stacklessmodule.c b/Stackless/module/stacklessmodule.c index 1de69daa15a52f..16ca814d119926 100644 --- a/Stackless/module/stacklessmodule.c +++ b/Stackless/module/stacklessmodule.c @@ -1405,15 +1405,15 @@ _peek(PyObject *self, PyObject *v) if (!PyLong_Check(v)) goto noobject; o = (PyObject*) PyLong_AsVoidPtr(v); /* this is plain heuristics, use for now */ - if (CANNOT_READ_MEM(o, sizeof(PyObject))) goto noobject; - if (IS_ON_STACK(o)) goto noobject; + if (SLP_CANNOT_READ_MEM(o, sizeof(PyObject))) goto noobject; + if (SLP_IS_ON_STACK(o)) goto noobject; if (Py_REFCNT(o) < 1 || Py_REFCNT(o) > 10000) goto noobject; t = Py_TYPE(o); for (i=0; i<100; i++) { if (t == &PyType_Type) break; - if (CANNOT_READ_MEM(t, sizeof(PyTypeObject))) goto noobject; - if (IS_ON_STACK(o)) goto noobject; + if (SLP_CANNOT_READ_MEM(t, sizeof(PyTypeObject))) goto noobject; + if (SLP_IS_ON_STACK(o)) goto noobject; if (Py_REFCNT(t) < 1 || Py_REFCNT(t) > 10000) goto noobject; if (!(isalpha(t->tp_name[0])||t->tp_name[0]=='_')) goto noobject; diff --git a/Stackless/pickling/prickelpit.c b/Stackless/pickling/prickelpit.c index a3d655bb0911e7..a001b7f5b5c43b 100644 --- a/Stackless/pickling/prickelpit.c +++ b/Stackless/pickling/prickelpit.c @@ -835,15 +835,15 @@ static int init_functype(PyObject * mod) #define frametuplefmt "O)(OiSOiOOiiOO" -DEF_INVALID_EXEC(eval_frame) -DEF_INVALID_EXEC(eval_frame_value) -DEF_INVALID_EXEC(eval_frame_noval) -DEF_INVALID_EXEC(eval_frame_iter) -DEF_INVALID_EXEC(eval_frame_setup_with) -DEF_INVALID_EXEC(eval_frame_with_cleanup) -DEF_INVALID_EXEC(slp_channel_seq_callback) -DEF_INVALID_EXEC(slp_restore_tracing) -DEF_INVALID_EXEC(slp_tp_init_callback) +SLP_DEF_INVALID_EXEC(eval_frame) +SLP_DEF_INVALID_EXEC(eval_frame_value) +SLP_DEF_INVALID_EXEC(eval_frame_noval) +SLP_DEF_INVALID_EXEC(eval_frame_iter) +SLP_DEF_INVALID_EXEC(eval_frame_setup_with) +SLP_DEF_INVALID_EXEC(eval_frame_with_cleanup) +SLP_DEF_INVALID_EXEC(slp_channel_seq_callback) +SLP_DEF_INVALID_EXEC(slp_restore_tracing) +SLP_DEF_INVALID_EXEC(slp_tp_init_callback) static PyTypeObject wrap_PyFrame_Type; @@ -1193,23 +1193,23 @@ MAKE_WRAPPERTYPE(PyFrame_Type, frame, "frame", frameobject_reduce, frame_new, fr static int init_frametype(PyObject * mod) { return slp_register_execute(&PyFrame_Type, "eval_frame", - PyEval_EvalFrameEx_slp, REF_INVALID_EXEC(eval_frame)) + PyEval_EvalFrameEx_slp, SLP_REF_INVALID_EXEC(eval_frame)) || slp_register_execute(&PyFrame_Type, "eval_frame_value", - slp_eval_frame_value, REF_INVALID_EXEC(eval_frame_value)) + slp_eval_frame_value, SLP_REF_INVALID_EXEC(eval_frame_value)) || slp_register_execute(&PyFrame_Type, "eval_frame_noval", - slp_eval_frame_noval, REF_INVALID_EXEC(eval_frame_noval)) + slp_eval_frame_noval, SLP_REF_INVALID_EXEC(eval_frame_noval)) || slp_register_execute(&PyFrame_Type, "eval_frame_iter", - slp_eval_frame_iter, REF_INVALID_EXEC(eval_frame_iter)) + slp_eval_frame_iter, SLP_REF_INVALID_EXEC(eval_frame_iter)) || slp_register_execute(&PyFrame_Type, "eval_frame_setup_with", - slp_eval_frame_setup_with, REF_INVALID_EXEC(eval_frame_setup_with)) + slp_eval_frame_setup_with, SLP_REF_INVALID_EXEC(eval_frame_setup_with)) || slp_register_execute(&PyFrame_Type, "eval_frame_with_cleanup", - slp_eval_frame_with_cleanup, REF_INVALID_EXEC(eval_frame_with_cleanup)) + slp_eval_frame_with_cleanup, SLP_REF_INVALID_EXEC(eval_frame_with_cleanup)) || slp_register_execute(&PyCFrame_Type, "channel_seq_callback", - slp_channel_seq_callback, REF_INVALID_EXEC(slp_channel_seq_callback)) + slp_channel_seq_callback, SLP_REF_INVALID_EXEC(slp_channel_seq_callback)) || slp_register_execute(&PyCFrame_Type, "slp_restore_tracing", - slp_restore_tracing, REF_INVALID_EXEC(slp_restore_tracing)) + slp_restore_tracing, SLP_REF_INVALID_EXEC(slp_restore_tracing)) || slp_register_execute(&PyCFrame_Type, "slp_tp_init_callback", - slp_tp_init_callback, REF_INVALID_EXEC(slp_tp_init_callback)) + slp_tp_init_callback, SLP_REF_INVALID_EXEC(slp_tp_init_callback)) || init_type(&wrap_PyFrame_Type, initchain, mod); } #undef initchain @@ -1825,7 +1825,7 @@ gen_setstate(PyObject *self, PyObject *args) MAKE_WRAPPERTYPE(PyGen_Type, gen, "generator", gen_reduce, gen_new, gen_setstate) -DEF_INVALID_EXEC(gen_iternext_callback) +SLP_DEF_INVALID_EXEC(gen_iternext_callback) static int init_generatortype(PyObject * mod) { @@ -1841,7 +1841,7 @@ static int init_generatortype(PyObject * mod) cbframe = gen->gi_frame->f_back; res = slp_register_execute(Py_TYPE(cbframe), "gen_iternext_callback", gen->gi_frame->f_back->f_execute, - REF_INVALID_EXEC(gen_iternext_callback)) + SLP_REF_INVALID_EXEC(gen_iternext_callback)) || init_type(&wrap_PyGen_Type, initchain, mod); assert(gen_exhausted_frame == NULL); diff --git a/Stackless/pickling/prickelpit.h b/Stackless/pickling/prickelpit.h index 3b720512ae5f02..0ae77085f64d9b 100644 --- a/Stackless/pickling/prickelpit.h +++ b/Stackless/pickling/prickelpit.h @@ -24,14 +24,14 @@ PyObject * slp_cannot_execute(PyFrameObject *f, const char *exec_name, PyObject /* macros to define and use an invalid frame executor */ -#define DEF_INVALID_EXEC(procname) \ +#define SLP_DEF_INVALID_EXEC(procname) \ static PyObject *\ cannot_##procname(PyFrameObject *f, int exc, PyObject *retval) \ { \ return slp_cannot_execute(f, #procname, retval); \ } -#define REF_INVALID_EXEC(procname) (cannot_##procname) +#define SLP_REF_INVALID_EXEC(procname) (cannot_##procname) /* pickling of arrays with nulls */ diff --git a/Stackless/pickling/safe_pickle.c b/Stackless/pickling/safe_pickle.c index b992312d688fd0..f188c4c2c49aa5 100644 --- a/Stackless/pickling/safe_pickle.c +++ b/Stackless/pickling/safe_pickle.c @@ -31,7 +31,7 @@ pickle_callback(PyFrameObject *f, int exc, PyObject *retval) * ourselves in an infinite loop of stack spilling. */ saved_base = ts->st.cstack_root; - ts->st.cstack_root = STACK_REFPLUS + (intptr_t *) &f; + ts->st.cstack_root = SLP_STACK_REFPLUS + (intptr_t *) &f; if (retval) { Py_DECREF(retval); cf->i = cPickle_save(cf->ob1, cf->ob2, cf->n); @@ -128,7 +128,7 @@ pickle_M(PyObject *self, PyObject *args, int pers_save) _self = self; _args = args; _pers_save = pers_save; - ts->st.cstack_root = STACK_REFPLUS + (intptr_t *) &self; + ts->st.cstack_root = SLP_STACK_REFPLUS + (intptr_t *) &self; ret = slp_int_wrapper(slp_eval_frame((PyFrameObject *)cf)); return ret; } diff --git a/Stackless/platf/slp_platformselect.h b/Stackless/platf/slp_platformselect.h index d2ae9312541f12..df244dee56853c 100644 --- a/Stackless/platf/slp_platformselect.h +++ b/Stackless/platf/slp_platformselect.h @@ -82,34 +82,34 @@ extern uint8_t* volatile slp_do_not_opimize_away_sink; /* adjust slots to typical size of a few recursions on your system */ -#ifndef CSTACK_SLOTS -#define CSTACK_SLOTS 1024 +#ifndef SLP_CSTACK_SLOTS +#define SLP_CSTACK_SLOTS 1024 #endif /* how many cstacks to cache at all */ -#ifndef CSTACK_MAXCACHE -#define CSTACK_MAXCACHE 100 +#ifndef SLP_CSTACK_MAXCACHE +#define SLP_CSTACK_MAXCACHE 100 #endif /* a good estimate how much the cstack level differs between initialisation and main C-Python(r) code. Not critical, but saves time. Note that this will vanish with the greenlet approach. */ -#ifndef CSTACK_GOODGAP -#define CSTACK_GOODGAP 4096 +#ifndef SLP_CSTACK_GOODGAP +#define SLP_CSTACK_GOODGAP 4096 #endif /* stack size in pointer to trigger stack spilling */ -#ifndef CSTACK_WATERMARK -#define CSTACK_WATERMARK 16384 +#ifndef SLP_CSTACK_WATERMARK +#define SLP_CSTACK_WATERMARK 16384 #endif /* define direction of stack growth */ -#ifndef CSTACK_DOWNWARDS -#define CSTACK_DOWNWARDS 1 /* 0 for upwards */ +#ifndef SLP_CSTACK_DOWNWARDS +#define SLP_CSTACK_DOWNWARDS 1 /* 0 for upwards */ #endif /************************************************************** @@ -118,17 +118,17 @@ extern uint8_t* volatile slp_do_not_opimize_away_sink; **************************************************************/ -#if CSTACK_DOWNWARDS == 1 -#define CSTACK_COMPARE(a, b) (a) < (b) -#define CSTACK_SUBTRACT(a, b) (a) - (b) +#if SLP_CSTACK_DOWNWARDS == 1 +#define SLP_CSTACK_COMPARE(a, b) (a) < (b) +#define SLP_CSTACK_SUBTRACT(a, b) (a) - (b) #else -#define CSTACK_COMPARE(a, b) (a) > (b) -#define CSTACK_SUBTRACT(a, b) (b) - (a) +#define SLP_CSTACK_COMPARE(a, b) (a) > (b) +#define SLP_CSTACK_SUBTRACT(a, b) (b) - (a) #endif -#define CSTACK_SAVE_NOW(tstate, stackvar) \ +#define SLP_CSTACK_SAVE_NOW(tstate, stackvar) \ ((tstate)->st.cstack_root != NULL ? \ - CSTACK_SUBTRACT((tstate)->st.cstack_root, \ - (intptr_t*)&(stackvar)) > CSTACK_WATERMARK : 1) + SLP_CSTACK_SUBTRACT((tstate)->st.cstack_root, \ + (intptr_t*)&(stackvar)) > SLP_CSTACK_WATERMARK : 1) #endif diff --git a/Stackless/platf/switch_amd64_unix.h b/Stackless/platf/switch_amd64_unix.h index a22b7f21c3eb73..bf26e4fb91d454 100644 --- a/Stackless/platf/switch_amd64_unix.h +++ b/Stackless/platf/switch_amd64_unix.h @@ -15,12 +15,12 @@ * 24-Nov-02 Christian Tismer * needed to add another magic constant to insure * that f in slp_eval_frame(PyFrameObject *f) - * STACK_REFPLUS will probably be 1 in most cases. + * SLP_STACK_REFPLUS will probably be 1 in most cases. * gets included into the saved stack area. * 17-Sep-02 Christian Tismer * after virtualizing stack save/restore, the * stack size shrunk a bit. Needed to introduce - * an adjustment STACK_MAGIC per platform. + * an adjustment SLP_STACK_MAGIC per platform. * 15-Sep-02 Gerd Woetzel * slightly changed framework for spark * 31-Avr-02 Armin Rigo @@ -31,13 +31,13 @@ #define SLP_USE_NATIVE_BITFIELD_LAYOUT 1 -#define STACK_REFPLUS 1 +#define SLP_STACK_REFPLUS 1 #ifdef SLP_EVAL -/* #define STACK_MAGIC 3 */ +/* #define SLP_STACK_MAGIC 3 */ /* the above works fine with gcc 2.96, but 2.95.3 wants this */ -#define STACK_MAGIC 0 +#define SLP_STACK_MAGIC 0 /* @@ -138,6 +138,7 @@ slp_switch(void) } } +#undef REGS_CLOBBERED #endif /* * further self-processing support diff --git a/Stackless/platf/switch_arm32_gcc.h b/Stackless/platf/switch_arm32_gcc.h index d0c05d68e0a9b5..1ea5516bee5685 100644 --- a/Stackless/platf/switch_arm32_gcc.h +++ b/Stackless/platf/switch_arm32_gcc.h @@ -21,10 +21,10 @@ * */ -#define STACK_REFPLUS 1 +#define SLP_STACK_REFPLUS 1 #ifdef SLP_EVAL -#define STACK_MAGIC 0 +#define SLP_STACK_MAGIC 0 #define REGS_TO_SAVE /*"r1", "r2", "r3", "r4",*/ "r5", "r6", "fp", "ip", "lr" static int @@ -46,4 +46,5 @@ slp_switch(void) } } +#undef REGS_TO_SAVE #endif diff --git a/Stackless/platf/switch_arm_thumb_gcc.h b/Stackless/platf/switch_arm_thumb_gcc.h index 489c920f14c2c4..e11371e727f7e0 100644 --- a/Stackless/platf/switch_arm_thumb_gcc.h +++ b/Stackless/platf/switch_arm_thumb_gcc.h @@ -1,9 +1,9 @@ -#define STACK_REFPLUS 1 -#define STACK_MAGIC 0 +#define SLP_STACK_REFPLUS 1 +#define SLP_STACK_MAGIC 0 /* Use the generic support for an external assembly language slp_switch function. */ -#define EXTERNAL_ASM +#define SLP_EXTERNAL_ASM #ifdef SLP_EVAL /* This always uses the external masm assembly file. */ diff --git a/Stackless/platf/switch_mips_unix.h b/Stackless/platf/switch_mips_unix.h index 7d6d51c579861a..b7cee6c4633f56 100644 --- a/Stackless/platf/switch_mips_unix.h +++ b/Stackless/platf/switch_mips_unix.h @@ -6,11 +6,11 @@ * Ported from ppc. */ -#define STACK_REFPLUS 1 +#define SLP_STACK_REFPLUS 1 #ifdef SLP_EVAL -#define STACK_MAGIC 0 +#define SLP_STACK_MAGIC 0 #ifdef __mips64 #define REGS_TO_SAVE "$16", "$17", "$18", "$19", "$20", "$21", "$22", \ @@ -42,6 +42,7 @@ slp_switch(void) return 0; } +#undef REGS_TO_SAVE #endif /* diff --git a/Stackless/platf/switch_ppc_macosx.h b/Stackless/platf/switch_ppc_macosx.h index d582d3125f43bf..c9594f93558dfd 100644 --- a/Stackless/platf/switch_ppc_macosx.h +++ b/Stackless/platf/switch_ppc_macosx.h @@ -11,11 +11,11 @@ * needed to add another magic constant to insure * that f in slp_eval_frame(PyFrameObject *f) * gets included into the saved stack area. - * STACK_REFPLUS will probably be 1 in most cases. + * SLP_STACK_REFPLUS will probably be 1 in most cases. * 17-Sep-02 Christian Tismer * after virtualizing stack save/restore, the * stack size shrunk a bit. Needed to introduce - * an adjustment STACK_MAGIC per platform. + * an adjustment SLP_STACK_MAGIC per platform. * 15-Sep-02 Gerd Woetzel * slightly changed framework for sparc * 29-Jun-02 Christian Tismer @@ -26,11 +26,11 @@ * Ported from i386. */ -#define STACK_REFPLUS 1 +#define SLP_STACK_REFPLUS 1 #ifdef SLP_EVAL -#define STACK_MAGIC 3 +#define SLP_STACK_MAGIC 3 #if STACKLESS_FRHACK #define REGS_TO_SAVE "r13", "r14", "r15", "r16", "r17", "r18", "r19", "r20", \ @@ -71,6 +71,7 @@ slp_switch(void) } } +#undef REGS_TO_SAVE #endif /* diff --git a/Stackless/platf/switch_ppc_unix.h b/Stackless/platf/switch_ppc_unix.h index f0bf07845f1dcf..0c33c054f3099c 100644 --- a/Stackless/platf/switch_ppc_unix.h +++ b/Stackless/platf/switch_ppc_unix.h @@ -11,13 +11,13 @@ * needed to add another magic constant to insure * that f in slp_eval_frame(PyFrameObject *f) * gets included into the saved stack area. - * STACK_REFPLUS will probably be 1 in most cases. + * SLP_STACK_REFPLUS will probably be 1 in most cases. * 04-Oct-02 Gustavo Niemeyer * Ported from MacOS version. * 17-Sep-02 Christian Tismer * after virtualizing stack save/restore, the * stack size shrunk a bit. Needed to introduce - * an adjustment STACK_MAGIC per platform. + * an adjustment SLP_STACK_MAGIC per platform. * 15-Sep-02 Gerd Woetzel * slightly changed framework for sparc * 29-Jun-02 Christian Tismer @@ -28,11 +28,11 @@ * Ported from i386. */ -#define STACK_REFPLUS 1 +#define SLP_STACK_REFPLUS 1 #ifdef SLP_EVAL -#define STACK_MAGIC 3 +#define SLP_STACK_MAGIC 3 #define REGS_TO_SAVE "r13", "r14", "r15", "r16", "r17", "r18", "r19", "r20", \ "r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29", "r31", \ @@ -59,6 +59,7 @@ slp_switch(void) __asm__ volatile ("" : : : REGS_TO_SAVE); } +#undef REGS_TO_SAVE #endif /* diff --git a/Stackless/platf/switch_ps3_SNTools.h b/Stackless/platf/switch_ps3_SNTools.h index ac305729b577ea..1fd1ddd9e0a1e7 100644 --- a/Stackless/platf/switch_ps3_SNTools.h +++ b/Stackless/platf/switch_ps3_SNTools.h @@ -5,11 +5,11 @@ #include -#define STACK_REFPLUS 1 -#define STACK_MAGIC 0 /* in the assembler, we grab the stack pointer directly */ +#define SLP_STACK_REFPLUS 1 +#define SLP_STACK_MAGIC 0 /* in the assembler, we grab the stack pointer directly */ -#define EXTERNAL_ASM +#define SLP_EXTERNAL_ASM /* use the c stack sparingly. No initial gap, and invoke stack spilling at 16k */ -#define CSTACK_GOODGAP 0 -#define CSTACK_WATERMARK (16*1024/sizeof(intptr_t)) \ No newline at end of file +#define SLP_CSTACK_GOODGAP 0 +#define SLP_CSTACK_WATERMARK (16*1024/sizeof(intptr_t)) \ No newline at end of file diff --git a/Stackless/platf/switch_s390_unix.h b/Stackless/platf/switch_s390_unix.h index 1e08c604998548..996ae83dea6da4 100644 --- a/Stackless/platf/switch_s390_unix.h +++ b/Stackless/platf/switch_s390_unix.h @@ -6,16 +6,16 @@ * needed to add another magic constant to insure * that f in slp_eval_frame(PyFrameObject *f) * gets included into the saved stack area. - * STACK_REFPLUS will probably be 1 in most cases. + * SLP_STACK_REFPLUS will probably be 1 in most cases. * 06-Oct-02 Gustavo Niemeyer * Ported to Linux/S390. */ -#define STACK_REFPLUS 1 +#define SLP_STACK_REFPLUS 1 #ifdef SLP_EVAL -#define STACK_MAGIC 0 +#define SLP_STACK_MAGIC 0 #define REGS_TO_SAVE "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r14", \ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ @@ -39,6 +39,7 @@ slp_switch(void) } } +#undef REGS_TO_SAVE #endif /* diff --git a/Stackless/platf/switch_sparc_sun_gcc.h b/Stackless/platf/switch_sparc_sun_gcc.h index 449e49faebfc9d..334204eab49934 100644 --- a/Stackless/platf/switch_sparc_sun_gcc.h +++ b/Stackless/platf/switch_sparc_sun_gcc.h @@ -6,22 +6,22 @@ * needed to add another magic constant to insure * that f in slp_eval_frame(PyFrameObject *f) * gets included into the saved stack area. - * STACK_REFPLUS will probably be 1 in most cases. + * SLP_STACK_REFPLUS will probably be 1 in most cases. * 17-Sep-02 Christian Tismer * after virtualizing stack save/restore, the * stack size shrunk a bit. Needed to introduce - * an adjustment STACK_MAGIC per platform. + * an adjustment SLP_STACK_MAGIC per platform. * 15-Sep-02 Gerd Woetzel * added support for SunOS sparc with gcc */ -#define STACK_REFPLUS 1 +#define SLP_STACK_REFPLUS 1 #ifdef SLP_EVAL #include -#define STACK_MAGIC 0 +#define SLP_STACK_MAGIC 0 static int slp_switch(void) diff --git a/Stackless/platf/switch_x64_msvc.h b/Stackless/platf/switch_x64_msvc.h index 9958e51611471e..818ecf77ecf87d 100644 --- a/Stackless/platf/switch_x64_msvc.h +++ b/Stackless/platf/switch_x64_msvc.h @@ -5,7 +5,7 @@ * 24-Nov-02 Christian Tismer * needed to add another magic constant to insure * that f in slp_eval_frame(PyFrameObject *f) - * STACK_REFPLUS will probably be 1 in most cases. + * SLP_STACK_REFPLUS will probably be 1 in most cases. * gets included into the saved stack area. * 26-Sep-02 Christian Tismer * again as a result of virtualized stack access, @@ -15,7 +15,7 @@ * 17-Sep-02 Christian Tismer * after virtualizing stack save/restore, the * stack size shrunk a bit. Needed to introduce - * an adjustment STACK_MAGIC per platform. + * an adjustment SLP_STACK_MAGIC per platform. * 15-Sep-02 Gerd Woetzel * slightly changed framework for sparc * 01-Mar-02 Christian Tismer @@ -24,11 +24,11 @@ #define SLP_USE_NATIVE_BITFIELD_LAYOUT 1 -#define STACK_REFPLUS 1 -#define STACK_MAGIC 0 +#define SLP_STACK_REFPLUS 1 +#define SLP_STACK_MAGIC 0 /* Use the generic support for an external assembly language slp_switch function. */ -#define EXTERNAL_ASM +#define SLP_EXTERNAL_ASM #ifdef SLP_EVAL /* This always uses the external masm assembly file. */ @@ -42,9 +42,9 @@ #define STACKLESS_SPY #ifdef IMPLEMENT_STACKLESSMODULE -#define CANNOT_READ_MEM(p, bytes) IsBadReadPtr(p, bytes) +#define SLP_CANNOT_READ_MEM(p, bytes) IsBadReadPtr(p, bytes) -static int IS_ON_STACK(void*p) +static int SLP_IS_ON_STACK(void*p) { int stackref; intptr_t stackbase = ((intptr_t)&stackref) & 0xfffff000; diff --git a/Stackless/platf/switch_x86_msvc.h b/Stackless/platf/switch_x86_msvc.h index 0a83c7a5f457ae..b2f0cb0ae1c215 100644 --- a/Stackless/platf/switch_x86_msvc.h +++ b/Stackless/platf/switch_x86_msvc.h @@ -6,7 +6,7 @@ * needed to add another magic constant to insure * that f in slp_eval_frame(PyFrameObject *f) * gets included into the saved stack area. - * STACK_REFPLUS will probably be 1 in most cases. + * SLP_STACK_REFPLUS will probably be 1 in most cases. * 26-Sep-02 Christian Tismer * again as a result of virtualized stack access, * the compiler used less registers. Needed to @@ -15,7 +15,7 @@ * 17-Sep-02 Christian Tismer * after virtualizing stack save/restore, the * stack size shrunk a bit. Needed to introduce - * an adjustment STACK_MAGIC per platform. + * an adjustment SLP_STACK_MAGIC per platform. * 15-Sep-02 Gerd Woetzel * slightly changed framework for sparc * 01-Mar-02 Christian Tismer @@ -24,14 +24,14 @@ #define SLP_USE_NATIVE_BITFIELD_LAYOUT 1 -#define _SEH32 +#define SLP_SEH32 -#define STACK_REFPLUS 1 +#define SLP_STACK_REFPLUS 1 /* switching related stuff */ #ifdef SLP_EVAL -#define STACK_MAGIC 0 +#define SLP_STACK_MAGIC 0 #pragma optimize("", off) @@ -67,9 +67,9 @@ slp_switch(void) #define STACKLESS_SPY #ifdef IMPLEMENT_STACKLESSMODULE -#define CANNOT_READ_MEM(p, bytes) IsBadReadPtr(p, bytes) +#define SLP_CANNOT_READ_MEM(p, bytes) IsBadReadPtr(p, bytes) -static int IS_ON_STACK(void*p) +static int SLP_IS_ON_STACK(void*p) { int stackref; int stackbase = ((int)&stackref) & 0xfffff000; diff --git a/Stackless/platf/switch_x86_unix.h b/Stackless/platf/switch_x86_unix.h index 1610d04fa688e6..42e3c63cba7930 100644 --- a/Stackless/platf/switch_x86_unix.h +++ b/Stackless/platf/switch_x86_unix.h @@ -8,11 +8,11 @@ * needed to add another magic constant to insure * that f in slp_eval_frame(PyFrameObject *f) * gets included into the saved stack area. - * STACK_REFPLUS will probably be 1 in most cases. + * SLP_STACK_REFPLUS will probably be 1 in most cases. * 17-Sep-02 Christian Tismer * after virtualizing stack save/restore, the * stack size shrunk a bit. Needed to introduce - * an adjustment STACK_MAGIC per platform. + * an adjustment SLP_STACK_MAGIC per platform. * 15-Sep-02 Gerd Woetzel * slightly changed framework for spark * 31-Avr-02 Armin Rigo @@ -23,11 +23,11 @@ #define SLP_USE_NATIVE_BITFIELD_LAYOUT 1 -#define STACK_REFPLUS 1 +#define SLP_STACK_REFPLUS 1 #ifdef SLP_EVAL -#define STACK_MAGIC 0 +#define SLP_STACK_MAGIC 0 /* * In order to switch the stack, we use the fact, that the compiler @@ -99,7 +99,7 @@ slp_switch(void) } } - +#undef REGS_CLOBBERED #endif /*