pike.git / src / interpret_functions.h

version» Context lines:

pike.git/src/interpret_functions.h:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: interpret_functions.h,v 1.180 2004/12/18 21:52:50 grubba Exp $ + || $Id: interpret_functions.h,v 1.181 2004/12/18 22:20:04 grubba Exp $   */      /*    * Opcode definitions for the interpreter.    */      #include "global.h"      #undef CJUMP   #undef AUTO_BIGNUM_LOOP_TEST
pike.git/src/interpret_functions.h:312:    LOCAL_VAR(struct program *p);       if ((Pike_sp[-1].type == T_OBJECT) &&    (p = (o = Pike_sp[-1].u.object)->prog) &&    (FIND_LFUN(p = o->prog->inherits[Pike_sp[-1].subtype].prog,    LFUN_ARROW) == -1)) {    int id = FIND_LFUN(p, arg1);    if ((id != -1) &&    (!(p->identifier_references[id].id_flags &    (ID_STATIC|ID_PRIVATE|ID_HIDDEN)))) { +  id += o->prog->inherits[Pike_sp[-1].subtype].identifier_level;    low_object_index_no_free(&tmp, o, id);    } else {    /* Not found. */    tmp.type = T_INT;    tmp.subtype = NUMBER_UNDEFINED;    tmp.u.integer = 0;    }    } else {    LOCAL_VAR(struct svalue tmp2);    tmp2.type = PIKE_T_STRING;
pike.git/src/interpret_functions.h:765:    } else if (Pike_sp[-2].type == T_OBJECT) {    /* One ref in the lvalue, and one on the stack. */    int i;    LOCAL_VAR(struct object *o);    LOCAL_VAR(struct program *p);    if((o = Pike_sp[-2].u.object)->refs <= 2 &&    (p = o->prog) &&    (i = FIND_LFUN(p->inherits[Pike_sp[-2].subtype].prog,    LFUN_ADD_EQ)) != -1)    { -  apply_low(o, i, 1); +  apply_low(o, i + p->inherits[Pike_sp[-2].subtype].identifier_level, 1);    /* NB: The lvalue already contains the object, so    * no need to reassign it.    */    pop_stack();    stack_pop_2_elems_keep_top();    goto add_to_done;    }    }    f_add(2);    assign_lvalue(Pike_sp-3,Pike_sp-1);
pike.git/src/interpret_functions.h:827:    } else if (Pike_sp[-2].type == PIKE_T_OBJECT) {    /* One ref in the lvalue, and one on the stack. */    int i;    LOCAL_VAR(struct object *o);    LOCAL_VAR(struct program *p);    if((o = Pike_sp[-2].u.object)->refs <= 2 &&    (p = o->prog) &&    (i = FIND_LFUN(p->inherits[Pike_sp[-2].subtype].prog,    LFUN_ADD_EQ)) != -1)    { -  apply_low(o, i, 1); +  apply_low(o, i + p->inherits[Pike_sp[-2].subtype].identifier_level, 1);    /* NB: The lvalue already contains the object, so    * no need to reassign it.    */    pop_n_elems(4);    goto add_to_and_pop_done;    }    }    f_add(2);    assign_lvalue(Pike_sp-3,Pike_sp-1);    pop_n_elems(3);
pike.git/src/interpret_functions.h:1137:    LOCAL_VAR(struct object *o);    if(Pike_sp[-1].type == T_OBJECT &&    (o = Pike_sp[-1].u.object)->prog)    {    int fun = FIND_LFUN(o->prog->inherits[Pike_sp[-1].subtype].prog,    LFUN__IS_TYPE);    if(fun != -1)    {   /* fprintf(stderr,"******OBJECT OVERLOAD IN TYPEP***** %s\n",get_name_of_type(arg1)); */    push_text(get_name_of_type(arg1)); -  apply_low(o, fun, 1); +  apply_low(o, fun + p->inherits[Pike_sp[-2].subtype].identifier_level, 1);    arg1=UNSAFE_IS_ZERO(Pike_sp-1) ? T_FLOAT : T_OBJECT ;    pop_stack();    }    }    if(Pike_sp[-1].type == arg1)    {    /* write_to_stderr("foreach\n", 8); */    DONT_BRANCH();    }else{    DO_BRANCH();
pike.git/src/interpret_functions.h:1651:    Pike_sp[-1].u.integer-=arg1;    Pike_sp[-1].subtype = NUMBER_NUMBER; /* Could have UNDEFINED there before. */    }else{    push_int(-arg1);    f_add(2);    }   });      OPCODE0(F_PUSH_ARRAY, "@", I_UPDATE_SP, {    int i; +  LOCAL_VAR(struct object *o);    LOCAL_VAR(struct program *p);       switch(Pike_sp[-1].type)    {    default:    PIKE_ERROR("@", "Bad argument.\n", Pike_sp, 1);       case PIKE_T_OBJECT: -  if(!(p = Pike_sp[-1].u.object->prog) || +  if(!(p = (o = Pike_sp[-1].u.object)->prog) ||    (i = FIND_LFUN(p->inherits[Pike_sp[-1].subtype].prog,    LFUN__VALUES)) == -1)    PIKE_ERROR("@", "Bad argument.\n", Pike_sp, 1);    -  apply_low(Pike_sp[-1].u.object, i, 0); +  apply_low(o, i + p->inherits[Pike_sp[-1].subtype].identifier_level, 0);    if(Pike_sp[-1].type != PIKE_T_ARRAY)    Pike_error("Bad return type from o->_values() in @\n");    free_svalue(Pike_sp-2);    move_svalue (Pike_sp - 2, Pike_sp - 1);    Pike_sp--;    break;       case PIKE_T_ARRAY: break;    }    dmalloc_touch_svalue(Pike_sp-1);
pike.git/src/interpret_functions.h:2010:    if((p=o->prog))    {    p = p->inherits[s->subtype].prog;    if(FIND_LFUN(p, LFUN_ARROW) == -1)    {    int fun;    fun=find_shared_string_identifier(Pike_fp->context.prog->strings[arg1],    p);    if(fun >= 0)    { +  fun += o->prog->inherits[s->subtype].identifier_level;    if(low_mega_apply(APPLY_LOW, args-1, o, (void *)(ptrdiff_t)fun))    {    Pike_fp->save_sp--;    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL;    DO_JUMP_TO(Pike_fp->pc);    }    stack_pop_keep_top();    DO_JUMP_TO_NEXT;    }    }
pike.git/src/interpret_functions.h:2067:    if((p=o->prog))    {    p = p->inherits[s->subtype].prog;    if(FIND_LFUN(p, LFUN_ARROW) == -1)    {    int fun;    fun=find_shared_string_identifier(Pike_fp->context.prog->strings[arg1],    p);    if(fun >= 0)    { +  fun += o->prog->inherits[s->subtype].identifier_level;    if(low_mega_apply(APPLY_LOW, args-1, o, (void *)(ptrdiff_t)fun))    {    Pike_fp->save_sp--;    Pike_fp->flags |=    PIKE_FRAME_RETURN_INTERNAL |    PIKE_FRAME_RETURN_POP;    DO_JUMP_TO(Pike_fp->pc);    }    pop_2_elems();    DO_JUMP_TO_NEXT;
pike.git/src/interpret_functions.h:2126:    if((p=o->prog))    {    p = p->inherits[s->subtype].prog;    if(FIND_LFUN(p, LFUN_ARROW) == -1)    {    int fun;    fun=find_shared_string_identifier(Pike_fp->context.prog->strings[arg1],    p);    if(fun >= 0)    { +  fun += o->prog->inherits[s->subtype].identifier_level;    if(low_mega_apply(APPLY_LOW, args-1, o, (void *)(ptrdiff_t)fun))    {    PIKE_OPCODE_T *addr = Pike_fp->pc;    Pike_fp->save_sp--;    DO_IF_DEBUG(Pike_fp->next->pc=0);    unlink_previous_frame();    DO_JUMP_TO(addr);    }    stack_pop_keep_top();    DO_DUMB_RETURN;