Branch: Tag:

2002-06-25

2002-06-25 14:26:41 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Removed the support for the old-style preorder dumped types (pre USE_PIKE_TYPE).

Rev: src/acconfig.h:1.101
Rev: src/builtin_functions.c:1.433
Rev: src/compilation.h:1.27
Rev: src/configure.in:1.590
Rev: src/constants.c:1.37
Rev: src/encode.c:1.149
Rev: src/global.h:1.70
Rev: src/interpret.c:1.262
Rev: src/language.yacc:1.288
Rev: src/las.c:1.295
Rev: src/main.c:1.149
Rev: src/operators.c:1.156
Rev: src/pike_types.c:1.188
Rev: src/pike_types.h:1.78
Rev: src/program.c:1.437
Rev: src/svalue.c:1.142
Rev: src/svalue.h:1.105

5:   \*/      /* -  * $Id: pike_types.h,v 1.77 2002/05/31 22:41:25 nilsson Exp $ +  * $Id: pike_types.h,v 1.78 2002/06/25 14:26:41 grubba Exp $    */   #ifndef PIKE_TYPES_H   #define PIKE_TYPES_H
20:   #define TYPE_STACK_DEBUG(X)   #endif /* PIKE_DEBUG */    - #ifdef USE_PIKE_TYPE +    /*    * The new type type.    */
62:   #endif /* PIKE_DEBUG */   #endif /* DEBUG_MALLOC */    - #else /* !USE_PIKE_TYPE */ +     - /* -  * The old type type. -  */ - /* Note that pike_type in this case is defined in global.h -  * to avoid circularities with svalue.h and this file. -  */ - #define free_type(T) free_string(T) - #define copy_pike_type(D, S) copy_shared_string(D, S) - #define check_type_string debug_check_type_string -  - #define CONSTTYPE(X) make_shared_binary_string(X,CONSTANT_STRLEN(X)) -  - extern unsigned char type_stack[PIKE_TYPE_STACK_SIZE]; - extern unsigned char *pike_type_mark_stack[PIKE_TYPE_STACK_SIZE/4]; -  - #endif /* USE_PIKE_TYPE */ -  +    struct compiler_frame;      /* Also used in struct node_identifier */
172:   PMOD_EXPORT extern struct pike_type *any_type_string;   PMOD_EXPORT extern struct pike_type *weak_type_string;    - #ifdef USE_PIKE_TYPE +    #define CONSTTYPE(X) make_pike_type(X)   #ifdef DEBUG_MALLOC   struct pike_type_location
201:    copy_pike_type((T), type_); \    } while(0)   #endif /* DEBUG_MALLOC */ - #else /* !USE_PIKE_TYPE */ - #define CONSTTYPE(X) make_shared_binary_string(X,CONSTANT_STRLEN(X)) - #define MAKE_CONSTANT_TYPE(T, X) MAKE_CONSTANT_SHARED_STRING(T, X) - #endif /* USE_PIKE_TYPE */ +       #ifdef PIKE_DEBUG   #define init_type_stack() type_stack_mark()
218:   #define exit_type_stack pop_stack_mark   #endif    - #ifdef USE_PIKE_TYPE +    void debug_push_type(unsigned INT16 type);   void debug_push_reverse_type(unsigned INT16 type);   #ifdef DEBUG_MALLOC
228:   #define push_type debug_push_type   #define push_reverse_type debug_push_reverse_type   #endif /* DEBUG_MALLOC */ - #else /* !USE_PIKE_TYPE */ - /* Hmm, these will cause fatals if they fail... */ - #define push_type(X) do { \ -  if(Pike_compiler->type_stackp >= type_stack + sizeof(type_stack)) \ -  yyerror("Type stack overflow."); \ -  else { \ -  *Pike_compiler->type_stackp=(X); \ -  Pike_compiler->type_stackp++; \ -  } \ - } while(0) +     - #define unsafe_push_type(X) do { \ -  *Pike_compiler->type_stackp=(X); \ -  Pike_compiler->type_stackp++; \ - } while(0) -  - #define unsafe_type_stack_mark() do { \ -  *Pike_compiler->pike_type_mark_stackp=Pike_compiler->type_stackp; \ -  Pike_compiler->pike_type_mark_stackp++; \ - } while(0) -  - #endif /* USE_PIKE_TYPE */ -  +    #define type_stack_mark() do { \    if(Pike_compiler->pike_type_mark_stackp >= pike_type_mark_stack + NELEM(pike_type_mark_stack)) \    fatal("Type mark stack overflow."); \
333:   int pike_type_allow_premature_toss(struct pike_type *type);   /* Prototypes end here */    - /* FIXME: Not supported under USE_PIKE_TYPE yet. */ - #ifndef USE_PIKE_TYPE + #if 0 /* FIXME: Not supported under USE_PIKE_TYPE yet. */   /* "Dynamic types" - use with ADD_FUNCTION_DTYPE */   #define dtStore(TYPE) {int e; for (e=0; e<CONSTANT_STRLEN(TYPE); e++) unsafe_push_type((TYPE)[e]);}   #define dtArr(VAL) {unsafe_push_type(PIKE_T_ARRAY); {VAL}}
389:    type_stack_reverse(); \    (TYPESTR)=pop_unfinished_type(); \   } while (0) - #endif /* !USE_PIKE_TYPE */ + #endif /* 0 */      #ifdef DEBUG_MALLOC   void describe_all_types(void);
399:    ((struct pike_type *)debug_malloc_pass(debug_pop_unfinished_type()))   #define make_pike_type(X) \    ((struct pike_type *)debug_malloc_pass(debug_make_pike_type(X))) - #ifdef USE_PIKE_TYPE +    #define pop_type_stack(E) do { debug_malloc_pass(debug_peek_type_stack()); debug_pop_type_stack(E); } while(0)   #define push_int_type(MIN,MAX) do { debug_push_int_type(MIN,MAX);debug_malloc_pass(debug_peek_type_stack()); } while(0)   #define push_object_type(FLAG,ID) do { debug_push_object_type(FLAG,ID);debug_malloc_pass(debug_peek_type_stack()); } while(0)
411:   #define push_finished_type(T) do { debug_push_finished_type((struct pike_type *)debug_malloc_pass(T));debug_malloc_pass(debug_peek_type_stack()); } while(0)   #define push_finished_type_with_markers(T,M) do { debug_push_finished_type_with_markers((struct pike_type *)debug_malloc_pass(T),M);debug_malloc_pass(debug_peek_type_stack()); } while(0)   #define push_finished_type_backwards(T) ERROR - #else /* !USE_PIKE_TYPE */ - #define make_pike_type debug_make_pike_type - #define pop_type_stack debug_pop_type_stack - #define push_int_type debug_push_int_type - #define push_object_type debug_push_object_type - #define push_object_type_backwards debug_push_object_type_backwards - #define push_scope_type debug_push_scope_type - #define push_type_name debug_push_type_name - #define push_unfinished_type debug_push_unfinished_type - #define push_assign_type debug_push_assign_type - #define push_finished_type debug_push_finished_type - #define push_finished_type_with_markers debug_push_finished_type_with_markers - #define push_finished_type_backwards debug_push_finished_type_backwards - #endif /* USE_PIKE_TYPE */ +    #else   #define make_pike_type debug_make_pike_type   #define pop_type debug_pop_type