Branch: Tag:

2008-02-27

2008-02-27 23:59:24 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Changed the definition of Pike_fp->context to a pointer.
This should reduce the overhead for apply() somewhat.

Rev: src/apply_low.h:1.33
Rev: src/builtin.cmod:1.194
Rev: src/interpret.c:1.386
Rev: src/interpret.h:1.171
Rev: src/interpret_functions.h:1.200
Rev: src/modules/Gmp/mpz_glue.c:1.171
Rev: src/object.c:1.282
Rev: src/object.h:1.93
Rev: src/opcodes.c:1.170
Rev: src/operators.c:1.227
Rev: src/program.c:1.653

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: program.c,v 1.652 2008/02/19 15:35:25 grubba Exp $ + || $Id: program.c,v 1.653 2008/02/27 23:59:23 grubba Exp $   */      #include "global.h"
1786:      struct program *id_to_program(INT32 id)   { +  struct program_state *state;    struct program *p;    INT32 h;    if(!id) return 0;
1810:    }    }    +  /* Check if it is a program being compiled right now. */ +  for (state = Pike_compiler; state; state = state->previous) { +  if (state->new_program && state->new_program->id == id) { +  return state->new_program; +  } +  } +     if ((id > 0) && (id < PROG_DYNAMIC_ID_START)) {    /* Reserved id. Attempt to load the proper dynamic module    * to resolv the id.
3630:   {    oldhandlertype handler;    debug_malloc_touch(Pike_fp->current_object); -  handler=((oldhandlertype *)Pike_fp->context.prog->program)[e]; +  handler=((oldhandlertype *)Pike_fp->context->prog->program)[e];    if(handler) handler(Pike_fp->current_object);    debug_malloc_touch(Pike_fp->current_object);   }
7748:    {    if(f->current_object)    debug_gc_check (f->current_object, " as current_object in trampoline frame"); -  if(f->context.prog) -  debug_gc_check (f->context.prog, " as context.prog in trampoline frame"); -  if(f->context.parent) -  debug_gc_check (f->context.parent, " as context.parent in trampoline frame"); +  if(f->current_program) +  debug_gc_check (f->current_program, " as current_program in trampoline frame");    debug_gc_check_svalues (f->locals, f->num_locals, " in locals of trampoline frame");    if(f->scope && !debug_gc_check (f->scope, " as scope frame of trampoline frame"))    gc_check_frame(f->scope);
7768:   static void gc_recurse_frame(struct pike_frame *f)   {    if(f->current_object) gc_recurse_object(f->current_object); -  if(f->context.prog) gc_recurse_program(f->context.prog); -  if(f->context.parent) gc_recurse_object(f->context.parent); +  if(f->current_program) gc_recurse_program(f->current_program);    if(f->flags & PIKE_FRAME_MALLOCED_LOCALS)    gc_recurse_svalues(f->locals,f->num_locals);    if(f->scope) gc_recurse_frame(f->scope);