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.225 2001/07/17 22:03:33 grubba Exp $"); + RCSID("$Id: interpret.c,v 1.226 2001/07/18 11:36:01 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:740:    if (x == -2) \    fatal("Return value -2 from eval_instruction is not handled here.\n"\    "Probable cause: F_ESCAPE_CATCH outside catch block.\n")   #else   #define EVAL_INSTR_RET_CHECK(x)   #endif         #ifdef PIKE_USE_MACHINE_CODE    + #ifdef sparc + #define LOW_GET_JUMP() (PROG_COUNTER[0]) + #define LOW_SKIPJUMP() (SET_PROG_COUNTER(PROG_COUNTER + 1)) + #else /* !sparc */   #define LOW_GET_JUMP() EXTRACT_INT(PROG_COUNTER) - #define LOW_SKIPJUMP() (PROG_COUNTER += sizeof(INT32)) + #define LOW_SKIPJUMP() (SET_PROG_COUNTER(PROG_COUNTER + sizeof(INT32))) + #endif /* sparc */      /* 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;         #define OPCODE0(O,N,C) \   void PIKE_CONCAT(opcode_,O)(void) { \
pike.git/src/interpret.c:785:   #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      #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"); + register unsigned INT32 *reg_pc __asm__ ("%i7"); + #define PROG_COUNTER (reg_pc + 2) + #define SET_PROG_COUNTER(X) (reg_pc = ((unsigned INT32 *)X)-2)   #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;
pike.git/src/interpret.c:847:    * 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 /* __GNUC__ */    - #ifdef sparc - #define SET_PROG_COUNTER(X) (PROG_COUNTER=((char *)X)-8) - #else /* !sparc */ + #ifndef SET_PROG_COUNTER   #define SET_PROG_COUNTER(X) (PROG_COUNTER=(X)) - #endif /* sparc */ + #endif /* SET_PROG_COUNTER */      #undef DONE   #undef FETCH   #undef INTER_RETURN   #undef INTER_ESCAPE_CATCH      #define DONE return   #define FETCH   #define INTER_RETURN {SET_PROG_COUNTER(do_inter_return_label);DONE;}   #define INTER_ESCAPE_CATCH {SET_PROG_COUNTER(do_escape_catch_label);DONE;}      #include "interpret_functions_fixed.h"         #else /* PIKE_USE_MACHINE_CODE */       -  + #ifndef SET_PROG_COUNTER + #define SET_PROG_COUNTER(X) (PROG_COUNTER=(X)) + #endif /* SET_PROG_COUNTER */ +    #ifdef HAVE_COMPUTED_GOTO   int lookup_sort_fun(const void *a, const void *b)   {    return (int)(((ptrdiff_t)((struct op_2_f *)a)->opcode) -    ((ptrdiff_t)((struct op_2_f *)b)->opcode));   }   #endif /* HAVE_COMPUTED_GOTO */      /* NOTE: Due to the implementation of computed goto,    * interpreter.h may only be included once.