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.86 1998/06/01 20:49:33 grubba Exp $"); + RCSID("$Id: interpret.c,v 1.87 1998/06/06 03:25:36 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:1366:    sp[-1].u.integer++;    }else{    pc+=sizeof(INT32);    }    break;    }       CASE(F_APPLY_AND_RETURN);    {    INT32 args=sp - *--mark_sp; -  if(fp->locals >= sp-args) +  if(fp->expendible >= sp-args)    {    MEMMOVE(sp-args+1,sp-args,args*sizeof(struct svalue));    sp++;    sp[-args-1].type=T_INT;    }    /* We sabotage the stack here */    assign_svalue(sp-args-1,fp->context.prog->constants+GET_ARG());    return args+1;    }       CASE(F_CALL_LFUN_AND_RETURN);    {    INT32 args=sp - *--mark_sp; -  if(fp->locals >= sp-args) +  if(fp->expendible >= sp-args)    {    MEMMOVE(sp-args+1,sp-args,args*sizeof(struct svalue));    sp++;    sp[-args-1].type=T_INT;    }else{    free_svalue(sp-args-1);    }    /* More stack sabotage */    sp[-args-1].u.object=fp->current_object;    sp[-args-1].subtype=GET_ARG()+fp->context.identifier_level;
pike.git/src/interpret.c:1917:    new_frame.current_object = o;    new_frame.context = p->inherits[ ref->inherit_offset ];       function = new_frame.context.prog->identifiers + ref->identifier_offset;      #ifdef PROFILING    function->num_calls++;   #endif       new_frame.locals = sp - args; +  new_frame.expendible = new_frame.locals;    new_frame.args = args;    new_frame.fun = fun;    new_frame.current_storage = o->storage+new_frame.context.storage_offset;    new_frame.pc = 0;       add_ref(new_frame.current_object);    add_ref(new_frame.context.prog);    if(new_frame.context.parent) add_ref(new_frame.context.parent);       if(t_flag)
pike.git/src/interpret.c:2086:   }         /* Put catch outside of eval_instruction, so    * the setjmp won't affect the optimization of    * eval_instruction    */   static int o_catch(unsigned char *pc)   {    JMP_BUF tmp; +  struct svalue *expendible=fp->expendible;    if(SETJMP(tmp))    {    *sp=throw_value;    throw_value.type=T_INT;    sp++;    UNSETJMP(tmp); -  +  fp->expendible=expendible;    return 0;    }else{    int x=eval_instruction(pc);    if(x!=-1) mega_apply(APPLY_STACK, x, 0,0);    UNSETJMP(tmp); -  +  fp->expendible=expendible;    return 1;    }   }      void f_call_function(INT32 args)   {    mega_apply(APPLY_STACK,args,0,0);   }      int apply_low_safe_and_stupid(struct object *o, INT32 offset)   {    JMP_BUF tmp;    struct frame new_frame;    int ret;       new_frame.parent_frame = fp;    new_frame.current_object = o;    new_frame.context=o->prog->inherits[0];    new_frame.locals = evaluator_stack; -  +  new_frame.expendible=new_frame.locals;    new_frame.args = 0;    new_frame.num_args=0;    new_frame.num_locals=0;    new_frame.fun = -1;    new_frame.pc = 0;    new_frame.current_storage=o->storage;    new_frame.context.parent=0;    fp = & new_frame;       add_ref(new_frame.current_object);