diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-11-11 06:04:20 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-11-11 06:04:20 +0000 |
commit | 57843af05bc7863df9b9bfb6b37e3a29d08532a9 (patch) | |
tree | afce7f3f9e5ac7d38a7578c9d040f161c686fe6b /pp_ctl.c | |
parent | 743e66e61aecff1c9998bd0ff719a1d679b03e9f (diff) | |
download | perl-57843af05bc7863df9b9bfb6b37e3a29d08532a9.tar.gz |
another change towards a shareable optree: avoid pointer to filegv
in COP; revert parts of change#4485 and s/xcv_filegv/xcv_file/
(CvFILE() may yet come in handy somewhere); adjust compiler doodads
to suit
p4raw-link: @4485 on //depot/perl: b195d4879f55e1610299cb9b1b55356940c2a577
p4raw-id: //depot/perl@4545
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 44 |
1 files changed, 16 insertions, 28 deletions
@@ -1446,7 +1446,7 @@ PP(pp_caller) else PUSHs(sv_2mortal(newSVpv(HvNAME(hv), 0))); PUSHs(sv_2mortal(newSVsv(CopFILESV(cx->blk_oldcop)))); - PUSHs(sv_2mortal(newSViv((I32)cx->blk_oldcop->cop_line))); + PUSHs(sv_2mortal(newSViv((I32)CopLINE(cx->blk_oldcop)))); if (!MAXARG) RETURN; if (CxTYPE(cx) == CXt_SUB) { /* So is ccstack[dbcxix]. */ @@ -2491,11 +2491,11 @@ Perl_sv_compile_2op(pTHX_ SV *sv, OP** startop, char *code, AV** avp) SAVESPTR(PL_compiling.cop_stash); PL_compiling.cop_stash = PL_curstash; } - SAVESPTR(CopFILEGV(&PL_compiling)); - SAVEI16(PL_compiling.cop_line); + SAVECOPFILE(&PL_compiling); + SAVECOPLINE(&PL_compiling); sprintf(tmpbuf, "_<(%.10s_eval %lu)", code, (unsigned long)++PL_evalseq); - CopFILEGV_set(&PL_compiling, gv_fetchfile(tmpbuf+2)); - PL_compiling.cop_line = 1; + CopFILE_set(&PL_compiling, tmpbuf+2); + CopLINE_set(&PL_compiling, 1); /* XXX For C<eval "...">s within BEGIN {} blocks, this ends up deleting the eval's FILEGV from the stash before gv_check() runs (i.e. before run-time proper). To work around the coredump that @@ -2671,7 +2671,7 @@ S_doeval(pTHX_ int gimme, OP** startop) } SvREFCNT_dec(PL_rs); PL_rs = SvREFCNT_inc(PL_nrs); - PL_compiling.cop_line = 0; + CopLINE_set(&PL_compiling, 0); if (startop) { *startop = PL_eval_root; SvREFCNT_dec(CvOUTSIDE(PL_compcv)); @@ -2782,21 +2782,9 @@ PP(pp_require) /* prepare to compile file */ - if (*name == '/' || - (*name == '.' && - (name[1] == '/' || - (name[1] == '.' && name[2] == '/'))) -#ifdef DOSISH - || (name[0] && name[1] == ':') -#endif -#ifdef WIN32 - || (name[0] == '\\' && name[1] == '\\') /* UNC path */ -#endif -#ifdef VMS - || (strchr(name,':') || ((*name == '[' || *name == '<') && - (isALNUM(name[1]) || strchr("$-_]>",name[1])))) -#endif - ) + if (PERL_FILE_IS_ABSOLUTE(name) + || (*name == '.' && (name[1] == '/' || + (name[1] == '.' && name[2] == '/')))) { tryname = name; tryrsfp = doopen_pmc(name,PERL_SCRIPT_MODE); @@ -2940,8 +2928,8 @@ PP(pp_require) } } } - SAVESPTR(CopFILEGV(&PL_compiling)); - CopFILEGV_set(&PL_compiling, gv_fetchfile(tryrsfp ? tryname : name)); + SAVECOPFILE(&PL_compiling); + CopFILE_set(&PL_compiling, tryrsfp ? tryname : name); SvREFCNT_dec(namesv); if (!tryrsfp) { if (PL_op->op_type == OP_REQUIRE) { @@ -3010,8 +2998,8 @@ PP(pp_require) PUSHBLOCK(cx, CXt_EVAL, SP); PUSHEVAL(cx, name, Nullgv); - SAVEI16(PL_compiling.cop_line); - PL_compiling.cop_line = 0; + SAVECOPLINE(&PL_compiling); + CopLINE_set(&PL_compiling, 0); PUTBACK; #ifdef USE_THREADS @@ -3051,10 +3039,10 @@ PP(pp_entereval) /* switch to eval mode */ - SAVESPTR(CopFILEGV(&PL_compiling)); + SAVECOPFILE(&PL_compiling); sprintf(tmpbuf, "_<(eval %lu)", (unsigned long)++PL_evalseq); - CopFILEGV_set(&PL_compiling, gv_fetchfile(tmpbuf+2)); - PL_compiling.cop_line = 1; + CopFILE_set(&PL_compiling, tmpbuf+2); + CopLINE_set(&PL_compiling, 1); /* XXX For C<eval "...">s within BEGIN {} blocks, this ends up deleting the eval's FILEGV from the stash before gv_check() runs (i.e. before run-time proper). To work around the coredump that |