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.81 2002/11/04 18:00:59 grubba Exp $ + || $Id: peep.c,v 1.82 2002/11/07 12:39:13 grubba Exp $   */      #include "global.h"   #include "language.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "program.h"   #include "las.h"   #include "docode.h"   #include "main.h"
pike.git/src/peep.c:19:   #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.81 2002/11/04 18:00:59 grubba Exp $"); + RCSID("$Id: peep.c,v 1.82 2002/11/07 12:39:13 grubba 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:149:      void assemble(void)   {    INT32 max_label,tmp;    INT32 *labels, *jumps, *uses;    ptrdiff_t e, length;    p_instr *c;    int reoptimize=!(debug_options & NO_PEEP_OPTIMIZING);   #ifdef PIKE_DEBUG    int synch_depth = 0; +  size_t fun_start = Pike_compiler->new_program->num_program;   #endif       c=(p_instr *)instrbuf.s.str;    length=instrbuf.s.len / sizeof(p_instr);      #ifdef PIKE_DEBUG    for (e = 0; e < length; e++) {    if((a_flag > 1 && store_linenumbers) || a_flag > 2)    {    if (c[e].opcode == F_POP_SYNCH_MARK) synch_depth--;
pike.git/src/peep.c:542:    tmp = read_pointer(jumps[e]);    upd_pointer(jumps[e], tmp2 - jumps[e]);    jumps[e]=tmp;    }    }       free((char *)labels);    free((char *)jumps);    free((char *)uses);    + #ifdef PIKE_DEBUG +  if (a_flag > 6) { +  size_t len = (Pike_compiler->new_program->num_program - fun_start)* +  sizeof(PIKE_OPCODE_T); + #ifdef DISASSEMBLE_CODE +  DISASSEMBLE_CODE(Pike_compiler->new_program->program + fun_start, len); + #else /* !DISASSEMBLE_CODE */ +  { +  /* FIXME: Hexdump here. */ +  } + #endif /* DISASSEMBLE_CODE */ +  } + #endif /* PIKE_DEBUG */       exit_bytecode();   }      /**** Peephole optimizer ****/      int remove_clear_locals=0x7fffffff;   static int fifo_len;   static ptrdiff_t eye, len;   static p_instr *instructions;