pike.git / src / interpret_functions.h

version» Context lines:

pike.git/src/interpret_functions.h:1:   /* -  * $Id: interpret_functions.h,v 1.14 2000/04/20 22:30:08 grubba Exp $ +  * $Id: interpret_functions.h,v 1.15 2000/04/21 00:29:48 hubbe 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:183:       if(!arg2) break;    --arg2;    }       low_object_index_no_free(Pike_sp,    o,    arg1 + inherit->identifier_level);    Pike_sp++;    print_return_value(); -  break; +    }   BREAK;      OPCODE2(F_EXTERNAL_LVALUE,"& external")   {    struct inherit *inherit;    struct program *p;    struct object *o;    INT32 i,id=arg1;   
pike.git/src/interpret_functions.h:228:    inherit=INHERIT_FROM_INT(p, i);       if(!arg2) break;    arg2--;    }       ref_push_object(o);    Pike_sp->type=T_LVALUE;    Pike_sp->u.integer=id + inherit->identifier_level;    Pike_sp++; -  break; +    } -  +    BREAK;      OPCODE1(F_MARK_AND_LOCAL, "mark & local")    *(Pike_mark_sp++) = Pike_sp;    assign_svalue_no_free(Pike_sp++, Pike_fp->locals + arg1);    print_return_value();   BREAK;      OPCODE1(F_LOCAL, "local")    assign_svalue_no_free(Pike_sp++, Pike_fp->locals + arg1);
pike.git/src/interpret_functions.h:305:   OPCODE2(F_LEXICAL_LOCAL,"lexical local")   {    struct pike_frame *f=Pike_fp;    while(arg2--)    {    f=f->scope;    if(!f) error("Lexical scope error.\n");    }    push_svalue(f->locals + arg1);    print_return_value(); -  break; +    }   BREAK;      OPCODE2(F_LEXICAL_LOCAL_LVALUE,"&lexical local")   {    struct pike_frame *f=Pike_fp;    while(arg2--)    {    f=f->scope;    if(!f) error("Lexical scope error.\n");    }    Pike_sp[0].type=T_LVALUE;    Pike_sp[0].u.lval=f->locals+arg1;    Pike_sp[1].type=T_VOID;    Pike_sp+=2; -  break; +    }   BREAK;      OPCODE1(F_ARRAY_LVALUE, "[ lvalues ]")    f_aggregate(arg1*2);    Pike_sp[-1].u.array->flags |= ARRAY_LVALUE;    Pike_sp[-1].u.array->type_field |= BIT_UNFINISHED | BIT_MIXED;    /* FIXME: Shouldn't a ref be added here? */    Pike_sp[0] = Pike_sp[-1];    Pike_sp[-1].type = T_ARRAY_LVALUE;    dmalloc_touch_svalue(Pike_sp);    Pike_sp++;   BREAK;      OPCODE1(F_CLEAR_2_LOCAL, "clear 2 local") -  instr = arg1; -  free_svalues(Pike_fp->locals + instr, 2, -1); -  Pike_fp->locals[instr].type = PIKE_T_INT; -  Pike_fp->locals[instr].subtype = 0; -  Pike_fp->locals[instr].u.integer = 0; -  Pike_fp->locals[instr+1].type = PIKE_T_INT; -  Pike_fp->locals[instr+1].subtype = 0; -  Pike_fp->locals[instr+1].u.integer = 0; +  free_svalues(Pike_fp->locals + arg1, 2, -1); +  Pike_fp->locals[arg1].type = PIKE_T_INT; +  Pike_fp->locals[arg1].subtype = 0; +  Pike_fp->locals[arg1].u.integer = 0; +  Pike_fp->locals[arg1+1].type = PIKE_T_INT; +  Pike_fp->locals[arg1+1].subtype = 0; +  Pike_fp->locals[arg1+1].u.integer = 0;   BREAK;      OPCODE1(F_CLEAR_4_LOCAL, "clear 4 local")   {    int e; -  instr = arg1; -  free_svalues(Pike_fp->locals + instr, 4, -1); +  free_svalues(Pike_fp->locals + arg1, 4, -1);    for(e = 0; e < 4; e++)    { -  Pike_fp->locals[instr+e].type = PIKE_T_INT; -  Pike_fp->locals[instr+e].subtype = 0; -  Pike_fp->locals[instr+e].u.integer = 0; +  Pike_fp->locals[arg1+e].type = PIKE_T_INT; +  Pike_fp->locals[arg1+e].subtype = 0; +  Pike_fp->locals[arg1+e].u.integer = 0;    }   }   BREAK;      OPCODE1(F_CLEAR_LOCAL, "clear local") -  instr = arg1; -  free_svalue(Pike_fp->locals + instr); -  Pike_fp->locals[instr].type = PIKE_T_INT; -  Pike_fp->locals[instr].subtype = 0; -  Pike_fp->locals[instr].u.integer = 0; +  free_svalue(Pike_fp->locals + arg1); +  Pike_fp->locals[arg1].type = PIKE_T_INT; +  Pike_fp->locals[arg1].subtype = 0; +  Pike_fp->locals[arg1].u.integer = 0;   BREAK;      OPCODE1(F_INC_LOCAL, "++local") -  instr = arg1; -  if( (Pike_fp->locals[instr].type == PIKE_T_INT) +  if( (Pike_fp->locals[arg1].type == PIKE_T_INT)   #ifdef AUTO_BIGNUM -  && (!INT_TYPE_ADD_OVERFLOW(Pike_fp->locals[instr].u.integer, 1)) +  && (!INT_TYPE_ADD_OVERFLOW(Pike_fp->locals[arg1].u.integer, 1))   #endif /* AUTO_BIGNUM */    )    { -  Pike_fp->locals[instr].u.integer++; -  assign_svalue_no_free(Pike_sp++,Pike_fp->locals+instr); +  Pike_fp->locals[arg1].u.integer++; +  assign_svalue_no_free(Pike_sp++,Pike_fp->locals+arg1);    } else { -  assign_svalue_no_free(Pike_sp++,Pike_fp->locals+instr); +  assign_svalue_no_free(Pike_sp++,Pike_fp->locals+arg1);    push_int(1);    f_add(2); -  assign_svalue(Pike_fp->locals+instr,Pike_sp-1); +  assign_svalue(Pike_fp->locals+arg1,Pike_sp-1);    }   BREAK;      OPCODE1(F_POST_INC_LOCAL, "local++")    assign_svalue_no_free(Pike_sp++, Pike_fp->locals + arg1);    if( (Pike_fp->locals[arg1].type == PIKE_T_INT)   #ifdef AUTO_BIGNUM    && (!INT_TYPE_ADD_OVERFLOW(Pike_fp->locals[arg1].u.integer, 1))   #endif /* AUTO_BIGNUM */    )
pike.git/src/interpret_functions.h:423:    } else {    assign_svalue_no_free(Pike_sp++, Pike_fp->locals + arg1);    push_int(1);    f_add(2);    assign_svalue(Pike_fp->locals + arg1, Pike_sp-1);    pop_stack();    }   BREAK;      OPCODE1(F_DEC_LOCAL, "--local") -  instr = arg1; -  if( (Pike_fp->locals[instr].type == PIKE_T_INT) +  if( (Pike_fp->locals[arg1].type == PIKE_T_INT)   #ifdef AUTO_BIGNUM -  && (!INT_TYPE_SUB_OVERFLOW(Pike_fp->locals[instr].u.integer, 1)) +  && (!INT_TYPE_SUB_OVERFLOW(Pike_fp->locals[arg1].u.integer, 1))   #endif /* AUTO_BIGNUM */    )    { -  Pike_fp->locals[instr].u.integer--; -  assign_svalue_no_free(Pike_sp++,Pike_fp->locals+instr); +  Pike_fp->locals[arg1].u.integer--; +  assign_svalue_no_free(Pike_sp++,Pike_fp->locals+arg1);    } else { -  assign_svalue_no_free(Pike_sp++,Pike_fp->locals+instr); +  assign_svalue_no_free(Pike_sp++,Pike_fp->locals+arg1);    push_int(1);    o_subtract(); -  assign_svalue(Pike_fp->locals+instr,Pike_sp-1); +  assign_svalue(Pike_fp->locals+arg1,Pike_sp-1);    }   BREAK;      OPCODE1(F_POST_DEC_LOCAL, "local--")    assign_svalue_no_free(Pike_sp++, Pike_fp->locals + arg1);    if( (Pike_fp->locals[arg1].type == PIKE_T_INT)   #ifdef AUTO_BIGNUM    && (!INT_TYPE_SUB_OVERFLOW(Pike_fp->locals[arg1].u.integer, 1))   #endif /* AUTO_BIGNUM */    )
pike.git/src/interpret_functions.h:784:   /* Stack machine stuff */      OPCODE0(F_POP_VALUE, "pop")    pop_stack();   BREAK;      OPCODE1(F_POP_N_ELEMS, "pop_n_elems")    pop_n_elems(arg1);   BREAK;    -  CASE(F_MARK2); *(Pike_mark_sp++)=Pike_sp; -  CASE(F_MARK); *(Pike_mark_sp++)=Pike_sp; break; + OPCODE0_TAIL(F_MARK2,"mark mark") +  *(Pike_mark_sp++)=Pike_sp; + OPCODE0(F_MARK,"mark") +  *(Pike_mark_sp++)=Pike_sp; + BREAK;      OPCODE1(F_MARK_X, "mark sp-X")    *(Pike_mark_sp++)=Pike_sp-arg1;   BREAK;      OPCODE0(F_POP_MARK, "pop mark")    --Pike_mark_sp;   BREAK;      OPCODE0(F_CLEAR_STRING_SUBTYPE, "clear string subtype")    if(Pike_sp[-1].type==PIKE_T_STRING) Pike_sp[-1].subtype=0;   BREAK;       /* Jumps */ -  CASE(F_BRANCH); + OPCODE0_JUMP(F_BRANCH,"branch")    DOJUMP(); -  break; + BREAK;    -  CASE(F_BRANCH_IF_NOT_LOCAL_ARROW); + OPCODE2(F_BRANCH_IF_NOT_LOCAL_ARROW,"branch if !local->x")   {    struct svalue tmp;    tmp.type=PIKE_T_STRING; -  tmp.u.string=Pike_fp->context.prog->strings[GET_ARG()]; +  tmp.u.string=Pike_fp->context.prog->strings[arg1];    tmp.subtype=1;    Pike_sp->type=PIKE_T_INT;    Pike_sp++; -  index_no_free(Pike_sp-1,Pike_fp->locals+GET_ARG2() , &tmp); +  index_no_free(Pike_sp-1,Pike_fp->locals+arg2, &tmp);    print_return_value();   }       /* Fall through */    -  CASE(F_BRANCH_WHEN_ZERO); + OPCODE0_TAILJUMP(F_BRANCH_WHEN_ZERO,"branch if zero")    if(!IS_ZERO(Pike_sp-1))    { -  pc+=sizeof(INT32); +  SKIPJUMP();    }else{    DOJUMP();    }    pop_stack(); -  break; + BREAK;       -  CASE(F_BRANCH_WHEN_NON_ZERO); + OPCODE0_JUMP(F_BRANCH_WHEN_NON_ZERO,"branch if not zero")    if(IS_ZERO(Pike_sp-1))    { -  pc+=sizeof(INT32); +  SKIPJUMP();    }else{    DOJUMP();    }    pop_stack(); -  break; + BREAK    -  CASE(F_BRANCH_IF_LOCAL); -  instr=GET_ARG(); -  if(IS_ZERO(Pike_fp->locals + instr)) + OPCODE1_JUMP(F_BRANCH_IF_LOCAL,"branch if local") +  if(IS_ZERO(Pike_fp->locals + arg1))    { -  pc+=sizeof(INT32); +  SKIPJUMP();    }else{    DOJUMP();    } -  break; + BREAK;       CASE(F_BRANCH_IF_NOT_LOCAL);    instr=GET_ARG();    if(!IS_ZERO(Pike_fp->locals + instr))    { -  pc+=sizeof(INT32); +  SKIPJUMP();    }else{    DOJUMP();    }    break;       CJUMP(F_BRANCH_WHEN_EQ, is_eq);    CJUMP(F_BRANCH_WHEN_NE,!is_eq);    CJUMP(F_BRANCH_WHEN_LT, is_lt);    CJUMP(F_BRANCH_WHEN_LE,!is_gt);    CJUMP(F_BRANCH_WHEN_GT, is_gt);    CJUMP(F_BRANCH_WHEN_GE,!is_lt);       CASE(F_BRANCH_AND_POP_WHEN_ZERO);    if(!IS_ZERO(Pike_sp-1))    { -  pc+=sizeof(INT32); +  SKIPJUMP();    }else{    DOJUMP();    pop_stack();    }    break;       CASE(F_BRANCH_AND_POP_WHEN_NON_ZERO);    if(IS_ZERO(Pike_sp-1))    { -  pc+=sizeof(INT32); +  SKIPJUMP();    }else{    DOJUMP();    pop_stack();    }    break;       CASE(F_LAND);    if(!IS_ZERO(Pike_sp-1))    { -  pc+=sizeof(INT32); +  SKIPJUMP();    pop_stack();    }else{    DOJUMP();    }    break;       CASE(F_LOR);    if(IS_ZERO(Pike_sp-1))    { -  pc+=sizeof(INT32); +  SKIPJUMP();    pop_stack();    }else{    DOJUMP();    }    break;       CASE(F_EQ_OR);    if(!is_eq(Pike_sp-2,Pike_sp-1))    {    pop_n_elems(2); -  pc+=sizeof(INT32); +  SKIPJUMP();    }else{    pop_n_elems(2);    push_int(1);    DOJUMP();    }    break;       CASE(F_EQ_AND);    if(is_eq(Pike_sp-2,Pike_sp-1))    {    pop_n_elems(2); -  pc+=sizeof(INT32); +  SKIPJUMP();    }else{    pop_n_elems(2);    push_int(0);    DOJUMP();    }    break;       CASE(F_CATCH);    if(o_catch(pc+sizeof(INT32)))    return -1; /* There was a return inside the evaluated code */
pike.git/src/interpret_functions.h:976:    {    fast_check_threads_etc(10);    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--;    pc+=EXTRACT_INT(pc);    Pike_sp[-1].u.integer++;    }else{ -  pc+=sizeof(INT32); +  SKIPJUMP();    }    break;    }       CASE(F_APPLY_AND_RETURN);    {    INT32 args=Pike_sp - *--Pike_mark_sp;   /* fprintf(stderr,"%p >= %p\n",Pike_fp->expendible,Pike_sp-args); */    if(Pike_fp->expendible >= Pike_sp-args)    {