pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:65:   #define SVALUE_STACK_MARGIN (100 + LOW_SVALUE_STACK_MARGIN)   /* Observed in 7.4: 11000 was enough, 10000 wasn't. */   #define C_STACK_MARGIN (20000 + LOW_C_STACK_MARGIN)      /* Another extra margin to use while dumping the raw error in    * exit_on_error, so that backtrace_frame._sprintf can be called    * then. */   #define LOW_SVALUE_STACK_MARGIN 20   #define LOW_C_STACK_MARGIN 500    - #ifdef HAVE_COMPUTED_GOTO - PIKE_OPCODE_T *fcode_to_opcode = NULL; - struct op_2_f *opcode_to_fcode = NULL; - #endif /* HAVE_COMPUTED_GOTO */ +       PMOD_EXPORT const char Pike_check_stack_errmsg[] =    "Svalue stack overflow. "    "(%ld of %ld entries on stack, needed %ld more entries)\n";   PMOD_EXPORT const char Pike_check_mark_stack_errmsg[] =    "Mark stack overflow.\n";   PMOD_EXPORT const char Pike_check_c_stack_errmsg[] =    "C stack overflow.\n";   #ifdef PIKE_DEBUG   PMOD_EXPORT const char msg_stack_error[] =
pike.git/src/interpret.c:304: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG    {    static struct callback *spcb;    if(!spcb)    {    spcb=add_gc_callback(gc_check_stack_callback,0,0);    dmalloc_accept_leak(spcb);    }    }   #endif - #if defined(HAVE_COMPUTED_GOTO) || defined(PIKE_USE_MACHINE_CODE) + #ifdef PIKE_USE_MACHINE_CODE    {    static int tables_need_init=1;    if(tables_need_init) {    /* Initialize the fcode_to_opcode table / jump labels. */   #if !defined(OPCODE_INLINE_RETURN)    eval_instruction(NULL);   #endif    tables_need_init=0;   #ifdef INIT_INTERPRETER_STATE    INIT_INTERPRETER_STATE();   #endif    }    } - #endif /* HAVE_COMPUTED_GOTO || PIKE_USE_MACHINE_CODE */ + #endif /* PIKE_USE_MACHINE_CODE */   }      /*    * lvalues are stored in two svalues in one of these formats:    * array[index] : { array, index }    * mapping[index] : { mapping, index }    * multiset[index] : { multiset, index }    * object[index] : { object, index } (external object indexing)    * local variable : { svalue pointer (T_SVALUE_PTR), nothing (T_VOID) }    * global variable : { object, identifier index (T_OBJ_INDEX) } (internal object indexing)
pike.git/src/interpret.c:856:    fprintf(stderr,"- %s:%4ld:%p(%"PRINTPTRDIFFT"d): "    "%-25s %4"PRINTPTRDIFFT"d %4"PRINTPTRDIFFT"d\n",    file ? file : "-",(long)linep,    Pike_fp->pc, Pike_fp->pc - Pike_fp->context->prog->program,    get_opcode_name(instr),    Pike_sp-Pike_interpreter.evaluator_stack,    Pike_mark_sp-Pike_interpreter.mark_stack);    free_string(filep);    }    - #ifdef HAVE_COMPUTED_GOTO -  if (instr) -  ADD_RUNNED(instr); -  else -  Pike_fatal("NULL Instruction!\n"); - #else /* !HAVE_COMPUTED_GOTO */ +     if(instr + F_OFFSET < F_MAX_OPCODE)    ADD_RUNNED(instr); - #endif /* HAVE_COMPUTED_GOTO */ +        if(d_flag )    {    backlogp++;    if(backlogp >= BACKLOG) backlogp=0;       backlog[backlogp].program_id = Pike_fp->context->prog->id;    backlog[backlogp].instruction=instr;    backlog[backlogp].pc = Pike_fp->pc;    backlog[backlogp].stack = Pike_sp - Pike_interpreter.evaluator_stack;
pike.git/src/interpret.c:1001: Inside #if defined(_REENTRANT)
     #ifdef _REENTRANT    if(thread != backlog[e].thread_state)    {    fprintf(stderr,"[Thread swap, Pike_interpreter.thread_state=%p]\n",backlog[e].thread_state);    thread = backlog[e].thread_state;    }   #endif       file = get_line(backlog[e].pc,p, &line); - #ifdef HAVE_COMPUTED_GOTO -  fprintf(stderr,"%s:%ld:(%"PRINTPTRDIFFT"d): %s", -  file->str, -  (long)line, -  backlog[e].pc - p->program, -  get_opcode_name(backlog[e].instruction)); - #else /* !HAVE_COMPUTED_GOTO */ +     if(backlog[e].instruction+F_OFFSET > F_MAX_OPCODE)    {    fprintf(stderr,"%s:%ld:(%"PRINTPTRDIFFT"d): ILLEGAL INSTRUCTION %d\n",    file->str,    (long)line,    backlog[e].pc - p->program,    backlog[e].instruction + F_OFFSET);    free_string(file);    continue;    }
pike.git/src/interpret.c:1040:    else if(instrs[backlog[e].instruction].flags & I_POINTER)    {    fprintf(stderr,"(%+ld)", (long)backlog[e].arg);    }    else if(instrs[backlog[e].instruction].flags & I_HASARG)    {    fprintf(stderr,"(%ld)", (long)backlog[e].arg);    }    fprintf(stderr," %ld, %ld\n", (long)backlog[e].stack,    (long)backlog[e].mark_stack); - #endif /* HAVE_COMPUTED_GOTO */ +     free_string(file);    }    }while(e!=backlogp);   }      #else /* PIKE_DEBUG */      #define DEBUG_LOG_ARG(arg) 0   #define DEBUG_LOG_ARG2(arg2) 0   
pike.git/src/interpret.c:1645:   #define OPCODE1_BRANCH(O,N,F,C) TEST_OPCODE1(O,N,F,C)   #define OPCODE2_BRANCH(O,N,F,C) TEST_OPCODE2(O,N,F,C)   #define OPCODE0_TAILBRANCH(O,N,F,C) TEST_OPCODE0(O,N,F,C)   #define OPCODE1_TAILBRANCH(O,N,F,C) TEST_OPCODE1(O,N,F,C)   #define OPCODE2_TAILBRANCH(O,N,F,C) TEST_OPCODE2(O,N,F,C)      #define OPCODE0_ALIAS(O,N,F,C)   #define OPCODE1_ALIAS(O,N,F,C)   #define OPCODE2_ALIAS(O,N,F,C)    - #undef HAVE_COMPUTED_GOTO -  +    #ifdef GLOBAL_DEF_PROG_COUNTER   GLOBAL_DEF_PROG_COUNTER;   #endif      #ifndef SET_PROG_COUNTER   #define SET_PROG_COUNTER(X) (PROG_COUNTER=(X))   #endif /* SET_PROG_COUNTER */      #undef DONE   #undef FETCH
pike.git/src/interpret.c:1793:    return -1;   }      #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.    */ - #if defined(PIKE_DEBUG) && !defined(HAVE_COMPUTED_GOTO) + #if defined(PIKE_DEBUG)   #define eval_instruction eval_instruction_with_debug   #include "interpreter_debug.h"      #undef eval_instruction   #define eval_instruction eval_instruction_without_debug      #undef PIKE_DEBUG   #undef NDEBUG   #undef DO_IF_DEBUG   #define DO_IF_DEBUG(X)
pike.git/src/interpret.c:1835:      static inline int eval_instruction(unsigned char *pc)   {    if(d_flag || Pike_interpreter.trace_level>2)    return eval_instruction_with_debug(pc);    else    return eval_instruction_without_debug(pc);   }       - #else /* !PIKE_DEBUG || HAVE_COMPUTED_GOTO */ + #else /* !PIKE_DEBUG */   #include "interpreter.h"   #endif         #endif /* PIKE_USE_MACHINE_CODE */      #undef REAL_PIKE_DEBUG   #undef DO_IF_REAL_DEBUG   #undef DO_IF_NOT_REAL_DEBUG