pike.git / src / peep.c

version» Context lines:

pike.git/src/peep.c:10:   #include "lex.h"   #include "pike_memory.h"   #include "peep.h"   #include "dmalloc.h"   #include "stuff.h"   #include "bignum.h"   #include "opcodes.h"   #include "builtin_functions.h"   #include "constants.h"    - RCSID("$Id: peep.c,v 1.54 2001/07/16 19:48:59 hubbe Exp $"); + RCSID("$Id: peep.c,v 1.55 2001/07/17 06:50:35 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:128: Inside #if defined(PIKE_DEBUG)
   if(instr > (long)instrbuf.s.len / (long)sizeof(p_instr) || instr < 0)    fatal("update_arg outside known space.\n");   #endif    p=(p_instr *)instrbuf.s.str;    p[instr].arg=arg;   }         /**** Bytecode Generator *****/    -  + /* FIXME: Move this to pike_cpulib.h */   #if defined(__i386__) && defined(__GNUC__)      #define PUSH_INT(X) ins_int((INT32)(X), add_to_program)   #define PUSH_ADDR(X) PUSH_INT((X)) - #define PUSHL(X) add_to_program(0x68),PUSH_INT((X) - #define CALL_ABSOLUTE(X) add_to_program(0x9a),PUSH_ADDR((X)) +  + /* This is ugly, but since the code may be moved we cannot use +  * relative addressing :( +  */ + #define CALL_ABSOLUTE(X) do{ \ +  add_to_program(0xb8); /* mov $xxx,%eax */ \ +  PUSH_INT(X); \ +  add_to_program(0xff); /* jsr *(%eax) */ \ +  add_to_program(0xd0); \ + }while(0) +    #define RET() add_to_program(0xc3);   #define POP(X) \    add_to_program(0x83), /* Addl.b 0x4, %esp */ \    add_to_program(0xc4), \    add_to_program(-X)      #endif         void ins_f_byte(unsigned int b)
pike.git/src/peep.c:160:       b-=F_OFFSET;   #ifdef PIKE_DEBUG    if(b>255)    Pike_error("Instruction too big %d\n",b);   #endif      #ifdef PIKE_USE_MACHINE_CODE   #if defined(__i386__) && defined(__GNUC__)    CALL_ABSOLUTE(instrs[b].address); -  return +  return;   #endif   #endif      #ifdef HAVE_COMPUTED_GOTO    add_to_program(fcode_to_opcode[b]);   #else /* !HAVE_COMPUTED_GOTO */    add_to_program((unsigned char)b);   #endif /* HAVE_COMPUTED_GOTO */   }