pike.git / src / interpret_functions.h

version» Context lines:

pike.git/src/interpret_functions.h:1:   /* -  * $Id: interpret_functions.h,v 1.12 2000/04/20 11:49:50 grubba Exp $ +  * $Id: interpret_functions.h,v 1.13 2000/04/20 14:03:39 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:70:      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();   BREAK;    -  +    OPCODE1(F_TRAMPOLINE, "trampoline")   {    struct object *o=low_clone(pike_trampoline_program);    add_ref( ((struct pike_trampoline *)(o->storage))->frame=Pike_fp );    ((struct pike_trampoline *)(o->storage))->func=arg1+Pike_fp->context.identifier_level;    push_object(o);    /* Make it look like a function. */    Pike_sp[-1].subtype = pike_trampoline_program->lfuns[LFUN_CALL];    Pike_sp[-1].type = T_FUNCTION;    print_return_value();
pike.git/src/interpret_functions.h:94:   /* The not so basic 'push value' instructions */      OPCODE1(F_GLOBAL,"global")    low_object_index_no_free(Pike_sp,    Pike_fp->current_object,    arg1 + Pike_fp->context.identifier_level);    Pike_sp++;    print_return_value();   BREAK;    -  +    OPCODE2(F_EXTERNAL,"external")   {    struct inherit *inherit;    struct program *p;    struct object *o;    INT32 i;       inherit=&Pike_fp->context;       o=Pike_fp->current_object;
pike.git/src/interpret_functions.h:235:       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;    -  CASE(F_MARK_AND_LOCAL); *(Pike_mark_sp++)=Pike_sp; -  CASE(F_LOCAL); -  assign_svalue_no_free(Pike_sp++,Pike_fp->locals+GET_ARG()); + OPCODE1(F_LOCAL, "local") +  assign_svalue_no_free(Pike_sp++, Pike_fp->locals + arg1);    print_return_value(); -  break; + BREAK;      OPCODE2(F_2_LOCALS, "2 locals")    assign_svalue_no_free(Pike_sp++, Pike_fp->locals + arg1);    print_return_value();    assign_svalue_no_free(Pike_sp++, 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);
pike.git/src/interpret_functions.h:307:    {    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.git/src/interpret_functions.h:484:    (BIT_ARRAY | BIT_MULTISET | BIT_MAPPING | BIT_STRING) )    {    struct svalue s;    s.type = PIKE_T_INT;    s.subtype = 0;    s.u.integer = 0;    assign_lvalue(Pike_sp-4, &s);    }   BREAK;    -  +    OPCODE0(F_ADD_TO_AND_POP, "+= and pop")    Pike_sp[0]=Pike_sp[-1];    Pike_sp[-1].type=PIKE_T_INT;    Pike_sp++;    lvalue_to_svalue_no_free(Pike_sp-2,Pike_sp-4);       /* this is so that foo+=bar (and similar things) will be faster, this    * is done by freeing the old reference to foo after it has been pushed    * on the stack. That way foo can have only 1 reference if we are lucky,    * and then the low array/multiset/mapping manipulation routines can be
pike.git/src/interpret_functions.h:536:    }else{    Pike_sp[0].type=T_SHORT_LVALUE;    Pike_sp[0].u.short_lval= (union anything *)GLOBAL_FROM_INT(tmp);    Pike_sp[0].subtype=i->run_time_type;    }    Pike_sp[1].type=T_VOID;    Pike_sp+=2;   }   BREAK;    -  +    OPCODE0(F_INC, "++x")   {    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;
pike.git/src/interpret_functions.h:649:    assign_svalue_no_free(Pike_sp,Pike_sp-1); Pike_sp++;    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);    }   }   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 --;
pike.git/src/interpret_functions.h:703:   OPCODE2(F_APPLY_ASSIGN_LOCAL,"apply, assign local")    strict_apply_svalue(Pike_fp->context.prog->constants + arg1, 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;    -  -  CASE(F_ASSIGN_LOCAL_AND_POP); -  instr=GET_ARG(); -  free_svalue(Pike_fp->locals+instr); -  Pike_fp->locals[instr]=Pike_sp[-1]; + OPCODE1(F_ASSIGN_LOCAL_AND_POP, "assign local and pop") +  free_svalue(Pike_fp->locals + arg1); +  Pike_fp->locals[arg1] = Pike_sp[-1];    Pike_sp--; -  break; + BREAK;      OPCODE1(F_ASSIGN_GLOBAL, "assign global")   {    struct identifier *i;    INT32 tmp=arg1 + Pike_fp->context.identifier_level;    if(!Pike_fp->current_object->prog)    error("Cannot access global variables in destructed object.\n");       i=ID_FROM_INT(Pike_fp->current_object->prog, tmp);    if(!IDENTIFIER_IS_VARIABLE(i->identifier_flags))
pike.git/src/interpret_functions.h:1110:    o_rsh();   BREAK;       COMPARISMENT(F_EQ, is_eq(Pike_sp-2,Pike_sp-1));    COMPARISMENT(F_NE,!is_eq(Pike_sp-2,Pike_sp-1));    COMPARISMENT(F_GT, is_gt(Pike_sp-2,Pike_sp-1));    COMPARISMENT(F_GE,!is_lt(Pike_sp-2,Pike_sp-1));    COMPARISMENT(F_LT, is_lt(Pike_sp-2,Pike_sp-1));    COMPARISMENT(F_LE,!is_gt(Pike_sp-2,Pike_sp-1));    -  CASE(F_ADD); f_add(2); break; -  CASE(F_SUBTRACT); o_subtract(); break; -  CASE(F_AND); o_and(); break; -  CASE(F_OR); o_or(); break; -  CASE(F_XOR); o_xor(); break; -  CASE(F_MULTIPLY); o_multiply(); break; -  CASE(F_DIVIDE); o_divide(); break; -  CASE(F_MOD); o_mod(); break; + OPCODE0(F_ADD, "+") +  f_add(2); + BREAK;    -  CASE(F_ADD_INT); push_int(GET_ARG()); f_add(2); break; -  CASE(F_ADD_NEG_INT); push_int(-GET_ARG()); f_add(2); break; + OPCODE0(F_SUBTRACT, "-") +  o_subtract(); + BREAK;    -  + OPCODE0(F_AND, "&") +  o_and(); + BREAK; +  + OPCODE0(F_OR, "|") +  o_or(); + BREAK; +  + OPCODE0(F_XOR, "^") +  o_xor(); + BREAK; +  + OPCODE0(F_MULTIPLY, "*") +  o_multiply(); + BREAK; +  + OPCODE0(F_DIVIDE, "/") +  o_divide(); + BREAK; +  + OPCODE0(F_MOD, "%") +  o_mod(); + BREAK; +  + OPCODE1(F_ADD_INT, "add integer") +  push_int(arg1); +  f_add(2); + BREAK; +  + OPCODE1(F_ADD_NEG_INT, "add -integer") +  push_int(-arg1); +  f_add(2); + BREAK; +    OPCODE0(F_PUSH_ARRAY, "@")    switch(Pike_sp[-1].type)    {    default:    PIKE_ERROR("@", "Bad argument.\n", Pike_sp, 1);       case PIKE_T_OBJECT:    if(!Pike_sp[-1].u.object->prog ||    FIND_LFUN(Pike_sp[-1].u.object->prog,LFUN__VALUES) == -1)    PIKE_ERROR("@", "Bad argument.\n", Pike_sp, 1);