summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-05-26 20:10:42 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-05-26 20:10:42 +0000
commit5dc0d6134ebb76636f69238201dde15cec972fd0 (patch)
tree3f466c13b594ff662ce13454c90ecf35572088ea /scope.c
parent5bc6513ddd9360f3cbfa6bf29425e38b658230f5 (diff)
parent9ed32d99bcab50ff8df392e9741dd3de08a596a4 (diff)
downloadperl-5dc0d6134ebb76636f69238201dde15cec972fd0.tar.gz
Integrate thrperl 5.003->5.004.
p4raw-id: //depot/perl@24
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c39
1 files changed, 36 insertions, 3 deletions
diff --git a/scope.c b/scope.c
index 0487ebefbd..cf58e24f0e 100644
--- a/scope.c
+++ b/scope.c
@@ -21,6 +21,7 @@ SV** sp;
SV** p;
int n;
{
+ dTHR;
stack_sp = sp;
av_extend(curstack, (p - stack_base) + (n) + 128);
return stack_sp;
@@ -29,6 +30,7 @@ int n;
I32
cxinc()
{
+ dTHR;
cxstack_max = cxstack_max * 3 / 2;
Renew(cxstack, cxstack_max + 1, CONTEXT); /* XXX should fix CXINC macro */
return cxstack_ix + 1;
@@ -38,6 +40,7 @@ void
push_return(retop)
OP *retop;
{
+ dTHR;
if (retstack_ix == retstack_max) {
retstack_max = retstack_max * 3 / 2;
Renew(retstack, retstack_max, OP*);
@@ -48,6 +51,7 @@ OP *retop;
OP *
pop_return()
{
+ dTHR;
if (retstack_ix > 0)
return retstack[--retstack_ix];
else
@@ -57,6 +61,7 @@ pop_return()
void
push_scope()
{
+ dTHR;
if (scopestack_ix == scopestack_max) {
scopestack_max = scopestack_max * 3 / 2;
Renew(scopestack, scopestack_max, I32);
@@ -68,6 +73,7 @@ push_scope()
void
pop_scope()
{
+ dTHR;
I32 oldsave = scopestack[--scopestack_ix];
LEAVE_SCOPE(oldsave);
}
@@ -75,6 +81,7 @@ pop_scope()
void
markstack_grow()
{
+ dTHR;
I32 oldmax = markstack_max - markstack;
I32 newmax = oldmax * 3 / 2;
@@ -86,6 +93,7 @@ markstack_grow()
void
savestack_grow()
{
+ dTHR;
savestack_max = savestack_max * 3 / 2;
Renew(savestack, savestack_max, ANY);
}
@@ -93,6 +101,7 @@ savestack_grow()
void
free_tmps()
{
+ dTHR;
/* XXX should tmps_floor live in cxstack? */
I32 myfloor = tmps_floor;
while (tmps_ix > myfloor) { /* clean up after last statement */
@@ -111,6 +120,7 @@ static SV *
save_scalar_at(sptr)
SV **sptr;
{
+ dTHR;
register SV *sv;
SV *osv = *sptr;
@@ -142,6 +152,7 @@ SV *
save_scalar(gv)
GV *gv;
{
+ dTHR;
SSCHECK(3);
SSPUSHPTR(gv);
SSPUSHPTR(GvSV(gv));
@@ -153,6 +164,7 @@ SV*
save_svref(sptr)
SV **sptr;
{
+ dTHR;
SSCHECK(3);
SSPUSHPTR(sptr);
SSPUSHPTR(*sptr);
@@ -188,6 +200,7 @@ AV *
save_ary(gv)
GV *gv;
{
+ dTHR;
SSCHECK(3);
SSPUSHPTR(gv);
SSPUSHPTR(GvAVn(gv));
@@ -201,6 +214,7 @@ HV *
save_hash(gv)
GV *gv;
{
+ dTHR;
SSCHECK(3);
SSPUSHPTR(gv);
SSPUSHPTR(GvHVn(gv));
@@ -214,6 +228,7 @@ void
save_item(item)
register SV *item;
{
+ dTHR;
register SV *sv;
SSCHECK(3);
@@ -228,6 +243,7 @@ void
save_int(intp)
int *intp;
{
+ dTHR;
SSCHECK(3);
SSPUSHINT(*intp);
SSPUSHPTR(intp);
@@ -238,6 +254,7 @@ void
save_long(longp)
long *longp;
{
+ dTHR;
SSCHECK(3);
SSPUSHLONG(*longp);
SSPUSHPTR(longp);
@@ -248,6 +265,7 @@ void
save_I32(intp)
I32 *intp;
{
+ dTHR;
SSCHECK(3);
SSPUSHINT(*intp);
SSPUSHPTR(intp);
@@ -268,6 +286,7 @@ void
save_iv(ivp)
IV *ivp;
{
+ dTHR;
SSCHECK(3);
SSPUSHIV(*ivp);
SSPUSHPTR(ivp);
@@ -281,6 +300,7 @@ void
save_pptr(pptr)
char **pptr;
{
+ dTHR;
SSCHECK(3);
SSPUSHPTR(*pptr);
SSPUSHPTR(pptr);
@@ -291,6 +311,7 @@ void
save_sptr(sptr)
SV **sptr;
{
+ dTHR;
SSCHECK(3);
SSPUSHPTR(*sptr);
SSPUSHPTR(sptr);
@@ -301,6 +322,7 @@ void
save_nogv(gv)
GV *gv;
{
+ dTHR;
SSCHECK(2);
SSPUSHPTR(gv);
SSPUSHINT(SAVEt_NSTAB);
@@ -310,6 +332,7 @@ void
save_hptr(hptr)
HV **hptr;
{
+ dTHR;
SSCHECK(3);
SSPUSHPTR(*hptr);
SSPUSHPTR(hptr);
@@ -320,6 +343,7 @@ void
save_aptr(aptr)
AV **aptr;
{
+ dTHR;
SSCHECK(3);
SSPUSHPTR(*aptr);
SSPUSHPTR(aptr);
@@ -330,17 +354,19 @@ void
save_freesv(sv)
SV *sv;
{
+ dTHR;
SSCHECK(2);
SSPUSHPTR(sv);
SSPUSHINT(SAVEt_FREESV);
}
void
-save_freeop(op)
-OP *op;
+save_freeop(o)
+OP *o;
{
+ dTHR;
SSCHECK(2);
- SSPUSHPTR(op);
+ SSPUSHPTR(o);
SSPUSHINT(SAVEt_FREEOP);
}
@@ -348,6 +374,7 @@ void
save_freepv(pv)
char *pv;
{
+ dTHR;
SSCHECK(2);
SSPUSHPTR(pv);
SSPUSHINT(SAVEt_FREEPV);
@@ -357,6 +384,7 @@ void
save_clearsv(svp)
SV** svp;
{
+ dTHR;
SSCHECK(2);
SSPUSHLONG((long)(svp-curpad));
SSPUSHINT(SAVEt_CLEARSV);
@@ -368,6 +396,7 @@ HV *hv;
char *key;
I32 klen;
{
+ dTHR;
SSCHECK(4);
SSPUSHINT(klen);
SSPUSHPTR(key);
@@ -380,6 +409,7 @@ save_list(sarg,maxsarg)
register SV **sarg;
I32 maxsarg;
{
+ dTHR;
register SV *sv;
register I32 i;
@@ -398,6 +428,7 @@ save_destructor(f,p)
void (*f) _((void*));
void* p;
{
+ dTHR;
SSCHECK(3);
SSPUSHDPTR(f);
SSPUSHPTR(p);
@@ -408,6 +439,7 @@ void
leave_scope(base)
I32 base;
{
+ dTHR;
register SV *sv;
register SV *value;
register GV *gv;
@@ -614,6 +646,7 @@ void
cx_dump(cx)
CONTEXT* cx;
{
+ dTHR;
PerlIO_printf(Perl_debug_log, "CX %d = %s\n", cx - cxstack, block_type[cx->cx_type]);
if (cx->cx_type != CXt_SUBST) {
PerlIO_printf(Perl_debug_log, "BLK_OLDSP = %ld\n", (long)cx->blk_oldsp);