pike.git / src / interpret.h

version» Context lines:

pike.git/src/interpret.h:527:    ptrdiff_t num_= (N); \    for(;num_-- > 0;s_++) \    { \    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)      /* Without fancy accounting stuff. This one can't assume there is an    * identifier corresponding to the frame (i.e. _fp_->ident might be    * bogus). */   #define LOW_POP_PIKE_FRAME(_fp_) do { \    struct pike_frame *tmp_=_fp_->next; \
pike.git/src/interpret.h:626:    Pike_interpreter.accounted_time += self_time; \    /* FIXME: Can context->prog be NULL? */ \    function = _fp_->context->prog->identifiers + _fp_->ident; \    if (!--function->recur_depth) \    function->total_time += time_passed; \    function->self_time += self_time; \    }); \    LOW_POP_PIKE_FRAME (_fp_); \    }while(0)    + #define ASSIGN_CURRENT_STORAGE(VAR, TYPE, INH, EXPECTED_PROGRAM) \ +  do { \ +  int inh__ = (INH); \ +  DO_IF_DEBUG( \ +  struct program *prog__ = (EXPECTED_PROGRAM); \ +  if ((inh__ < 0) || \ +  (inh__ >= Pike_fp->context->prog->num_inherits)) \ +  Pike_fatal("Inherit #%d out of range [0..%d]\n", \ +  inh__, Pike_fp->context->prog->num_inherits-1); \ +  if (prog__ && (Pike_fp->context[inh__].prog != prog__)) \ +  Pike_fatal("Inherit #%d has wrong program %p != %p.\n", \ +  Pike_fp->context[inh__].prog, prog__); \ +  ); \ +  VAR = ((TYPE *)(Pike_fp->current_object->storage + \ +  Pike_fp->context[inh__].storage_offset)); \ +  } while(0)    -  +    enum apply_type   {    APPLY_STACK, /* The function is the first argument */    APPLY_SVALUE, /* arg1 points to an svalue containing the function */    APPLY_SVALUE_STRICT, /* Like APPLY_SVALUE, but does not return values for void functions */    APPLY_LOW /* arg1 is the object pointer,(int)arg2 the function */   };      #define APPLY_MASTER(FUN,ARGS) \   do{ \
pike.git/src/interpret.h:741:    /* destructed before function calls. Otherwise done through */ \    /* evaluator_callbacks. */ \    destruct_objects_to_destruct_cb(); \    } while (0)      /* Used before any sort of backward branch. This is only a safeguard    * for some corner cases with loops without calls - not relevant in    * ordinary code. */   #define FAST_CHECK_THREADS_ON_BRANCH() fast_check_threads_etc (8)    - #include "block_alloc_h.h" +    /* Prototypes begin here */   void push_sp_mark(void);   ptrdiff_t pop_sp_mark(void);   void gc_mark_stack_external (struct pike_frame *frame,    struct svalue *stack_p, struct svalue *stack);   PMOD_EXPORT int low_init_interpreter(struct Pike_interpreter_struct *interpreter);   PMOD_EXPORT void init_interpreter(void);   void lvalue_to_svalue_no_free(struct svalue *to,struct svalue *lval);   PMOD_EXPORT void assign_lvalue(struct svalue *lval,struct svalue *from);   PMOD_EXPORT union anything *get_pointer_if_this_type(struct svalue *lval, TYPE_T t);   void print_return_value(void);   void reset_evaluator(void);   struct backlog;   void dump_backlog(void); - BLOCK_ALLOC (catch_context, 0); - BLOCK_ALLOC(pike_frame,128); + struct catch_context *alloc_catch_context(void); + PMOD_EXPORT void really_free_catch_context( struct catch_context *data ); + PMOD_EXPORT void really_free_pike_frame( struct pike_frame *X ); + void count_memory_in_catch_contexts(size_t*, size_t*); + void count_memory_in_pike_frames(size_t*, size_t*);    -  + /*BLOCK_ALLOC (catch_context, 0);*/ + /*BLOCK_ALLOC(pike_frame,128);*/ +    #ifdef PIKE_USE_MACHINE_CODE   void call_check_threads_etc();   #if defined(OPCODE_INLINE_BRANCH) || defined(INS_F_JUMP) || \    defined(INS_F_JUMP_WITH_ARG) || defined(INS_F_JUMP_WITH_TWO_ARGS)   void branch_check_threads_etc();   #endif   #ifdef OPCODE_INLINE_RETURN   PIKE_OPCODE_T *inter_return_opcode_F_CATCH(PIKE_OPCODE_T *addr);   #endif   #ifdef PIKE_DEBUG   void simple_debug_instr_prologue_0 (PIKE_INSTR_T instr);   void simple_debug_instr_prologue_1 (PIKE_INSTR_T instr, INT32 arg);   void simple_debug_instr_prologue_2 (PIKE_INSTR_T instr, INT32 arg1, INT32 arg2);   #endif   #endif /* PIKE_USE_MACHINE_CODE */      PMOD_EXPORT void find_external_context(struct external_variable_context *loc,    int arg2); -  + struct pike_frame *alloc_pike_frame(void);   void really_free_pike_scope(struct pike_frame *scope); - int low_mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2); + void *lower_mega_apply( INT32 args, struct object *o, ptrdiff_t fun ); + void *low_mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2);   void low_return(void);   void low_return_pop(void);   void unlink_previous_frame(void);   int apply_low_safe_and_stupid(struct object *o, INT32 offset);      PMOD_EXPORT struct Pike_interpreter_struct * pike_get_interpreter_pointer();   PMOD_EXPORT void mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2); -  + PMOD_EXPORT void mega_apply_low(INT32 args, void *arg1, ptrdiff_t arg2);   PMOD_EXPORT void f_call_function(INT32 args);   PMOD_EXPORT void call_handle_error(void);   PMOD_EXPORT int safe_apply_low(struct object *o,int fun,int args);   PMOD_EXPORT int safe_apply_low2(struct object *o,int fun,int args,    const char *fun_name);   PMOD_EXPORT int safe_apply(struct object *o, const char *fun ,INT32 args);   int low_unsafe_apply_handler(const char *fun,    struct object *handler,    struct object *compat,    INT32 args);
pike.git/src/interpret.h:827:   PMOD_EXPORT void low_cleanup_interpret(struct Pike_interpreter_struct *interpreter);   void really_clean_up_interpret(void);   /* Prototypes end here */      /* These need to be after the prototypes,    * to avoid implicit declaration of mega_apply().    */   #ifdef __ECL   static INLINE void apply_low(struct object *o, ptrdiff_t fun, INT32 args)   { -  mega_apply(APPLY_LOW, args, (void*)o, (void*)fun); +  mega_apply_low(args, (void*)o, fun);   }      static INLINE void strict_apply_svalue(struct svalue *sval, INT32 args)   {    mega_apply(APPLY_SVALUE_STRICT, args, (void*)sval, 0);   }   #else /* !__ECL */   #define apply_low(O,FUN,ARGS) \ -  mega_apply(APPLY_LOW, (ARGS), (void*)(O),(void*)(ptrdiff_t)(FUN)) +  mega_apply_low((ARGS), (void*)(O),(FUN))      #define strict_apply_svalue(SVAL,ARGS) \    mega_apply(APPLY_SVALUE, (ARGS), (void*)(SVAL),0)   #endif /* __ECL */      #define apply_current(FUN, ARGS) \    apply_low(Pike_fp->current_object, \    (FUN) + Pike_fp->context->identifier_level, \    (ARGS))