pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:2119:    scope->flags&=~PIKE_FRAME_MALLOCED_LOCALS;   #endif    }    really_free_pike_frame(scope);   }      void *lower_mega_apply( INT32 args, struct object *o, ptrdiff_t fun )   {    struct pike_callsite C;    callsite_init(&C, args); -  callsite_resolve_fun(&C, o, fun); +  callsite_resolve_identifier(&C, o, fun);    if (C.type == CALLTYPE_PIKEFUN) {    return C.ptr;    }    /* This is only needed for pike functions right now:    * callsite_prepare(&C); */    callsite_execute(&C);    callsite_free(&C);    return NULL;   }   
pike.git/src/interpret.c:2243:       if(Pike_sp != frame->locals + args)    pike_pop_locals(frame->locals, args);       callsite_init(&C, args);       if (!(frame->flags & PIKE_FRAME_NO_REUSE) && frame->refs == 1) {    C.frame = frame;    }    -  callsite_resolve_fun(&C, o, fun); +  callsite_resolve_identifier(&C, o, fun);       if (C.frame == frame) {    if (C.type == CALLTYPE_PIKEFUN) {    return C.ptr;    } else C.frame = NULL;    }       callsite_prepare(&C);    callsite_execute(&C);    callsite_free(&C);
pike.git/src/interpret.c:2345:    callsite_prepare(&C);    callsite_execute(&C);    callsite_free(&C);   }      PMOD_EXPORT void mega_apply_low(INT32 args, struct object *o, ptrdiff_t fun)   {    struct pike_callsite C;       callsite_init(&C, args); -  callsite_resolve_fun(&C, o, fun); +  callsite_resolve_identifier(&C, o, fun);    callsite_prepare(&C);    callsite_execute(&C);    callsite_free(&C);   }      /* Put catch outside of eval_instruction, so the setjmp won't affect    * the optimization of eval_instruction.    */   static int catching_eval_instruction (PIKE_OPCODE_T *pc)   {
pike.git/src/interpret.c:3244:    Pike_error("Attempt to call a mapping\n");    break;       default:    Pike_error("Call to non-function value type:%s.\n",    get_name_of_type(TYPEOF(*s)));    break;    }   }    - PMOD_EXPORT void callsite_resolve_fun(struct pike_callsite *c, struct object *o, INT16 fun) { + PMOD_EXPORT void callsite_resolve_identifier(struct pike_callsite *c, struct object *o, INT16 fun) {    struct program *p = o->prog;    struct inherit *context;    struct reference *ref;    struct identifier *function;    INT32 args = c->args;       if(UNLIKELY(!p))    PIKE_ERROR("destructed object->function",    "Cannot call functions in destructed objects.\n", Pike_sp, args);       if(UNLIKELY(!(p->flags & PROGRAM_PASS_1_DONE) || (p->flags & PROGRAM_AVOID_CHECK)))    PIKE_ERROR("__empty_program() -> function",    "Cannot call functions in unfinished objects.\n", Pike_sp, args);       if(UNLIKELY(p == pike_trampoline_program &&    fun == QUICK_FIND_LFUN(pike_trampoline_program, LFUN_CALL)))    {    struct pike_frame *scope = ((struct pike_trampoline *)(o->storage))->frame;    fun = ((struct pike_trampoline *)(o->storage))->func;    o = scope->current_object; -  callsite_resolve_fun(c, o, fun); +  callsite_resolve_identifier(c, o, fun);    c->frame->scope = scope;    add_ref(scope);    return;    }      #ifdef PIKE_DEBUG    if(fun>=(int)p->num_identifier_references)    {    fprintf(stderr, "Function index out of range. %ld >= %d\n",    (long)fun, (int)p->num_identifier_references);
pike.git/src/interpret.c:3365:    struct external_variable_context loc;    loc.o = o;    loc.inherit = INHERIT_FROM_INT(p, fun);    loc.parent_identifier = 0;    find_external_context(&loc, function->func.ext_ref.depth);    fun = function->func.ext_ref.id;    p = (o = loc.o)->prog;    function = ID_FROM_INT(p, fun);    } while (IDENTIFIER_IS_ALIAS(function->identifier_flags));    -  callsite_resolve_fun(c, o, fun); +  callsite_resolve_identifier(c, o, fun);    return;    }   #ifdef PIKE_DEBUG    Pike_fatal("Unknown identifier type.\n");   #endif    UNREACHABLE(break);    }    /*    * The cases which do _not_ return, have a frame created. These are:    * CALLTYPE_CFUN, CALLTYPE_PIKEFUN.
pike.git/src/interpret.c:3452:    Pike_fatal("Illegal lfun.\n");   #endif    if(UNLIKELY(!p))    PIKE_ERROR("destructed object", "Apply on destructed object.\n", Pike_sp, c->args);       int fun = FIND_LFUN(p, lfun);       if (UNLIKELY(fun < 0))    Pike_error ("Cannot call undefined lfun %s.\n", lfun_names[lfun]);    -  callsite_resolve_fun(c, o, fun); +  callsite_resolve_identifier(c, o, fun);   }      PMOD_EXPORT void callsite_resolve_svalue(struct pike_callsite *c, struct svalue *s) {    switch(TYPEOF(*s))    {    default:    callsite_svalue_error(c, s);    UNREACHABLE(break);    case T_FUNCTION:    if(SUBTYPEOF(*s) == FUNCTION_BUILTIN)    {    c->type = CALLTYPE_EFUN;    c->ptr = s->u.efun->function;    }else{ -  callsite_resolve_fun(c, s->u.object, SUBTYPEOF(*s)); +  callsite_resolve_identifier(c, s->u.object, SUBTYPEOF(*s));    return;    }    break;    case T_ARRAY:    c->type = (s >= Pike_interpreter.evaluator_stack && s < Pike_sp)    ? CALLTYPE_ARRAY_ON_STACK    : CALLTYPE_ARRAY;    c->ptr = s->u.array;    break;    case PIKE_T_TYPE: