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.236 2001/07/27 15:02:03 grubba Exp $"); + RCSID("$Id: interpret.c,v 1.237 2001/07/31 23:10:35 marcus 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:770: Inside #if defined(PIKE_USE_MACHINE_CODE)
  /* Labels to jump to to cause eval_instruction to return */   /* FIXME: Replace these with assembler lables */   void *do_inter_return_label;   void *do_escape_catch_label;   void *dummy_label;      #ifndef DEF_PROG_COUNTER   #define DEF_PROG_COUNTER   #endif /* !DEF_PROG_COUNTER */    + #ifndef CALL_MACHINE_CODE + #define CALL_MACHINE_CODE(pc) \ +  do { \ +  /* The test is needed to get the labels to work... */ \ +  if (pc) { \ +  /* No extra setup needed! \ +  */ \ +  return ((int (*)(void))(pc))(); \ +  } \ +  while(0) + #endif /* !CALL_MACHINE_CODE */ +    #define OPCODE0(O,N,C) \   void PIKE_CONCAT(opcode_,O)(void) { \    DEF_PROG_COUNTER; \   DO_IF_DEBUG(if(t_flag > 3) fprintf(stderr,"- (%p,%ld): %s()\n",PROG_COUNTER,DO_NOT_WARN((long)(Pike_sp-Pike_interpreter.evaluator_stack)),N));\   C }      #define OPCODE1(O,N,C) \   void PIKE_CONCAT(opcode_,O)(INT32 arg1) {\    DEF_PROG_COUNTER; \   DO_IF_DEBUG(if(t_flag > 3) fprintf(stderr,"- (%p,%ld): %s(%d)\n",PROG_COUNTER,DO_NOT_WARN((long)(Pike_sp-Pike_interpreter.evaluator_stack)),N,arg1)); \
pike.git/src/interpret.c:842: Inside #if defined(__GNUC__) and #if defined(PIKE_DEBUG)
   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, %ecx & %edx, but -  * the code jumped to does. -  */ -  __asm__ __volatile__( " sub $8,%%esp\n" -  " jmp *%0" -  : "=m" (pc) -  : -  : "cc", "memory", "eax", "ecx", "edx" ); - #elif defined(__ppc__) || defined(_POWER) -  __asm__ __volatile__( " mtlr %0\n" -  " blr" -  : -  : "r" (pc) -  : "cc", "memory", "r0", "r3", "r4", "r5", -  "r6", "r7", "r8", "r9", "r10", "r11", "r12", -  "lr", "ctr"); - #else /* !__i386__ && !__ppc__ */ -  /* The test is needed to get the labels to work... */ -  if (pc) { -  /* No extra setup needed! -  */ -  return ((int (*)(void))pc)(); -  } - #endif /* __i386__ || __ppc__ */ +  CALL_MACHINE_CODE(pc); +     /* 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