pike.git / src / peep.c

version» Context lines:

pike.git/src/peep.c:90:    p_instr *p = (p_instr *)low_make_buf_space(sizeof(p_instr), &instrbuf);    if (!p) Pike_fatal("Out of memory in peep.\n");    *p = *opcode;    num_instrs++;    return p - (p_instr *)instrbuf.s.str;   }      ptrdiff_t insert_opcode2(unsigned int f,    INT32 b,    INT32 c, -  INT32 current_line, +  INT_TYPE current_line,    struct pike_string *current_file)   {    p_instr *p;      #ifdef PIKE_DEBUG    if(!hasarg2(f) && c)    Pike_fatal("hasarg2(%d) is wrong!\n",f);   #endif       p=(p_instr *)low_make_buf_space(sizeof(p_instr), &instrbuf);
pike.git/src/peep.c:121:    current_file,    "insert_opcode"));    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, +  INT_TYPE current_line,    struct pike_string *current_file)   {   #ifdef PIKE_DEBUG    if(!hasarg(f) && b)    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) + ptrdiff_t insert_opcode0(int f, INT_TYPE current_line, +  struct pike_string *current_file)   {   #ifdef PIKE_DEBUG    if(hasarg(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)
pike.git/src/peep.c:185:    int reoptimize = relabel = !(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, +  fprintf(stderr, "~~~%4ld %4lx %*s", (long)c[e].line,    DO_NOT_WARN((unsigned long)e), synch_depth, "");    dump_instr(c+e);    fprintf(stderr,"\n");    if (c[e].opcode == F_SYNCH_MARK) synch_depth++;    }    if (synch_depth) {    Pike_fatal("Unbalanced sync_mark/pop_sync_mark: %d\n", synch_depth);    }    }   #endif      #ifdef PIKE_PORTABLE_BYTECODE    /* No need to do this for constant evaluations. */    if (store_linenumbers) {    p_wchar2 *current_tripple;    struct pike_string *previous_file = NULL; -  int previous_line = 0; +  INT_TYPE previous_line = 0;    ptrdiff_t num_linedirectives = 0;       /* Count the number of F_FILENAME/F_LINE pseudo-ops we need to add. */    for (e=0; e < length; e++) {    if (c[e].file != previous_file) {    previous_file = dmalloc_touch_named(struct pike_string *,    c[e].file, "prev_file");    num_linedirectives++;    }    if (c[e].line != previous_line) {
pike.git/src/peep.c:245: Inside #if defined(PIKE_PORTABLE_BYTECODE)
   c[e].file,    "store_prog_string"));    current_tripple[2] = 0;    current_tripple += 3;    previous_file = dmalloc_touch_named(struct pike_string *,    c[e].file, "prev_file");    }    if (c[e].line != previous_line) {    current_tripple[0] = F_LINE;    current_tripple[1] = c[e].line; -  current_tripple[2] = 0; +  current_tripple[2] = c[e].line>>32;    current_tripple += 3;    previous_line = c[e].line;    }    current_tripple[0] = c[e].opcode;    current_tripple[1] = c[e].arg;    current_tripple[2] = c[e].arg2;    current_tripple += 3;    }   #ifdef PIKE_DEBUG    if (current_tripple != STR2(tripples) + 3*(length + num_linedirectives)) {
pike.git/src/peep.c:289: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG    if (max_pointer > max_label) {    fprintf(stderr,    "Reference to undefined label %d > %d\n"    "Bad instructions are marked with '***':\n",    max_pointer, max_label);    c=(p_instr *)instrbuf.s.str;    for(e=0;e<length;e++,c++) {    if (c->opcode == F_POP_SYNCH_MARK) synch_depth--; -  fprintf(stderr, " * %4d %4lx ", -  c->line, DO_NOT_WARN((unsigned long)e)); +  fprintf(stderr, " * %4ld %4lx ", +  (long)c->line, DO_NOT_WARN((unsigned long)e));    dump_instr(c);    if ((instrs[c->opcode - F_OFFSET].flags & I_POINTER) &&    (c->arg > max_label)) {    fprintf(stderr, " ***\n");    } else {    fprintf(stderr, "\n");    }    if (c->opcode == F_SYNCH_MARK) synch_depth++;    }   
pike.git/src/peep.c:489: Inside #if defined(PIKE_DEBUG)
   {   #ifdef PIKE_DEBUG    if (c != (((p_instr *)instrbuf.s.str)+e)) {    Pike_fatal("Instruction loop deviates. "    "0x%04"PRINTPTRDIFFT"x != 0x%04"PRINTPTRDIFFT"x\n",    e, c - ((p_instr *)instrbuf.s.str));    }    if((a_flag > 2 && store_linenumbers) || a_flag > 3)    {    if (c->opcode == F_POP_SYNCH_MARK) synch_depth--; -  fprintf(stderr, "===%4d %4lx %*s", c->line, +  fprintf(stderr, "===%4ld %4lx %*s", (long)c->line,    DO_NOT_WARN((unsigned long)PIKE_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, dmalloc_touch_named(struct pike_string *,    c->file,
pike.git/src/peep.c:798:   static long stack_depth = 0;   static p_instr instrstack[PEEP_STACK_SIZE];      int remove_clear_locals=0x7fffffff;   static ptrdiff_t eye, len;   static p_instr *instructions;      /* insopt{0,1,2} push an instruction on instrstack. */      static INLINE p_instr *insopt2(int f, INT32 a, INT32 b, -  int cl, struct pike_string *cf) +  INT_TYPE cl, struct pike_string *cf)   {    p_instr *p;      #ifdef PIKE_DEBUG    if(!hasarg2(f) && b)    Pike_fatal("hasarg2(%d /*%s */) is wrong!\n",f,get_f_name(f));   #endif       p = instrstack + stack_depth++;   
pike.git/src/peep.c:824:    p->opcode=f;    p->line=cl;    copy_shared_string(p->file, dmalloc_touch_named(struct pike_string *,    cf, "insopt2"));    p->arg=a;    p->arg2=b;       return p;   }    - static INLINE p_instr *insopt1(int f, INT32 a, int cl, struct pike_string *cf) + static INLINE p_instr *insopt1(int f, INT32 a, INT_TYPE cl, +  struct pike_string *cf)   {   #ifdef PIKE_DEBUG    if(!hasarg(f) && a)    Pike_fatal("hasarg(%d /* %s */) is wrong!\n",f,get_f_name(f));   #endif       return insopt2(f,a,0,cl, cf);   }    - static INLINE p_instr *insopt0(int f, int cl, struct pike_string *cf) + static INLINE p_instr *insopt0(int f, INT_TYPE cl, struct pike_string *cf)   {   #ifdef PIKE_DEBUG    if(hasarg(f))    Pike_fatal("hasarg(%d /* %s */) is wrong!\n",f,get_f_name(f));   #endif    return insopt2(f,0,0,cl, cf);   }      #ifdef PIKE_DEBUG   static void debug(void)
pike.git/src/peep.c:938:   }         /* NOTE: Called with opcodes in reverse order! */   static void do_optimization(int topop, int topush, ...)   {    va_list arglist;    int q=0;    int oplen;    struct pike_string *cf; -  INT32 cl=instr(0)->line; +  INT_TYPE cl=instr(0)->line;      #ifdef PIKE_DEBUG    if(a_flag>5)    {    int e; -  fprintf(stderr,"PEEP at %d:",cl); +  fprintf(stderr, "PEEP at %ld:", cl);    for(e = topop; e--;)    {    fprintf(stderr," ");    dump_instr(instr(e));    }    fprintf(stderr," => ");    }   #endif       if (stack_depth + topush > PEEP_STACK_SIZE) {
pike.git/src/peep.c:1057: Inside #if defined(PIKE_DEBUG)
   ptrdiff_t e, length;    int synch_depth = 0;       c=(p_instr *)instrbuf.s.str;    length=instrbuf.s.len / sizeof(p_instr);       fprintf(stderr,"Before peep optimization:\n");    for(e=0;e<length;e++,c++)    {    if (c->opcode == F_POP_SYNCH_MARK) synch_depth--; -  fprintf(stderr,"<<<%4d: %*s",c->line,synch_depth,""); +  fprintf(stderr,"<<<%4ld: %*s",(long)c->line,synch_depth,"");    dump_instr(c);    fprintf(stderr,"\n");    if (c->opcode == F_SYNCH_MARK) synch_depth++;    }    }   #endif       len=instrbuf.s.len/sizeof(p_instr);    instructions=(p_instr *)instrbuf.s.str;    instrbuf.s.str=0;
pike.git/src/peep.c:1106: Inside #if defined(PIKE_DEBUG)
   ptrdiff_t e, length;    int synch_depth = 0;       c=(p_instr *)instrbuf.s.str;    length=instrbuf.s.len / sizeof(p_instr);       fprintf(stderr,"After peep optimization:\n");    for(e=0;e<length;e++,c++)    {    if (c->opcode == F_POP_SYNCH_MARK) synch_depth--; -  fprintf(stderr,">>>%4d: %*s",c->line,synch_depth,""); +  fprintf(stderr,">>>%4ld: %*s",(long)c->line,synch_depth,"");    dump_instr(c);    fprintf(stderr,"\n");    if (c->opcode == F_SYNCH_MARK) synch_depth++;    }    }   #endif       return relabel;   }