perlintern.html

来自「perl教程」· HTML 代码 · 共 986 行 · 第 1/3 页

HTML
986 行
字号
<pre>
        U32     intro_my()</pre>
</dd>
</li>
<dt><strong><a name="item_pad_add_anon">pad_add_anon</a></strong>

<dd>
<p>Add an anon code entry to the current compiling pad</p>
</dd>
<dd>
<pre>
        PADOFFSET       pad_add_anon(SV* sv, OPCODE op_type)</pre>
</dd>
</li>
<dt><strong><a name="item_pad_add_name">pad_add_name</a></strong>

<dd>
<p>Create a new name in the current pad at the specified offset.
If <code>typestash</code> is valid, the name is for a typed lexical; set the
name's stash to that value.
If <code>ourstash</code> is valid, it's an our lexical, set the name's
GvSTASH to that value</p>
</dd>
<dd>
<p>Also, if the name is @.. or %.., create a new array or hash for that slot</p>
</dd>
<dd>
<p>If fake, it means we're cloning an existing entry</p>
</dd>
<dd>
<pre>
        PADOFFSET       pad_add_name(char *name, HV* typestash, HV* ourstash, bool clone)</pre>
</dd>
</li>
<dt><strong><a name="item_pad_alloc">pad_alloc</a></strong>

<dd>
<p>Allocate a new my or tmp pad entry. For a my, simply push a null SV onto
the end of PL_comppad, but for a tmp, scan the pad from PL_padix upwards
for a slot which has no name and no active value.</p>
</dd>
<dd>
<pre>
        PADOFFSET       pad_alloc(I32 optype, U32 tmptype)</pre>
</dd>
</li>
<dt><strong><a name="item_pad_block_start">pad_block_start</a></strong>

<dd>
<p>Update the pad compilation state variables on entry to a new block</p>
</dd>
<dd>
<pre>
        void    pad_block_start(int full)</pre>
</dd>
</li>
<dt><strong><a name="item_pad_check_dup">pad_check_dup</a></strong>

<dd>
<p>Check for duplicate declarations: report any of:
     * a my in the current scope with the same name;
     * an our (anywhere in the pad) with the same name and the same stash
       as <code>ourstash</code>
<code>is_our</code> indicates that the name to check is an 'our' declaration</p>
</dd>
<dd>
<pre>
        void    pad_check_dup(char* name, bool is_our, HV* ourstash)</pre>
</dd>
</li>
<dt><strong><a name="item_pad_findlex">pad_findlex</a></strong>

<dd>
<p>Find a named lexical anywhere in a chain of nested pads. Add fake entries
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.</p>
</dd>
<dd>
<pre>
        PADOFFSET       pad_findlex(const char* name, PADOFFSET newoff, const CV* innercv)</pre>
</dd>
</li>
<dt><strong><a name="item_pad_findmy">pad_findmy</a></strong>

<dd>
<p>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.
Returns the offset in the current pad, or NOT_IN_PAD on failure.</p>
</dd>
<dd>
<pre>
        PADOFFSET       pad_findmy(char* name)</pre>
</dd>
</li>
<dt><strong><a name="item_pad_fixup_inner_anons">pad_fixup_inner_anons</a></strong>

<dd>
<p>For any anon CVs in the pad, change CvOUTSIDE of that CV from
old_cv to new_cv if necessary. Needed when a newly-compiled CV has to be
moved to a pre-existing CV struct.</p>
</dd>
<dd>
<pre>
        void    pad_fixup_inner_anons(PADLIST *padlist, CV *old_cv, CV *new_cv)</pre>
</dd>
</li>
<dt><strong><a name="item_pad_free">pad_free</a></strong>

<dd>
<p>Free the SV at offset po in the current pad.</p>
</dd>
<dd>
<pre>
        void    pad_free(PADOFFSET po)</pre>
</dd>
</li>
<dt><strong><a name="item_pad_leavemy">pad_leavemy</a></strong>

<dd>
<p>Cleanup at end of scope during compilation: set the max seq number for
lexicals in this scope and warn of any lexicals that never got introduced.</p>
</dd>
<dd>
<pre>
        void    pad_leavemy()</pre>
</dd>
</li>
<dt><strong><a name="item_pad_new">pad_new</a></strong>

<dd>
<p>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:</p>
</dd>
<dd>
<pre>
    padnew_CLONE        this pad is for a cloned CV
    padnew_SAVE         save old globals
    padnew_SAVESUB      also save extra stuff for start of sub</pre>
</dd>
<dd>
<pre>
        PADLIST*        pad_new(int flags)</pre>
</dd>
</li>
<dt><strong><a name="item_pad_push">pad_push</a></strong>

<dd>
<p>Push a new pad frame onto the padlist, unless there's already a pad at
this depth, in which case don't bother creating a new one.
If has_args is true, give the new pad an @_ in slot zero.</p>
</dd>
<dd>
<pre>
        void    pad_push(PADLIST *padlist, int depth, int has_args)</pre>
</dd>
</li>
<dt><strong><a name="item_pad_reset">pad_reset</a></strong>

<dd>
<p>Mark all the current temporaries for reuse</p>
</dd>
<dd>
<pre>
        void    pad_reset()</pre>
</dd>
</li>
<dt><strong><a name="item_pad_setsv">pad_setsv</a></strong>

<dd>
<p>Set the entry at offset po in the current pad to sv.
Use the macro <a href="#item_pad_setsv"><code>PAD_SETSV()</code></a> rather than calling this function directly.</p>
</dd>
<dd>
<pre>
        void    pad_setsv(PADOFFSET po, SV* sv)</pre>
</dd>
</li>
<dt><strong><a name="item_pad_swipe">pad_swipe</a></strong>

<dd>
<p>Abandon the tmp in the current pad at offset po and replace with a
new one.</p>
</dd>
<dd>
<pre>
        void    pad_swipe(PADOFFSET po, bool refadjust)</pre>
</dd>
</li>
<dt><strong><a name="item_pad_tidy">pad_tidy</a></strong>

<dd>
<p>Tidy up a pad after we've finished compiling it:
    * remove most stuff from the pads of anonsub prototypes;
    * give it a @_;
    * mark tmps as such.</p>
</dd>
<dd>
<pre>
        void    pad_tidy(padtidy_type type)</pre>
</dd>
</li>
<dt><strong><a name="item_pad_undef">pad_undef</a></strong>

<dd>
<p>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 the outer of this cv.</p>
</dd>
<dd>
<p>(This function should really be called pad_free, but the name was already
taken)</p>
</dd>
<dd>
<pre>
        void    pad_undef(CV* cv)</pre>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="stack_manipulation_macros">Stack Manipulation Macros</a></h1>
<dl>
<dt><strong><a name="item_djsp">djSP</a></strong>

<dd>
<p>Declare Just <code>SP</code>. This is actually identical to <code>dSP</code>, and declares
a local copy of perl's stack pointer, available via the <code>SP</code> macro.
See <code>SP</code>.  (Available for backward source code compatibility with the
old (Perl 5.005) thread model.)</p>
</dd>
<dd>
<pre>
                <span class="variable">djSP</span><span class="operator">;</span>
</pre>
</dd>
</li>
<dt><strong><a name="item_lvret">LVRET</a></strong>

<dd>
<p>True if this op will be the return value of an lvalue subroutine</p>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="sv_manipulation_functions">SV Manipulation Functions</a></h1>
<dl>
<dt><strong><a name="item_report_uninit">report_uninit</a></strong>

<dd>
<p>Print appropriate &quot;Use of uninitialized variable&quot; warning</p>
</dd>
<dd>
<pre>
        void    report_uninit()</pre>
</dd>
</li>
<dt><strong><a name="item_sv_add_arena">sv_add_arena</a></strong>

<dd>
<p>Given a chunk of memory, link it to the head of the list of arenas,
and split it into a list of free SVs.</p>
</dd>
<dd>
<pre>
        void    sv_add_arena(char* ptr, U32 size, U32 flags)</pre>
</dd>
</li>
<dt><strong><a name="item_sv_clean_all">sv_clean_all</a></strong>

<dd>
<p>Decrement the refcnt of each remaining SV, possibly triggering a
cleanup. This function may have to be called multiple times to free
SVs which are in complex self-referential hierarchies.</p>
</dd>
<dd>
<pre>
        I32     sv_clean_all()</pre>
</dd>
</li>
<dt><strong><a name="item_sv_clean_objs">sv_clean_objs</a></strong>

<dd>
<p>Attempt to destroy all objects not yet freed</p>
</dd>
<dd>
<pre>
        void    sv_clean_objs()</pre>
</dd>
</li>
<dt><strong><a name="item_sv_free_arenas">sv_free_arenas</a></strong>

<dd>
<p>Deallocate the memory used by all arenas. Note that all the individual SV
heads and bodies within the arenas must already have been freed.</p>
</dd>
<dd>
<pre>
        void    sv_free_arenas()</pre>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="authors">AUTHORS</a></h1>
<p>The autodocumentation system was originally added to the Perl core by
Benjamin Stuhl. Documentation is by whoever was kind enough to
document their functions.</p>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p>perlguts(1), <code>perlapi(1)</code></p>

</body>

</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?