pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:3117: Inside #if defined(PIKE_DEBUG)
   d, ref->id_flags, ref->inherit_offset,    ref->identifier_offset,    id->name->size_shift ? "(wide)" : id->name->str,    indent, "",    p->num_strings?p->strings[id->filename_strno]->str:"-", id->linenumber);    if (IDENTIFIER_IS_ALIAS(id->identifier_flags)) {    fprintf (stderr, "%*s Alias for %d:%d\n",    indent, "", id->func.ext_ref.depth, id->func.ext_ref.id);    } else if (IDENTIFIER_IS_CONSTANT(id->identifier_flags)) {    fprintf (stderr, "%*s Constant #%ld\n", -  indent, "", (long)id->func.offset); +  indent, "", (long)id->func.const_info.offset);    } else if (IDENTIFIER_IS_VARIABLE(id->identifier_flags)) {    fprintf (stderr, "%*s Offset: 0x%08lx\n",    indent, "", (long)id->func.offset);    } else if (IDENTIFIER_IS_PIKE_FUNCTION(id->identifier_flags)) {    INT32 line;    struct program *inh_p = INHERIT_FROM_PTR(p,ref)->prog;    struct pike_string *file =    get_line (ID_FROM_PTR(p,ref)->func.offset + inh_p->program, inh_p, &line);    if (!file->size_shift)    fprintf (stderr, "%*s %s:%d\n",
pike.git/src/program.c:4658:    p = state->new_program;    numid = n->u.integer.b;    }       continue_inherit:       /* FIXME: Support external constants. */    if(numid != IDREF_MAGIC_THIS &&    (IDENTIFIER_IS_CONSTANT((i=ID_FROM_INT(p, numid))->    identifier_flags)) && -  (i->func.offset != -1)) +  (i->func.const_info.offset != -1))    {    struct svalue *s=&PROG_FROM_INT(p, numid)-> -  constants[i->func.offset].sval; +  constants[i->func.const_info.offset].sval;    if(s->type != T_PROGRAM)    {    do_inherit(s,flags,name);    return;    }else{    low_inherit(s->u.program,    0,    numid,    offset+42,    flags,
pike.git/src/program.c:5286:    struct identifier *id = p->identifiers + idref->identifier_offset;    int depth = 0;    while (state && (c->u.object->prog != state->new_program)) {    depth++;    state = state->previous;    }    if(state) {    /* Alias for a symbol in the current or surrounding programs.    */    if(IDENTIFIER_IS_CONSTANT(id->identifier_flags) && -  (id->func.offset != -1) && +  (id->func.const_info.offset != -1) &&    (state == Pike_compiler)) { -  c=& p->constants[id->func.offset].sval; +  c=& p->constants[id->func.const_info.offset].sval;    } else if (IDENTIFIER_IS_VARIABLE(id->identifier_flags) &&    (state == Pike_compiler)) {    my_yyerror("Attempt to make a constant %S of a variable.",    name);    c = NULL;    } else {    /* Alias for a function or a variable or constant in a surrounding    * scope.    */    int n = c->subtype;
pike.git/src/program.c:5328: Inside #if 1
   if(n==-1   #if 1    || !c   #endif    )    {    yyerror("Pass2: Constant disappeared!");    }else{    struct identifier *id;    id=ID_FROM_INT(Pike_compiler->new_program,n); -  if(id->func.offset>=0) { +  if(id->func.const_info.offset>=0) {    /* Update the stored constant. */    assign_svalue (&PROG_FROM_INT(Pike_compiler->new_program,n)-> -  constants[id->func.offset].sval, c); +  constants[id->func.const_info.offset].sval, c);    } else {    id->run_time_type = (unsigned char) c->type; -  id->func.offset = store_constant(c, 0, 0); +  id->func.const_info.offset = store_constant(c, 0, 0);    }    free_type(id->type);    if ((c->type == T_INT) && !(flags & ID_INLINE)) {    if (c->u.integer) {    copy_pike_type(id->type, int_type_string);    } else {    copy_pike_type(id->type, zero_type_string);    }    } else {    id->type = get_type_of_svalue(c);    }   #ifdef PROGRAM_BUILD_DEBUG    fprintf (stderr, "%.*sstored constant #%d at %d\n",    cc->compilation_depth, "", -  n, id->func.offset); +  n, id->func.const_info.offset);   #endif    }    return n;    }      #ifdef PIKE_DEBUG    if(Pike_compiler->new_program->flags & (PROGRAM_FIXED | PROGRAM_OPTIMIZED))    Pike_fatal("Attempting to add constant to fixed program\n");       if(Pike_compiler->compiler_pass==2) {
pike.git/src/program.c:5385:    if ((c->type == T_INT) && !(flags & ID_INLINE)) {    if (c->u.integer) {    copy_pike_type(dummy.type, int_type_string);    } else {    copy_pike_type(dummy.type, zero_type_string);    }    } else {    dummy.type = get_type_of_svalue(c);    }    dummy.run_time_type = (unsigned char) c->type; -  dummy.func.offset=store_constant(c, 0, 0); +  dummy.func.const_info.offset = store_constant(c, 0, 0);    dummy.opt_flags=OPT_SIDE_EFFECT | OPT_EXTERNAL_DEPEND;    if(c->type == PIKE_T_PROGRAM && (c->u.program->flags & PROGRAM_CONSTANT))    dummy.opt_flags=0;   #if 1    }    else {    copy_pike_type(dummy.type, mixed_type_string);    dummy.run_time_type=T_MIXED; -  dummy.func.offset=-1; +  dummy.func.const_info.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;   
pike.git/src/program.c:6394:    if (p->identifier_references[e].id_flags &    (ID_HIDDEN|ID_PROTECTED|ID_PRIVATE)) {    continue;    }    id = ID_FROM_INT(p, e);    if (IDENTIFIER_IS_ALIAS(id->identifier_flags)) {    /* FIXME!    */    continue;    } else if (IDENTIFIER_IS_CONSTANT(id->identifier_flags)) { -  if (id->func.offset >= 0) { +  if (id->func.const_info.offset >= 0) {    struct program *p2 = PROG_FROM_INT(p, e); -  struct svalue *val = &p2->constants[id->func.offset].sval; +  struct svalue *val = &p2->constants[id->func.const_info.offset].sval;    if ((val->type != T_PROGRAM) ||    !(val->u.program->flags & PROGRAM_USES_PARENT)) {    ref_push_string(ID_FROM_INT(p, e)->name);    n++;    }    } else {    /* Prototype constant. */    ref_push_string(ID_FROM_INT(p, e)->name);    n++;    }
pike.git/src/program.c:6433:    if (p->identifier_references[e].id_flags &    (ID_HIDDEN|ID_PROTECTED|ID_PRIVATE)) {    continue;    }    id = ID_FROM_INT(p, e);    if (IDENTIFIER_IS_ALIAS(id->identifier_flags)) {    /* FIXME!    */    continue;    } else if (IDENTIFIER_IS_CONSTANT(id->identifier_flags)) { -  if (id->func.offset >= 0) { +  if (id->func.const_info.offset >= 0) {    struct program *p2 = PROG_FROM_INT(p, e); -  struct svalue *val = &p2->constants[id->func.offset].sval; +  struct svalue *val = &p2->constants[id->func.const_info.offset].sval;    if ((val->type != T_PROGRAM) ||    !(val->u.program->flags & PROGRAM_USES_PARENT)) {    push_svalue(val);    n++;    }    } else {    /* Prototype constant. */    push_int(0);    n++;    }
pike.git/src/program.c:6505: Inside #if 0 && defined (COMPILER_DEBUG)
   low_object_index_no_free(to, loc.o, refid);   #if 0 && defined (COMPILER_DEBUG)    safe_pike_fprintf (stderr, "low_program_index_no_free1 %O->%S: %O\n",    what, s, to);   #endif    return 1;    }    }       if (IDENTIFIER_IS_CONSTANT(id->identifier_flags)) { -  if (id->func.offset >= 0) { +  if (id->func.const_info.offset >= 0) {    struct program *p2 = PROG_FROM_INT(p, e); -  struct svalue *val = &p2->constants[id->func.offset].sval; +  struct svalue *val = &p2->constants[id->func.const_info.offset].sval;    assign_svalue_no_free(to, val);    } else {    /* Prototype constant. */    to->type = T_INT;    to->subtype = NUMBER_NUMBER;    to->u.integer = 0;    }   #if 0 && defined (COMPILER_DEBUG)    safe_pike_fprintf (stderr, "low_program_index_no_free2 %O->%S: %O\n",    what, s, to);
pike.git/src/program.c:6542:    struct identifier *id;    int parent_identifier = -1;       if (what->type == T_PROGRAM) {    p = what->u.program;    } else if ((what->type == T_FUNCTION) &&    (what->subtype != FUNCTION_BUILTIN) &&    ((parent = what->u.object)->prog) &&    IDENTIFIER_IS_CONSTANT((id = ID_FROM_INT(parent->prog,    what->subtype))->identifier_flags) && -  (id->func.offset != -1) && -  ((sub = &PROG_FROM_INT(parent->prog, what->subtype)->constants[id->func.offset].sval)->type == T_PROGRAM)) { +  (id->func.const_info.offset != -1) && +  ((sub = &PROG_FROM_INT(parent->prog, what->subtype)-> +  constants[id->func.const_info.offset].sval)->type == T_PROGRAM)) {    p = sub->u.program;    parent_identifier = what->subtype;    } else {    /* Not a program. */    return 0;    }    if (ind->type != T_STRING) {    Pike_error("Can't index a program with a %s (expected string)\n",    get_name_of_type(ind->type));    }
pike.git/src/program.c:10646:    if(!IDENTIFIER_IS_ALIAS(id->identifier_flags)) break;       loc.o = o;    loc.inherit = INHERIT_FROM_INT(p, i);    loc.parent_identifier = i;    find_external_context(&loc, id->func.ext_ref.depth);    i = id->func.ext_ref.id + loc.inherit->identifier_level;    o = loc.o;    }    if(!IDENTIFIER_IS_CONSTANT(id->identifier_flags)) return 0; -  if(id->func.offset==-1) return 0; -  f = &PROG_FROM_INT(p,i)->constants[id->func.offset].sval; +  if(id->func.const_info.offset==-1) return 0; +  f = &PROG_FROM_INT(p,i)->constants[id->func.const_info.offset].sval;    if(f->type!=T_PROGRAM) return 0;    return f->u.program;   }      PMOD_EXPORT struct program *program_from_function(const struct svalue *f)   {    if(f->type != T_FUNCTION) return 0;    if(f->subtype == FUNCTION_BUILTIN) return 0;    return low_program_from_function(f->u.object, f->subtype);   }