pike.git / src / interpret_functions.h

version» Context lines:

pike.git/src/interpret_functions.h:399:    else    {    struct svalue *tmp;    tmp = (struct svalue *)(co->storage + cx->storage_offset + arg1);    assign_svalue(tmp,Pike_sp-1);    }    });      OPCODE2(F_ASSIGN_PRIVATE_TYPED_GLOBAL_AND_POP, "assign global <private,typed> and pop", I_UPDATE_SP, {    /* lazy mode. */ -  LOCAL_VAR(union anything *tmp); -  LOCAL_VAR(struct object *co); -  co = Pike_fp->current_object; -  if(!co->prog) /* note: generate an error. */ -  object_low_set_index(co,0,0); -  tmp = (union anything *)(Pike_fp->current_object->storage + Pike_fp->context->storage_offset + arg1); -  assign_to_short_svalue( tmp, arg2, Pike_sp-1 ); +  union anything *tmp_s; +  LOCAL_VAR(struct object *o); +  o = Pike_fp->current_object; +  if(!o->prog) /* note: generate an error. */ +  object_low_set_index(o,0,0); +  tmp_s = (union anything *)(o->storage + Pike_fp->context->storage_offset + arg1); +  assign_to_short_svalue( tmp_s, arg2, Pike_sp-1 );    pop_stack();   });      OPCODE2(F_ASSIGN_PRIVATE_TYPED_GLOBAL, "assign global <private,typed>", 0, { -  LOCAL_VAR(union anything *tmp); -  LOCAL_VAR(struct object *co); -  co = Pike_fp->current_object; -  if(!co->prog) /* note: generate an error. */ -  object_low_set_index(co,0,0); -  tmp = (union anything *)(Pike_fp->current_object->storage + Pike_fp->context->storage_offset + arg1); +  union anything *tmp; +  LOCAL_VAR(struct object *o); +  o = Pike_fp->current_object; +  if(!o->prog) /* note: generate an error. */ +  object_low_set_index(o,0,0); +  tmp = (union anything *)(o->storage + Pike_fp->context->storage_offset + arg1);    assign_to_short_svalue( tmp, arg2, Pike_sp-1);   });         OPCODE2(F_PRIVATE_TYPED_GLOBAL, "global <private,typed>", I_UPDATE_SP, { -  LOCAL_VAR(struct object *co); -  LOCAL_VAR(void *ptr); +  void *ptr; +  LOCAL_VAR(struct object *o);    -  co = Pike_fp->current_object; -  ptr = (void *)(co->storage + Pike_fp->context->storage_offset + arg1); +  o = Pike_fp->current_object; +  ptr = (void *)(o->storage + Pike_fp->context->storage_offset + arg1);    if( arg2 < MIN_REF_TYPE )    {   #if SIZEOF_FLOAT_TYPE != SIZEOF_INT_TYPE    if( UNLIKELY(arg2)==PIKE_T_INT )    push_integer( *(INT_TYPE*)ptr );    else    push_float( *(FLOAT_TYPE*)ptr );   #else    SET_SVAL_TYPE_SUBTYPE(Pike_sp[0],arg2,0);    Pike_sp[0].u.integer = *(INT_TYPE*)ptr;
pike.git/src/interpret_functions.h:1189:      OPCODE1(F_ASSIGN_GLOBAL_AND_POP, "assign global and pop", I_UPDATE_SP, {    object_low_set_index(Pike_fp->current_object,    arg1 + Pike_fp->context->identifier_level,    Pike_sp-1);    pop_stack();   });      OPCODE1(F_ASSIGN_PRIVATE_GLOBAL_AND_POP,    "assign private global and pop", I_UPDATE_SP, { -  LOCAL_VAR(struct svalue *tmp); -  LOCAL_VAR(struct object *co); +  struct svalue *tmp; +  struct object *co;    co = Pike_fp->current_object;    if(!co->prog) /* note: generate an error. */    object_low_set_index(co,0,0);    tmp = (struct svalue *)(co->storage + Pike_fp->context->storage_offset + arg1);    free_svalue(tmp);    *tmp = *--Pike_sp;   });      OPCODE1(F_ASSIGN_PRIVATE_GLOBAL, "assign private global", I_UPDATE_SP, { -  LOCAL_VAR(struct svalue *tmp); -  LOCAL_VAR(struct object *co); +  struct svalue *tmp; +  struct object *co;    co = Pike_fp->current_object;    if(!co->prog) /* note: generate an error. */    object_low_set_index(co,0,0);    tmp = (struct svalue *)(co->storage +Pike_fp->context->storage_offset +arg1);    assign_svalue( tmp, Pike_sp-1 );   });      OPCODE2(F_ASSIGN_GLOBAL_NUMBER_AND_POP, "assign global number and pop", 0, {    LOCAL_VAR(struct svalue tmp);    SET_SVAL(tmp,PIKE_T_INT,0,integer,arg2);
pike.git/src/interpret_functions.h:1933:    {    Pike_sp[-1].u.integer-=arg1;    SET_SVAL_SUBTYPE(Pike_sp[-1], 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(TYPEOF(Pike_sp[-1]))    {    default:    PIKE_ERROR("@", "Bad argument.\n", Pike_sp, 1);       case PIKE_T_OBJECT: -  +  { +  int i;    if(!(p = (o = Pike_sp[-1].u.object)->prog) ||    (i = FIND_LFUN(p->inherits[SUBTYPEOF(Pike_sp[-1])].prog,    LFUN__VALUES)) == -1)    PIKE_ERROR("@", "Bad argument.\n", Pike_sp, 1);       apply_low(o, i + p->inherits[SUBTYPEOF(Pike_sp[-1])].identifier_level, 0);    if(TYPEOF(Pike_sp[-1]) != 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_sp--;    push_array_items(Pike_sp->u.array);   });      OPCODE0(F_APPEND_ARRAY, "append array", I_UPDATE_SP|I_UPDATE_M_SP, {
pike.git/src/interpret_functions.h:2891:    });    assign_svalues(Pike_fp->locals, Pike_sp-args, args, BIT_MIXED);    pop_n_elems(Pike_sp - (Pike_fp->locals + args));    }       FETCH;    JUMP_DONE;   });      OPCODE1(F_THIS_OBJECT, "this_object", I_UPDATE_SP, { -  LOCAL_VAR(int level); +  int level;    LOCAL_VAR(struct object *o);    o = Pike_fp->current_object;    for (level = 0; level < arg1; level++) {    LOCAL_VAR(struct program *p);    p = o->prog;    if (!p)    Pike_error ("Object %d level(s) up is destructed - cannot get the parent.\n",    level);    if (!(p->flags & PROGRAM_USES_PARENT))    /* FIXME: Ought to write out the object here. */    Pike_error ("Object %d level(s) up lacks parent reference.\n", level);    o = PARENT_INFO(o)->parent;    }    ref_push_object(o);    });      OPCODE0(F_UNDEFINEDP,"undefinedp",0, { -  LOCAL_VAR(int undef); +  int undef;    if(TYPEOF(Pike_sp[-1]) != T_INT)    {    pop_stack();    push_int(0); -  return; +     } -  +  else +  {    undef = SUBTYPEOF(Pike_sp[-1]) == NUMBER_UNDEFINED;    SET_SVAL(Pike_sp[-1], T_INT, NUMBER_NUMBER, integer,    undef); -  +  }   });      OPCODE0(F_DESTRUCTEDP,"destructedp",0, {    if((TYPEOF(Pike_sp[-1]) == T_OBJECT || TYPEOF(Pike_sp[-1]) == T_FUNCTION)    && !Pike_sp[-1].u.object->prog)    {    pop_stack();    push_int(1); -  return; +     } -  +  else +  {    pop_stack();    push_int(0); -  +  }   });      OPCODE0(F_ZERO_TYPE, "zero_type", 0, {    if(TYPEOF(Pike_sp[-1]) != T_INT)    {    if((TYPEOF(Pike_sp[-1]) == T_OBJECT || TYPEOF(Pike_sp[-1]) == T_FUNCTION)    && !Pike_sp[-1].u.object->prog)    {    pop_stack();    push_int(NUMBER_DESTRUCTED);