Skip to content

Commit

Permalink
disambiguate bp as bp_ni - it is the $Nx and $Ix bp only
Browse files Browse the repository at this point in the history
  • Loading branch information
plobsing committed Aug 19, 2011
1 parent 865c881 commit 136f201
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions include/parrot/call.h
Expand Up @@ -419,7 +419,7 @@ PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
void Parrot_pcc_set_regs_ni(PARROT_INTERP,
ARGIN(PMC *ctx),
ARGIN(Regs_ni *bp))
ARGIN(Regs_ni *bp_ni))
__attribute__nonnull__(2)
__attribute__nonnull__(3);

Expand Down Expand Up @@ -522,7 +522,7 @@ PMC * Parrot_set_new_context(PARROT_INTERP,
, PARROT_ASSERT_ARG(ctx))
#define ASSERT_ARGS_Parrot_pcc_set_regs_ni __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(ctx) \
, PARROT_ASSERT_ARG(bp))
, PARROT_ASSERT_ARG(bp_ni))
#define ASSERT_ARGS_Parrot_pcc_set_regs_ps __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(ctx) \
, PARROT_ASSERT_ARG(bp_ps))
Expand Down
4 changes: 2 additions & 2 deletions include/parrot/context.h
Expand Up @@ -41,8 +41,8 @@ typedef struct Parrot_CallContext_attributes Parrot_Context;
/* Manually inlined macros. Used in optimized builds */
# define CTX_REG_PMC(i, p, x) (CONTEXT_STRUCT(p)->bp_ps.regs_p[-1L - (x)])
# define CTX_REG_STR(i, p, x) (CONTEXT_STRUCT(p)->bp_ps.regs_s[(x)])
# define CTX_REG_NUM(i, p, x) (CONTEXT_STRUCT(p)->bp.regs_n[-1L - (x)])
# define CTX_REG_INT(i, p, x) (CONTEXT_STRUCT(p)->bp.regs_i[(x)])
# define CTX_REG_NUM(i, p, x) (CONTEXT_STRUCT(p)->bp_ni.regs_n[-1L - (x)])
# define CTX_REG_INT(i, p, x) (CONTEXT_STRUCT(p)->bp_ni.regs_i[(x)])
#endif

#define REG_NUM(interp, x) CTX_REG_NUM((interp), (interp)->ctx, (x))
Expand Down
24 changes: 12 additions & 12 deletions src/call/context.c
Expand Up @@ -26,7 +26,7 @@ Parrot_Context functions.
| context || N | I | P | S +
+----------++----+------+------------+----+
^ ^ ^ ^
| | ctx.bp ctx.bp_ps
| | ctx.bp_ni ctx.bp_ps
ctx.state opt
padding
Expand Down Expand Up @@ -240,10 +240,10 @@ clear_regs(PARROT_INTERP, ARGMOD(Parrot_Context *ctx))
if (Interp_debug_TEST(interp, PARROT_REG_DEBUG_FLAG)) {
/* depending on -D40, set int and num to identifiable garbage values */
for (i = 0; i < ctx->n_regs_used[REGNO_INT]; ++i)
ctx->bp.regs_i[i] = -999;
ctx->bp_ni.regs_i[i] = -999;

for (i = 0; i < ctx->n_regs_used[REGNO_NUM]; ++i)
ctx->bp.regs_n[-1L - i] = -99.9;
ctx->bp_ni.regs_n[-1L - i] = -99.9;
}
}

Expand Down Expand Up @@ -446,10 +446,10 @@ allocate_registers(PARROT_INTERP, ARGIN(PMC *pmcctx), ARGIN(const UINTVAL *numbe
ctx->n_regs_used[REGNO_STR] = number_regs_used[REGNO_STR];
ctx->n_regs_used[REGNO_PMC] = number_regs_used[REGNO_PMC];

/* ctx.bp points to I0, which has Nx on the left */
ctx->bp.regs_i = (INTVAL *)((char *)ctx->registers + size_n);
/* ctx.bp_ni points to I0, which has N0 on the left */
ctx->bp_ni.regs_i = (INTVAL *)((char *)ctx->registers + size_n);

/* ctx.bp_ps points to S0, which has Px on the left */
/* ctx.bp_ps points to S0, which has P0 on the left */
ctx->bp_ps.regs_s = (STRING **)((char *)ctx->registers + size_nip);

clear_regs(interp, ctx);
Expand Down Expand Up @@ -635,7 +635,7 @@ Parrot_pcc_get_INTVAL_reg(PARROT_INTERP, ARGIN(const PMC *ctx), UINTVAL idx)
{
ASSERT_ARGS(Parrot_pcc_get_INTVAL_reg)
PARROT_ASSERT(Parrot_pcc_get_regs_used(interp, ctx, REGNO_INT) > idx);
return &(CONTEXT_STRUCT(ctx)->bp.regs_i[idx]);
return &(CONTEXT_STRUCT(ctx)->bp_ni.regs_i[idx]);
}

/*
Expand All @@ -657,7 +657,7 @@ Parrot_pcc_get_FLOATVAL_reg(PARROT_INTERP, ARGIN(const PMC *ctx), UINTVAL idx)
{
ASSERT_ARGS(Parrot_pcc_get_FLOATVAL_reg)
PARROT_ASSERT(Parrot_pcc_get_regs_used(interp, ctx, REGNO_NUM) > idx);
return &(CONTEXT_STRUCT(ctx)->bp.regs_n[-1L - idx]);
return &(CONTEXT_STRUCT(ctx)->bp_ni.regs_n[-1L - idx]);
}

/*
Expand Down Expand Up @@ -761,12 +761,12 @@ Regs_ni*
Parrot_pcc_get_regs_ni(SHIM_INTERP, ARGIN(const PMC *ctx))
{
ASSERT_ARGS(Parrot_pcc_get_regs_ni)
return &(CONTEXT_STRUCT(ctx)->bp);
return &(CONTEXT_STRUCT(ctx)->bp_ni);
}

/*
=item C<void Parrot_pcc_set_regs_ni(PARROT_INTERP, PMC *ctx, Regs_ni *bp)>
=item C<void Parrot_pcc_set_regs_ni(PARROT_INTERP, PMC *ctx, Regs_ni *bp_ni)>
Copy Regs_ni into Context.
Expand All @@ -776,10 +776,10 @@ Copy Regs_ni into Context.
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
void
Parrot_pcc_set_regs_ni(SHIM_INTERP, ARGIN(PMC *ctx), ARGIN(Regs_ni *bp))
Parrot_pcc_set_regs_ni(SHIM_INTERP, ARGIN(PMC *ctx), ARGIN(Regs_ni *bp_ni))
{
ASSERT_ARGS(Parrot_pcc_set_regs_ni)
CONTEXT_STRUCT(ctx)->bp = *bp;
CONTEXT_STRUCT(ctx)->bp_ni = *bp_ni;
}

/*
Expand Down
2 changes: 1 addition & 1 deletion src/pmc/callcontext.pmc
Expand Up @@ -506,7 +506,7 @@ pmclass CallContext provides array provides hash auto_attrs {
ATTR PMC *caller_ctx; /* caller context */

ATTR void *registers; /* pointer to allocated registers */
ATTR Regs_ni bp; /* pointers to FLOATVAL & INTVAL */
ATTR Regs_ni bp_ni; /* pointers to FLOATVAL & INTVAL */
ATTR Regs_ps bp_ps; /* pointers to PMC & STR */

ATTR UINTVAL n_regs_used[4]; /* INSP in PBC points to Sub */
Expand Down

0 comments on commit 136f201

Please sign in to comment.