pike.git
/
src
/
program.h
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/program.h:8:
#define PROGRAM_H #include "global.h" #include "pike_macros.h" #include "pike_error.h" #include "svalue.h" #include "dmalloc.h" #include "time_stuff.h" #include "program_id.h" #include "pike_rusage.h"
-
#include "block_alloc_h.h"
+
/* Needed to support dynamic loading on NT */ PMOD_EXPORT extern struct program_state * Pike_compiler; /* Compilation flags */ #define COMPILATION_CHECK_FINAL 0x01 /* This flag is set when resolve functions should force the lookup so * that we don't get a placeholder back. Used for inherits. */ #define COMPILATION_FORCE_RESOLVE 0x02
pike.git/src/program.h:558:
* them "dead" and destroy them in an arbitrary order). * * Such a "very simple" handler should only do things like freeing * pointers and clearing variables in the object storage. It can not * assume that any other context is intact when it's called. It might * even get called after the module exit function, which means that * this optimization trick can never be used in a dynamically loaded * module. */ #define PROGRAM_LIVE_OBJ 0x2000
-
/* Indicates that the class is a facet or product_class. */
-
#define PROGRAM_IS_FACET 0x4000
-
#define PROGRAM_IS_PRODUCT 0x8000
-
+
/* Using define instead of enum allows for ifdefs - Hubbe */ #define PROG_EVENT_INIT 0 #define PROG_EVENT_EXIT 1 #define PROG_EVENT_GC_RECURSE 2 #define PROG_EVENT_GC_CHECK 3 #define NUM_PROG_EVENTS 4 /* These macros should only be used if (p->flags & PROGRAM_USES_PARENT) * is true */
pike.git/src/program.h:636:
size_t total_size; #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];
-
-
#ifdef WITH_FACETS
-
/* Facet related stuff */
-
INT32 facet_index; /* Index to the facet this facet class belongs to */
-
struct object *facet_group;
-
#endif
+
};
-
void dump_program_tables (const struct program *p, int indent);
+
PMOD_EXPORT
void dump_program_tables (const struct program *p, int indent);
#ifdef PIKE_DEBUG static INLINE int CHECK_IDREF_RANGE (int x, const struct program *p) { if (x < 0 || 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); } return x; }
pike.git/src/program.h:694:
debug_malloc_touch(_); \ DO_IF_DEBUG ( \ DO_IF_PIKE_CLEANUP ( \ if (gc_external_refs_zapped) \ gc_check_zapped (_, PIKE_T_PROGRAM, __FILE__, __LINE__))); \ if(!sub_ref(_)) \ really_free_program(_); \ }while(0) #endif
-
BLOCK
_
ALLOC
_
FILL
_
PAGES
(program,
n/a
);
+
ATTRIBUTE((malloc))
+
PMOD
_
EXPORT struct program * alloc
_
program();
+
PMOD
_
EXPORT void really_free_program
(
struct
program
* p);
+
PMOD_EXPORT void count_memory_in_programs(size_t *num
,
size_t *_size
);
+
void free_all_program_blocks();
extern struct program *first_program; extern struct program *null_program; extern struct program *compilation_env_program; extern struct program *compilation_program; extern struct object *compilation_environment; extern struct program *pike_trampoline_program; extern struct program *gc_internal_program; extern struct program *placeholder_program;
pike.git/src/program.h:777:
/* Prototypes begin here */ PMOD_EXPORT void do_free_program (struct program *p); void ins_int(INT32 i, void (*func)(char tmp)); void ins_short(int i, void (*func)(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 *resolve_identifier(struct pike_string *ident);
+
PMOD_EXPORT struct program *resolve_program(struct pike_string *ident);
node *program_magic_identifier (struct program_state *state, int state_depth, int inherit_num, struct pike_string *ident, int colon_colon_ref); struct program *parent_compilation(int level); struct program *id_to_program(INT32 id); void optimize_program(struct program *p); void fsort_program_identifier_index(unsigned short *start, unsigned short *end, struct program *p);
pike.git/src/program.h:800:
struct program *low_allocate_program(void); void low_start_new_program(struct program *p, 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 is_variant_dispatcher(struct program *prog, int fun);
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 *)); int really_low_reference_inherited_identifier(struct program_state *q, int e, int i); int low_reference_inherited_identifier(struct program_state *q, int e, struct pike_string *name, int flags); int find_inherit(struct program *p, struct pike_string *name);
-
node
*
reference_inherited_identifier(struct pike_string *
super_name
,
-
struct pike_string *
function_
name);
+
PMOD_EXPORT
int
reference_inherited_identifier(struct
program_state *state,
+
struct
pike_string *
inherit
,
+
struct pike_string *name);
void rename_last_inherit(struct pike_string *n);
-
+
void lower_inherit(struct program *p,
+
struct object *parent,
+
int parent_identifier,
+
int parent_offset,
+
INT32 flags,
+
struct pike_string *name);
PMOD_EXPORT void low_inherit(struct program *p, struct object *parent, int parent_identifier, int parent_offset, INT32 flags, struct pike_string *name); 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);
pike.git/src/program.h:906:
PMOD_EXPORT int debug_end_class(const char *name, ptrdiff_t namelen, INT32 flags); INT32 define_function(struct pike_string *name, struct pike_type *type, unsigned flags, unsigned function_flags, union idptr *func, unsigned opt_flags); int really_low_find_shared_string_identifier(struct pike_string *name, struct program *prog, int flags);
+
int really_low_find_variant_identifier(struct pike_string *name,
+
struct program *prog,
+
struct pike_type *type,
+
int start_pos,
+
int flags);
PMOD_EXPORT int low_find_lfun(struct program *p, ptrdiff_t lfun); int lfun_lookup_id(struct pike_string *lfun_name); int low_find_shared_string_identifier(struct pike_string *name, struct program *prog); struct ff_hash; int find_shared_string_identifier(struct pike_string *name, struct program *prog); PMOD_EXPORT int find_identifier(const char *name,struct program *prog); int store_prog_string(struct pike_string *str); int store_constant(const struct svalue *foo,
pike.git/src/program.h:1037:
PMOD_EXPORT struct program *program_from_svalue(const struct svalue *s); struct find_child_cache_s; int find_child(struct program *parent, struct program *child); struct implements_cache_s; PMOD_EXPORT int implements(struct program *a, struct program *b); PMOD_EXPORT int is_compatible(struct program *a, struct program *b); void yyexplain_not_compatible(int severity_level, struct program *a, struct program *b); void yyexplain_not_implements(int severity_level, struct program *a, struct program *b);
+
void string_builder_explain_not_compatible(struct string_builder *s,
+
struct program *a,
+
struct program *b);
+
void string_builder_explain_not_implements(struct string_builder *s,
+
struct program *a,
+
struct program *b);
PMOD_EXPORT void *parent_storage(int depth); PMOD_EXPORT void change_compiler_compatibility(int major, int minor); void make_area_executable (char *start, size_t len); void make_program_executable(struct program *p); /* Prototypes end here */ void count_memory_in_programs(size_t *, size_t *); #ifndef PIKE_USE_MACHINE_CODE #define make_program_executable(X)