pike.git / src / interpret_functions.h

version» Context lines:

pike.git/src/interpret_functions.h:1:   /* -  * $Id: interpret_functions.h,v 1.57 2001/06/07 21:46:13 hubbe Exp $ +  * $Id: interpret_functions.h,v 1.58 2001/06/10 00:24:17 grubba Exp $    *    * Opcode definitions for the interpreter.    */      OPCODE0(F_UNDEFINED,"push UNDEFINED")    push_int(0);    Pike_sp[-1].subtype=NUMBER_UNDEFINED;   BREAK;      OPCODE0(F_CONST0, "push 0")
pike.git/src/interpret_functions.h:663:   OPCODE0(F_ASSIGN, "assign")    assign_lvalue(Pike_sp-3,Pike_sp-1);    free_svalue(Pike_sp-3);    free_svalue(Pike_sp-2);    Pike_sp[-3]=Pike_sp[-1];    Pike_sp-=2;   BREAK;      OPCODE2(F_APPLY_ASSIGN_LOCAL_AND_POP,"apply, assign local and pop")    apply_svalue(&((Pike_fp->context.prog->constants + arg1)->sval), -  DO_NOT_WARN(Pike_sp - *--Pike_mark_sp)); +  DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)));    free_svalue(Pike_fp->locals+arg2);    Pike_fp->locals[arg2]=Pike_sp[-1];    Pike_sp--;   BREAK;      OPCODE2(F_APPLY_ASSIGN_LOCAL,"apply, assign local")    apply_svalue(&((Pike_fp->context.prog->constants + arg1)->sval), -  DO_NOT_WARN(Pike_sp - *--Pike_mark_sp)); +  DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)));    assign_svalue(Pike_fp->locals+arg2, Pike_sp-1);   BREAK;      OPCODE0(F_ASSIGN_AND_POP, "assign and pop")    assign_lvalue(Pike_sp-3, Pike_sp-1);    pop_n_elems(3);   BREAK;      OPCODE1(F_ASSIGN_LOCAL_AND_POP, "assign local and pop")    free_svalue(Pike_fp->locals + arg1);
pike.git/src/interpret_functions.h:947:   OPCODE0(F_THROW_ZERO, "throw(0)")    push_int(0);    f_throw(1);   BREAK;      OPCODE1(F_SWITCH, "switch")   {    INT32 tmp;    tmp=switch_lookup(Pike_fp->context.prog->    constants[arg1].sval.u.array,Pike_sp-1); -  pc=(unsigned char *)DO_ALIGN(pc,sizeof(INT32)); +  pc=(unsigned char *)DO_ALIGN(pc,((ptrdiff_t)sizeof(INT32)));    pc+=(tmp>=0 ? 1+tmp*2 : 2*~tmp) * sizeof(INT32);    if(*(INT32*)pc < 0) fast_check_threads_etc(7);    pc+=*(INT32*)pc;    pop_stack();   }   BREAK;      OPCODE1(F_SWITCH_ON_INDEX, "switch on index")   {    INT32 tmp;    struct svalue s;    index_no_free(&s,Pike_sp-2,Pike_sp-1);    Pike_sp++[0]=s;       tmp=switch_lookup(Pike_fp->context.prog->    constants[arg1].sval.u.array,Pike_sp-1);    pop_n_elems(3); -  pc=(unsigned char *)DO_ALIGN(pc,sizeof(INT32)); +  pc=(unsigned char *)DO_ALIGN(pc,((ptrdiff_t)sizeof(INT32)));    pc+=(tmp>=0 ? 1+tmp*2 : 2*~tmp) * sizeof(INT32);    if(*(INT32*)pc < 0) fast_check_threads_etc(7);    pc+=*(INT32*)pc;   }   BREAK;      OPCODE2(F_SWITCH_ON_LOCAL, "switch on local")   {    INT32 tmp;    tmp=switch_lookup(Pike_fp->context.prog->    constants[arg2].sval.u.array,Pike_fp->locals + arg1); -  pc=(unsigned char *)DO_ALIGN(pc,sizeof(INT32)); +  pc=(unsigned char *)DO_ALIGN(pc,((ptrdiff_t)sizeof(INT32)));    pc+=(tmp>=0 ? 1+tmp*2 : 2*~tmp) * sizeof(INT32);    if(*(INT32*)pc < 0) fast_check_threads_etc(7);    pc+=*(INT32*)pc;   }   BREAK;          /* FIXME: Does this need bignum tests? /Fixed - Hubbe */    /* LOOP(OPCODE, INCREMENT, OPERATOR, IS_OPERATOR) */    LOOP(F_INC_LOOP, 1, <, is_lt);
pike.git/src/interpret_functions.h:1381:    print_return_value();   }   BREAK;       CASE(F_POS_INT_INDEX);    push_int(GET_ARG());    print_return_value();    goto do_index;       CASE(F_NEG_INT_INDEX); -  push_int(-GET_ARG()); +  push_int(-(ptrdiff_t)GET_ARG());    print_return_value();       CASE(F_INDEX);    do_index:    {    struct svalue s;    index_no_free(&s,Pike_sp-2,Pike_sp-1);    pop_n_elems(2);    *Pike_sp=s;    Pike_sp++;
pike.git/src/interpret_functions.h:1521:   OPCODE1(F_SIZEOF_LOCAL, "sizeof local")    push_int(pike_sizeof(Pike_fp->locals+arg1));   BREAK;      OPCODE1(F_SSCANF, "sscanf")    o_sscanf(arg1);   BREAK;      OPCODE1(F_CALL_LFUN,"call lfun")    if(low_mega_apply(APPLY_LOW, -  DO_NOT_WARN(Pike_sp - *--Pike_mark_sp), +  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;    }   BREAK;      OPCODE1(F_CALL_LFUN_AND_POP,"call lfun & pop")   #if 0    apply_low(Pike_fp->current_object,    arg1+Pike_fp->context.identifier_level,    DO_NOT_WARN(Pike_sp - *--Pike_mark_sp));    pop_stack();   #else    if(low_mega_apply(APPLY_LOW, -  DO_NOT_WARN(Pike_sp - *--Pike_mark_sp), +  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 | PIKE_FRAME_RETURN_POP;    pc=Pike_fp->pc;    }else{    pop_stack();    }   #endif
pike.git/src/interpret_functions.h:1578:    Pike_fp->next->pc=pc;    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL | PIKE_FRAME_RETURN_POP;    pc=Pike_fp->pc;    }else{    pop_stack();    }   BREAK;      OPCODE1(F_APPLY,"apply")    if(low_mega_apply(APPLY_SVALUE_STRICT, -  DO_NOT_WARN(Pike_sp - *--Pike_mark_sp ), +  DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)),    &((Pike_fp->context.prog->constants + arg1)->sval),0))    {    Pike_fp->next->pc=pc;    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL;    pc=Pike_fp->pc;    }   BREAK;         OPCODE1(F_APPLY_AND_POP,"apply")    if(low_mega_apply(APPLY_SVALUE_STRICT, -  DO_NOT_WARN(Pike_sp - *--Pike_mark_sp ), +  DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)),    &((Pike_fp->context.prog->constants + arg1)->sval),0))    {    Pike_fp->next->pc=pc;    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL | PIKE_FRAME_RETURN_POP;    pc=Pike_fp->pc;    }else{    pop_stack();    }   BREAK;         OPCODE0(F_CALL_FUNCTION,"call function")    if(low_mega_apply(APPLY_STACK, -  DO_NOT_WARN(Pike_sp - *--Pike_mark_sp ), +  DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)),    0,0))    {    Pike_fp->next->pc=pc;    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL;    pc=Pike_fp->pc;    }   BREAK;         OPCODE0(F_CALL_FUNCTION_AND_POP,"call function & pop")    if(low_mega_apply(APPLY_STACK, -  DO_NOT_WARN(Pike_sp - *--Pike_mark_sp ), +  DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)),    0,0))    {    Pike_fp->next->pc=pc;    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL | PIKE_FRAME_RETURN_POP;    pc=Pike_fp->pc;    }else{    pop_stack();    }   BREAK;      OPCODE1(F_APPLY_AND_RETURN,"apply & return")   {    if(low_mega_apply(APPLY_SVALUE, -  DO_NOT_WARN(Pike_sp - *--Pike_mark_sp ), +  DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)),    &((Pike_fp->context.prog->constants + arg1)->sval),0))    {   #ifdef PIKE_DEBUG    Pike_fp->next->pc=0;   #endif    pc=Pike_fp->pc;    unlink_previous_frame();    }else{    goto do_dumb_return;    }   }   BREAK;      OPCODE1(F_CALL_LFUN_AND_RETURN,"call lfun & return")   {    if(low_mega_apply(APPLY_LOW, -  DO_NOT_WARN(Pike_sp - *--Pike_mark_sp), +  DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)),    Pike_fp->current_object,    (void *)(arg1+Pike_fp->context.identifier_level)))    {   #ifdef PIKE_DEBUG    Pike_fp->next->pc=0;   #endif    pc=Pike_fp->pc;    unlink_previous_frame();    }else{    goto do_dumb_return;    }   }   BREAK      OPCODE0(F_CALL_FUNCTION_AND_RETURN, "call function & return")   {    if(low_mega_apply(APPLY_STACK, -  DO_NOT_WARN(Pike_sp - *--Pike_mark_sp ), +  DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)),    0,0))    {   #ifdef PIKE_DEBUG    Pike_fp->next->pc=0;   #endif    pc=Pike_fp->pc;    unlink_previous_frame();    }else{    goto do_dumb_return;    }
pike.git/src/interpret_functions.h:1691:   {    /* 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);    if(low_mega_apply(APPLY_LOW, -  DO_NOT_WARN(Pike_sp - *--Pike_mark_sp), +  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;    }   }
pike.git/src/interpret_functions.h:1724:    check_c_stack(8192);    check_stack(256);       new_frame=alloc_pike_frame();    new_frame[0]=Pike_fp[0];       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(Pike_sp - new_frame->locals); +  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);      #ifdef PIKE_DEBUG    if(new_frame->num_args != EXTRACT_UCHAR(addr-1))    fatal("Wrong number of arguments in F_RECUR %d!=%d\n",    new_frame->num_args, EXTRACT_UCHAR(addr-1));
pike.git/src/interpret_functions.h:1765:   }   BREAK      /* 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;    unsigned char *addr; -  int args = DO_NOT_WARN(Pike_sp - *--Pike_mark_sp); +  INT32 args = DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp));       fast_check_threads_etc(6);       addr=pc+GET_JUMP();    num_locals=EXTRACT_UCHAR(addr-2);         #ifdef PIKE_DEBUG    if(args != EXTRACT_UCHAR(addr-1))    fatal("Wrong number of arguments in F_TAIL_RECUR %d != %d\n",