pike.git / src / interpret.h

version» Context lines:

pike.git/src/interpret.h:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/      /* -  * $Id: interpret.h,v 1.25 1999/01/21 09:15:02 hubbe Exp $ +  * $Id: interpret.h,v 1.26 1999/01/31 09:01:49 hubbe Exp $    */   #ifndef INTERPRET_H   #define INTERPRET_H      #include "global.h"   #include "program.h"      #ifndef STRUCT_FRAME_DECLARED   #define STRUCT_FRAME_DECLARED   #endif - struct frame + struct pike_frame   { -  +  INT32 refs; /* must be first */ +  INT32 args; +  INT16 fun; +  INT16 num_locals; +  INT16 num_args; +  INT16 malloced_locals; +  struct pike_frame *next; +  struct pike_frame *scope;    unsigned char *pc; -  struct frame *parent_frame; +     struct svalue *locals;    struct svalue *expendible;    struct object *current_object;    struct inherit context;    char *current_storage; -  INT32 args; -  INT32 fun; -  INT16 num_locals; -  INT16 num_args; +    };      #ifdef PIKE_DEBUG   #define debug_check_stack() do{if(sp<evaluator_stack)fatal("Stack error.\n");}while(0)   #define check__positive(X,Y) if((X)<0) fatal(Y)   #include "error.h"   #else   #define check__positive(X,Y)   #define debug_check_stack()   #endif
pike.git/src/interpret.h:83:   #define ref_push_array(A) do{ struct array *_=(A); debug_malloc_touch(_); _->refs++; sp->u.array=_ ;sp++->type=T_ARRAY; }while(0)   #define ref_push_multiset(L) do{ struct multiset *_=(L); debug_malloc_touch(_); _->refs++; sp->u.multiset=_; sp++->type=T_MULTISET; }while(0)   #define ref_push_string(S) do{ struct pike_string *_=(S); debug_malloc_touch(_); _->refs++; sp->subtype=0; sp->u.string=_; sp++->type=T_STRING; }while(0)   #define ref_push_object(O) do{ struct object *_=(O); debug_malloc_touch(_); _->refs++; sp->u.object=_; sp++->type=T_OBJECT; }while(0)      #define push_svalue(S) do { struct svalue *_=(S); assign_svalue_no_free(sp,_); sp++; }while(0)      #define stack_dup() push_svalue(sp-1)   #define stack_swap() do { struct svalue _=sp[-1]; sp[-1]=sp[-2]; sp[-2]=_; } while(0)    + #define free_pike_frame(F) do{ struct pike_frame *f_=(F); debug_malloc_touch(f_); if(!--f_->refs) really_free_pike_frame(f_); }while(0)    -  + #define POP_PIKE_FRAME() do { \ +  struct pike_frame *tmp_=fp; \ +  fp=tmp_->next; \ +  if(!--tmp_->refs) \ +  { \ +  really_free_pike_frame(tmp_); \ +  }else{ \ +  if(tmp_->num_locals) \ +  { \ +  struct svalue *s=(struct svalue *)xalloc(sizeof(struct svalue)* \ +  tmp_->num_locals); \ +  assign_svalues_no_free(s,tmp_->locals,tmp_->num_locals,BIT_MIXED);\ +  tmp_->locals=s; \ +  tmp_->malloced_locals=1; \ +  }else{ \ +  tmp_->locals=0; \ +  } \ +  tmp_->next=0; \ +  } \ +  }while(0) +  +    enum apply_type   {    APPLY_STACK, /* The function is the first argument */    APPLY_SVALUE, /* arg1 points to an svalue containing the function */    APPLY_LOW /* arg1 is the object pointer,(int)arg2 the function */   };      #define apply_low(O,FUN,ARGS) \    mega_apply(APPLY_LOW, (ARGS), (void*)(O),(void*)(FUN))   
pike.git/src/interpret.h:133: Inside #if defined(PIKE_DEBUG)
     #ifdef PIKE_DEBUG   #define fast_check_threads_etc(X) do { \    static int div_; if(d_flag || !(div_++& ((1<<(X))-1))) check_threads_etc(); } while(0)      #else   #define fast_check_threads_etc(X) do { \    static int div_; if(!(div_++& ((1<<(X))-1))) check_threads_etc(); } while(0)   #endif    + #include "block_alloc_h.h"   /* Prototypes begin here */   void push_sp_mark(void);   int pop_sp_mark(void);   void init_interpreter(void);   void lvalue_to_svalue_no_free(struct svalue *to,struct svalue *lval);   void assign_lvalue(struct svalue *lval,struct svalue *from);   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(pike_frame,128) +  + static void restore_creds(struct object *creds);   void mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2);   void f_call_function(INT32 args);   int apply_low_safe_and_stupid(struct object *o, INT32 offset);   void safe_apply_low(struct object *o,int fun,int args);   void safe_apply(struct object *o, char *fun ,INT32 args);   void apply_lfun(struct object *o, int fun, int args);   void apply_shared(struct object *o,    struct pike_string *fun,    int args);   void apply(struct object *o, char *fun, int args);   void apply_svalue(struct svalue *s, INT32 args);   void slow_check_stack(void);   void cleanup_interpret(void);   /* Prototypes end here */      extern struct svalue *sp;   extern struct svalue **mark_sp;   extern struct svalue *evaluator_stack;   extern struct svalue **mark_stack; - extern struct frame *fp; /* frame pointer */ + extern struct pike_frame *fp; /* pike_frame pointer */   extern char *stack_top;   extern int stack_size;   extern int evaluator_stack_malloced, mark_stack_malloced;   struct callback;   extern struct callback_list evaluator_callbacks;   extern void call_callback(struct callback_list *, void *);      #ifdef PROFILING   #ifdef HAVE_GETHRTIME   extern long long accounted_time;   extern long long time_base;   #endif   #endif      #endif