pike.git / src / peep.c

version» Context lines:

pike.git/src/peep.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: peep.c,v 1.99 2004/05/29 18:21:05 grubba Exp $ + || $Id: peep.c,v 1.100 2004/08/24 16:56:32 grubba Exp $   */      #include "global.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "program.h"   #include "las.h"   #include "docode.h"   #include "main.h"   #include "pike_error.h"
pike.git/src/peep.c:18:   #include "peep.h"   #include "dmalloc.h"   #include "stuff.h"   #include "bignum.h"   #include "opcodes.h"   #include "builtin_functions.h"   #include "constants.h"   #include "interpret.h"   #include "pikecode.h"    - RCSID("$Id: peep.c,v 1.99 2004/05/29 18:21:05 grubba Exp $"); + RCSID("$Id: peep.c,v 1.100 2004/08/24 16:56:32 grubba Exp $");      static void asm_opt(void);      dynamic_buffer instrbuf;      #ifdef PIKE_DEBUG   static int hasarg(int opcode)   {    return instrs[opcode-F_OFFSET].flags & I_HASARG;   }
pike.git/src/peep.c:139:    p=(p_instr *)instrbuf.s.str;    p[instr].arg=arg;   }      #ifndef FLUSH_CODE_GENERATOR_STATE   #define FLUSH_CODE_GENERATOR_STATE()   #endif      /**** Bytecode Generator *****/    + static int reoptimize; +    INT32 assemble(int store_linenumbers)   {    INT32 entry_point;    INT32 max_label=-1,tmp;    INT32 *labels, *jumps, *uses;    ptrdiff_t e, length;    p_instr *c; -  int reoptimize=!(debug_options & NO_PEEP_OPTIMIZING); +    #ifdef PIKE_PORTABLE_BYTECODE    struct pike_string *tripples = NULL;   #endif /* PIKE_PORTABLE_BYTECODE */   #ifdef PIKE_DEBUG    INT32 max_pointer=-1;    int synch_depth = 0;    size_t fun_start = Pike_compiler->new_program->num_program;   #endif    -  +  reoptimize=!(debug_options & NO_PEEP_OPTIMIZING); +     c=(p_instr *)instrbuf.s.str;    length=instrbuf.s.len / sizeof(p_instr);      #ifdef PIKE_DEBUG    if((a_flag > 1 && store_linenumbers) || a_flag > 2)    {    for (e = 0; e < length; e++) {    if (c[e].opcode == F_POP_SYNCH_MARK) synch_depth--;    fprintf(stderr, "~~~%4d %4lx %*s", c[e].line,    DO_NOT_WARN((unsigned long)e), synch_depth, "");
pike.git/src/peep.c:369:    }       for(e=0;e<=max_label;e++)    {    if(!uses[e] && labels[e]>=0)    {    c[labels[e]].opcode=F_NOP;    reoptimize++;    }    } -  if(!reoptimize) break; +        asm_opt(); -  +  +  if(!reoptimize) break;   #if 1   #ifdef PIKE_DEBUG    if (a_flag > 3)    fprintf(stderr, "Rerunning optimizer.\n");   #endif   #else /* !1 */    reoptimize=0;   #endif /* 1 */    }   
pike.git/src/peep.c:950:    int k=va_arg(arglist, int);    insopt2(i,j,k,cl,cf);    }    break;    }    }       va_end(arglist);       DO_OPTIMIZATION_POSTQUEL(q); +  +  reoptimize++;   }      #include "peep_engine.c"      static void asm_opt(void)   {   #ifdef PIKE_DEBUG    if(a_flag > 3)    {    p_instr *c;