pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: interpret.c,v 1.222 2001/07/17 08:33:22 hubbe Exp $"); + RCSID("$Id: interpret.c,v 1.223 2001/07/17 17:50:38 grubba Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"   #include "svalue.h"   #include "array.h"   #include "mapping.h"   #include "pike_error.h"   #include "language.h"   #include "stralloc.h"   #include "constants.h"
pike.git/src/interpret.c:781:   #define OPCODE0_TAIL(O,N,C) OPCODE0(O,N,C)   #define OPCODE1_TAIL(O,N,C) OPCODE1(O,N,C)   #define OPCODE2_TAIL(O,N,C) OPCODE2(O,N,C)      #define OPCODE0_TAILJUMP(O,N,C) OPCODE0(O,N,C)   #define OPCODE1_TAILJUMP(O,N,C) OPCODE1(O,N,C)   #define OPCODE2_TAILJUMP(O,N,C) OPCODE2(O,N,C)      #undef HAVE_COMPUTED_GOTO    - #if defined(__i386__) && defined(__GNUC__) + #ifdef __GNUC__ + #ifdef __i386__   #define PROG_COUNTER (((unsigned char **)__builtin_frame_address(0))[1]) -  + #elif defined(sparc) + #define PROG_COUNTER reg_pc + register unsigned char *reg_pc __asm__ ("%i7"); + #endif /* __i386__ || sparc */      static int eval_instruction(PIKE_OPCODE_T *pc)   {    do_inter_return_label = && inter_return_label;    do_escape_catch_label = && inter_escape_catch_label;    -  + #ifdef PIKE_DEBUG +  if (t_flag) { +  int i; +  fprintf(stderr, "Calling code at 0x%p:\n", pc); +  for (i=0; i < 16; i+=4) { +  fprintf(stderr, +  " 0x%08x 0x%08x 0x%08x 0x%08x\n", +  ((int *)pc)[i], +  ((int *)pc)[i+1], +  ((int *)pc)[i+2], +  ((int *)pc)[i+3]); +  } +  } + #endif /* PIKE_DEBUG */ +  + #ifdef __i386__    /* This code does not clobber %eax, but    * the code jumped to does.    */    __asm__ __volatile__( " sub $8,%%esp\n"    " jmp *%0"    : "=m" (pc)    :    : "cc", "memory", "eax" ); -  + #elif defined(sparc) +  /* No extra setup needed! +  */ +  return ((int (*)(void))pc)(); + #endif /* __i386__ || sparc */       /* This code is never reached, but will    * prevent gcc from optimizing the labels below too much    */       fprintf(stderr,"We have reached the end of the world!\n");    goto *dummy_label;       /* %%esp will be slightly buggered after    * returning from the function code (8 bytes off), but that    * should not matter to these return statements. -Hubbe    */       inter_return_label: return -1;    inter_escape_catch_label: return -2;   }    - #endif + #endif /* __GNUC__ */    - #ifdef PIKE_USE_SPARC_GCC - #define PROG_COUNTER reg_pc - register void *reg_pc __asm__ ("%i7"); - #endif -  +    #undef DONE   #undef FETCH   #undef INTER_RETURN   #undef INTER_ESCAPE_CATCH      #define DONE return   #define FETCH   #define INTER_RETURN {PROG_COUNTER=do_inter_return_label;DONE;}   #define INTER_ESCAPE_CATCH {PROG_COUNTER=do_escape_catch_label;DONE;}