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.24 1998/11/22 11:02:54 hubbe Exp $ +  * $Id: interpret.h,v 1.25 1999/01/21 09:15:02 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   {    unsigned char *pc;    struct frame *parent_frame;    struct svalue *locals;    struct svalue *expendible; -  INT32 args; +     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    -  + #define check_stack(X) do { \ +  if(sp - evaluator_stack + (X) >= stack_size) \ +  error("Stack overflow.\n"); \ +  }while(0) +  + #define check_mark_stack(X) do { \ +  if(mark_sp - mark_stack + (X) >= stack_size) \ +  error("Mark stack overflow.\n"); \ +  }while(0) +  + #define check_c_stack(X) do { \ +  long x_= ((char *)&x_) + STACK_DIRECTION * (X) - stack_top ; \ +  x_*=STACK_DIRECTION; \ +  if(x_>0) \ +  error("C stack overflow.\n"); \ +  }while(0) +  +    #define pop_stack() do{ free_svalue(--sp); debug_check_stack(); }while(0)      #define pop_n_elems(X) \    do { int x_=(X); if(x_) { \    check__positive(x_,"Popping negative number of args....\n"); \    sp-=x_; debug_check_stack(); \    free_svalues(sp,x_,BIT_MIXED); \    } } while (0)      #define push_program(P) do{ struct program *_=(P); debug_malloc_touch(_); sp->u.program=_; sp++->type=T_PROGRAM; }while(0)
pike.git/src/interpret.h:119:      #else   #define fast_check_threads_etc(X) do { \    static int div_; if(!(div_++& ((1<<(X))-1))) check_threads_etc(); } while(0)   #endif      /* Prototypes begin here */   void push_sp_mark(void);   int pop_sp_mark(void);   void init_interpreter(void); - void check_stack(INT32 size); - void check_mark_stack(INT32 size); +    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);   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);