Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 6th, 2012  |  syntax: None  |  size: 4.49 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. diff --git a/embed.fnc b/embed.fnc
  2. index dc667b7..6014c1f 100644
  3. --- a/embed.fnc
  4. +++ b/embed.fnc
  5. @@ -888,7 +888,7 @@ sd  |void   |pad_reset
  6.  : Used in op.c
  7.  pd     |void   |pad_swipe      |PADOFFSET po|bool refadjust
  8.  : FIXME
  9. -p      |void   |peep           |NULLOK OP* o
  10. +p      |void   |peep           |NULLOK OP* o|NN void *next
  11.  : Defined in doio.c, used only in pp_hot.c
  12.  dopM   |PerlIO*|start_glob     |NN SV *tmpglob|NN IO *io
  13.  #if defined(USE_REENTRANT_API)
  14. diff --git a/embed.h b/embed.h
  15. index 07aa965..5312d22 100644
  16. --- a/embed.h
  17. +++ b/embed.h
  18. @@ -3150,7 +3150,7 @@
  19.  #endif
  20.  #ifdef PERL_CORE
  21.  #define pad_swipe(a,b)         Perl_pad_swipe(aTHX_ a,b)
  22. -#define peep(a)                        Perl_peep(aTHX_ a)
  23. +#define peep(a,b)              Perl_peep(aTHX_ a,b)
  24.  #endif
  25.  #if defined(USE_REENTRANT_API)
  26.  #define reentrant_size()       Perl_reentrant_size(aTHX)
  27. diff --git a/op.c b/op.c
  28. index 276e100..e27166b 100644
  29. --- a/op.c
  30. +++ b/op.c
  31. @@ -103,7 +103,8 @@ recursive, but it's recursive on basic blocks, not on tree nodes.
  32.  #include "perl.h"
  33.  #include "keywords.h"
  34.  
  35. -#define CALL_PEEP(o) CALL_FPTR(PL_peepp)(aTHX_ o)
  36. +#define CALL_A_PEEP(peep, o) CALL_FPTR(peep)(aTHX_ o, peep)
  37. +#define CALL_PEEP(o) CALL_A_PEEP(PL_peepp, o)
  38.  #define CALL_OPFREEHOOK(o) if (PL_opfreehook) CALL_FPTR(PL_opfreehook)(aTHX_ o)
  39.  
  40.  #if defined(PL_OP_SLAB_ALLOC)
  41. @@ -8515,10 +8516,11 @@ S_is_inplace_av(pTHX_ OP *o, OP *oright) {
  42.   * peep() is called */
  43.  
  44.  void
  45. -Perl_peep(pTHX_ register OP *o)
  46. +Perl_peep(pTHX_ register OP *o, void *_next)
  47.  {
  48.      dVAR;
  49.      register OP* oldop = NULL;
  50. +    peep_t next_peep = (peep_t)_next;
  51.  
  52.      if (!o || o->op_opt)
  53.         return;
  54. @@ -8714,7 +8716,7 @@ Perl_peep(pTHX_ register OP *o)
  55.              sop = fop->op_sibling;
  56.             while (cLOGOP->op_other->op_type == OP_NULL)
  57.                 cLOGOP->op_other = cLOGOP->op_other->op_next;
  58. -           peep(cLOGOP->op_other); /* Recursive calls are not replaced by fptr calls */
  59. +           CALL_A_PEEP(next_peep, cLOGOP->op_other); /* Recursive calls are not replaced by fptr calls */
  60.            
  61.            stitch_keys:    
  62.             o->op_opt = 1;
  63. @@ -8765,20 +8767,20 @@ Perl_peep(pTHX_ register OP *o)
  64.         case OP_ONCE:
  65.             while (cLOGOP->op_other->op_type == OP_NULL)
  66.                 cLOGOP->op_other = cLOGOP->op_other->op_next;
  67. -           peep(cLOGOP->op_other); /* Recursive calls are not replaced by fptr calls */
  68. +           CALL_A_PEEP(next_peep, cLOGOP->op_other); /* Recursive calls are not replaced by fptr calls */
  69.             break;
  70.  
  71.         case OP_ENTERLOOP:
  72.         case OP_ENTERITER:
  73.             while (cLOOP->op_redoop->op_type == OP_NULL)
  74.                 cLOOP->op_redoop = cLOOP->op_redoop->op_next;
  75. -           peep(cLOOP->op_redoop);
  76. +           CALL_A_PEEP(next_peep, cLOOP->op_redoop);
  77.             while (cLOOP->op_nextop->op_type == OP_NULL)
  78.                 cLOOP->op_nextop = cLOOP->op_nextop->op_next;
  79. -           peep(cLOOP->op_nextop);
  80. +           CALL_A_PEEP(next_peep, cLOOP->op_nextop);
  81.             while (cLOOP->op_lastop->op_type == OP_NULL)
  82.                 cLOOP->op_lastop = cLOOP->op_lastop->op_next;
  83. -           peep(cLOOP->op_lastop);
  84. +           CALL_A_PEEP(next_peep, cLOOP->op_lastop);
  85.             break;
  86.  
  87.         case OP_SUBST:
  88. @@ -8787,7 +8789,7 @@ Perl_peep(pTHX_ register OP *o)
  89.                    cPMOP->op_pmstashstartu.op_pmreplstart->op_type == OP_NULL)
  90.                 cPMOP->op_pmstashstartu.op_pmreplstart
  91.                     = cPMOP->op_pmstashstartu.op_pmreplstart->op_next;
  92. -           peep(cPMOP->op_pmstashstartu.op_pmreplstart);
  93. +           CALL_A_PEEP(next_peep, cPMOP->op_pmstashstartu.op_pmreplstart);
  94.             break;
  95.  
  96.         case OP_EXEC:
  97. diff --git a/perl.h b/perl.h
  98. index 7fcff2f..31b7107 100644
  99. --- a/perl.h
  100. +++ b/perl.h
  101. @@ -4833,7 +4833,7 @@ struct perl_debug_pad {
  102.         PERL_DEBUG_PAD(i))
  103.  
  104.  /* Enable variables which are pointers to functions */
  105. -typedef void (CPERLscope(*peep_t))(pTHX_ OP* o);
  106. +typedef void (CPERLscope(*peep_t))(pTHX_ OP* o, void *next);
  107.  typedef regexp*(CPERLscope(*regcomp_t)) (pTHX_ char* exp, char* xend, PMOP* pm);
  108.  typedef I32 (CPERLscope(*regexec_t)) (pTHX_ regexp* prog, char* stringarg,
  109.                                       char* strend, char* strbeg, I32 minend,
  110. diff --git a/proto.h b/proto.h
  111. index 8ad7e66..4406951 100644
  112. --- a/proto.h
  113. +++ b/proto.h
  114. @@ -2570,7 +2570,11 @@ PERL_CALLCONV void       Perl_pad_free(pTHX_ PADOFFSET po);
  115.  STATIC void    S_pad_reset(pTHX);
  116.  #endif
  117.  PERL_CALLCONV void     Perl_pad_swipe(pTHX_ PADOFFSET po, bool refadjust);
  118. -PERL_CALLCONV void     Perl_peep(pTHX_ OP* o);
  119. +PERL_CALLCONV void     Perl_peep(pTHX_ OP* o, void *next)
  120. +                       __attribute__nonnull__(pTHX_2);
  121. +#define PERL_ARGS_ASSERT_PEEP  \
  122. +       assert(next)
  123. +
  124.  PERL_CALLCONV PerlIO*  Perl_start_glob(pTHX_ SV *tmpglob, IO *io)
  125.                         __attribute__nonnull__(pTHX_1)
  126.                         __attribute__nonnull__(pTHX_2);