pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:2246:   #endif /* PROFILING */   }      static void restore_catching_eval_jmpbuf (LOW_JMP_BUF *p)   {    Pike_interpreter.catching_eval_jmpbuf = p;   }      PMOD_EXPORT void mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2)   { -  /* Save and clear Pike_interpreter.catching_eval_jmpbuf so that the -  * following eval_instruction will install a LOW_JMP_BUF of its -  * own to handle catches. */ -  LOW_JMP_BUF *saved_jmpbuf = Pike_interpreter.catching_eval_jmpbuf; -  ONERROR uwp, fwp; +     struct pike_frame *frame = frame_init();    -  Pike_interpreter.catching_eval_jmpbuf = NULL; -  SET_ONERROR (uwp, restore_catching_eval_jmpbuf, saved_jmpbuf); -  +     /* The C stack margin is normally 8 kb, but if we get here during a    * lowered margin then don't fail just because of that, unless it's    * practically zero. */    check_c_stack(Pike_interpreter.c_stack_margin ?    Pike_interpreter.c_stack_margin : 100);          switch (type) {    case APPLY_STACK:    frame_setup_from_svalue(frame, Pike_sp-args);
pike.git/src/interpret.c:2285:    frame_execute(frame);    break;    case APPLY_LOW:    frame_setup_from_fun(frame, arg1, PTR_TO_INT(arg2));    frame_prepare(frame, args);    frame_execute(frame);    break;    }       frame_return_and_unlink(Pike_fp); -  -  CALL_AND_UNSET_ONERROR(uwp); +    }      PMOD_EXPORT void mega_apply_low(INT32 args, void *arg1, ptrdiff_t arg2)   { -  /* Save and clear Pike_interpreter.catching_eval_jmpbuf so that the -  * following eval_instruction will install a LOW_JMP_BUF of its -  * own to handle catches. */ -  LOW_JMP_BUF *saved_jmpbuf = Pike_interpreter.catching_eval_jmpbuf; -  ONERROR uwp; +     struct pike_frame *frame = frame_init(); -  Pike_interpreter.catching_eval_jmpbuf = NULL; -  SET_ONERROR (uwp, restore_catching_eval_jmpbuf, saved_jmpbuf); +        /* The C stack margin is normally 8 kb, but if we get here during a    * lowered margin then don't fail just because of that, unless it's    * practically zero. */    check_c_stack(Pike_interpreter.c_stack_margin ?    Pike_interpreter.c_stack_margin : 100);       frame_setup_from_fun(frame, arg1, PTR_TO_INT(arg2));    frame_prepare(frame, args);    frame_execute(frame);    frame_return_and_unlink(Pike_fp); -  -  CALL_AND_UNSET_ONERROR(uwp); +    }      /* 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)   {    LOW_JMP_BUF jmpbuf;   #ifdef PIKE_DEBUG    if (Pike_interpreter.catching_eval_jmpbuf)
pike.git/src/interpret.c:3591:       switch (type) {    case FRAME_EFUN:    case FRAME_C_FUNCTION: {    void (*fun)(INT32) = frame->ptr;    fun(frame->num_args);    break;    }    case FRAME_PIKE_FUNCTION: {    /* we could use frame->ptr just aswell here. */ +  /* Save and clear Pike_interpreter.catching_eval_jmpbuf so that the +  * following eval_instruction will install a LOW_JMP_BUF of its +  * own to handle catches. */ +  LOW_JMP_BUF *saved_jmpbuf = Pike_interpreter.catching_eval_jmpbuf; +  ONERROR uwp; +     PIKE_OPCODE_T *pc = frame->pc; -  +  +  Pike_interpreter.catching_eval_jmpbuf = NULL; +  SET_ONERROR (uwp, restore_catching_eval_jmpbuf, saved_jmpbuf); +     eval_instruction(pc   #ifdef ENTRY_PROLOGUE_SIZE    - ENTRY_PROLOGUE_SIZE   #endif /* ENTRY_PROLOGUE_SIZE */    );    -  +  CALL_AND_UNSET_ONERROR(uwp); +     break;    }    case FRAME_PARENT_CLONE: {    struct program *p = frame->ptr;    struct object *parent = frame->current_object;    push_object(parent_clone_object(p, parent, frame->fun, frame->num_args));    break;    }    case FRAME_CLONE: {    struct program *p = frame->ptr;