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.121 1999/04/17 13:48:47 grubba Exp $"); + RCSID("$Id: interpret.c,v 1.122 1999/05/02 08:11:43 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:179:    sp=evaluator_stack;    mark_sp=mark_stack;    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);    }    }   #endif   #ifdef PROFILING   #ifdef HAVE_GETHRTIME    time_base = gethrtime();    accounted_time =0;   #endif   #endif   }
pike.git/src/interpret.c:783:    case APPLY_LOW:    o=(struct object *)arg1;    fun=(long)arg2;       apply_low:    scope=0;    apply_low_with_scope:    {    struct program *p;    struct reference *ref; -  struct pike_frame *new_frame=alloc_pike_frame(); +  struct pike_frame *new_frame;    struct identifier *function;       if(fun<0)    {    pop_n_elems(sp-save_sp);    push_int(0);    return;    }       check_stack(256);    check_mark_stack(256);    check_c_stack(8192);    -  +  new_frame=alloc_pike_frame(); +  debug_malloc_touch(new_frame); +    #ifdef PIKE_DEBUG    if(d_flag>2) do_debug();   #endif       p=o->prog;    if(!p)    PIKE_ERROR("destructed object->function",    "Cannot call functions in destructed objects.\n", sp, args);   #ifdef PIKE_DEBUG    if(fun>=(int)p->num_identifier_references)
pike.git/src/interpret.c:907: Inside #if defined(PROFILING)
     #ifdef PROFILING   #ifdef HAVE_GETHRTIME    self_time_base=function->total_time;   #endif   #endif       switch(function->identifier_flags & (IDENTIFIER_FUNCTION | IDENTIFIER_CONSTANT))    {    case IDENTIFIER_C_FUNCTION: +  debug_malloc_touch(fp);    fp->num_args=args;    new_frame->num_locals=args;    check_threads_etc();    (*function->func.c_fun)(args);    break;       case IDENTIFIER_CONSTANT:    {    struct svalue *s=fp->context.prog->constants+function->func.offset; -  +  debug_malloc_touch(fp);    if(s->type == T_PROGRAM)    {    struct object *tmp;    check_threads_etc();    tmp=parent_clone_object(s->u.program,    o,    fun,    args);    push_object(tmp);    break;    }    /* Fall through */    }       case 0:    { -  +  debug_malloc_touch(fp);    if(sp-save_sp-args<=0)    {    /* Create an extra svalue for tail recursion style call */    sp++;    MEMMOVE(sp-args,sp-args-1,sizeof(struct svalue)*args);    sp[-args-1].type=T_INT;    }    low_object_index_no_free(sp-args-1,o,fun);    tailrecurse=args+1;    break;
pike.git/src/interpret.c:1102:         /* 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; +  debug_malloc_touch(fp);    if(SETJMP(tmp))    {    *sp=throw_value;    throw_value.type=T_INT;    sp++;    UNSETJMP(tmp);    fp->expendible=expendible;    return 0;    }else{    int x;
pike.git/src/interpret.c:1321:   }   #endif      void cleanup_interpret(void)   {   #ifdef PIKE_DEBUG    int e;   #endif       while(fp) -  { -  struct pike_frame *tmp=fp; -  fp=tmp->next; -  tmp->next=0; -  free_pike_frame(tmp); -  } +  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;    }    }
pike.git/src/interpret.c:1365:       mark_stack=0;    evaluator_stack=0;    mark_stack_malloced=0;    evaluator_stack_malloced=0;   }      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_all_pike_frame_blocks();   #endif   }