pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:3336:       case IDENTIFIER_CONSTANT:    {    struct svalue *s=&(context->prog->    constants[function->func.const_info.offset].sval);    debug_malloc_touch(Pike_fp);    if(TYPEOF(*s) == T_PROGRAM)    {    c->type = CALLTYPE_PARENT_CLONE;    c->ptr = s->u.program; -  /* this case needs a frame, too */ -  break; -  } -  callsite_resolve_svalue(c, s); +  c->u.parent_clone.parent = o; +  c->u.parent_clone.fun = fun; +  } else callsite_resolve_svalue(c, s);    return;    }       case IDENTIFIER_VARIABLE:    {    struct svalue *save_sp = c->retval;       if(Pike_sp-save_sp-args<=0)    {    /* Create an extra svalue for tail recursion style call */
pike.git/src/interpret.c:3396:    callsite_resolve_fun(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 and CALLTYPE_PARENT_CLONE. +  * CALLTYPE_CFUN, CALLTYPE_PIKEFUN.    */       struct pike_frame *frame = c->frame;       if (LIKELY(!frame) || c->type != CALLTYPE_PIKEFUN) {    add_ref(o);    add_ref(p);    frame = alloc_pike_frame();       /* link new frame */
pike.git/src/interpret.c:3501:    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:    c->type = CALLTYPE_CAST;    c->ptr = s->u.type; +  c->u.cast.run_time_type = compile_type_to_runtime_type(c->ptr);    break;    case T_PROGRAM:    c->type = CALLTYPE_CLONE;    c->ptr = s->u.program;    break;    case T_OBJECT:    callsite_resolve_lfun(c, s->u.object, LFUN_CALL);    return;    }    if (PIKE_NEEDS_TRACE())
pike.git/src/interpret.c:3624:    case CALLTYPE_PIKEFUN:    {    PIKE_OPCODE_T *pc = c->ptr;   #ifdef ENTRY_PROLOGUE_SIZE    pc -= ENTRY_PROLOGUE_SIZE;   #endif    eval_instruction(pc);    }    goto do_return;    case CALLTYPE_CAST: -  o_cast(c->ptr, compile_type_to_runtime_type(c->ptr)); +  o_cast(c->ptr, c->u.cast.run_time_type);    break;    case CALLTYPE_ARRAY:    case CALLTYPE_ARRAY_ON_STACK:    apply_array(c->ptr, c->args, c->type == CALLTYPE_ARRAY_ON_STACK);    break;    case CALLTYPE_CLONE:    push_object(clone_object(c->ptr, c->args));    break;    case CALLTYPE_PARENT_CLONE:    {    struct object *tmp;    tmp=parent_clone_object(c->ptr, -  c->frame->current_object, -  c->frame->fun, +  c->u.parent_clone.parent, +  c->u.parent_clone.fun,    c->args);    push_object(tmp);    }    break;    }       if (LIKELY(c->retval+1 == Pike_sp)) return;   do_return:    callsite_return_slowpath(c);   }      PMOD_EXPORT void callsite_save_jmpbuf(struct pike_callsite *c) {   #ifdef PIKE_DEBUG    if (c->type != CALLTYPE_PIKEFUN)    Pike_fatal("callsite_save_jmpbuf called for non pike frame.\n");   #endif    -  c->saved_jmpbuf = Pike_interpreter.catching_eval_jmpbuf; -  SET_ONERROR (c->onerror, restore_catching_eval_jmpbuf, c->saved_jmpbuf); +  c->u.pike.saved_jmpbuf = Pike_interpreter.catching_eval_jmpbuf; +  SET_ONERROR (c->u.pike.onerror, restore_catching_eval_jmpbuf, c->u.pike.saved_jmpbuf);    Pike_interpreter.catching_eval_jmpbuf = NULL;   }      PMOD_EXPORT void callsite_free_frame(const struct pike_callsite *c) {    struct pike_frame *frame = c->frame;    INT32 refs;      #ifdef PIKE_DEBUG    if (!frame)    Pike_fatal("callsite_free_frame called without frame.\n");
pike.git/src/interpret.c:3693:    ptrdiff_t needs_retval = !(frame->flags & PIKE_FRAME_RETURN_POP);       if (c->retval + needs_retval < Pike_sp)    pike_pop_locals(c->retval, needs_retval);    }       if (c->type != CALLTYPE_PIKEFUN) return;       /* restore catching_eval_jmpbuf */    -  Pike_interpreter.catching_eval_jmpbuf = c->saved_jmpbuf; -  UNSET_ONERROR(c->onerror); +  Pike_interpreter.catching_eval_jmpbuf = c->u.pike.saved_jmpbuf; +  UNSET_ONERROR(c->u.pike.onerror);   }      static void callsite_return_slowpath(const struct pike_callsite *c) {    const struct svalue *sp = Pike_sp;    struct svalue *save_sp = c->retval;    struct pike_frame *frame = c->frame;    ptrdiff_t needs_retval = (c->type != CALLTYPE_PIKEFUN || !(frame->flags & PIKE_FRAME_RETURN_POP));      #ifdef PIKE_DEBUG    if(Pike_mark_sp < Pike_fp->save_mark_sp)