Branch: Tag:

2009-11-20

2009-11-20 10:58:09 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Avoid generating unnecessary parent pointers for inherits and types.
Fixes [bug 2672 (#2672)].

Rev: src/docode.c:1.206
Rev: src/las.c:1.442
Rev: src/program.c:1.772

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: docode.c,v 1.205 2009/11/10 08:41:33 peter Exp $ + || $Id: docode.c,v 1.206 2009/11/20 10:58:09 grubba Exp $   */      #include "global.h"
870:    int level = 0;    struct program_state *state = Pike_compiler;    while (state && (state->new_program->id != n->u.integer.a)) { +  state->new_program->flags |= PROGRAM_USES_PARENT | PROGRAM_NEEDS_PARENT;    state = state->previous;    level++;    }
2529: Inside #if 0
  #if 0    struct object *o;    -  for(o=Pike_compiler->fake_object;o!=n->u.sval.u.object;o=o->parent) +  for(o=Pike_compiler->fake_object;o!=n->u.sval.u.object;o=o->parent) { +  state->new_program->flags |= +  PROGRAM_USES_PARENT | PROGRAM_NEEDS_PARENT;    x++; -  +  }   #else    struct program_state *state=Pike_compiler; -  for(;state->fake_object!=n->u.sval.u.object;state=state->previous) +  for(;state->fake_object!=n->u.sval.u.object;state=state->previous) { +  state->new_program->flags |= +  PROGRAM_USES_PARENT | PROGRAM_NEEDS_PARENT;    x++; -  +  }   #endif    emit2(F_EXTERNAL, n->u.sval.subtype, x);    Pike_compiler->new_program->flags |=