summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2006-04-23 16:50:27 -0500
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-04-24 07:14:49 +0000
commitd6f07c0562911cf76e1e5f209b2eb29c706bd31d (patch)
tree0553bced78b9173a0e7fa9f064279010c856661d
parentea5423ed7213500644a0e5d3956d06216e1dfa0f (diff)
downloadperl-d6f07c0562911cf76e1e5f209b2eb29c706bd31d.tar.gz
Inlining static funcs in perl.c
Message-ID: <20060424025027.GA25998@petdance.com> p4raw-id: //depot/perl@27941
-rw-r--r--embed.fnc2
-rw-r--r--embed.h4
-rw-r--r--perl.c47
-rw-r--r--proto.h6
4 files changed, 20 insertions, 39 deletions
diff --git a/embed.fnc b/embed.fnc
index 82736d7258..37c4446cfe 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -1198,8 +1198,6 @@ s |int |fd_on_nosuid_fs|int fd
# endif
s |void* |parse_body |NULLOK char **env|XSINIT_t xsinit
rs |void |run_body |I32 oldscope
-s |void |call_body |NN const OP *myop|bool is_eval
-s |void* |call_list_body |NN CV *cv
s |SV * |incpush_if_exists|NN SV *dir
#endif
diff --git a/embed.h b/embed.h
index 430b4973de..92b68a26b3 100644
--- a/embed.h
+++ b/embed.h
@@ -1203,8 +1203,6 @@
#ifdef PERL_CORE
#define parse_body S_parse_body
#define run_body S_run_body
-#define call_body S_call_body
-#define call_list_body S_call_list_body
#define incpush_if_exists S_incpush_if_exists
#endif
#endif
@@ -3360,8 +3358,6 @@
#ifdef PERL_CORE
#define parse_body(a,b) S_parse_body(aTHX_ a,b)
#define run_body(a) S_run_body(aTHX_ a)
-#define call_body(a,b) S_call_body(aTHX_ a,b)
-#define call_list_body(a) S_call_list_body(aTHX_ a)
#define incpush_if_exists(a) S_incpush_if_exists(aTHX_ a)
#endif
#endif
diff --git a/perl.c b/perl.c
index 320793d557..184261a11d 100644
--- a/perl.c
+++ b/perl.c
@@ -137,6 +137,22 @@ static I32 read_e_script(pTHX_ int idx, SV *buf_sv, int maxlen);
#endif
#endif
+#define CALL_BODY_EVAL(myop) \
+ if (PL_op == (myop)) \
+ PL_op = Perl_pp_entereval(aTHX); \
+ if (PL_op) \
+ CALLRUNOPS(aTHX);
+
+#define CALL_BODY_SUB(myop) \
+ if (PL_op == (myop)) \
+ PL_op = Perl_pp_entersub(aTHX); \
+ if (PL_op) \
+ CALLRUNOPS(aTHX);
+
+#define CALL_LIST_BODY(cv) \
+ PUSHMARK(PL_stack_sp); \
+ call_sv((SV*)(cv), G_EVAL|G_DISCARD);
+
static void
S_init_tls_and_interp(PerlInterpreter *my_perl)
{
@@ -2609,7 +2625,7 @@ Perl_call_sv(pTHX_ SV *sv, I32 flags)
if (!(flags & G_EVAL)) {
CATCH_SET(TRUE);
- call_body((OP*)&myop, FALSE);
+ CALL_BODY_SUB((OP*)&myop);
retval = PL_stack_sp - (PL_stack_base + oldmark);
CATCH_SET(oldcatch);
}
@@ -2624,7 +2640,7 @@ Perl_call_sv(pTHX_ SV *sv, I32 flags)
switch (ret) {
case 0:
redo_body:
- call_body((OP*)&myop, FALSE);
+ CALL_BODY_SUB((OP*)&myop);
retval = PL_stack_sp - (PL_stack_base + oldmark);
if (!(flags & G_KEEPERR))
sv_setpvn(ERRSV,"",0);
@@ -2672,20 +2688,6 @@ Perl_call_sv(pTHX_ SV *sv, I32 flags)
return retval;
}
-STATIC void
-S_call_body(pTHX_ const OP *myop, bool is_eval)
-{
- dVAR;
- if (PL_op == myop) {
- if (is_eval)
- PL_op = Perl_pp_entereval(aTHX); /* this doesn't do a POPMARK */
- else
- PL_op = Perl_pp_entersub(aTHX); /* this does */
- }
- if (PL_op)
- CALLRUNOPS(aTHX);
-}
-
/* Eval a string. The G_EVAL flag is always assumed. */
/*
@@ -2739,7 +2741,7 @@ Perl_eval_sv(pTHX_ SV *sv, I32 flags)
switch (ret) {
case 0:
redo_body:
- call_body((OP*)&myop,TRUE);
+ CALL_BODY_EVAL((OP*)&myop);
retval = PL_stack_sp - (PL_stack_base + oldmark);
if (!(flags & G_KEEPERR))
sv_setpvn(ERRSV,"",0);
@@ -5124,7 +5126,7 @@ Perl_call_list(pTHX_ I32 oldscope, AV *paramList)
if (PL_madskills)
PL_madskills |= 16384;
#endif
- call_list_body(cv);
+ CALL_LIST_BODY(cv);
#ifdef PERL_MAD
if (PL_madskills)
PL_madskills &= ~16384;
@@ -5189,15 +5191,6 @@ Perl_call_list(pTHX_ I32 oldscope, AV *paramList)
}
}
-STATIC void *
-S_call_list_body(pTHX_ CV *cv)
-{
- dVAR;
- PUSHMARK(PL_stack_sp);
- call_sv((SV*)cv, G_EVAL|G_DISCARD);
- return NULL;
-}
-
void
Perl_my_exit(pTHX_ U32 status)
{
diff --git a/proto.h b/proto.h
index 760caa1cf6..fa6de13aef 100644
--- a/proto.h
+++ b/proto.h
@@ -3261,12 +3261,6 @@ STATIC void* S_parse_body(pTHX_ char **env, XSINIT_t xsinit);
STATIC void S_run_body(pTHX_ I32 oldscope)
__attribute__noreturn__;
-STATIC void S_call_body(pTHX_ const OP *myop, bool is_eval)
- __attribute__nonnull__(pTHX_1);
-
-STATIC void* S_call_list_body(pTHX_ CV *cv)
- __attribute__nonnull__(pTHX_1);
-
STATIC SV * S_incpush_if_exists(pTHX_ SV *dir)
__attribute__nonnull__(pTHX_1);