Change 34965 by [EMAIL PROTECTED] on 2008/12/01 11:06:05

        Move the implmentation of SAVEHINTS() into a new Perl_save_hints() in
        scope.c. "Inlined" macro functions in scope.h are actually space
        inefficient.

Affected files ...

... //depot/perl/embed.fnc#661 edit
... //depot/perl/embed.h#794 edit
... //depot/perl/proto.h#992 edit
... //depot/perl/scope.c#243 edit
... //depot/perl/scope.h#100 edit

Differences ...

==== //depot/perl/embed.fnc#661 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc#660~34963~   2008-12-01 01:46:15.000000000 -0800
+++ perl/embed.fnc      2008-12-01 03:06:05.000000000 -0800
@@ -900,6 +900,7 @@
 Ap     |void   |save_shared_pvref|NN char** str
 Ap     |void   |save_gp        |NN GV* gv|I32 empty
 Ap     |HV*    |save_hash      |NN GV* gv
+p      |void   |save_hints
 Amp    |void   |save_helem     |NN HV *hv|NN SV *key|NN SV **sptr
 Ap     |void   |save_helem_flags|NN HV *hv|NN SV *key|NN SV **sptr|const U32 
flags
 Ap     |void   |save_hptr      |NN HV** hptr

==== //depot/perl/embed.h#794 (text+w) ====
Index: perl/embed.h
--- perl/embed.h#793~34963~     2008-12-01 01:46:15.000000000 -0800
+++ perl/embed.h        2008-12-01 03:06:05.000000000 -0800
@@ -787,6 +787,9 @@
 #define save_shared_pvref      Perl_save_shared_pvref
 #define save_gp                        Perl_save_gp
 #define save_hash              Perl_save_hash
+#ifdef PERL_CORE
+#define save_hints             Perl_save_hints
+#endif
 #define save_helem_flags       Perl_save_helem_flags
 #define save_hptr              Perl_save_hptr
 #define save_I16               Perl_save_I16
@@ -3131,6 +3134,9 @@
 #define save_shared_pvref(a)   Perl_save_shared_pvref(aTHX_ a)
 #define save_gp(a,b)           Perl_save_gp(aTHX_ a,b)
 #define save_hash(a)           Perl_save_hash(aTHX_ a)
+#ifdef PERL_CORE
+#define save_hints()           Perl_save_hints(aTHX)
+#endif
 #define save_helem_flags(a,b,c,d)      Perl_save_helem_flags(aTHX_ a,b,c,d)
 #define save_hptr(a)           Perl_save_hptr(aTHX_ a)
 #define save_I16(a)            Perl_save_I16(aTHX_ a)

==== //depot/perl/proto.h#992 (text+w) ====
Index: perl/proto.h
--- perl/proto.h#991~34963~     2008-12-01 01:46:15.000000000 -0800
+++ perl/proto.h        2008-12-01 03:06:05.000000000 -0800
@@ -2815,6 +2815,7 @@
 #define PERL_ARGS_ASSERT_SAVE_HASH     \
        assert(gv)
 
+PERL_CALLCONV void     Perl_save_hints(pTHX);
 /* PERL_CALLCONV void  Perl_save_helem(pTHX_ HV *hv, SV *key, SV **sptr)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2)

==== //depot/perl/scope.c#243 (text) ====
Index: perl/scope.c
--- perl/scope.c#242~34964~     2008-12-01 02:36:44.000000000 -0800
+++ perl/scope.c        2008-12-01 03:06:05.000000000 -0800
@@ -536,6 +536,25 @@
 }
 
 void
+Perl_save_hints(pTHX)
+{
+    dVAR;
+    if (PL_compiling.cop_hints_hash) {
+       HINTS_REFCNT_LOCK;
+           PL_compiling.cop_hints_hash->refcounted_he_refcnt++;
+           HINTS_REFCNT_UNLOCK;
+    }
+    SSCHECK(4);
+    if (PL_hints & HINT_LOCALIZE_HH) {
+       SSPUSHPTR(GvHV(PL_hintgv));
+       GvHV(PL_hintgv) = Perl_hv_copy_hints_hv(aTHX_ GvHV(PL_hintgv));
+    }
+    SSPUSHINT(PL_hints);
+    SSPUSHPTR(PL_compiling.cop_hints_hash);
+    SSPUSHINT(SAVEt_HINTS);
+}
+
+void
 Perl_save_aelem(pTHX_ AV *av, I32 idx, SV **sptr)
 {
     dVAR;

==== //depot/perl/scope.h#100 (text) ====
Index: perl/scope.h
--- perl/scope.h#99~34964~      2008-12-01 02:36:44.000000000 -0800
+++ perl/scope.h        2008-12-01 03:06:05.000000000 -0800
@@ -157,22 +157,7 @@
 
 #define SAVEOP()       save_op()
 
-#define SAVEHINTS() \
-    STMT_START {                                       \
-       if (PL_compiling.cop_hints_hash) {              \
-           HINTS_REFCNT_LOCK;                          \
-           PL_compiling.cop_hints_hash->refcounted_he_refcnt++;        \
-           HINTS_REFCNT_UNLOCK;                        \
-       }                                               \
-       SSCHECK(4);                                     \
-       if (PL_hints & HINT_LOCALIZE_HH) {              \
-           SSPUSHPTR(GvHV(PL_hintgv));                 \
-           GvHV(PL_hintgv) = Perl_hv_copy_hints_hv(aTHX_ GvHV(PL_hintgv)); \
-       }                                               \
-       SSPUSHINT(PL_hints);                            \
-       SSPUSHPTR(PL_compiling.cop_hints_hash);         \
-       SSPUSHINT(SAVEt_HINTS);                         \
-    } STMT_END
+#define SAVEHINTS()    save_hints()
 
 #define SAVECOMPPAD() save_pushptr(MUTABLE_SV(PL_comppad), SAVEt_COMPPAD)
 
End of Patch.

Reply via email to