summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-08-11 16:21:07 +0100
committerDavid Mitchell <davem@iabyn.com>2015-08-17 11:16:23 +0100
commit71afaecef1b2593c92e9603a00232b189f376700 (patch)
treebba6044a7f3f2ad5114eced0a7edb0806dbc8c89 /scope.c
parent90ce4d0578578878b213fa81e151eead287da29e (diff)
downloadperl-71afaecef1b2593c92e9603a00232b189f376700.tar.gz
Eliminate PL_sawalias, GPf_ALIASED_SV
These two commits: v5.21.3-759-gff2a62e "Skip no-common-vars optimisation for aliases" v5.21.4-210-gc997e36 "Make list assignment respect foreach aliasing" added a run-time mechanism to detect aliased package variables, by either "*pkg = ...," or "for $pkg (...)", and used that information to enable the OPpASSIGN_COMMON mechanism at runtime for detecting common elements in a list assign, e.g. for $alias ($a, ...) { ($a,$b) = (1,$alias); } The previous commit but one changed the OPpASSIGN_COMMON mechanism such that it no longer uses PL_sawalias. So this var and the mechanism for setting it can now be removed. This commit removes: * the PL_sawalias variable * the GPf_ALIASED_SV GP flag * the SAVEt_GP_ALIASED_SV and save_aliased_sv() save type.
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/scope.c b/scope.c
index 5699d7cbd7..9768c30734 100644
--- a/scope.c
+++ b/scope.c
@@ -720,16 +720,6 @@ Perl_save_alloc(pTHX_ I32 size, I32 pad)
return start;
}
-void
-Perl_save_aliased_sv(pTHX_ GV *gv)
-{
- dSS_ADD;
- PERL_ARGS_ASSERT_SAVE_ALIASED_SV;
- SS_ADD_PTR(gp_ref(GvGP(gv)));
- SS_ADD_UV(SAVEt_GP_ALIASED_SV | cBOOL(GvALIASED_SV(gv)) << 8);
- SS_ADD_END(2);
-}
-
#define ARG0_SV MUTABLE_SV(arg0.any_ptr)
@@ -1252,24 +1242,6 @@ Perl_leave_scope(pTHX_ I32 base)
case SAVEt_READONLY_OFF:
SvREADONLY_off(ARG0_SV);
break;
- case SAVEt_GP_ALIASED_SV: {
- /* The GP may have been abandoned, leaving the savestack with
- the only remaining reference to it. */
- GP * const gp = (GP *)ARG0_PTR;
- if (gp->gp_refcnt == 1) {
- GV * const gv = (GV *)sv_2mortal(newSV_type(SVt_PVGV));
- isGV_with_GP_on(gv);
- GvGP_set(gv,gp);
- gp_free(gv);
- isGV_with_GP_off(gv);
- }
- else {
- gp->gp_refcnt--;
- if (uv >> 8) gp->gp_flags |= GPf_ALIASED_SV;
- else gp->gp_flags &= ~GPf_ALIASED_SV;
- }
- break;
- }
default:
Perl_croak(aTHX_ "panic: leave_scope inconsistency %u", type);
}