SvFAKE lexicals in scope for all of the sub
[p5sagit/p5-mst-13.2.git] / pod / perlintern.pod
index d256e7e..0ec74e0 100644 (file)
@@ -30,7 +30,7 @@ Found in file pad.h
 Access the SV at offset po in the saved current pad in the given
 context block structure (can be used as an lvalue).
 
-       PAD *   CX_CURPAD_SV(struct context, PADOFFSET po)
+       SV *    CX_CURPAD_SV(struct context, PADOFFSET po)
 
 =for hackers
 Found in file pad.h
@@ -113,6 +113,25 @@ Clone a padlist.
 =for hackers
 Found in file pad.h
 
+=item PAD_RESTORE_LOCAL
+
+Restore the old pad saved into the local variable opad by PAD_SAVE_LOCAL()
+
+       void    PAD_RESTORE_LOCAL(PAD *opad)
+
+=for hackers
+Found in file pad.h
+
+=item PAD_SAVE_LOCAL
+
+Save the current pad to the local variable opad, then make the
+current pad equal to npad
+
+       void    PAD_SAVE_LOCAL(PAD *opad, PAD *npad)
+
+=for hackers
+Found in file pad.h
+
 =item PAD_SAVE_SETNULLPAD
 
 Save the current pad then set it to null.
@@ -162,15 +181,6 @@ For internal use only.
 =for hackers
 Found in file pad.h
 
-=item PAD_UPDATE_CURPAD
-
-Set PL_curpad from the value of PL_comppad.
-
-       void    PAD_UPDATE_CURPAD()
-
-=for hackers
-Found in file pad.h
-
 =item SAVECLEARSV      
 
 Clear the pointed to pad value on scope exit. (ie the runtime action of 'my')
@@ -184,19 +194,11 @@ Found in file pad.h
 
 save PL_comppad and PL_curpad
 
-       void    SAVECOMPPAD()
-
-=for hackers
-Found in file pad.h
-
-=item SAVEFREEOP       
 
-Free the op on scope exit. At the same time, reset PL_curpad
 
 
 
-
-       void    SAVEFREEOP      (OP *o)
+       void    SAVECOMPPAD()
 
 =for hackers
 Found in file pad.h
@@ -205,6 +207,7 @@ Found in file pad.h
 
 Save a pad slot (used to restore after an iteration)
 
+XXX DAPM it would make more sense to make the arg a PADOFFSET
        void    SAVEPADSV       (PADOFFSET po)
 
 =for hackers
@@ -213,6 +216,23 @@ Found in file pad.h
 
 =back
 
+=head1 Functions in file pp_ctl.c
+
+
+=over 8
+
+=item find_runcv
+
+Locate the CV corresponding to the currently executing sub or eval.
+
+       CV*     find_runcv()
+
+=for hackers
+Found in file pp_ctl.c
+
+
+=back
+
 =head1 Global Variables
 
 =over 8
@@ -350,7 +370,7 @@ but that is really the callers pad (a slot of which is allocated by
 every entersub).
 
 The CvPADLIST AV has does not have AvREAL set, so REFCNT of component items
-is managed "manual" (mostly in op.c) rather than normal av.c rules.
+is managed "manual" (mostly in pad.c) rather than normal av.c rules.
 The items in the AV are not SVs as for a normal AV, but other AVs:
 
 0'th Entry of the CvPADLIST is an AV which represents the "names" or rather
@@ -366,7 +386,10 @@ C<PL_comppad_name> is set the the the names AV.
 C<PL_comppad> is set the the frame AV for the frame CvDEPTH == 1.
 C<PL_curpad> is set the body of the frame AV (i.e. AvARRAY(PL_comppad)).
 
-Itterating over the names AV itterates over all possible pad
+During execution, C<PL_comppad> and C<PL_curpad> refer to the live
+frame of the currently executing sub.
+
+Iterating over the names AV iterates over all possible pad
 items. Pad slots that are SVs_PADTMP (targets/GVs/constants) end up having
 &PL_sv_undef "names" (see pad_alloc()).
 
@@ -402,7 +425,7 @@ Found in file pad.c
 =item cv_clone
 
 Clone a CV: make a new CV which points to the same code etc, but which
-has a newly-created pad done by copying the prototype pad and capturing
+has a newly-created pad built by copying the prototype pad and capturing
 any outer lexicals.
 
        CV*     cv_clone(CV* proto)
@@ -491,7 +514,6 @@ Check for duplicate declarations: report any of:
        as C<ourstash>
 C<is_our> indicates that the name to check is an 'our' declaration
 
-
        void    pad_check_dup(char* name, bool is_our, HV* ourstash)
 
 =for hackers
@@ -500,20 +522,22 @@ Found in file pad.c
 =item pad_findlex
 
 Find a named lexical anywhere in a chain of nested pads. Add fake entries
-in the inner pads if its found in an outer one.
-
-If flags == FINDLEX_NOSEARCH we don't bother searching outer contexts.
+in the inner pads if it's found in an outer one. innercv is the CV *inside*
+the chain of outer CVs to be searched. If newoff is non-null, this is a
+run-time cloning: don't add fake entries, just find the lexical and add a
+ref to it at newoff in the current pad.
 
-       PADOFFSET       pad_findlex(char* name, PADOFFSET newoff, U32 seq, CV* startcv, I32 cx_ix, I32 saweval, U32 flags)
+       PADOFFSET       pad_findlex(char* name, PADOFFSET newoff, CV* innercv)
 
 =for hackers
 Found in file pad.c
 
 =item pad_findmy
 
-Given a lexical name, try to find it's offset, first in the current pad,
+Given a lexical name, try to find its offset, first in the current pad,
 or failing that, in the pads of any lexically enclosing subs (including
-the complications introduced by eval). If the name is found in an outer pad, then a fake entry is added to the current pad.
+the complications introduced by eval). If the name is found in an outer pad,
+then a fake entry is added to the current pad.
 Returns the offset in the current pad, or NOT_IN_PAD on failure.
 
        PADOFFSET       pad_findmy(char* name)
@@ -552,7 +576,7 @@ Found in file pad.c
 
 =item pad_new
 
-Create a new comnpiling padlist, saving and updating the various global
+Create a new compiling padlist, saving and updating the various global
 vars at the same time as creating the pad itself. The following flags
 can be OR'ed together:
 
@@ -623,9 +647,9 @@ Free the padlist associated with a CV.
 If parts of it happen to be current, we null the relevant
 PL_*pad* global vars so that we don't have any dangling references left.
 We also repoint the CvOUTSIDE of any about-to-be-orphaned
-inner subs to outercv.
+inner subs to the outer of this cv.
 
-       void    pad_undef(CV* cv, CV* outercv)
+       void    pad_undef(CV* cv)
 
 =for hackers
 Found in file pad.c