pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:2741:    int id = find_identifier(fun, o->prog);    if (id >= 0)    apply_low(o, id, args);    else    Pike_error ("Cannot call unknown function \"%s\".\n", fun);   }         PMOD_EXPORT void apply_svalue(struct svalue *s, INT32 args)   { -  if(TYPEOF(*s) == T_INT) +  if(UNLIKELY(TYPEOF(*s) == T_INT))    {    pop_n_elems(args);    push_int(0);    }else{ -  ptrdiff_t expected_stack=Pike_sp-args+1 - Pike_interpreter.evaluator_stack; +     struct pike_callsite C;       callsite_init(&C, args);    callsite_resolve_svalue(&C, s);    callsite_prepare(&C);    callsite_execute(&C);    callsite_free(&C); -  -  /* Note: do we still need those? I guess callsite_return takes care -  * of this stuff */ -  if(Pike_sp > (expected_stack + Pike_interpreter.evaluator_stack)) -  { -  pop_n_elems(Pike_sp-(expected_stack + Pike_interpreter.evaluator_stack)); +     } -  else if(Pike_sp < (expected_stack + Pike_interpreter.evaluator_stack)) -  { -  push_int(0); +    } - #ifdef PIKE_DEBUG -  if(Pike_sp < (expected_stack + Pike_interpreter.evaluator_stack)) -  Pike_fatal("Stack underflow!\n"); - #endif -  } - } +       PMOD_EXPORT void safe_apply_svalue(struct svalue *s, int args, int handle_errors)   {    JMP_BUF recovery;    free_svalue(& throw_value);    mark_free_svalue (&throw_value);    if(SETJMP_SP(recovery, args))    {    if(handle_errors) call_handle_error();    push_int(0);