pike.git / src / program.h

version» Context lines:

pike.git/src/program.h:109:       LFUN__SEARCH = NUM_LFUNS,    LFUN__TYPES,    LFUN__SERIALIZE,    LFUN__DESERIALIZE,    LFUN__SIZE_OBJECT,    LFUN__RANDOM,    LFUN_POW,    LFUN_RPOW,    LFUN__SQRT, +  LFUN__ANNOTATIONS, +  LFUN__M_CLEAR, +  LFUN__M_ADD,   };      extern const char *const lfun_names[];      extern struct pike_string *lfun_strings[];      #ifndef STRUCT_NODE_S_DECLARED   #define STRUCT_NODE_S_DECLARED   struct node_s;   typedef struct node_s node;
pike.git/src/program.h:491:    /* The parent object for the program in this inherit, or NULL if    * there isn't any. */    struct object *parent;       /* The program for this inherit. */    struct program *prog;       /* The name of the inherit, if there is any. For nested inherits,    * this can be a string on the form "A::B::C". */    struct pike_string *name; +  +  /* The set of annotations for this inherit (if any). +  * +  * For inherit #0 these are set either directly via +  * annotations on the class, or via inherit of classes +  * that have annotations that are annotated as @Inherited. +  * +  * For inherits at level 1 these are set from the annotations +  * on the corresponding inherit declaration, together with +  * the original annotations that haven't been annotated as +  * @Inherited. +  * +  * For inherits at higher levels they are copied verbatim from their +  * previous program. +  */ +  struct multiset *annotations;   };      /**    * Special inherit references.    *    * These are used by find_inherited_identifier().    */   #define INHERIT_SELF 0 /* Self. */   #define INHERIT_LOCAL -1 /* Self and not overrideable (force local). */   #define INHERIT_GLOBAL -2 /* Self and overrideable. */   #define INHERIT_ALL -3 /* All inherits but not self. */       -  + /* PROGRAM_* flags. Currently INT16. */    -  +    /* program parts have been realloced into one block */   #define PROGRAM_OPTIMIZED 1      /* program has gone through pass 1 of compiler, prototypes etc. will    * not change from now on    */   #define PROGRAM_FIXED 2      /* Program is done and can be cloned */   #define PROGRAM_FINISHED 4
pike.git/src/program.h:656:      #define FOO(NUMTYPE,TYPE,ARGTYPE,NAME) TYPE * NAME ;   #include "program_areas.h"      #define FOO(NUMTYPE,TYPE,ARGTYPE,NAME) NUMTYPE PIKE_CONCAT(num_,NAME) ;   #include "program_areas.h"       INT16 lfuns[NUM_LFUNS];   };    + struct local_variable_info + { +  int names[MAX_LOCAL]; /* Offset in strings. */ +  int types[MAX_LOCAL]; /* Offset in constants. */ +  int num_local; /* Number of entries in either of the above. */ + }; +    PMOD_EXPORT void dump_program_tables (const struct program *p, int indent);      #ifdef PIKE_DEBUG   PIKE_UNUSED_ATTRIBUTE   static inline unsigned INT16 CHECK_IDREF_RANGE(unsigned INT16 x, const struct program *p) {    if (x >= p->num_identifier_references) {    dump_program_tables(p, 4);    debug_fatal ("Identifier reference index %d out of range 0..%d\n", x,    p->num_identifier_references - 1);    }
pike.git/src/program.h:769:      #define FOO(NUMTYPE,TYPE,ARGTYPE,NAME) \    void PIKE_CONCAT(add_to_,NAME)(ARGTYPE ARG);   #define BAR(NUMTYPE,TYPE,ARGTYPE,NAME) \    void PIKE_CONCAT(low_add_many_to_,NAME)(struct program_state *state, ARGTYPE *ARG, NUMTYPE cnt); \    void PIKE_CONCAT(add_to_,NAME)(ARGTYPE ARG);   #include "program_areas.h"      /* Prototypes begin here */   PMOD_EXPORT void do_free_program (struct program *p); - void ins_int(INT32 i, void (*func)(char tmp)); + void ins_int(INT32 i, void (*func)(unsigned char tmp));   void add_relocated_int_to_program(INT32 i);   void use_module(struct svalue *s);   void unuse_modules(INT32 howmany);   node *find_module_identifier(struct pike_string *ident,    int see_inherit);   node *find_predef_identifier(struct pike_string *ident);   int low_resolve_identifier(struct pike_string *ident);   node *resolve_identifier(struct pike_string *ident);   PMOD_EXPORT struct program *resolve_program(struct pike_string *ident);   node *find_inherited_identifier(struct program_state *inherit_state,
pike.git/src/program.h:808:    int pass,    struct pike_string *name,    int flags,    int *idp);   PMOD_EXPORT void debug_start_new_program(INT_TYPE line, const char *file);   void dump_program_desc(struct program *p);   int sizeof_variable(int run_time_type);   void check_program(struct program *p);   int low_is_variant_dispatcher(struct identifier *id);   int is_variant_dispatcher(struct program *prog, int fun); + PMOD_EXPORT void add_annotation(int id, struct svalue *sval); + void compiler_add_annotations(int id, node *annotations); + PMOD_EXPORT void add_program_annotation(int id, struct svalue *sval); + void compiler_add_program_annotations(int id, node *annotations);   struct program *end_first_pass(int finish);   PMOD_EXPORT struct program *debug_end_program(void);   PMOD_EXPORT size_t low_add_storage(size_t size, size_t alignment,    ptrdiff_t modulo_orig);   PMOD_EXPORT void set_init_callback(void (*init_callback)(struct object *));   PMOD_EXPORT void set_exit_callback(void (*exit_callback)(struct object *));   PMOD_EXPORT void set_gc_recurse_callback(void (*m)(struct object *));   PMOD_EXPORT void set_gc_check_callback(void (*m)(struct object *));   PMOD_EXPORT void pike_set_prog_event_callback(void (*cb)(int));   PMOD_EXPORT void pike_set_prog_optimize_callback(node *(*opt)(node *));
pike.git/src/program.h:850:    INT32 flags,    struct pike_string *name);   PMOD_EXPORT struct program *lexical_inherit(int scope_depth,    struct pike_string *symbol,    INT32 flags,    int failure_severity_level);   PMOD_EXPORT void do_inherit(struct svalue *s,    INT32 flags,    struct pike_string *name);   void compiler_do_inherit(node *n, INT32 flags, struct pike_string *name); - void compiler_do_implement(node *n); +    int call_handle_inherit(struct pike_string *s);   void simple_do_inherit(struct pike_string *s,    INT32 flags,    struct pike_string *name);   int isidentifier(const struct pike_string *s);   int low_define_alias(struct pike_string *name, struct pike_type *type,    int flags, int depth, int refno);   PMOD_EXPORT int define_alias(struct pike_string *name, struct pike_type *type,    int flags, int depth, int refno);   int is_auto_variable_type( int variable );
pike.git/src/program.h:911:    const char *str,    INT32 flags);   PMOD_EXPORT int add_program_constant(const char *name,    struct program *p,    INT32 flags);   PMOD_EXPORT int add_object_constant(const char *name,    struct object *o,    INT32 flags);   PMOD_EXPORT int add_function_constant(const char *name, void (*cfun)(INT32), const char * type, int flags);   PMOD_EXPORT int debug_end_class(const char *name, ptrdiff_t namelen, INT32 flags); + int is_lfun_name(struct pike_string *name);   INT32 define_function(struct pike_string *name,    struct pike_type *type,    unsigned flags,    unsigned function_flags,    union idptr *func,    unsigned opt_flags);   PMOD_EXPORT int really_low_find_shared_string_identifier(const struct pike_string *name,    const struct program *prog,    int flags);   int really_low_find_variant_identifier(struct pike_string *name,
pike.git/src/program.h:941:   int find_shared_string_identifier(struct pike_string *name,    const struct program *prog);   PMOD_EXPORT int find_identifier(const char *name,const struct program *prog);   int store_prog_string(struct pike_string *str);   int store_constant(const struct svalue *foo,    int equal,    struct pike_string *constant_name);   struct array *program_indices(struct program *p);   struct array *program_values(struct program *p);   struct array *program_types(struct program *p); + struct array *program_inherit_annotations(struct program *p); + struct array *program_annotations(struct program *p, int flags);   int low_program_index_no_free(struct svalue *to, struct program *p, int e,    struct object *parent, int parent_identifier);   int program_index_no_free(struct svalue *to, struct svalue *what,    struct svalue *ind);   INT_TYPE get_small_number(char **q);   void ext_store_program_line (struct program *prog, INT_TYPE line,    struct pike_string *file);   void start_line_numbering(void);   void store_linenumber(INT_TYPE current_line, struct pike_string *current_file); -  + void store_linenumber_local_name(int local_num, int string_num); + void store_linenumber_local_type(int local_num, int constant_num); + void store_linenumber_local_end(int local_num);   PMOD_EXPORT struct pike_string *low_get_program_line(struct program *prog,    INT_TYPE *linep);   PMOD_EXPORT struct pike_string *get_program_line(struct program *prog,    INT_TYPE *linep);   PMOD_EXPORT char *low_get_program_line_plain (struct program *prog,    INT_TYPE *linep,    int malloced);   PMOD_EXPORT struct pike_string *low_get_line(PIKE_OPCODE_T *pc,    struct program *prog, -  INT_TYPE *linep); +  INT_TYPE *linep, +  struct local_variable_info *vars);   PMOD_EXPORT char *low_get_line_plain (PIKE_OPCODE_T *pc, struct program *prog,    INT_TYPE *linep, int malloced);   PMOD_EXPORT struct pike_string *get_line(PIKE_OPCODE_T *pc,    struct program *prog,    INT_TYPE *linep);   PMOD_EXPORT struct pike_string *low_get_function_line (struct object *o,    int fun,    INT_TYPE *linep);   PMOD_EXPORT struct pike_string *get_identifier_line(struct program *p,    int fun,