pike.git / src / interpret_functions.h

version» Context lines:

pike.git/src/interpret_functions.h:1:   /* -  * $Id: interpret_functions.h,v 1.48 2001/02/24 02:38:31 hubbe Exp $ +  * $Id: interpret_functions.h,v 1.49 2001/03/09 02:29:33 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:27:      OPCODE1(F_NUMBER, "push int")    push_int(arg1);   BREAK;      OPCODE1(F_NEG_NUMBER,"push -int")    push_int(-arg1);   BREAK;      OPCODE1(F_CONSTANT,"constant") -  assign_svalue_no_free(Pike_sp++,& Pike_fp->context.prog->constants[arg1].sval); +  push_svalue(& Pike_fp->context.prog->constants[arg1].sval);    print_return_value();   BREAK;      /* The rest of the basic 'push value' instructions */      OPCODE1_TAIL(F_MARK_AND_STRING,"mark & string")    *(Pike_mark_sp++)=Pike_sp;      OPCODE1(F_STRING,"string")    copy_shared_string(Pike_sp->u.string,Pike_fp->context.prog->strings[arg1]);
pike.git/src/interpret_functions.h:180:       ref_push_object(loc.o);    Pike_sp->type=T_LVALUE;    Pike_sp->u.integer=arg1 + loc.inherit->identifier_level;    Pike_sp++;   }   BREAK;      OPCODE1(F_MARK_AND_LOCAL, "mark & local")    *(Pike_mark_sp++) = Pike_sp; -  assign_svalue_no_free(Pike_sp++, Pike_fp->locals + arg1); +  push_svalue( Pike_fp->locals + arg1);    print_return_value();   BREAK;      OPCODE1(F_LOCAL, "local") -  assign_svalue_no_free(Pike_sp++, Pike_fp->locals + arg1); +  push_svalue( Pike_fp->locals + arg1);    print_return_value();   BREAK;      OPCODE2(F_2_LOCALS, "2 locals") -  assign_svalue_no_free(Pike_sp++, Pike_fp->locals + arg1); +  push_svalue( Pike_fp->locals + arg1);    print_return_value(); -  assign_svalue_no_free(Pike_sp++, Pike_fp->locals + arg2); +  push_svalue( Pike_fp->locals + arg2);    print_return_value();   BREAK;      OPCODE2(F_LOCAL_2_LOCAL, "local = local")    assign_svalue(Pike_fp->locals + arg1, Pike_fp->locals + arg2);   BREAK;      OPCODE2(F_LOCAL_2_GLOBAL, "global = local")   {    INT32 tmp = arg1 + Pike_fp->context.identifier_level;
pike.git/src/interpret_functions.h:316:    Pike_fp->locals[arg1].u.integer = 0;   BREAK;      OPCODE1(F_INC_LOCAL, "++local")    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_fp->locals[arg1].u.integer++; -  assign_svalue_no_free(Pike_sp++,Pike_fp->locals+arg1); +  push_int(++(Pike_fp->locals[arg1].u.integer));    } else { -  assign_svalue_no_free(Pike_sp++,Pike_fp->locals+arg1); +  push_svalue(Pike_fp->locals+arg1);    push_int(1);    f_add(2);    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); +  push_svalue( 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_fp->locals[arg1].u.integer++;    } else { -  assign_svalue_no_free(Pike_sp++, Pike_fp->locals + arg1); +  push_svalue(Pike_fp->locals + arg1);    push_int(1);    f_add(2); -  assign_svalue(Pike_fp->locals + arg1, Pike_sp-1); -  pop_stack(); +  stack_pop_to(Pike_fp->locals + arg1);    }   BREAK;      OPCODE1(F_INC_LOCAL_AND_POP, "++local and pop")    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_fp->locals[arg1].u.integer++;    } else { -  assign_svalue_no_free(Pike_sp++, Pike_fp->locals + arg1); +  push_svalue( Pike_fp->locals + arg1);    push_int(1);    f_add(2); -  assign_svalue(Pike_fp->locals + arg1, Pike_sp-1); -  pop_stack(); +  stack_pop_to(Pike_fp->locals + arg1);    }   BREAK;      OPCODE1(F_DEC_LOCAL, "--local")    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_fp->locals[arg1].u.integer--; -  assign_svalue_no_free(Pike_sp++,Pike_fp->locals+arg1); +  push_int(--(Pike_fp->locals[arg1].u.integer));    } else { -  assign_svalue_no_free(Pike_sp++,Pike_fp->locals+arg1); +  push_svalue(Pike_fp->locals+arg1);    push_int(1);    o_subtract();    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); +  push_svalue( 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_fp->locals[arg1].u.integer--;    } else { -  assign_svalue_no_free(Pike_sp++, Pike_fp->locals + arg1); +  push_svalue(Pike_fp->locals + arg1);    push_int(1);    o_subtract(); -  assign_svalue(Pike_fp->locals + arg1, Pike_sp-1); -  pop_stack(); +  stack_pop_to(Pike_fp->locals + arg1);    }    /* Pike_fp->locals[instr].u.integer--; */   BREAK;      OPCODE1(F_DEC_LOCAL_AND_POP, "--local and pop")    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_fp->locals[arg1].u.integer--;    } else { -  assign_svalue_no_free(Pike_sp++, Pike_fp->locals + arg1); +  push_svalue(Pike_fp->locals + arg1);    push_int(1);    o_subtract(); -  assign_svalue(Pike_fp->locals + arg1, Pike_sp-1); -  pop_stack(); +  stack_pop_to(Pike_fp->locals + arg1);    }   BREAK;      OPCODE0(F_LTOSVAL, "lvalue to svalue")    lvalue_to_svalue_no_free(Pike_sp, Pike_sp-2);    Pike_sp++;   BREAK;      OPCODE0(F_LTOSVAL2, "ltosval2")    Pike_sp[0] = Pike_sp[-1];
pike.git/src/interpret_functions.h:504:   {    union anything *u=get_pointer_if_this_type(Pike_sp-2, PIKE_T_INT);    if(u   #ifdef AUTO_BIGNUM    && !INT_TYPE_ADD_OVERFLOW(u->integer, 1)   #endif    )    {    instr=++ u->integer;    pop_n_elems(2); -  push_int(u->integer); +  push_int(instr);    } else {    lvalue_to_svalue_no_free(Pike_sp, Pike_sp-2); Pike_sp++;    push_int(1);    f_add(2);    assign_lvalue(Pike_sp-3, Pike_sp-1); -  assign_svalue(Pike_sp-3, Pike_sp-1); -  pop_n_elems(2); +  stack_unlink(2);    }   }   BREAK;      OPCODE0(F_DEC, "--x")   {    union anything *u=get_pointer_if_this_type(Pike_sp-2, PIKE_T_INT);    if(u   #ifdef AUTO_BIGNUM    && !INT_TYPE_SUB_OVERFLOW(u->integer, 1)   #endif    )    {    instr=-- u->integer;    pop_n_elems(2); -  push_int(u->integer); +  push_int(instr);    } else {    lvalue_to_svalue_no_free(Pike_sp, Pike_sp-2); Pike_sp++;    push_int(1);    o_subtract();    assign_lvalue(Pike_sp-3, Pike_sp-1); -  assign_svalue(Pike_sp-3, Pike_sp-1); -  pop_n_elems(2); +  stack_unlink(2);    }   }   BREAK;      OPCODE0(F_DEC_AND_POP, "x-- and pop")   {    union anything *u=get_pointer_if_this_type(Pike_sp-2, PIKE_T_INT);    if(u   #ifdef AUTO_BIGNUM    && !INT_TYPE_SUB_OVERFLOW(u->integer, 1)   #endif   )    { -  instr=-- u->integer; +  -- u->integer;    pop_n_elems(2);    }else{    lvalue_to_svalue_no_free(Pike_sp, Pike_sp-2); Pike_sp++;    push_int(1);    o_subtract();    assign_lvalue(Pike_sp-3, Pike_sp-1);    pop_n_elems(3);    }   }   BREAK;
pike.git/src/interpret_functions.h:595: Inside #if defined(AUTO_BIGNUM)
  #ifdef AUTO_BIGNUM    && !INT_TYPE_ADD_OVERFLOW(u->integer, 1)   #endif    )    {    instr=u->integer ++;    pop_n_elems(2);    push_int(instr);    } else {    lvalue_to_svalue_no_free(Pike_sp, Pike_sp-2); Pike_sp++; -  assign_svalue_no_free(Pike_sp,Pike_sp-1); Pike_sp++; +  stack_dup();    push_int(1);    f_add(2);    assign_lvalue(Pike_sp-4, Pike_sp-1); -  assign_svalue(Pike_sp-4, Pike_sp-2); -  pop_n_elems(3); +  pop_stack(); +  stack_unlink(2); +  print_return_value();    }   }   BREAK;      OPCODE0(F_POST_DEC, "x--")   {    union anything *u=get_pointer_if_this_type(Pike_sp-2, PIKE_T_INT);    if(u   #ifdef AUTO_BIGNUM    && !INT_TYPE_SUB_OVERFLOW(u->integer, 1)   #endif    )    {    instr=u->integer --;    pop_n_elems(2);    push_int(instr);    } else {    lvalue_to_svalue_no_free(Pike_sp, Pike_sp-2); Pike_sp++; -  assign_svalue_no_free(Pike_sp,Pike_sp-1); Pike_sp++; +  stack_dup();    push_int(1);    o_subtract();    assign_lvalue(Pike_sp-4, Pike_sp-1); -  assign_svalue(Pike_sp-4, Pike_sp-2); -  pop_n_elems(3); +  pop_stack(); +  stack_unlink(2); +  print_return_value();    }   }   BREAK;      OPCODE1(F_ASSIGN_LOCAL,"assign local")    assign_svalue(Pike_fp->locals+arg1,Pike_sp-1);   BREAK;      OPCODE0(F_ASSIGN, "assign")    assign_lvalue(Pike_sp-3,Pike_sp-1);