pike.git / src / docode.c

version» Context lines:

pike.git/src/docode.c:264:   #endif    switch(x)    {    case 0: return;    case 1: emit0(F_POP_VALUE); break;    default: emit1(F_POP_N_ELEMS,x); break;    }    current_stack_depth -= x;   }    - static void do_pop_mark(void *ignored) + static void do_pop_mark(void *UNUSED(ignored))   {    struct compilation *c = THIS_COMPILATION;    emit0(F_POP_MARK);   }    - static void do_pop_to_mark(void *ignored) + static void do_pop_to_mark(void *UNUSED(ignored))   {    struct compilation *c = THIS_COMPILATION;    emit0(F_POP_TO_MARK);   }      #ifdef PIKE_DEBUG   static void do_cleanup_synch_mark(void)   {    struct compilation *c = THIS_COMPILATION;    if (d_flag > 2)
pike.git/src/docode.c:608:    default:    my_yyerror("docode: Failed to make svalue for builtin %s",func);    }    free_node(n);   }      static void emit_range (node *n DO_IF_DEBUG (COMMA int num_args))   {    struct compilation *c = THIS_COMPILATION;    node *low = CADR (n), *high = CDDR (n); -  int bound_types; /* Got bogus gcc warning here. */ +  int bound_types = 0; /* Got bogus gcc warning here. */       switch (low->token) {    case F_RANGE_FROM_BEG: bound_types = RANGE_LOW_FROM_BEG; break;    case F_RANGE_FROM_END: bound_types = RANGE_LOW_FROM_END; break;    case F_RANGE_OPEN: bound_types = RANGE_LOW_OPEN; break;   #ifdef PIKE_DEBUG    default:    Pike_fatal ("Unexpected node %d as range lower bound.\n", low->token);   #endif    }
pike.git/src/docode.c:911:    } else {    /* FIXME: Support inlining for the parent case.    *    * do_call_external(n->u.integer.a, f + inh->identifier_level,    * NULL);    */    emit2(F_EXTERNAL, n->u.integer.b, level);    }    } else if (level) {    if (IDENTIFIER_IS_CONSTANT(id->identifier_flags) && -  (ref->id_flags & ID_INLINE) && !ref->inherit_offset && +  (ref->id_flags & ID_INLINE) &&    (id->func.const_info.offset >= 0)) {    /* An inline, local or final constant identifier in    * a lexically surrounding (aka parent) class.    * Avoid vtable traversal during runtime by moving    * the constant to this class.    */    struct svalue *s = &state->new_program-> -  +  inherits[ref->inherit_offset].prog->    constants[id->func.const_info.offset].sval;    if (TYPEOF(*s) == T_PROGRAM &&    s->u.program->flags & PROGRAM_USES_PARENT) {    /* An external reference is required. */    emit2(F_EXTERNAL, n->u.integer.b, level);    } else {    int tmp1 = store_constant(s, 1, NULL);    emit1(F_CONSTANT, tmp1);    }    } else { -  +  struct program_state *state = Pike_compiler; +  int e; +  for (e = level; e; e--) { +  state->new_program->flags |= +  PROGRAM_USES_PARENT|PROGRAM_NEEDS_PARENT; +  state = state->previous; +  }    emit2(F_EXTERNAL, n->u.integer.b, level);    }    } else if (n->u.integer.b == IDREF_MAGIC_THIS) {    emit1(F_THIS_OBJECT, 0);    } else if(IDENTIFIER_IS_FUNCTION(id->identifier_flags) &&    id->identifier_flags & IDENTIFIER_HAS_BODY)    {    /* Only use this opcode when it's certain that the result    * can't zero, i.e. when we know the function isn't just a    * prototype. */