pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: interpret.c,v 1.396 2008/05/10 11:53:41 grubba Exp $ + || $Id: interpret.c,v 1.397 2008/05/10 23:27:05 mast Exp $   */      #include "global.h"   #include "interpret.h"   #include "object.h"   #include "program.h"   #include "svalue.h"   #include "array.h"   #include "mapping.h"   #include "pike_error.h"
pike.git/src/interpret.c:844:   #endif   }      #ifdef PIKE_DEBUG      #define BACKLOG 100   struct backlog   {    PIKE_INSTR_T instruction;    INT32 arg,arg2; -  struct program *program; +  INT32 program_id;    PIKE_OPCODE_T *pc;   #ifdef _REENTRANT    struct thread_state *thread_state;   #endif    ptrdiff_t stack;    ptrdiff_t mark_stack;   };      struct backlog backlog[BACKLOG];   int backlogp=BACKLOG-1;
pike.git/src/interpret.c:895:   #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;    -  if(backlog[backlogp].program) -  free_program(backlog[backlogp].program); -  -  backlog[backlogp].program=Pike_fp->context->prog; -  add_ref(Pike_fp->context->prog); +  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;    backlog[backlogp].mark_stack = Pike_mark_sp - Pike_interpreter.mark_stack;   #ifdef _REENTRANT    backlog[backlogp].thread_state=Pike_interpreter.thread_state;   #endif      #ifdef _REENTRANT    CHECK_INTERPRETER_LOCK();
pike.git/src/interpret.c:999:    struct thread_state *thread=0;   #endif       int e;    if(!d_flag || backlogp<0 || backlogp>=BACKLOG)    return;       e=backlogp;    do    { +  struct program *p;    e++;    if(e>=BACKLOG) e=0;    -  if(backlog[e].program) +  p = id_to_program (backlog[e].program_id); +  if (p)    {    struct pike_string *file;    INT32 line;      #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,backlog[e].program, &line); +  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 - backlog[e].program->program, +  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 - backlog[e].program->program, +  backlog[e].pc - p->program,    backlog[e].instruction + F_OFFSET);    free_string(file);    continue;    }       fprintf(stderr,"%s:%ld:(%"PRINTPTRDIFFT"d): %s",    file->str,    (long)line, -  backlog[e].pc - backlog[e].program->program, -  low_get_f_name(backlog[e].instruction + F_OFFSET, backlog[e].program)); +  backlog[e].pc - p->program, +  low_get_f_name(backlog[e].instruction + F_OFFSET, p));    if(instrs[backlog[e].instruction].flags & I_HASARG2)    {    fprintf(stderr,"(%ld,%ld)",    (long)backlog[e].arg,    (long)backlog[e].arg2);    }    else if(instrs[backlog[e].instruction].flags & I_POINTER)    {    fprintf(stderr,"(%+ld)", (long)backlog[e].arg);    }
pike.git/src/interpret.c:2997:      PMOD_EXPORT void cleanup_interpret(void)   {   #ifdef PIKE_DEBUG    int e;   #endif       while(Pike_fp)    POP_PIKE_FRAME();    - #ifdef PIKE_DEBUG -  for(e=0;e<BACKLOG;e++) -  { -  if(backlog[e].program) -  { -  free_program(backlog[e].program); -  backlog[e].program=0; -  } -  } - #endif +     reset_evaluator();       low_cleanup_interpret(&Pike_interpreter);   }      void really_clean_up_interpret(void)   {   #ifdef DO_PIKE_CLEANUP   #if 0    struct pike_frame_block *p;    int e;    for(p=pike_frame_blocks;p;p=p->next)    for(e=0;e<128;e++)    debug_malloc_dump_references( p->x + e);   #endif    free_callback_list (&evaluator_callbacks);    free_all_pike_frame_blocks();    free_all_catch_context_blocks();   #endif   }