pike.git / src / interpret_functions.h

version» Context lines:

pike.git/src/interpret_functions.h:1:   /* -  * $Id: interpret_functions.h,v 1.70 2001/07/06 22:56:56 grubba Exp $ +  * $Id: interpret_functions.h,v 1.71 2001/07/08 19:35:37 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:1104:    push_int(1);    if (!is_lt(sp-2, sp-1)) {    o_subtract();    DOJUMP();    } else {    pop_n_elems(2);    SKIPJUMP();    }   });    -  CASE(F_FOREACH) /* array, lvalue, X, i */ -  { + OPCODE0_JUMP(F_FOREACH, "foreach", { /* array, lvalue, X, i */    if(Pike_sp[-4].type != PIKE_T_ARRAY)    PIKE_ERROR("foreach", "Bad argument 1.\n", Pike_sp-3, 1);    if(Pike_sp[-1].u.integer < Pike_sp[-4].u.array->size)    {    fast_check_threads_etc(10); - #if 0 -  index_no_free(Pike_sp,Pike_sp-4,Pike_sp-1); -  Pike_sp++; -  assign_lvalue(Pike_sp-4, Pike_sp-1); -  free_svalue(Pike_sp-1); -  Pike_sp--; - #else +     if(Pike_sp[-1].u.integer < 0)    Pike_error("Foreach loop variable is negative!\n");    assign_lvalue(Pike_sp-3, Pike_sp[-4].u.array->item + Pike_sp[-1].u.integer); - #endif -  pc+=GET_JUMP(); +  pc += GET_JUMP();    Pike_sp[-1].u.integer++;    }else{ - #if 0 -  pop_n_elems(4); - #endif +     SKIPJUMP();    } -  break; -  } + });      OPCODE0(F_MAKE_ITERATOR, "Iterator", {    extern void f_Iterator(INT32);    f_Iterator(1);   });    -  -  CASE(F_NEW_FOREACH) /* iterator, lvalue, lvalue */ -  { + OPCODE0_JUMP(F_NEW_FOREACH, "foreach++", { /* iterator, lvalue, lvalue */    extern int foreach_iterate(struct object *o);       if(Pike_sp[-5].type != PIKE_T_OBJECT)    PIKE_ERROR("foreach", "Bad argument 1.\n", Pike_sp-3, 1);    if(foreach_iterate(Pike_sp[-5].u.object))    {    fast_check_threads_etc(10);    pc+=GET_JUMP();    }else{    SKIPJUMP();    } -  break; -  } + });          CASE(F_RETURN_LOCAL);    instr=GET_ARG();   #if defined(PIKE_DEBUG) && defined(GC2)    /* special case! Pike_interpreter.mark_stack may be invalid at the time we    * call return -1, so we must call the callbacks here to    * prevent false alarms! /Hubbe    */    if(d_flag>3) do_gc();
pike.git/src/interpret_functions.h:1208:       CASE(F_DUMB_RETURN);    do_dumb_return:    if(Pike_fp -> flags & PIKE_FRAME_RETURN_INTERNAL)    {    int f=Pike_fp->flags;    low_return();    if(f & PIKE_FRAME_RETURN_POP)    pop_stack();    pc=Pike_fp->pc; -  break; +  DONE;    }    return -1;      OPCODE0(F_NEGATE, "unary minus", {    if(Pike_sp[-1].type == PIKE_T_INT)    {    DO_IF_BIGNUM(    if(INT_TYPE_NEG_OVERFLOW(Pike_sp[-1].u.integer))    {    convert_stack_top_to_bignum();
pike.git/src/interpret_functions.h:1478:    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++;    }    print_return_value(); -  break; +  DONE;      OPCODE2(F_MAGIC_INDEX, "::`[]", {    push_magic_index(magic_index_program, arg2, arg1);   });      OPCODE2(F_MAGIC_SET_INDEX, "::`[]=", {    push_magic_index(magic_set_index_program, arg2, arg1);   });      OPCODE0(F_CAST, "cast", {