Expose save_pushi32ptr() and implement SAVECOPARYBASE() with it.
Nicholas Clark [Mon, 1 Dec 2008 09:46:15 +0000 (09:46 +0000)]
p4raw-id: //depot/perl@34963

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

index 6874bc4..90f53fc 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -923,9 +923,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 397e2f4..e0b98f8 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 83455f3..e47177a 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -2913,9 +2913,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 90b6c40..0923747 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 fc639af..152566a 100644 (file)
--- a/scope.h
+++ b/scope.h
@@ -183,13 +183,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