Here is the patch (again) to use the appropriate bitmask determined by Configure for the different register chunks.
-- Jason
Index: Configure.pl =================================================================== RCS file: /home/perlcvs/parrot/Configure.pl,v retrieving revision 1.29 diff -u -r1.29 Configure.pl --- Configure.pl 2001/10/17 11:45:23 1.29 +++ Configure.pl 2001/10/19 22:30:15 @@ -85,7 +85,11 @@ perl => $^X, debugging => $opt_debugging, rm_f => 'rm -f', - stacklow => '(~0xfff)', + stacklow => '(~0xfff)', + intlow => '(~0xfff)', + numlow => '(~0xfff)', + strlow => '(~0xfff)', + pmclow => '(~0xfff)', ); #copy the things from --define foo=bar Index: config_h.in =================================================================== RCS file: /home/perlcvs/parrot/config_h.in,v retrieving revision 1.9 diff -u -r1.9 config_h.in --- config_h.in 2001/10/12 17:59:01 1.9 +++ config_h.in 2001/10/19 22:30:15 @@ -26,8 +26,11 @@ #define FRAMES_PER_INT_REG_CHUNK FRAMES_PER_CHUNK #define FRAMES_PER_STR_REG_CHUNK FRAMES_PER_CHUNK -#define MASK_CHUNK_LOW_BITS (~0xfff) #define MASK_STACK_CHUNK_LOW_BITS ${stacklow} +#define MASK_INT_CHUNK_LOW_BITS ${intlow} +#define MASK_NUM_CHUNK_LOW_BITS ${numlow} +#define MASK_STR_CHUNK_LOW_BITS ${strlow} +#define MASK_PMC_CHUNK_LOW_BITS ${pmclow} ${headers} Index: register.c =================================================================== RCS file: /home/perlcvs/parrot/register.c,v retrieving revision 1.11 diff -u -r1.11 register.c --- register.c 2001/10/16 00:38:24 1.11 +++ register.c 2001/10/19 22:30:15 @@ -19,7 +19,7 @@ Parrot_push_i(struct Parrot_Interp *interpreter) { struct IRegChunk *chunk_base; - chunk_base = CHUNK_BASE(interpreter->int_reg); + chunk_base = INT_CHUNK_BASE(interpreter->int_reg); /* Do we have any slots left in the current chunk? */ if (chunk_base->free) { interpreter->int_reg = &chunk_base->IReg[chunk_base->used++]; @@ -46,7 +46,7 @@ Parrot_clone_i(struct Parrot_Interp *interpreter) { struct IRegChunk *chunk_base; - chunk_base = CHUNK_BASE(interpreter->int_reg); + chunk_base = INT_CHUNK_BASE(interpreter->int_reg); /* Do we have any slots left in the current chunk? */ if (chunk_base->free) { interpreter->int_reg = &chunk_base->IReg[chunk_base->used++]; @@ -77,7 +77,7 @@ void Parrot_pop_i(struct Parrot_Interp *interpreter) { struct IRegChunk *chunk_base; - chunk_base = CHUNK_BASE(interpreter->int_reg); + chunk_base = INT_CHUNK_BASE(interpreter->int_reg); /* Is there more than one register frame in use? */ if (chunk_base->used > 1) { chunk_base->used--; @@ -118,7 +118,7 @@ Parrot_push_s(struct Parrot_Interp *interpreter) { struct SRegChunk *chunk_base; - chunk_base = CHUNK_BASE(interpreter->string_reg); + chunk_base = STR_CHUNK_BASE(interpreter->string_reg); /* Do we have any slots left in the current chunk? */ if (chunk_base->free) { interpreter->string_reg = &chunk_base->SReg[chunk_base->used++]; @@ -148,7 +148,7 @@ Parrot_clone_s(struct Parrot_Interp *interpreter) { struct SRegChunk *chunk_base; - chunk_base = CHUNK_BASE(interpreter->string_reg); + chunk_base = STR_CHUNK_BASE(interpreter->string_reg); /* Do we have any slots left in the current chunk? */ if (chunk_base->free) { interpreter->string_reg = &chunk_base->SReg[chunk_base->used++]; @@ -182,7 +182,7 @@ void Parrot_pop_s(struct Parrot_Interp *interpreter) { struct SRegChunk *chunk_base; - chunk_base = CHUNK_BASE(interpreter->string_reg); + chunk_base = STR_CHUNK_BASE(interpreter->string_reg); /* Is there more than one register frame in use? */ if (chunk_base->used > 1) { chunk_base->used--; @@ -223,7 +223,7 @@ Parrot_push_n(struct Parrot_Interp *interpreter) { struct NRegChunk *chunk_base; - chunk_base = CHUNK_BASE(interpreter->num_reg); + chunk_base = NUM_CHUNK_BASE(interpreter->num_reg); /* Do we have any slots left in the current chunk? */ if (chunk_base->free) { interpreter->num_reg = &chunk_base->NReg[chunk_base->used++]; @@ -250,7 +250,7 @@ Parrot_clone_n(struct Parrot_Interp *interpreter) { struct NRegChunk *chunk_base; - chunk_base = CHUNK_BASE(interpreter->num_reg); + chunk_base = NUM_CHUNK_BASE(interpreter->num_reg); /* Do we have any slots left in the current chunk? */ if (chunk_base->free) { interpreter->num_reg = &chunk_base->NReg[chunk_base->used++]; @@ -281,7 +281,7 @@ void Parrot_pop_n(struct Parrot_Interp *interpreter) { struct NRegChunk *chunk_base; - chunk_base = CHUNK_BASE(interpreter->num_reg); + chunk_base = NUM_CHUNK_BASE(interpreter->num_reg); /* Is there more than one register frame in use? */ if (chunk_base->used > 1) { chunk_base->used--; @@ -322,7 +322,7 @@ Parrot_push_p(struct Parrot_Interp *interpreter) { struct PRegChunk *chunk_base; - chunk_base = CHUNK_BASE(interpreter->pmc_reg); + chunk_base = PMC_CHUNK_BASE(interpreter->pmc_reg); /* Do we have any slots left in the current chunk? */ if (chunk_base->free) { interpreter->pmc_reg = &chunk_base->PReg[chunk_base->used++]; @@ -351,7 +351,7 @@ Parrot_clone_p(struct Parrot_Interp *interpreter) { struct PRegChunk *chunk_base; - chunk_base = CHUNK_BASE(interpreter->pmc_reg); + chunk_base = PMC_CHUNK_BASE(interpreter->pmc_reg); /* Do we have any slots left in the current chunk? */ if (chunk_base->free) { interpreter->pmc_reg = &chunk_base->PReg[chunk_base->used++]; @@ -384,7 +384,7 @@ void Parrot_pop_p(struct Parrot_Interp *interpreter) { struct PRegChunk *chunk_base; - chunk_base = CHUNK_BASE(interpreter->pmc_reg); + chunk_base = PMC_CHUNK_BASE(interpreter->pmc_reg); /* Is there more than one register frame in use? */ if (chunk_base->used > 1) { chunk_base->used--; Index: include/parrot/register.h =================================================================== RCS file: /home/perlcvs/parrot/include/parrot/register.h,v retrieving revision 1.7 diff -u -r1.7 register.h --- include/parrot/register.h 2001/10/16 00:38:25 1.7 +++ include/parrot/register.h 2001/10/19 22:30:16 @@ -63,9 +63,12 @@ struct PReg PReg[FRAMES_PER_CHUNK]; }; -/* This macro masks off the low bits of a register chunk address, +/* These macros masks off the low bits of a register chunk address, since we're guaranteed to be aligned */ -#define CHUNK_BASE(x) (void *)(MASK_CHUNK_LOW_BITS & (ptrcast_t)x) +#define INT_CHUNK_BASE(x) (void *)(MASK_INT_CHUNK_LOW_BITS & (ptrcast_t)x) +#define NUM_CHUNK_BASE(x) (void *)(MASK_NUM_CHUNK_LOW_BITS & (ptrcast_t)x) +#define STR_CHUNK_BASE(x) (void *)(MASK_STR_CHUNK_LOW_BITS & (ptrcast_t)x) +#define PMC_CHUNK_BASE(x) (void *)(MASK_PMC_CHUNK_LOW_BITS & (ptrcast_t)x) void Parrot_clear_i(struct Parrot_Interp *); void Parrot_clear_s(struct Parrot_Interp *);