Expose save_pushi32ptr() and implement SAVECOPARYBASE() with it.
authorNicholas Clark <nick@ccl4.org>
Mon, 1 Dec 2008 09:46:15 +0000 (09:46 +0000)
committerDavid Mitchell <davem@iabyn.com>
Mon, 30 Mar 2009 13:36:51 +0000 (14:36 +0100)
p4raw-id: //depot/perl@34963

(cherry picked from commit 7623d4262995987d3de73f116de43554c077f9c7)

embed.fnc
embed.h
proto.h
scope.c
scope.h

index 6b4f2a9..38db486 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -904,9 +904,8 @@ Ap  |void   |save_padsv_and_mortalize|PADOFFSET off
 Ap     |void   |save_sptr      |NN SV** sptr
 Ap     |SV*    |save_svref     |NN SV** sptr
 Ap     |void   |save_pushptr   |NULLOK void *const ptr|const int type
-#if defined(PERL_IN_SCOPE_C)
-s      |void   |save_pushi32ptr|I32 i|NULLOK void *const ptr|const int type
-#endif
+: Used by SAVECOPARYBASE() in op.c
+p      |void   |save_pushi32ptr|I32 i|NULLOK void *const ptr|const int type
 : Used by SAVESWITCHSTACK() in pp.c
 p      |void   |save_pushptrptr|NULLOK void *const ptr1 \
                                |NULLOK void *const ptr2|const int type
diff --git a/embed.h b/embed.h
index 7bb0815..523b599 100644 (file)
--- a/embed.h
+++ b/embed.h
 #define save_sptr              Perl_save_sptr
 #define save_svref             Perl_save_svref
 #define save_pushptr           Perl_save_pushptr
-#if defined(PERL_IN_SCOPE_C)
-#ifdef PERL_CORE
-#define save_pushi32ptr                S_save_pushi32ptr
-#endif
-#endif
 #ifdef PERL_CORE
+#define save_pushi32ptr                Perl_save_pushi32ptr
 #define save_pushptrptr                Perl_save_pushptrptr
 #define sawparens              Perl_sawparens
 #define scalar                 Perl_scalar
 #define save_sptr(a)           Perl_save_sptr(aTHX_ a)
 #define save_svref(a)          Perl_save_svref(aTHX_ a)
 #define save_pushptr(a,b)      Perl_save_pushptr(aTHX_ a,b)
-#if defined(PERL_IN_SCOPE_C)
-#ifdef PERL_CORE
-#define save_pushi32ptr(a,b,c) S_save_pushi32ptr(aTHX_ a,b,c)
-#endif
-#endif
 #ifdef PERL_CORE
+#define save_pushi32ptr(a,b,c) Perl_save_pushi32ptr(aTHX_ a,b,c)
 #define save_pushptrptr(a,b,c) Perl_save_pushptrptr(aTHX_ a,b,c)
 #define sawparens(a)           Perl_sawparens(aTHX_ a)
 #define scalar(a)              Perl_scalar(aTHX_ a)
diff --git a/proto.h b/proto.h
index 4269511..510e9b4 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -2922,9 +2922,7 @@ PERL_CALLCONV SV* Perl_save_svref(pTHX_ SV** sptr)
        assert(sptr)
 
 PERL_CALLCONV void     Perl_save_pushptr(pTHX_ void *const ptr, const int type);
-#if defined(PERL_IN_SCOPE_C)
-STATIC void    S_save_pushi32ptr(pTHX_ I32 i, void *const ptr, const int type);
-#endif
+PERL_CALLCONV void     Perl_save_pushi32ptr(pTHX_ I32 i, void *const ptr, const int type);
 PERL_CALLCONV void     Perl_save_pushptrptr(pTHX_ void *const ptr1, void *const ptr2, const int type);
 PERL_CALLCONV OP*      Perl_sawparens(pTHX_ OP* o);
 PERL_CALLCONV OP*      Perl_scalar(pTHX_ OP* o);
diff --git a/scope.c b/scope.c
index 8a6f001..e058433 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -360,8 +360,8 @@ Perl_save_bool(pTHX_ bool *boolp)
     SSPUSHINT(SAVEt_BOOL);
 }
 
-static void
-S_save_pushi32ptr(pTHX_ const I32 i, void *const ptr, const int type)
+void
+Perl_save_pushi32ptr(pTHX_ const I32 i, void *const ptr, const int type)
 {
     dVAR;
     SSCHECK(3);
diff --git a/scope.h b/scope.h
index 5041e9b..a0e0d0d 100644 (file)
--- a/scope.h
+++ b/scope.h
@@ -181,13 +181,7 @@ Closing bracket on a callback.  See C<ENTER> and L<perlcall>.
        PL_curstackinfo->si_stack = (t);                \
     } STMT_END
 
-#define SAVECOPARYBASE(c) \
-    STMT_START {                                       \
-       SSCHECK(3);                                     \
-       SSPUSHINT(CopARYBASE_get(c));                   \
-       SSPUSHPTR(c);                                   \
-       SSPUSHINT(SAVEt_COP_ARYBASE);                   \
-    } STMT_END
+#define SAVECOPARYBASE(c) save_pushi32ptr(CopARYBASE_get(c), c, SAVEt_COP_ARYBASE);
 
 /* Need to do the cop warnings like this, rather than a "SAVEFREESHAREDPV",
    because realloc() means that the value can actually change. Possibly