summaryrefslogtreecommitdiff
path: root/proto.h
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-12-16 12:30:01 +0000
committerDavid Mitchell <davem@iabyn.com>2016-02-03 09:18:34 +0000
commit799da9d7a389d2e825fba9c63b2f6876513385c7 (patch)
tree2b77332b832f7cf6a5ceec8e0a97936aadf2a5ed /proto.h
parentd8bdd59a731e612643be6a230102949e419f17db (diff)
downloadperl-799da9d7a389d2e825fba9c63b2f6876513385c7.tar.gz
make pp_leavesublv use S_leavesub_adjust_stacks()
Currently S_leavesub_adjust_stacks() is just used by pp_leavesub. Rename it to Perl_leave_adjust_stacks(), extend its functionality slightly, then make pp_leavesublv() use it too. This means that lvalue sub exit gains the benefit of FREETMPS being done, and (where mortal copying needs doing) the optimised copying code. It also means there is now one less version of the "process args on scope exit" code. pp_leavesublv() still does a scan of its return args looking for things to croak() on, but leaves everything else to leave_adjust_stacks(). leave_adjust_stacks() is intended shortly to be used in place of S_leave_common() too, thus unifying all args-on-scope-exit code. The changes to leave_adjust_stacks() in this commit (apart from the renaming and doc changes) are: * a new arg to indicate what condition to use to decide whether to pass or copy the arg; * a new branch to mortalise and ref count bump an arg
Diffstat (limited to 'proto.h')
-rw-r--r--proto.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/proto.h b/proto.h
index 48208640c7..9578a67b33 100644
--- a/proto.h
+++ b/proto.h
@@ -1610,6 +1610,9 @@ PERL_CALLCONV I32 Perl_keyword(pTHX_ const char *name, I32 len, bool all_keyword
PERL_CALLCONV int Perl_keyword_plugin_standard(pTHX_ char* keyword_ptr, STRLEN keyword_len, OP** op_ptr);
#define PERL_ARGS_ASSERT_KEYWORD_PLUGIN_STANDARD \
assert(keyword_ptr); assert(op_ptr)
+PERL_CALLCONV void Perl_leave_adjust_stacks(pTHX_ SV **base_sp, I32 gimme, int filter);
+#define PERL_ARGS_ASSERT_LEAVE_ADJUST_STACKS \
+ assert(base_sp)
PERL_CALLCONV void Perl_leave_scope(pTHX_ I32 base);
PERL_CALLCONV bool Perl_lex_bufutf8(pTHX);
PERL_CALLCONV void Perl_lex_discard_to(pTHX_ char* ptr);