Branch: Tag:

2007-09-24

2007-09-24 19:18:25 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Changed the semantics of program_index_no_free() somewhat in preparation for having symbols with storage in parent classes.
Changed the representation of tentatively typed function identifiers.
They are now marked by having the run time type T_MIXED.
Changed the encoding in the identifier_flags field somewhat to free up a bit to indicate that the symbol has storage in an external scope.
Bumped version to 7.7.36 since the dump format for programs has changed.
Fixed minor bug in index_no_free() when indexing a function that wasn't a program.

Rev: src/object.c:1.275
Rev: src/operators.c:1.222
Rev: src/program.c:1.619
Rev: src/program.h:1.230
Rev: src/version.h:1.393

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: program.h,v 1.229 2007/05/26 19:14:59 mast Exp $ + || $Id: program.h,v 1.230 2007/09/24 19:18:25 grubba Exp $   */      #ifndef PROGRAM_H
216:   };      #define IDENTIFIER_VARIABLE 0 - #define IDENTIFIER_PIKE_FUNCTION 1 + #define IDENTIFIER_CONSTANT 1   #define IDENTIFIER_C_FUNCTION 2 - #define IDENTIFIER_FUNCTION 3 - #define IDENTIFIER_CONSTANT 4 - #define IDENTIFIER_TYPE_MASK 7 + #define IDENTIFIER_PIKE_FUNCTION 3 + #define IDENTIFIER_FUNCTION 2 + #define IDENTIFIER_TYPE_MASK 3    -  + #define IDENTIFIER_EXTERN 4 /* Identifier actually in a surrounding scope. */ +    #define IDENTIFIER_VARARGS 8 /* Used for functions only. */   #define IDENTIFIER_NO_THIS_REF 8 /* Used for variables only: Don't count refs to self. */   #define IDENTIFIER_HAS_BODY 16 /* Function has a body (set already in pass 1). */
230:   #define IDENTIFIER_ALIAS 128 /* This identifier is an alias. */      #define IDENTIFIER_IS_FUNCTION(X) ((X) & IDENTIFIER_FUNCTION) - #define IDENTIFIER_IS_PIKE_FUNCTION(X) ((X) & IDENTIFIER_PIKE_FUNCTION) - #define IDENTIFIER_IS_C_FUNCTION(X) ((X) & IDENTIFIER_C_FUNCTION) - #define IDENTIFIER_IS_CONSTANT(X) ((X) & IDENTIFIER_CONSTANT) + #define IDENTIFIER_IS_PIKE_FUNCTION(X) (((X) & IDENTIFIER_TYPE_MASK) == IDENTIFIER_PIKE_FUNCTION) + #define IDENTIFIER_IS_C_FUNCTION(X) (((X) & IDENTIFIER_TYPE_MASK) == IDENTIFIER_C_FUNCTION) + #define IDENTIFIER_IS_CONSTANT(X) (((X) & IDENTIFIER_TYPE_MASK) == IDENTIFIER_CONSTANT)   #define IDENTIFIER_IS_VARIABLE(X) (!((X) & IDENTIFIER_TYPE_MASK)) -  + #define IDENTIFIER_IS_SCOPED(X) ((X) & IDENTIFIER_SCOPED)   #define IDENTIFIER_IS_ALIAS(X) ((X) & IDENTIFIER_ALIAS)      #define IDENTIFIER_MASK 255
591:   #endif   };    - #if 0 + #if PIKE_DEBUG   static INLINE int CHECK_IDREF_RANGE (int x, const struct program *p)   {    if (x < 0 || x >= p->num_identifier_references)
831:    struct pike_string *constant_name);   struct array *program_indices(struct program *p);   struct array *program_values(struct program *p); - void program_index_no_free(struct svalue *to, struct program *p, + int program_index_no_free(struct svalue *to, struct svalue *what,    struct svalue *ind);   int get_small_number(char **q);   void ext_store_program_line (struct program *prog, INT32 line, struct pike_string *file);