pike.git / src / interpret_functions.h

version» Context lines:

pike.git/src/interpret_functions.h:1:   /* -  * $Id: interpret_functions.h,v 1.78 2001/07/18 11:36:01 grubba Exp $ +  * $Id: interpret_functions.h,v 1.79 2001/07/18 17:42:36 grubba Exp $    *    * Opcode definitions for the interpreter.    */      #include "global.h"      #undef CJUMP   #undef AUTO_BIGNUM_LOOP_TEST   #undef LOOP   #undef COMPARISON
pike.git/src/interpret_functions.h:96:    * without do{}while() can be hazardous to your health.    * However, in this case it is required to handle break    * properly. -Hubbe    */   #undef DO_DUMB_RETURN   #define DO_DUMB_RETURN { \    if(Pike_fp -> flags & PIKE_FRAME_RETURN_INTERNAL) \    { \    int f=Pike_fp->flags; \    low_return(); \ +  if (t_flag) \ +  fprintf(stderr, "Returning to 0x%p\n", \ +  Pike_fp->pc); \    SET_PROG_COUNTER(Pike_fp->pc); \    FETCH; \    if(f & PIKE_FRAME_RETURN_POP) \    pop_stack(); \    DONE; \    } \ -  +  if (t_flag) \ +  fprintf(stderr, "Inter return\n"); \    INTER_RETURN; \   }      #undef DO_RETURN   #ifndef PIKE_DEBUG   #define DO_RETURN DO_DUMB_RETURN   #else   #define DO_RETURN { \    if(d_flag>3) do_gc(); \    if(d_flag>4) do_debug(); \
pike.git/src/interpret_functions.h:217:    index_no_free(&tmp, Pike_sp-1, &tmp2);    }    free_svalue(Pike_sp-1);    Pike_sp[-1] = tmp;    print_return_value();   });      OPCODE0(F_FLOAT, "push float", {    /* FIXME, this opcode uses 'PROG_COUNTER' which is not allowed.. */    MEMCPY((void *)&Pike_sp->u.float_number, PROG_COUNTER, sizeof(FLOAT_TYPE)); -  SET_PROG_COUNTER(PROG_COUNTER + -  DO_IF_ELSE_COMPUTED_GOTO(1, sizeof(FLOAT_TYPE))); +  SET_PROG_COUNTER((PIKE_OPCODE_T *)(((FLOAT_TYPE *)PROG_COUNTER) + 1));    FETCH;    Pike_sp->type=PIKE_T_FLOAT;    Pike_sp++;   });      OPCODE1(F_LFUN, "local function", {    Pike_sp->u.object=Pike_fp->current_object;    add_ref(Pike_fp->current_object);    Pike_sp->subtype=arg1+Pike_fp->context.identifier_level;    Pike_sp->type=PIKE_T_FUNCTION;
pike.git/src/interpret_functions.h:1082:    pop_n_elems(2);    SKIPJUMP();    }else{    pop_n_elems(2);    push_int(0);    DOJUMP();    }   });      OPCODE0_JUMP(F_CATCH, "catch", { -  switch (o_catch(PROG_COUNTER+DO_IF_ELSE_COMPUTED_GOTO(1, sizeof(INT32)))) +  switch (o_catch((PIKE_OPCODE_T *)(((INT32 *)PROG_COUNTER)+1)))    {    case 1:    /* There was a return inside the evaluated code */    DO_DUMB_RETURN;    case 2:    SET_PROG_COUNTER(Pike_fp->pc);    break;    default:    SET_PROG_COUNTER(PROG_COUNTER + GET_JUMP());    }
pike.git/src/interpret_functions.h:1856:      /* Assume that the number of arguments is correct */   OPCODE1_JUMP(F_COND_RECUR, "recur if not overloaded", {    /* FIXME:    * this test should actually test if this function is    * overloaded or not. Currently it only tests if    * this context is inherited or not.    */    if(Pike_fp->current_object->prog != Pike_fp->context.prog)    { -  SET_PROG_COUNTER(PROG_COUNTER + -  DO_IF_ELSE_COMPUTED_GOTO(1, sizeof(INT32))); +  SET_PROG_COUNTER((PIKE_OPCODE_T *)(((INT32 *)PROG_COUNTER) + 1));    if(low_mega_apply(APPLY_LOW,    DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)),    Pike_fp->current_object,    (void *)(arg1+Pike_fp->context.identifier_level)))    {    Pike_fp->next->pc=PROG_COUNTER;    SET_PROG_COUNTER(Pike_fp->pc);    FETCH;    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL;    } else {
pike.git/src/interpret_functions.h:1899:    new_frame->next=Pike_fp;       new_frame->save_sp = new_frame->expendible =    new_frame->locals = *--Pike_mark_sp;    new_frame->num_args = new_frame->args =    DO_NOT_WARN((INT32)(Pike_sp - new_frame->locals));    new_frame->save_mark_sp = Pike_mark_sp;    new_frame->mark_sp_base = Pike_mark_sp;       addr = PROG_COUNTER+GET_JUMP(); -  new_frame->num_locals = -  DO_IF_ELSE_COMPUTED_GOTO((ptrdiff_t)addr[-2], -  EXTRACT_UCHAR(addr-2)); +  new_frame->num_locals = (ptrdiff_t)addr[-2];       DO_IF_DEBUG({ -  if(new_frame->num_args != -  DO_IF_ELSE_COMPUTED_GOTO((ptrdiff_t)addr[-1], -  EXTRACT_UCHAR(addr-1))) +  if(new_frame->num_args != (ptrdiff_t)addr[-1])    fatal("Wrong number of arguments in F_RECUR %d!=%d\n",    new_frame->num_args, -  DO_IF_ELSE_COMPUTED_GOTO((ptrdiff_t)addr[-1], -  EXTRACT_UCHAR(addr-1))); +  (ptrdiff_t)addr[-1]);       if(t_flag > 3)    fprintf(stderr,"- Allocating %d extra locals.\n",    new_frame->num_locals - new_frame->num_args);    });    -  Pike_fp->pc = PROG_COUNTER + DO_IF_ELSE_COMPUTED_GOTO(1, sizeof(INT32)); +  Pike_fp->pc = (PIKE_OPCODE_T *)(((INT32 *)PROG_COUNTER) + 1);    SET_PROG_COUNTER(addr);    FETCH;       clear_svalues(Pike_sp, new_frame->num_locals - new_frame->num_args);    Pike_sp += new_frame->num_locals - new_frame->args;       if(new_frame->scope) add_ref(new_frame->scope);    add_ref(new_frame->current_object);    add_ref(new_frame->context.prog);    if(new_frame->context.parent)
pike.git/src/interpret_functions.h:1957:    new_frame->next=Pike_fp;       new_frame->save_sp = new_frame->expendible =    new_frame->locals = *--Pike_mark_sp;    new_frame->num_args = new_frame->args =    DO_NOT_WARN((INT32)(Pike_sp - new_frame->locals));    new_frame->save_mark_sp = Pike_mark_sp;    new_frame->mark_sp_base = Pike_mark_sp;       addr = PROG_COUNTER+GET_JUMP(); -  new_frame->num_locals = -  DO_IF_ELSE_COMPUTED_GOTO((ptrdiff_t)addr[-2], -  EXTRACT_UCHAR(addr-2)); +  new_frame->num_locals = (ptrdiff_t)addr[-2];       DO_IF_DEBUG({    if(new_frame->num_args != (ptrdiff_t)addr[-1])    fatal("Wrong number of arguments in F_RECUR %d!=%d\n",    new_frame->num_args, -  DO_IF_ELSE_COMPUTED_GOTO((ptrdiff_t)addr[-1], -  EXTRACT_UCHAR(addr-1))); +  (ptrdiff_t)addr[-1]);       if(t_flag > 3)    fprintf(stderr,"- Allocating %d extra locals.\n",    new_frame->num_locals - new_frame->num_args);    });       Pike_fp->pc = (PIKE_OPCODE_T *)(((INT32 *)PROG_COUNTER) + 1);    SET_PROG_COUNTER(addr);    FETCH;