pike.git / src / interpret_functions.h

version» Context lines:

pike.git/src/interpret_functions.h:2900: Inside #if 0
  #if 0   /* This opcode needs mending if it is to work with machine code. */   OPCODE0_JUMP(F_BREAKPOINT, "breakpoint", 0, {    extern void o_breakpoint(void);    o_breakpoint();    DO_JUMP_TO(PROG_COUNTER-1);   });   #endif      OPCODE1(F_THIS_OBJECT, "this_object", I_UPDATE_SP, { -  int level; +  LOCAL_VAR(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); +  if(TYPEOF(Pike_sp[-1]) != T_INT) +  { +  pop_stack(); +  push_int(1); +  return; +  } +  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; +  } +  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);    }else{    pop_stack();