This makes the other 26 (or 58) bits available for save data.
SSCHECK(3);
SSPUSHLONG(*longp);
SSPUSHPTR(longp);
- SSPUSHINT(SAVEt_LONG);
+ SSPUSHUV(SAVEt_LONG);
}
void
SSCHECK(3);
SSPUSHIV(*ivp);
SSPUSHPTR(ivp);
- SSPUSHINT(SAVEt_IV);
+ SSPUSHUV(SAVEt_IV);
}
void
SSCHECK(2);
SSPUSHPTR(gv);
- SSPUSHINT(SAVEt_NSTAB);
+ SSPUSHUV(SAVEt_NSTAB);
}
void
SSCHECK(3);
SSPUSHPTR(sarg[i]); /* remember the pointer */
SSPUSHPTR(sv); /* remember the value */
- SSPUSHINT(SAVEt_ITEM);
+ SSPUSHUV(SAVEt_ITEM);
}
}
*/
if (PL_savestack_ix == mgs->mgs_ss_ix)
{
- I32 popval = SSPOPINT;
- assert(popval == SAVEt_DESTRUCTOR_X);
+ UV type = SSPOPUV;
+ I32 popval;
+ assert(type == SAVEt_DESTRUCTOR_X);
PL_savestack_ix -= 2;
- popval = SSPOPINT;
- assert(popval == SAVEt_ALLOC);
+ type = SSPOPUV;
+ assert(type == SAVEt_ALLOC);
popval = SSPOPINT;
PL_savestack_ix -= popval;
}
void* any_ptr;
I32 any_i32;
IV any_iv;
+ UV any_uv;
long any_long;
bool any_bool;
void (*any_dptr) (void*);
state = (struct re_save_state *)(PL_savestack + PL_savestack_ix);
PL_savestack_ix += SAVESTACK_ALLOC_FOR_RE_SAVE_STATE;
- SSPUSHINT(SAVEt_RE_STATE);
+ SSPUSHUV(SAVEt_RE_STATE);
Copy(&PL_reg_state, state, 1, struct re_save_state);
SSPUSHINT(*PL_reglastcloseparen);
SSPUSHPTR(PL_reginput);
SSPUSHINT(total_elems);
- SSPUSHINT(SAVEt_REGCONTEXT); /* Magic cookie. */
+ SSPUSHUV(SAVEt_REGCONTEXT); /* Magic cookie. */
return retval;
}
PERL_ARGS_ASSERT_REGCPPOP;
/* Pop REGCP_OTHER_ELEMS before the parentheses loop starts. */
- i = SSPOPINT;
+ i = SSPOPUV;
assert(i == SAVEt_REGCONTEXT); /* Check that the magic cookie is there. */
i = SSPOPINT; /* Parentheses elements to pop. */
input = (char *) SSPOPPTR;
SSCHECK(3);
SSPUSHPTR(ptr1);
SSPUSHPTR(ptr2);
- SSPUSHINT(type);
+ SSPUSHUV(type);
}
SV *
SSPUSHPTR(sv);
SSPUSHINT(mask);
SSPUSHINT(val);
- SSPUSHINT(SAVEt_SET_SVFLAGS);
+ SSPUSHUV(SAVEt_SET_SVFLAGS);
}
void
SSCHECK(3);
SSPUSHBOOL(*boolp);
SSPUSHPTR(boolp);
- SSPUSHINT(SAVEt_BOOL);
+ SSPUSHUV(SAVEt_BOOL);
}
void
SSCHECK(3);
SSPUSHINT(i);
SSPUSHPTR(ptr);
- SSPUSHINT(type);
+ SSPUSHUV(type);
}
void
SSPUSHPTR(SvREFCNT_inc_simple_NN(PL_curpad[off]));
SSPUSHPTR(PL_comppad);
SSPUSHLONG((long)off);
- SSPUSHINT(SAVEt_PADSV_AND_MORTALIZE);
+ SSPUSHUV(SAVEt_PADSV_AND_MORTALIZE);
}
void
dVAR;
SSCHECK(2);
SSPUSHPTR(ptr);
- SSPUSHINT(type);
+ SSPUSHUV(type);
}
void
ASSERT_CURPAD_ACTIVE("save_clearsv");
SSCHECK(2);
SSPUSHLONG((long)(svp-PL_curpad));
- SSPUSHINT(SAVEt_CLEARSV);
+ SSPUSHUV(SAVEt_CLEARSV);
SvPADSTALE_off(*svp); /* mark lexical as active */
}
SSCHECK(3);
SSPUSHDPTR(f);
SSPUSHPTR(p);
- SSPUSHINT(SAVEt_DESTRUCTOR);
+ SSPUSHUV(SAVEt_DESTRUCTOR);
}
void
SSCHECK(3);
SSPUSHDXPTR(f);
SSPUSHPTR(p);
- SSPUSHINT(SAVEt_DESTRUCTOR_X);
+ SSPUSHUV(SAVEt_DESTRUCTOR_X);
}
void
SSPUSHPTR(ptr1);
SSPUSHINT(i);
SSPUSHPTR(ptr2);
- SSPUSHINT(type);
+ SSPUSHUV(type);
}
void
SSPUSHPTR(SvREFCNT_inc_simple(hv));
SSPUSHPTR(newSVsv(key));
SSPUSHPTR(SvREFCNT_inc(*sptr));
- SSPUSHINT(SAVEt_HELEM);
+ SSPUSHUV(SAVEt_HELEM);
save_scalar_at(sptr, flags);
if (flags & SAVEf_KEEPOLDELEM)
return;
PL_savestack_ix += elems;
SSPUSHINT(elems);
- SSPUSHINT(SAVEt_ALLOC);
+ SSPUSHUV(SAVEt_ALLOC);
return start;
}
DEBUG_l(Perl_deb(aTHX_ "savestack: releasing items %ld -> %ld\n",
(long)PL_savestack_ix, (long)base));
while (PL_savestack_ix > base) {
+ UV uv = SSPOPUV;
+ const U8 type = (U8)uv & SAVE_MASK;
TAINT_NOT;
- switch (SSPOPINT) {
+ switch (type) {
case SAVEt_ITEM: /* normal string */
value = MUTABLE_SV(SSPOPPTR);
sv = MUTABLE_SV(SSPOPPTR);
#define SAVEf_SETMAGIC 1
#define SAVEf_KEEPOLDELEM 2
+#define SAVE_TIGHT_SHIFT 6
+#define SAVE_MASK 0x3F
+
#define save_aelem(av,idx,sptr) save_aelem_flags(av,idx,sptr,SAVEf_SETMAGIC)
#define save_helem(hv,key,sptr) save_helem_flags(hv,key,sptr,SAVEf_SETMAGIC)
#define SSPUSHLONG(i) (PL_savestack[PL_savestack_ix++].any_long = (long)(i))
#define SSPUSHBOOL(p) (PL_savestack[PL_savestack_ix++].any_bool = (p))
#define SSPUSHIV(i) (PL_savestack[PL_savestack_ix++].any_iv = (IV)(i))
+#define SSPUSHUV(u) (PL_savestack[PL_savestack_ix++].any_uv = (UV)(u))
#define SSPUSHPTR(p) (PL_savestack[PL_savestack_ix++].any_ptr = (void*)(p))
#define SSPUSHDPTR(p) (PL_savestack[PL_savestack_ix++].any_dptr = (p))
#define SSPUSHDXPTR(p) (PL_savestack[PL_savestack_ix++].any_dxptr = (p))
#define SSPOPLONG (PL_savestack[--PL_savestack_ix].any_long)
#define SSPOPBOOL (PL_savestack[--PL_savestack_ix].any_bool)
#define SSPOPIV (PL_savestack[--PL_savestack_ix].any_iv)
+#define SSPOPUV (PL_savestack[--PL_savestack_ix].any_uv)
#define SSPOPPTR (PL_savestack[--PL_savestack_ix].any_ptr)
#define SSPOPDPTR (PL_savestack[--PL_savestack_ix].any_dptr)
#define SSPOPDXPTR (PL_savestack[--PL_savestack_ix].any_dxptr)
STMT_START { \
SSCHECK(2); \
SSPUSHINT(PL_stack_sp - PL_stack_base); \
- SSPUSHINT(SAVEt_STACK_POS); \
+ SSPUSHUV(SAVEt_STACK_POS); \
} STMT_END
#define SAVEOP() save_op()
SSCHECK(3); \
SSPUSHINT(cxstack[cxstack_ix].blk_oldsp); \
SSPUSHINT(cxstack_ix); \
- SSPUSHINT(SAVEt_STACK_CXPOS); \
+ SSPUSHUV(SAVEt_STACK_CXPOS); \
} STMT_END
#define SAVEPARSER(p) save_pushptr((p), SAVEt_PARSER)
#define TOPLONG(ss,ix) ((ss)[ix].any_long)
#define POPIV(ss,ix) ((ss)[--(ix)].any_iv)
#define TOPIV(ss,ix) ((ss)[ix].any_iv)
+#define POPUV(ss,ix) ((ss)[--(ix)].any_uv)
+#define TOPUV(ss,ix) ((ss)[ix].any_uv)
#define POPBOOL(ss,ix) ((ss)[--(ix)].any_bool)
#define TOPBOOL(ss,ix) ((ss)[ix].any_bool)
#define POPPTR(ss,ix) ((ss)[--(ix)].any_ptr)
Newxz(nss, max, ANY);
while (ix > 0) {
- const I32 type = POPINT(ss,ix);
- TOPINT(nss,ix) = type;
+ const UV uv = POPUV(ss,ix);
+ const U8 type = (U8)uv & SAVE_MASK;
+
+ TOPUV(nss,ix) = uv;
switch (type) {
case SAVEt_HELEM: /* hash element */
sv = (const SV *)POPPTR(ss,ix);