pike.git / src / interpret.h

version» Context lines:

pike.git/src/interpret.h:266:    struct svalue *_=(X); \    free_svalue(_); \    stack_pop_to_no_free(_); \    }while(0)      #define push_program(P) do{ \    struct program *_=(P); \    struct svalue *_sp_ = Pike_sp++; \    debug_malloc_touch(_); \    _sp_->u.program=_; \ -  _sp_->type=PIKE_T_PROGRAM; \ -  IF_CHECKER(_sp_->subtype=0); \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_PROGRAM); \ +  IF_CHECKER(SET_SVAL_SUBTYPE(*_sp_, 0)); \    }while(0)      #define push_int(I) do{ \    INT_TYPE _=(I); \    struct svalue *_sp_ = Pike_sp++; \    _sp_->u.integer=_; \ -  _sp_->type=PIKE_T_INT; \ -  _sp_->subtype=NUMBER_NUMBER; \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_INT); \ +  SET_SVAL_SUBTYPE(*_sp_, NUMBER_NUMBER); \    }while(0)      #define push_undefined() do{ \    struct svalue *_sp_ = Pike_sp++; \    _sp_->u.integer=0; \ -  _sp_->type=PIKE_T_INT; \ -  _sp_->subtype=NUMBER_UNDEFINED; \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_INT); \ +  SET_SVAL_SUBTYPE(*_sp_, NUMBER_UNDEFINED); \    }while(0)      #define push_obj_index(I) do{ \    int _=(I); \    struct svalue *_sp_ = Pike_sp++; \    _sp_->u.identifier=_; \ -  _sp_->type=T_OBJ_INDEX; \ -  IF_CHECKER(_sp_->subtype=0); \ +  SET_SVAL_TYPE(*_sp_, T_OBJ_INDEX); \ +  IF_CHECKER(SET_SVAL_SUBTYPE(*_sp_, 0)); \    }while(0)      #define push_mapping(M) do{ \    struct mapping *_=(M); \    struct svalue *_sp_ = Pike_sp++; \    debug_malloc_touch(_); \    _sp_->u.mapping=_; \ -  _sp_->type=PIKE_T_MAPPING; \ -  IF_CHECKER(_sp_->subtype=0); \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_MAPPING); \ +  IF_CHECKER(SET_SVAL_SUBTYPE(*_sp_, 0)); \    }while(0)      #define push_array(A) do{ \    struct array *_=(A); \    struct svalue *_sp_ = Pike_sp++; \    debug_malloc_touch(_); \    _sp_->u.array=_ ; \ -  _sp_->type=PIKE_T_ARRAY; \ -  IF_CHECKER(_sp_->subtype=0); \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_ARRAY); \ +  IF_CHECKER(SET_SVAL_SUBTYPE(*_sp_, 0)); \    }while(0)      #define push_empty_array() ref_push_array(&empty_array)      #define push_multiset(L) do{ \    struct multiset *_=(L); \    struct svalue *_sp_ = Pike_sp++; \    debug_malloc_touch(_); \    _sp_->u.multiset=_; \ -  _sp_->type=PIKE_T_MULTISET; \ -  IF_CHECKER(_sp_->subtype=0); \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_MULTISET); \ +  IF_CHECKER(SET_SVAL_SUBTYPE(*_sp_, 0)); \    }while(0)      #define push_string(S) do { \    struct pike_string *_=(S); \    struct svalue *_sp_ = Pike_sp++; \    debug_malloc_touch(_); \    DO_IF_DEBUG(if(_->size_shift & ~3) { \    Pike_fatal("Pushing string with bad shift: %d\n", \    _->size_shift); \    }); \ -  _sp_->subtype=0; \ +  SET_SVAL_SUBTYPE(*_sp_, 0); \    _sp_->u.string=_; \ -  _sp_->type=PIKE_T_STRING; \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_STRING); \    }while(0)      #define push_empty_string() ref_push_string(empty_pike_string)      #define push_type_value(S) do{ \    struct pike_type *_=(S); \    struct svalue *_sp_ = Pike_sp++; \    debug_malloc_touch(_); \    _sp_->u.type=_; \ -  _sp_->type=PIKE_T_TYPE; \ -  IF_CHECKER(_sp_->subtype=0); \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_TYPE); \ +  IF_CHECKER(SET_SVAL_SUBTYPE(*_sp_, 0)); \    }while(0)      #define push_object(O) do { \    struct object *_=(O); \    struct svalue *_sp_ = Pike_sp++; \    debug_malloc_touch(_); \    _sp_->u.object=_; \ -  _sp_->type=PIKE_T_OBJECT; \ -  _sp_->subtype = 0; \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_OBJECT); \ +  SET_SVAL_SUBTYPE(*_sp_, 0); \    }while(0)      #define push_object_inherit(O, INH_NUM) do { \    struct object *_ = (O); \    struct svalue *_sp_ = Pike_sp++; \    int _inh_ = (INH_NUM); \    debug_malloc_touch(_); \    _sp_->u.object = _; \ -  _sp_->type = PIKE_T_OBJECT; \ -  _sp_->subtype = _inh_; \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_OBJECT); \ +  SET_SVAL_SUBTYPE(*_sp_, _inh_); \    }while(0)      #define push_float(F) do{ \    FLOAT_TYPE _=(F); \    struct svalue *_sp_ = Pike_sp++; \    _sp_->u.float_number=_; \ -  _sp_->type=PIKE_T_FLOAT; \ -  IF_CHECKER(_sp_->subtype=0); \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_FLOAT); \ +  IF_CHECKER(SET_SVAL_SUBTYPE(*_sp_, 0)); \    }while(0)      #define push_text(T) do { \    const char *_ = (T); \    struct svalue *_sp_ = Pike_sp++; \ -  _sp_->subtype=0; \ +  SET_SVAL_SUBTYPE(*_sp_, 0); \    _sp_->u.string=make_shared_binary_string(_,strlen(_)); \    debug_malloc_touch(_sp_->u.string); \ -  _sp_->type=PIKE_T_STRING; \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_STRING); \    }while(0)      #define push_constant_text(T) do{ \    struct svalue *_sp_ = Pike_sp++; \ -  _sp_->subtype=0; \ +  SET_SVAL_SUBTYPE(*_sp_, 0); \    REF_MAKE_CONST_STRING(_sp_->u.string,T); \ -  _sp_->type=PIKE_T_STRING; \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_STRING); \    }while(0)      #define push_constant_string_code(STR, CODE) do{ \    struct pike_string *STR; \    REF_MAKE_CONST_STRING_CODE (STR, CODE); \    push_string (STR); \    }while(0)      #define push_function(OBJ, FUN) do { \    struct object *_=(OBJ); \    struct svalue *_sp_ = Pike_sp++; \    debug_malloc_touch(_); \    _sp_->u.object=_; \ -  _sp_->subtype=(FUN); \ -  _sp_->type=PIKE_T_FUNCTION; \ +  SET_SVAL_SUBTYPE(*_sp_, (FUN)); \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_FUNCTION); \    } while (0)      #define ref_push_program(P) do{ \    struct program *_=(P); \    struct svalue *_sp_ = Pike_sp++; \    add_ref(_); \    _sp_->u.program=_; \ -  _sp_->type=PIKE_T_PROGRAM; \ -  IF_CHECKER(_sp_->subtype=0); \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_PROGRAM); \ +  IF_CHECKER(SET_SVAL_SUBTYPE(*_sp_, 0)); \    }while(0)      #define ref_push_mapping(M) do{ \    struct mapping *_=(M); \    struct svalue *_sp_ = Pike_sp++; \    add_ref(_); \    _sp_->u.mapping=_; \ -  _sp_->type=PIKE_T_MAPPING; \ -  IF_CHECKER(_sp_->subtype=0); \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_MAPPING); \ +  IF_CHECKER(SET_SVAL_SUBTYPE(*_sp_, 0)); \    }while(0)      #define ref_push_array(A) do{ \    struct array *_=(A); \    struct svalue *_sp_ = Pike_sp++; \    add_ref(_); \    _sp_->u.array=_ ; \ -  _sp_->type=PIKE_T_ARRAY; \ -  IF_CHECKER(_sp_->subtype=0); \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_ARRAY); \ +  IF_CHECKER(SET_SVAL_SUBTYPE(*_sp_, 0)); \    }while(0)      #define ref_push_multiset(L) do{ \    struct multiset *_=(L); \    struct svalue *_sp_ = Pike_sp++; \    add_ref(_); \    _sp_->u.multiset=_; \ -  _sp_->type=PIKE_T_MULTISET; \ -  IF_CHECKER(_sp_->subtype=0); \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_MULTISET); \ +  IF_CHECKER(SET_SVAL_SUBTYPE(*_sp_, 0)); \    }while(0)      #define ref_push_string(S) do{ \    struct pike_string *_=(S); \    struct svalue *_sp_ = Pike_sp++; \    DO_IF_DEBUG(if(_->size_shift & ~3) { \    Pike_fatal("Pushing string with bad shift: %d\n", \    _->size_shift); \    }); \    add_ref(_); \ -  _sp_->subtype=0; \ +  SET_SVAL_SUBTYPE(*_sp_, 0); \    _sp_->u.string=_; \ -  _sp_->type=PIKE_T_STRING; \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_STRING); \    }while(0)      #define ref_push_type_value(S) do{ \    struct pike_type *_=(S); \    struct svalue *_sp_ = Pike_sp++; \    add_ref(_); \    _sp_->u.type=_; \ -  _sp_->type=PIKE_T_TYPE; \ -  IF_CHECKER(_sp_->subtype=0); \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_TYPE); \ +  IF_CHECKER(SET_SVAL_SUBTYPE(*_sp_, 0)); \    }while(0)      #define ref_push_object(O) do{ \    struct object *_=(O); \    struct svalue *_sp_ = Pike_sp++; \    add_ref(_); \    _sp_->u.object=_; \ -  _sp_->type=PIKE_T_OBJECT; \ -  _sp_->subtype = 0; \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_OBJECT); \ +  SET_SVAL_SUBTYPE(*_sp_, 0); \    }while(0)      #define ref_push_object_inherit(O, INH_NUM) do{ \    struct object *_ = (O); \    struct svalue *_sp_ = Pike_sp++; \    int _inh_ = (INH_NUM); \    add_ref(_); \    _sp_->u.object = _; \ -  _sp_->type = PIKE_T_OBJECT; \ -  _sp_->subtype = _inh_; \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_OBJECT); \ +  SET_SVAL_SUBTYPE(*_sp_, _inh_); \    }while(0)      #define ref_push_function(OBJ, FUN) do { \    struct object *_=(OBJ); \    struct svalue *_sp_ = Pike_sp++; \    add_ref(_); \    _sp_->u.object=_; \ -  _sp_->subtype=(FUN); \ -  _sp_->type=PIKE_T_FUNCTION; \ +  SET_SVAL_SUBTYPE(*_sp_, (FUN)); \ +  SET_SVAL_TYPE(*_sp_, PIKE_T_FUNCTION); \    } while (0)      #define push_svalue(S) do { \    const struct svalue *_=(S); \    struct svalue *_sp_ = Pike_sp++; \    assign_svalue_no_free(_sp_,_); \    }while(0)      #define stack_dup() push_svalue(Pike_sp-1)   
pike.git/src/interpret.h:510:    struct svalue _=_sp_[-1]; \    _sp_[-1]=_sp_[-2]; \    _sp_[-2]=_; \    } while(0)      #define push_zeroes(N) do{ \    struct svalue *s_=Pike_sp; \    ptrdiff_t num_= (N); \    for(;num_-- > 0;s_++) \    { \ -  s_->type=PIKE_T_INT; \ -  s_->subtype=NUMBER_NUMBER; \ +  SET_SVAL_TYPE(*s_, PIKE_T_INT); \ +  SET_SVAL_SUBTYPE(*s_, NUMBER_NUMBER); \    s_->u.integer=0; \    } \    Pike_sp=s_; \   }while(0)      #define push_undefines(N) do{ \    struct svalue *s_=Pike_sp; \    ptrdiff_t num_= (N); \    for(;num_-- > 0;s_++) \    { \ -  s_->type=PIKE_T_INT; \ -  s_->subtype=NUMBER_UNDEFINED; \ +  SET_SVAL_TYPE(*s_, PIKE_T_INT); \ +  SET_SVAL_SUBTYPE(*s_, NUMBER_UNDEFINED); \    s_->u.integer=0; \    } \    Pike_sp=s_; \   }while(0)      #define free_pike_frame(F) do{ struct pike_frame *f_=(F); if(!sub_ref(f_)) really_free_pike_frame(f_); }while(0)      /* A scope is any frame which may have malloced locals */   #define free_pike_scope(F) do{ struct pike_frame *f_=(F); if(!sub_ref(f_)) really_free_pike_scope(f_); }while(0)