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.69 1998/02/27 08:39:17 hubbe Exp $"); + RCSID("$Id: interpret.c,v 1.70 1998/03/18 20:22:30 per 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:1524:    fprintf(stderr,"- %s:%4ld: %s\n",file,(long)linep,s);    free(s);   }         void mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2)   {    struct object *o;    int fun, tailrecurse=-1;    struct svalue *save_sp=sp-args; + #ifdef PROFILING + #ifdef HAVE_GETHRTIME +  long long start_time = gethrtime(); + #endif + #endif       switch(type)    {    case APPLY_STACK:    apply_stack:    if(!args)    error("Too few arguments to `()\n");    args--;    if(sp-save_sp-args > (args<<2) + 32)    {
pike.git/src/interpret.c:1676:    fatal("Inherit offset out of range in program.\n");   #endif       /* init a new evaluation frame */    new_frame.parent_frame = fp;    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.args = args;    new_frame.fun = fun;    new_frame.current_storage = o->storage+new_frame.context.storage_offset;    new_frame.pc = 0;       new_frame.current_object->refs++;    new_frame.context.prog->refs++;    if(new_frame.context.parent) new_frame.context.parent->refs++;   
pike.git/src/interpret.c:1787:    new_frame.num_args=num_args;    tailrecurse=eval_instruction(pc);   #ifdef DEBUG    if(sp<evaluator_stack)    fatal("Stack error (also simple).\n");   #endif    break;    }       } + #ifdef PROFILING + #ifdef HAVE_GETHRTIME +  function->total_time+=(INT32)((gethrtime()-start_time)/1000); + #endif + #endif      #if 0    if(sp - new_frame.locals > 1)    {    pop_n_elems(sp - new_frame.locals -1);    }else if(sp - new_frame.locals < 1){   #ifdef DEBUG    if(sp - new_frame.locals<0) fatal("Frame underflow.\n");   #endif    sp->u.integer = 0;