Branch: Tag:

1998-03-18

1998-03-18 20:22:32 by Per Hedbor <ph@opera.com>

Added support for profiling, and fixed typo in threads.c

Rev: src/builtin_functions.c:1.84
Rev: src/interpret.c:1.70
Rev: src/program.c:1.66
Rev: src/program.h:1.34
Rev: src/threads.c:1.60

4:   ||| 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"
1531:    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)    {
1683:       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;
1794:    }       } + #ifdef PROFILING + #ifdef HAVE_GETHRTIME +  function->total_time+=(INT32)((gethrtime()-start_time)/1000); + #endif + #endif      #if 0    if(sp - new_frame.locals > 1)