pike.git / src / interpret_functions.h

version» Context lines:

pike.git/src/interpret_functions.h:1:   /* -  * $Id: interpret_functions.h,v 1.72 2001/07/09 11:37:20 grubba Exp $ +  * $Id: interpret_functions.h,v 1.73 2001/07/09 16:25:27 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:126:    }    free_svalue(Pike_sp-1);    Pike_sp[-1] = tmp;    print_return_value();   });      OPCODE0(F_FLOAT, "push float", {    /* FIXME, this opcode uses 'pc' which is not allowed.. */    Pike_sp->type=PIKE_T_FLOAT;    MEMCPY((void *)&Pike_sp->u.float_number, pc, sizeof(FLOAT_TYPE)); -  pc+=sizeof(FLOAT_TYPE); +  pc += DO_IF_ELSE_COMPUTED_GOTO(1, sizeof(FLOAT_TYPE));    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_sp++;    print_return_value();
pike.git/src/interpret_functions.h:1087:    f_add(2); \    assign_lvalue(Pike_sp-3,Pike_sp-1); \    if(OP4 ( Pike_sp-1, Pike_sp-4 )) \    { \    DOJUMP(); \    }else{ \    SKIPJUMP(); \    } \    pop_stack(); \    } \ -  break; \ +     })      LOOP(F_INC_LOOP, "++Loop", 1, <, is_lt);   LOOP(F_DEC_LOOP, "--Loop", -1, >, is_gt);   LOOP(F_INC_NEQ_LOOP, "++Loop!=", 1, !=, !is_eq);   LOOP(F_DEC_NEQ_LOOP, "--Loop!=", -1, !=, !is_eq);      /* Use like:    *    * push(loopcnt)
pike.git/src/interpret_functions.h:1179:    }else{    push_svalue(Pike_fp->locals + val);    }    print_return_value();    goto do_dumb_return;    }       CASE(F_RETURN_IF_TRUE);    if(!IS_ZERO(Pike_sp-1)) goto do_return;    pop_stack(); -  break; +  DONE;       CASE(F_RETURN_1);    push_int(1);    goto do_return;       CASE(F_RETURN_0);    push_int(0);    goto do_return;       CASE(F_RETURN);
pike.git/src/interpret_functions.h:1774:      /* 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)    { -  pc += sizeof(INT32)/sizeof(PIKE_OPCODE_T); +  pc += DO_IF_ELSE_COMPUTED_GOTO(1, sizeof(INT32));    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=pc;    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL;    pc=Pike_fp->pc;    }    DONE;    }       /* FALL THROUGH */       /* Assume that the number of arguments is correct */    /* FIXME: Use new recursion stuff */    OPCODE0_TAILJUMP(F_RECUR, "recur", { -  +  instr = 0; +     OPCODE0_TAILJUMP(F_RECUR_AND_POP, "recur & pop", {    PIKE_OPCODE_T opcode = instr;    PIKE_OPCODE_T *addr;    struct pike_frame *new_frame;       fast_check_threads_etc(6);    check_c_stack(8192);    check_stack(256);       new_frame=alloc_pike_frame();
pike.git/src/interpret_functions.h:1814:    new_frame->refs=1;    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=pc+GET_JUMP(); -  new_frame->num_locals=EXTRACT_UCHAR(addr-2); +  addr = pc+GET_JUMP(); +  new_frame->num_locals = +  DO_IF_ELSE_COMPUTED_GOTO((ptrdiff_t)addr[-2], +  EXTRACT_UCHAR(addr-2));       DO_IF_DEBUG({ -  if(new_frame->num_args != EXTRACT_UCHAR(addr-1)) +  if(new_frame->num_args != +  DO_IF_ELSE_COMPUTED_GOTO((ptrdiff_t)addr[-1], +  EXTRACT_UCHAR(addr-1)))    fatal("Wrong number of arguments in F_RECUR %d!=%d\n", -  new_frame->num_args, EXTRACT_UCHAR(addr-1)); +  new_frame->num_args, +  DO_IF_ELSE_COMPUTED_GOTO((ptrdiff_t)addr[-1], +  EXTRACT_UCHAR(addr-1)));       if(t_flag > 3)    fprintf(stderr,"- Allocating %d extra locals.\n",    new_frame->num_locals - new_frame->num_args);    });       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)    add_ref(new_frame->context.parent); -  Pike_fp->pc=pc+sizeof(INT32); +  Pike_fp->pc = pc + DO_IF_ELSE_COMPUTED_GOTO(1, sizeof(INT32));    Pike_fp=new_frame;    pc=addr;    new_frame->flags=PIKE_FRAME_RETURN_INTERNAL; -  if (opcode == DO_IF_ELSE_COMPUTED_GOTO(&&LABEL_F_RECUR_AND_POP, -  F_RECUR_AND_POP-F_OFFSET)) +  if (opcode) { +  /* F_RECUR_AND_POP */    new_frame->flags|=PIKE_FRAME_RETURN_POP; -  +  }    });    });   });      /* Assume that the number of arguments is correct */   /* FIXME: adjust Pike_mark_sp */   OPCODE0_JUMP(F_TAIL_RECUR, "tail recursion", {    int x;    INT32 num_locals;    PIKE_OPCODE_T *addr;