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.217 2001/07/09 11:37:20 grubba Exp $"); + RCSID("$Id: interpret.c,v 1.218 2001/07/09 14:19:15 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:59:      #define TRACE_LEN (100 + t_flag * 10)      /* Keep some margin on the stack space checks. They're lifted when    * handle_error runs to give it some room. */   #define SVALUE_STACK_MARGIN 100 /* Tested in 7.1: 40 was enough, 30 wasn't. */   #define C_STACK_MARGIN 8000 /* Tested in 7.1: 3000 was enough, 2600 wasn't. */      #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";   
pike.git/src/interpret.c:684: Inside #if defined(_REENTRANT)
   fprintf(stderr,"[Thread swap, Pike_interpreter.thread_id=%p]\n",backlog[e].thread_id);    thread = backlog[e].thread_id;    }   #endif       file=get_line(backlog[e].pc-1,backlog[e].program, &line);   #ifdef HAVE_COMPUTED_GOTO    fprintf(stderr,"%s:%ld: %s",    file,    (long)line, -  low_get_f_name(backlog[e].instruction, backlog[e].program)); +  get_opcode_name(backlog[e].instruction));   #else /* !HAVE_COMPUTED_GOTO */    if(backlog[e].instruction < 0 || backlog[e].instruction+F_OFFSET > F_MAX_OPCODE)    {    fprintf(stderr,"%s:%ld: ILLEGAL INSTRUCTION %d\n",    file,    (long)line,    backlog[e].instruction + F_OFFSET);    continue;    }   
pike.git/src/interpret.c:734: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG   #define EVAL_INSTR_RET_CHECK(x) \    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 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)   #define eval_instruction eval_instruction_with_debug   #include "interpreter_debug.h"      #undef eval_instruction   #define eval_instruction eval_instruction_without_debug   #undef PIKE_DEBUG
pike.git/src/interpret.c:1234:    }    low_object_index_no_free(Pike_sp-args-1,o,fun);    tailrecurse=args+1;    break;    }       case IDENTIFIER_PIKE_FUNCTION:    {    int num_args;    int num_locals; -  unsigned char *pc; +  PIKE_OPCODE_T *pc;      #ifdef PIKE_DEBUG    if (Pike_in_gc > GC_PASS_PREPARE && Pike_in_gc < GC_PASS_FREE)    fatal("Pike code called within gc.\n");   #endif       debug_malloc_touch(Pike_fp);    pc=new_frame->context.prog->program + function->func.offset;    -  num_locals=EXTRACT_UCHAR(pc++); -  num_args=EXTRACT_UCHAR(pc++); + #ifdef HAVE_COMPUTED_GOTO +  num_locals = (int)(ptrdiff_t)((pc++)[0]); +  num_args = (int)(ptrdiff_t)((pc++)[0]); + #else /* !HAVE_COMPUTED_GOTO */ +  num_locals = EXTRACT_UCHAR(pc++); +  num_args = EXTRACT_UCHAR(pc++); + #endif /* HAVE_COMPUTED_GOTO */      #ifdef PIKE_DEBUG    if(num_locals < num_args)    fatal("Wrong number of arguments or locals in function def.\n"    "num_locals: %d < num_args: %d\n",    num_locals, num_args);   #endif       if(function->identifier_flags & IDENTIFIER_SCOPE_USED)    new_frame->expendible+=num_locals;
pike.git/src/interpret.c:1287:       if(num_locals > args)    clear_svalues(Pike_sp, num_locals - args);    Pike_sp += num_locals - args;       new_frame->num_locals=num_locals;    new_frame->num_args=num_args;    new_frame->save_mark_sp=Pike_mark_sp;    new_frame->mark_sp_base=Pike_mark_sp;    check_threads_etc(); -  new_frame->pc=pc; +  new_frame->pc = pc;    return 1;    }    }   #ifdef PROFILING   #ifdef HAVE_GETHRTIME    {    long long time_passed, time_in_children, self_time;    time_in_children= Pike_interpreter.accounted_time - Pike_fp->children_base;    time_passed = gethrtime() - Pike_interpreter.time_base - Pike_fp->start_time;    self_time=time_passed - time_in_children;