Branch: Tag:

2017-11-18

2017-11-18 10:14:46 by Arne Goedeke <el@laramies.com>

Interpreter: some refactoring and extra debug

2201:    /* We can reuse the current frame, so we set it into C here    * to allow callsite_resolve_* to pick it up    */ -  if (!(frame->flags & PIKE_FRAME_NO_REUSE) && frame->refs == 1) { +  if (frame_can_reuse(frame))    C.frame = frame; -  } +        switch (type) {    case APPLY_STACK:
2246:       callsite_init(&C, args);    -  if (!(frame->flags & PIKE_FRAME_NO_REUSE) && frame->refs == 1) { +  if (frame_can_reuse(frame))    C.frame = frame; -  } +        callsite_resolve_identifier(&C, o, fun);   
3403:    frame->current_object = o;    frame->current_program = p;    } else { + #ifdef PIKE_DEBUG +  if (!frame_can_reuse(frame)) +  Pike_error("Invalid frame reused in tailcall.\n"); + #endif    if (o != frame->current_object) {    free_object(frame->current_object);    add_ref(frame->current_object = o);