pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:1:   /*   || 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.734 2008/07/13 19:06:23 grubba Exp $ + || $Id: program.c,v 1.735 2008/07/14 11:49:10 grubba Exp $   */      #include "global.h"   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"   #include "pike_types.h"   #include "stralloc.h"   #include "las.h"   #include "lex.h"
pike.git/src/program.c:4636:    dummy.run_time_type = id->run_time_type; /* Not actually used. */    dummy.func.ext_ref.depth = depth;    dummy.func.ext_ref.id = refno;    dummy.opt_flags = 0;   #ifdef PROFILING    dummy.self_time=0;    dummy.num_calls=0;    dummy.total_time=0;   #endif    +  if (flags & ID_PRIVATE) flags |= ID_INLINE; +     ref.id_flags=flags;    ref.identifier_offset=Pike_compiler->new_program->num_identifiers;    ref.inherit_offset=0;       debug_add_to_identifiers(dummy);       n = Pike_compiler->new_program->num_identifier_references;    add_to_identifier_references(ref);       return n;
pike.git/src/program.c:4765:    dummy.func.offset=offset - Pike_compiler->new_program->inherits[0].storage_offset;    dummy.opt_flags = 0;   #ifdef PROFILING    dummy.self_time=0;    dummy.num_calls=0;    dummy.total_time=0;   #endif       if (run_time_type == PIKE_T_FREE) dummy.func.offset = -1;    +  if (flags & ID_PRIVATE) flags |= ID_INLINE; +     ref.id_flags=flags;    ref.identifier_offset=Pike_compiler->new_program->num_identifiers;    ref.inherit_offset=0;       add_to_variable_index(ref.identifier_offset);       debug_add_to_identifiers(dummy);       n=Pike_compiler->new_program->num_identifier_references;    add_to_identifier_references(ref);
pike.git/src/program.c:5184: Inside #if 1
  #if 1    }    else {    copy_pike_type(dummy.type, mixed_type_string);    dummy.run_time_type=T_MIXED;    dummy.func.offset=-1;    dummy.opt_flags=0;    }   #endif    +  if (flags & ID_PRIVATE) flags |= ID_INLINE; +     ref.id_flags=flags;    ref.identifier_offset=Pike_compiler->new_program->num_identifiers;    ref.inherit_offset=0;      #ifdef PROFILING    dummy.self_time=0;    dummy.num_calls=0;    dummy.total_time=0;   #endif   
pike.git/src/program.c:5670:    fun.func = *func;    else    fun.func.offset = -1;       fun.opt_flags = opt_flags;       ref.identifier_offset=Pike_compiler->new_program->num_identifiers;    debug_add_to_identifiers(fun);    }    +  if (flags & ID_PRIVATE) flags |= ID_INLINE; +     ref.inherit_offset = 0;    ref.id_flags = flags;    if ((overridden = override_identifier (&ref, name)) >= 0) {   #ifdef PIKE_DEBUG    struct reference *oref =    Pike_compiler->new_program->identifier_references+overridden;    if((oref->inherit_offset != ref.inherit_offset) ||    (oref->identifier_offset != ref.identifier_offset) ||    ((oref->id_flags | ID_USED) != (ref.id_flags | ID_USED))) {    fprintf(stderr,
pike.git/src/program.c:5744: Inside #if defined(PIKE_DEBUG)
   Pike_compiler->new_program->num_identifiers,    fun.name->str,    fun.identifier_flags, fun.opt_flags);    }   #endif /* PIKE_DEBUG */       i=Pike_compiler->new_program->num_identifiers;       debug_add_to_identifiers(fun);    +  if (flags & ID_PRIVATE) flags |= ID_INLINE; +     ref.id_flags = flags;    ref.identifier_offset = i;    ref.inherit_offset = 0;    }       /* Add the reference. */       i=Pike_compiler->new_program->num_identifier_references;    add_to_identifier_references(ref);   
pike.git/src/program.c:5788: Inside #if 0
   for (r = state->new_program->identifier_references, j = 0;    j < state->new_program->num_identifier_references;    j++, r++) {    if (((r->id_flags & (ID_PARENT_REF|ID_PROTECTED|ID_PRIVATE|ID_HIDDEN)) ==    ID_PARENT_REF|ID_PROTECTED|ID_PRIVATE|ID_HIDDEN) &&    (r->identifier_offset == i) &&    (!(r->inherit_offset))) {    return j;    }    } -  ref.id_flags = ID_PARENT_REF|ID_PROTECTED|ID_PRIVATE|ID_HIDDEN; +  ref.id_flags = ID_PARENT_REF|ID_PROTECTED|ID_PRIVATE|ID_HIDDEN|ID_INLINE;    ref.identifier_offset = i;    ref.inherit_offset = 0;    add_to_identifier_references(ref);    state->new_program->flags |= PROGRAM_USES_PARENT | PROGRAM_NEEDS_PARENT;    return j;   }      #endif /* 0 */      /* Identifier lookup
pike.git/src/program.c:7712: Inside #if defined(PIKE_DEBUG)
   Pike_fatal("Program has bad shift %d!\n", c->prog->size_shift);    break;   #endif    }       c->lex.pos=c->prog->str;   }      static void run_init2(struct compilation *c)   { + #if 0 +  int i; +  struct program *p; +  struct reference *refs; + #endif /* 0 */    debug_malloc_touch(c);    Pike_compiler->compiler = c;       /* Get the proper default module. */    safe_apply_current2(PC_GET_DEFAULT_MODULE_FUN_NUM, 0, NULL);    if(Pike_sp[-1].type == T_INT)    {    pop_stack();    ref_push_mapping(get_builtin_constants());    }    assign_svalue(&c->default_module, Pike_sp-1);    pop_stack();       use_module(& c->default_module);       Pike_compiler->compat_major=PIKE_MAJOR_VERSION;    Pike_compiler->compat_minor=PIKE_MINOR_VERSION;       if(c->major>=0)    change_compiler_compatibility(c->major, c->minor); -  +  + #if 0 +  /* Make all inherited private symbols that weren't overloaded +  * in the first pass local. +  */ +  p = c->new_program; +  i = p->num_identifier_references; +  refs = p->identifier_references; +  while (i--) { +  if (refs[i].id_flags & ID_PRIVATE) refs[i].id_flags |= ID_INLINE;    } -  + #endif /* 0 */ + }      static void run_exit(struct compilation *c)   {    debug_malloc_touch(c);      #ifdef PIKE_DEBUG    if(c->num_used_modules)    Pike_fatal("Failed to pop modules properly.\n");   #endif