pike.git / src / peep.c

version» Context lines:

pike.git/src/peep.c:12:   #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.71 2002/05/10 22:30:33 mast Exp $"); + RCSID("$Id: peep.c,v 1.72 2002/08/15 14:49:24 marcus 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:73:   ptrdiff_t insert_opcode2(unsigned int f,    INT32 b,    INT32 c,    INT32 current_line,    struct pike_string *current_file)   {    p_instr *p;      #ifdef PIKE_DEBUG    if(!hasarg2(f) && c) -  fatal("hasarg2(%d) is wrong!\n",f); +  Pike_fatal("hasarg2(%d) is wrong!\n",f);   #endif       p=(p_instr *)low_make_buf_space(sizeof(p_instr), &instrbuf);         #ifdef PIKE_DEBUG    if(!instrbuf.s.len) -  fatal("Low make buf space failed!!!!!!\n"); +  Pike_fatal("Low make buf space failed!!!!!!\n");   #endif       p->opcode=f;    p->line=current_line;    copy_shared_string(p->file, current_file);    p->arg=b;    p->arg2=c;       return p - (p_instr *)instrbuf.s.str;   }      ptrdiff_t insert_opcode1(unsigned int f,    INT32 b,    INT32 current_line,    struct pike_string *current_file)   {   #ifdef PIKE_DEBUG    if(!hasarg(f) && b) -  fatal("hasarg(%d) is wrong!\n",f); +  Pike_fatal("hasarg(%d) is wrong!\n",f);   #endif       return insert_opcode2(f,b,0,current_line,current_file);   }      ptrdiff_t insert_opcode0(int f,int current_line, struct pike_string *current_file)   {   #ifdef PIKE_DEBUG    if(hasarg(f)) -  fatal("hasarg(%d) is wrong!\n",f); +  Pike_fatal("hasarg(%d) is wrong!\n",f);   #endif    return insert_opcode1(f,0,current_line, current_file);   }         void update_arg(int instr,INT32 arg)   {    p_instr *p;   #ifdef PIKE_DEBUG    if(instr > (long)instrbuf.s.len / (long)sizeof(p_instr) || instr < 0) -  fatal("update_arg outside known space.\n"); +  Pike_fatal("update_arg outside known space.\n");   #endif    p=(p_instr *)instrbuf.s.str;    p[instr].arg=arg;   }      #ifndef FLUSH_CODE_GENERATOR_STATE   #define FLUSH_CODE_GENERATOR_STATE()   #endif      /**** Bytecode Generator *****/
pike.git/src/peep.c:298: Inside #if defined(INS_ENTRY)
   case F_ENTRY:   #ifdef INS_ENTRY    INS_ENTRY();   #endif /* INS_ENTRY */    break;       case F_LABEL:    if(c->arg == -1) break;   #ifdef PIKE_DEBUG    if(c->arg > max_label || c->arg < 0) -  fatal("max_label calculation failed!\n"); +  Pike_fatal("max_label calculation failed!\n");       if(labels[c->arg] != -1) -  fatal("Duplicate label!\n"); +  Pike_fatal("Duplicate label!\n");   #endif    FLUSH_CODE_GENERATOR_STATE();    labels[c->arg] = DO_NOT_WARN((INT32)PIKE_PC);    UPDATE_PC();    break;       case F_VOLATILE_RETURN:    ins_f_byte(F_RETURN);    break;   
pike.git/src/peep.c:330: Inside #if defined(INS_F_JUMP)
   UPDATE_F_JUMP(tmp, jumps[c->arg]);    jumps[c->arg]=~tmp;    break;    }   #endif       ins_f_byte(c->opcode);       case I_ISPOINTER:   #ifdef PIKE_DEBUG -  if(c->arg > max_label || c->arg < 0) fatal("Jump to unknown label?\n"); +  if(c->arg > max_label || c->arg < 0) Pike_fatal("Jump to unknown label?\n");   #endif    tmp = DO_NOT_WARN((INT32)PIKE_PC);    ins_pointer(jumps[c->arg]);    jumps[c->arg]=tmp;    break;       case I_TWO_ARGS:    ins_f_byte_with_2_args(c->opcode, c->arg, c->arg2);    break;       case I_HASARG:    ins_f_byte_with_arg(c->opcode, c->arg);    break;       case 0:    ins_f_byte(c->opcode);    break;      #ifdef PIKE_DEBUG    default: -  fatal("Unknown instruction type.\n"); +  Pike_fatal("Unknown instruction type.\n");   #endif    }    }      #ifdef ADJUST_PIKE_PC    if (instrs[c->opcode - F_OFFSET].flags & I_PC_AT_NEXT)    ADJUST_PIKE_PC (PIKE_PC);   #endif      #ifdef ALIGN_PIKE_JUMPS
pike.git/src/peep.c:398:    }       for(e=0;e<=max_label;e++)    {    INT32 tmp2=labels[e];       while(jumps[e]!=-1)    {   #ifdef PIKE_DEBUG    if(labels[e]==-1) -  fatal("Hyperspace error: unknown jump point %ld at %d (pc=%x).\n", +  Pike_fatal("Hyperspace error: unknown jump point %ld at %d (pc=%x).\n",    PTRDIFF_T_TO_LONG(e), labels[e], jumps[e]);   #endif   #ifdef INS_F_JUMP    if(jumps[e] < 0)    {    tmp = READ_F_JUMP(~jumps[e]);    UPDATE_F_JUMP(~jumps[e], tmp2);    jumps[e]=tmp;    continue;    }
pike.git/src/peep.c:439:   static ptrdiff_t eye, len;   static p_instr *instructions;      static INLINE ptrdiff_t insopt2(int f, INT32 a, INT32 b,    int cl, struct pike_string *cf)   {    p_instr *p;      #ifdef PIKE_DEBUG    if(!hasarg2(f) && b) -  fatal("hasarg2(%d /*%s */) is wrong!\n",f,get_f_name(f)); +  Pike_fatal("hasarg2(%d /*%s */) is wrong!\n",f,get_f_name(f));   #endif       p=(p_instr *)low_make_buf_space(sizeof(p_instr), &instrbuf);       if(fifo_len)    {    MEMMOVE(p-fifo_len+1,p-fifo_len,fifo_len*sizeof(p_instr));    p-=fifo_len;    }      #ifdef PIKE_DEBUG    if(!instrbuf.s.len) -  fatal("Low make buf space failed!!!!!!\n"); +  Pike_fatal("Low make buf space failed!!!!!!\n");   #endif       p->opcode=f;    p->line=cl;    copy_shared_string(p->file, cf);    p->arg=a;    p->arg2=b;       return p - (p_instr *)instrbuf.s.str;   }      static INLINE ptrdiff_t insopt1(int f, INT32 a, int cl, struct pike_string *cf)   {   #ifdef PIKE_DEBUG    if(!hasarg(f) && a) -  fatal("hasarg(%d /* %s */) is wrong!\n",f,get_f_name(f)); +  Pike_fatal("hasarg(%d /* %s */) is wrong!\n",f,get_f_name(f));   #endif       return insopt2(f,a,0,cl, cf);   }      static INLINE ptrdiff_t insopt0(int f, int cl, struct pike_string *cf)   {   #ifdef PIKE_DEBUG    if(hasarg(f)) -  fatal("hasarg(%d /* %s */) is wrong!\n",f,get_f_name(f)); +  Pike_fatal("hasarg(%d /* %s */) is wrong!\n",f,get_f_name(f));   #endif    return insopt2(f,0,0,cl, cf);   }      static void debug(void)   {    if(fifo_len > (long)instrbuf.s.len / (long)sizeof(p_instr))    fifo_len=(long)instrbuf.s.len / (long)sizeof(p_instr);   #ifdef PIKE_DEBUG    if(eye < 0) -  fatal("Popped beyond start of code.\n"); +  Pike_fatal("Popped beyond start of code.\n");       if(instrbuf.s.len)    {    p_instr *p;    p=(p_instr *)low_make_buf_space(0, &instrbuf);    if(!p[-1].file) -  fatal("No file name on last instruction!\n"); +  Pike_fatal("No file name on last instruction!\n");    }   #endif   }         static INLINE p_instr *instr(int offset)   {    p_instr *p;       debug();
pike.git/src/peep.c:572:   {    int e,d;    if(fifo_len)    {    p_instr *p;       d=n;    if(d>fifo_len) d=fifo_len;   #ifdef PIKE_DEBUG    if((long)d > (long)instrbuf.s.len / (long)sizeof(p_instr)) -  fatal("Popping out of instructions.\n"); +  Pike_fatal("Popping out of instructions.\n");   #endif       /* FIXME: It looks like the fifo could be optimized.    * /grubba 2000-11-21 (in Versailles)    */       p=(p_instr *)low_make_buf_space(0, &instrbuf);    p-=fifo_len;    for(e=0;e<d;e++) free_string(p[e].file);    fifo_len-=d;