Branch: Tag:

2017-03-19

2017-03-19 15:41:09 by Arne Goedeke <el@laramies.com>

Interpreter: merge callsite_execute and callsite_return

2080:    /* This is only needed for pike functions right now:    * callsite_prepare(&C); */    callsite_execute(&C); -  callsite_return(&C); +     callsite_free(&C);    return NULL;   }
2135:    }       callsite_execute(&C); -  callsite_return(&C); +     callsite_free(&C);       return NULL;
2185:       callsite_prepare(&C);    callsite_execute(&C); -  callsite_return(&C); +     callsite_free(&C);       return NULL;
2213:       callsite_prepare(&C);    callsite_execute(&C); -  callsite_return(&C); +     callsite_free(&C);       return NULL;
2772:    callsite_resolve_svalue(&C, s);    callsite_prepare(&C);    callsite_execute(&C); -  callsite_return(&C); +     callsite_free(&C);       /* Note: do we still need those? I guess callsite_return takes care
3567:    pike_pop_locals(c->retval, c->args);   }    + static void callsite_return_slowpath(const struct pike_callsite *c); +    PMOD_EXPORT void callsite_execute(const struct pike_callsite *c) {    FAST_CHECK_THREADS_ON_CALL();    switch (c->type) {
3575: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG    Pike_fatal("Unknown callsite type: %d\n", c->type);   #endif -  break; +  UNREACHABLE(break);    case CALLTYPE_EFUN:    case CALLTYPE_CFUN:    {
3591:   #endif    eval_instruction(pc);    } -  break; +  goto do_return;    case CALLTYPE_CAST:    o_cast(c->ptr, compile_type_to_runtime_type(c->ptr));    break;
3613:    }    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) {
3662:    UNSET_ONERROR(c->onerror);   }    - PMOD_EXPORT void callsite_return_slowpath(const struct pike_callsite *c) { + 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;