pike.git / src / peep.c

version» Context lines:

pike.git/src/peep.c:8:   #include "main.h"   #include "pike_error.h"   #include "lex.h"   #include "pike_memory.h"   #include "peep.h"   #include "dmalloc.h"   #include "stuff.h"   #include "bignum.h"   #include "opcodes.h"    - RCSID("$Id: peep.c,v 1.45 2000/12/05 21:08:20 per Exp $"); + RCSID("$Id: peep.c,v 1.46 2001/01/31 22:03:53 mast Exp $");      static void asm_opt(void);      dynamic_buffer instrbuf;      static int hasarg(int opcode)   {    return instrs[opcode-F_OFFSET].flags & I_HASARG;   }   
pike.git/src/peep.c:209:    add_to_program((unsigned char)b);   }      void assemble(void)   {    INT32 d,max_label,tmp;    INT32 *labels, *jumps, *uses;    ptrdiff_t e, length;    p_instr *c;    int reoptimize=1; + #ifdef PIKE_DEBUG +  int synch_depth; + #endif       c=(p_instr *)instrbuf.s.str;    length=instrbuf.s.len / sizeof(p_instr);       max_label=-1;    for(e=0;e<length;e++,c++)    if(c->opcode == F_LABEL)    if(c->arg > max_label)    max_label = c->arg;   
pike.git/src/peep.c:314:    asm_opt();    reoptimize=0;    }       c=(p_instr *)instrbuf.s.str;    length=instrbuf.s.len / sizeof(p_instr);       for(e=0;e<=max_label;e++) labels[e]=jumps[e]=-1;       c=(p_instr *)instrbuf.s.str; + #ifdef PIKE_DEBUG +  synch_depth = 0; + #endif    for(e=0;e<length;e++)    {   #ifdef PIKE_DEBUG    if((a_flag > 2 && store_linenumbers) || a_flag > 3)    { -  fprintf(stderr, "===%3d %4lx ", c->line, -  DO_NOT_WARN((unsigned long)PC)); +  if (c->opcode == F_POP_SYNCH_MARK) synch_depth--; +  fprintf(stderr, "===%4d %4lx %*s", c->line, +  DO_NOT_WARN((unsigned long)PC), synch_depth, "");    dump_instr(c);    fprintf(stderr,"\n"); -  +  if (c->opcode == F_SYNCH_MARK) synch_depth++;    }   #endif       if(store_linenumbers)    store_linenumber(c->line, c->file);       switch(c->opcode)    {    case F_NOP:    case F_NOTREACHED:
pike.git/src/peep.c:683:   }         static void asm_opt(void)   {   #ifdef PIKE_DEBUG    if(a_flag > 3)    {    p_instr *c;    ptrdiff_t e, length; +  int synch_depth = 0;       c=(p_instr *)instrbuf.s.str;    length=instrbuf.s.len / sizeof(p_instr);       fprintf(stderr,"Optimization begins: \n");    for(e=0;e<length;e++,c++)    { -  fprintf(stderr,"---%3d: ",c->line); +  if (c->opcode == F_POP_SYNCH_MARK) synch_depth--; +  fprintf(stderr,"---%4d: %*s",c->line,synch_depth,"");    dump_instr(c);    fprintf(stderr,"\n"); -  +  if (c->opcode == F_SYNCH_MARK) synch_depth++;    }    }   #endif      #ifndef IN_TPIKE   #include "peep_engine.c"   #endif /* IN_TPIKE */      #ifdef PIKE_DEBUG    if(a_flag > 4)