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.63 2001/07/21 09:30:25 hubbe Exp $"); + RCSID("$Id: peep.c,v 1.64 2001/07/24 01:16:11 hubbe 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:311:    break;       case F_VOLATILE_RETURN:    ins_f_byte(F_RETURN);    break;       default:    switch(instrs[c->opcode - F_OFFSET].flags)    {    case I_ISJUMP: + #ifdef INS_F_JUMP +  tmp=INS_F_JUMP(c->opcode); +  if(tmp != -1) +  { +  upd_pointer(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");   #endif    tmp = DO_NOT_WARN((INT32)PC);    ins_pointer(jumps[c->arg]);    jumps[c->arg]=tmp;    break;
pike.git/src/peep.c:341:    ins_f_byte(c->opcode);    break;      #ifdef PIKE_DEBUG    default:    fatal("Unknown instruction type.\n");   #endif    }    }    + #ifdef ALIGN_PIKE_JUMPS +  if(e+1 < length) +  { +  switch(c->opcode) +  { +  case F_RETURN: +  case F_VOLATILE_RETURN: +  case F_BRANCH: +  case F_RETURN_0: +  case F_RETURN_1: +  case F_RETURN_LOCAL: +  + #define CALLS(X) \ +  case PIKE_CONCAT3(F_,X,_AND_RETURN): \ +  case PIKE_CONCAT3(F_MARK_,X,_AND_RETURN): +  +  CALLS(APPLY) +  CALLS(CALL_FUNCTION) +  CALLS(CALL_LFUN) +  CALLS(CALL_BUILTIN) +  while( ((INT32) PC & (ALIGN_PIKE_JUMPS-1) ) ) +  ins_byte(0); +  } +  } + #endif +     c++;    }       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",    PTRDIFF_T_TO_LONG(e), labels[e], jumps[e]);   #endif -  + #ifdef INS_F_JUMP +  if(jumps[e] < 0) +  { +  tmp = read_pointer(~jumps[e]); +  UPDATE_F_JUMP(~jumps[e], tmp2); +  jumps[e]=tmp; +  continue; +  } + #endif +     tmp = read_pointer(jumps[e]);    upd_pointer(jumps[e], tmp2 - jumps[e]);    jumps[e]=tmp;    }    }       free((char *)labels);    free((char *)jumps);    free((char *)uses);