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.156 2000/07/07 00:54:54 hubbe Exp $"); + RCSID("$Id: interpret.c,v 1.157 2000/07/07 01:24:14 hubbe Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"   #include "svalue.h"   #include "array.h"   #include "mapping.h"   #include "error.h"   #include "language.h"   #include "stralloc.h"   #include "constants.h"
pike.git/src/interpret.c:64:    */   struct Pike_interpreter Pike_interpreter;   int stack_size = EVALUATOR_STACK_SIZE;         /* mark stack, used to store markers into the normal stack */   int mark_stack_malloced = 0;      void push_sp_mark(void)   { -  if(Pike_interpreter.mark_sp == Pike_interpreter.mark_stack + stack_size) +  if(Pike_mark_sp == Pike_interpreter.mark_stack + stack_size)    error("No more mark stack!\n"); -  *Pike_interpreter.mark_sp++=Pike_sp; +  *Pike_mark_sp++=Pike_sp;   }   int pop_sp_mark(void)   {   #ifdef PIKE_DEBUG -  if(Pike_interpreter.mark_sp < Pike_interpreter.mark_stack) +  if(Pike_mark_sp < Pike_interpreter.mark_stack)    fatal("Mark stack underflow!\n");   #endif -  return Pike_sp - *--Pike_interpreter.mark_sp; +  return Pike_sp - *--Pike_mark_sp;   }         #ifdef PIKE_DEBUG   static void gc_check_stack_callback(struct callback *foo, void *bar, void *gazonk)   {    struct pike_frame *f;    debug_gc_xmark_svalues(Pike_interpreter.evaluator_stack,Pike_sp-Pike_interpreter.evaluator_stack-1," on current interpreter stack");       for(f=Pike_fp;f;f=f->next)
pike.git/src/interpret.c:160:    Pike_interpreter.evaluator_stack_malloced=1;    }       if(!Pike_interpreter.mark_stack)    {    Pike_interpreter.mark_stack=(struct svalue **)xalloc(stack_size*sizeof(struct svalue *));    mark_stack_malloced=1;    }       Pike_sp=Pike_interpreter.evaluator_stack; -  Pike_interpreter.mark_sp=Pike_interpreter.mark_stack; +  Pike_mark_sp=Pike_interpreter.mark_stack;    Pike_fp=0;      #ifdef PIKE_DEBUG    {    static struct callback *spcb;    if(!spcb)    {    spcb=add_gc_callback(gc_check_stack_callback,0,0);    dmalloc_accept_leak(spcb);    }
pike.git/src/interpret.c:1079: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG    if(num_locals < num_args)    fatal("Wrong number of arguments or locals in function def.\n");   #endif    new_frame->num_locals=num_locals;    new_frame->num_args=num_args;       check_threads_etc();       { -  struct svalue **save_mark_sp=Pike_interpreter.mark_sp; +  struct svalue **save_mark_sp=Pike_mark_sp;    tailrecurse=eval_instruction(pc); -  Pike_interpreter.mark_sp=save_mark_sp; +  Pike_mark_sp=save_mark_sp;   #ifdef PIKE_DEBUG -  if(Pike_interpreter.mark_sp < save_mark_sp) +  if(Pike_mark_sp < save_mark_sp)    fatal("Popped below save_mark_sp!\n");   #endif    }   #ifdef PIKE_DEBUG    if(Pike_sp<Pike_interpreter.evaluator_stack)    fatal("Stack error (also simple).\n");   #endif    break;    }   
pike.git/src/interpret.c:1206:    debug_malloc_touch(Pike_fp);    if(SETJMP(tmp))    {    *Pike_sp=throw_value;    throw_value.type=T_INT;    Pike_sp++;    UNSETJMP(tmp);    Pike_fp->expendible=expendible;    return 0;    }else{ -  struct svalue **save_mark_sp=Pike_interpreter.mark_sp; +  struct svalue **save_mark_sp=Pike_mark_sp;    int x;    Pike_fp->expendible=Pike_fp->locals + Pike_fp->num_locals;    x=eval_instruction(pc);   #ifdef PIKE_DEBUG -  if(Pike_interpreter.mark_sp < save_mark_sp) +  if(Pike_mark_sp < save_mark_sp)    fatal("mark Pike_sp underflow in catch.\n");   #endif -  Pike_interpreter.mark_sp=save_mark_sp; +  Pike_mark_sp=save_mark_sp;    Pike_fp->expendible=expendible;    if(x!=-1) mega_apply(APPLY_STACK, x, 0,0);    UNSETJMP(tmp);    return 1;    }   }      void f_call_function(INT32 args)   {    mega_apply(APPLY_STACK,args,0,0);
pike.git/src/interpret.c:1254:    new_frame->context.parent=0;    Pike_fp = new_frame;       add_ref(new_frame->current_object);    add_ref(new_frame->context.prog);       if(SETJMP(tmp))    {    ret=1;    }else{ -  struct svalue **save_mark_sp=Pike_interpreter.mark_sp; +  struct svalue **save_mark_sp=Pike_mark_sp;    int tmp=eval_instruction(o->prog->program + offset); -  Pike_interpreter.mark_sp=save_mark_sp; +  Pike_mark_sp=save_mark_sp;    if(tmp!=-1) mega_apply(APPLY_STACK, tmp, 0,0);      #ifdef PIKE_DEBUG    if(Pike_sp<Pike_interpreter.evaluator_stack)    fatal("Stack error (simple).\n");   #endif    ret=0;    }    UNSETJMP(tmp);   
pike.git/src/interpret.c:1391: Inside #if defined(PIKE_DEBUG)
   struct svalue *s,**m;    struct pike_frame *f;       debug_check_stack();       if(Pike_sp > &(Pike_interpreter.evaluator_stack[stack_size]))    fatal("Svalue stack overflow. "    "(%d entries on stack, stack_size is %d entries)\n",    Pike_sp-Pike_interpreter.evaluator_stack,stack_size);    -  if(Pike_interpreter.mark_sp > &(Pike_interpreter.mark_stack[stack_size])) +  if(Pike_mark_sp > &(Pike_interpreter.mark_stack[stack_size]))    fatal("Mark stack overflow.\n");    -  if(Pike_interpreter.mark_sp < Pike_interpreter.mark_stack) +  if(Pike_mark_sp < Pike_interpreter.mark_stack)    fatal("Mark stack underflow.\n");       for(s=Pike_interpreter.evaluator_stack;s<Pike_sp;s++) check_svalue(s);       s=Pike_interpreter.evaluator_stack; -  for(m=Pike_interpreter.mark_stack;m<Pike_interpreter.mark_sp;m++) +  for(m=Pike_interpreter.mark_stack;m<Pike_mark_sp;m++)    {    if(*m < s)    fatal("Mark stack failure.\n");       s=*m;    }       if(s > &(Pike_interpreter.evaluator_stack[stack_size]))    fatal("Mark stack exceeds svalue stack\n");