YAP 7.1.0
hstruct.h
1
2 /* This file, hstruct.h, was generated automatically by "yap -L misc/buildlocalglobal"
3 please do not update, update H/HEAPFIELDS instead */
4
5//
6// File defining fields in the Yap_heap_codes global structure
7//
8// these fields used to spread all over the place, because they must be used in 4 ways:
9// - they must be defined somewhere
10// - they have an #ifdef to get a shorter name
11// - they must be initialised somewhere
12// - they must be restorable and collectable (from the atom gc).
13//
14//
15// The defs include 4+ components:
16// Type
17// name in structured
18// global name
19// init code and restore code (optional)
20//
21//
22//
23// MkAT (MkAtomTerm) cvts from a predefined atom to a term
24// MkPred constructs a pred_entry
25// MkOp gets an opcode
26// void does nothing
27// =VALUE inits as VALUE
28// Init... sets up call to InitFunc
29// Restore... sets up call to RestoreFunc
30//
31
32/* memory management */
33 UInt Yap_HoleSize_;
34#if USE_DL_MALLOC
35 struct malloc_state *Yap_av_;
36 struct memory_hole Yap_MemoryHoles[MAX_DLMALLOC_HOLES]_;
37 UInt Yap_NOfMemoryHoles_;
38#if defined(YAPOR) || defined(THREADS)
39 lockvar DLMallocLock_;
40#endif
41#endif
42#if USE_DL_MALLOC || (USE_SYSTEM_MALLOC && HAVE_MALLINFO)
43#ifndef HeapUsed
44#define HeapUsed Yap_givemallinfo()
45#endif
46 Int NotHeapUsed_;
47#else
48 Int HeapUsed_;
49#endif
50 Int HeapMax_;
51 ADDR HeapTop_;
52 ADDR HeapLim_;
53 struct FREEB *FreeBlocks_;
54#if defined(YAPOR) || defined(THREADS)
55 lockvar FreeBlocksLock_;
56 lockvar HeapUsedLock_;
57 lockvar HeapTopLock_;
58 int HeapTopOwner_;
59#endif
60 UInt MaxStack_;
61 UInt MaxTrail_;
62/* execution info */
63/* OPCODE REVERSE TABLE, needed to recover op tables */
64#if USE_THREADED_CODE
65 struct opcode_optab_entry *OP_RTABLE_;
66#endif
67/* popular opcodes */
68 OPCODE EITHER_OPCODE_;
69 OPCODE EXECUTE_CPRED_OPCODE_;
70 OPCODE EXECUTE_CPRED_OP_CODE_;
71 OPCODE EXPAND_OP_CODE_;
72 OPCODE FAIL_OPCODE_;
73 OPCODE INDEX_OPCODE_;
74 OPCODE LOCKPRED_OPCODE_;
75 OPCODE ORLAST_OPCODE_;
76 OPCODE UNDEF_OPCODE_;
77 OPCODE RETRY_USERC_OPCODE_;
78 OPCODE EXECUTE_CPRED_OPCODE_;
79 OPCODE FCALL_OPCODE_;
80/* atom tables */
81 UInt NOfAtoms_;
82 UInt AtomHashTableSize_;
83 UInt WideAtomHashTableSize_;
84 UInt NOfWideAtoms_;
85 AtomHashEntry INVISIBLECHAIN_;
86 AtomHashEntry *WideHashChain_;
87 AtomHashEntry *HashChain_;
88/* use atom defs here */
89#include "tatoms.h"
90#ifdef EUROTRA
91 Term TermDollarU_;
92#endif
93//modules
94 Term USER_MODULE_;
95 Term IDB_MODULE_;
96 Term ATTRIBUTES_MODULE_;
97 Term CHARSIO_MODULE_;
98 Term CHTYPE_MODULE_;
99 Term TERMS_MODULE_;
100 Term SYSTEM_MODULE_;
101 Term READUTIL_MODULE_;
102 Term HACKS_MODULE_;
103 Term ARG_MODULE_;
104 Term GLOBALS_MODULE_;
105 Term SWI_MODULE_;
106 Term DBLOAD_MODULE_;
107 Term RANGE_MODULE_;
108 Term ERROR_MODULE_;
109//
110// Module list
111//
112 struct mod_entry *CurrentModules_;
113// make sure we have the modules set at this point.
114// don't actually want to define a field
115
116// hidden predicates
117 Prop HIDDEN_PREDICATES_;
118// make sure we have the streams set at this point.
119// don't actually want to define a field
120
121 union flagTerm* GLOBAL_Flags_;
122 UInt GLOBAL_flagCount_;
123/* Anderson's JIT */
124 yap_exec_mode Yap_ExecutionMode_;
125/* The Predicate Hash Table: fast access to predicates. */
126 UInt PredsInHashTable_;
127 uint64_t PredHashTableSize_;
128 struct pred_entry **PredHash_;
129#if defined(YAPOR) || defined(THREADS)
130 rwlock_t PredHashRWLock_;
131#endif
132/* Well-Known Predicates */
133 struct pred_entry *CreepCode_;
134 struct pred_entry *UndefHook_;
135 struct pred_entry *UndefHook0_;
136 struct pred_entry *UserUndefHook_;
137 struct pred_entry *SpyCode_;
138 struct pred_entry *PredFail_;
139 struct pred_entry *PredTrue_;
140#ifdef COROUTINING
141 struct pred_entry *WakeUpCode_;
142#endif
143 struct pred_entry *PredCsult_;
144 struct pred_entry *PredDollarCatch_;
145#ifdef YAPOR
146 struct pred_entry *PredGetwork_;
147#endif /* YAPOR */
148 struct pred_entry *PredGoalExpansion_;
149 struct pred_entry *PredHandleThrow_;
150 struct pred_entry *PredIs_;
151 struct pred_entry *PredLogUpdClause_;
152 struct pred_entry *PredLogUpdClauseErase_;
153 struct pred_entry *PredLogUpdClause0_;
154 struct pred_entry *PredCall_;
155 struct pred_entry *PredMetaCall_;
156 struct pred_entry *PredPrologCutTo_;
157 struct pred_entry *PredProtectStack_;
158 struct pred_entry *PredRecordedWithKey_;
159 struct pred_entry *PredRestoreRegs_;
160 struct pred_entry *PredSafeCallCleanup_;
161 struct pred_entry *PredStaticClause_;
162 struct pred_entry *PredThrow_;
163 struct pred_entry *PredTraceMetaCall_;
164 struct pred_entry *PredCommentHook_;
165 struct pred_entry *PredProcedure_;
166 struct pred_entry *PredUndefinedQuery_;
167 struct pred_entry *PredComma_;
168 struct pred_entry *PredCatch_;
169/* low-level tracer */
170#ifdef LOW_LEVEL_TRACER
171 int Yap_do_low_level_trace_;
172#if defined(YAPOR) || defined(THREADS)
173 lockvar Yap_low_level_trace_lock_;
174#endif
175#endif
176/* code management info */
177 UInt Yap_ClauseSpace_;
178 UInt Yap_IndexSpace_Tree_;
179 UInt Yap_IndexSpace_EXT_;
180 UInt Yap_IndexSpace_SW_;
181 UInt Yap_LUClauseSpace_;
182 UInt Yap_LUIndexSpace_Tree_;
183 UInt Yap_LUIndexSpace_CP_;
184 UInt Yap_LUIndexSpace_EXT_;
185 UInt Yap_LUIndexSpace_SW_;
186/* static code: may be shared by many predicate or may be used for meta-execution */
187 yamop COMMA_CODE_[5];
188 yamop DUMMYCODE_[1];
189 yamop FAILCODE_[1];
190 yamop NOCODE_[1];
191 yamop EXITCODE_[1];
192 yamop ENV_FOR_TRUSTFAIL_[2];
193 yamop *TRUSTFAILCODE_;
194 yamop ENV_FOR_YESCODE_[2];
195 yamop *YESCODE_;
196 yamop RTRYCODE_[1];
197#ifdef BEAM
198 yamop BEAM_RETRY_CODE_[1];
199#endif /* BEAM */
200#ifdef YAPOR
201 yamop GETWORK_[1];
202 yamop GETWORK_SEQ_[1];
203 yamop GETWORK_FIRST_TIME_[1];
204#endif /* YAPOR */
205#ifdef TABLING
206 yamop LOAD_ANSWER_[1];
207 yamop TRY_ANSWER_[1];
208 yamop ANSWER_RESOLUTION_[1];
209 yamop COMPLETION_[1];
210#ifdef THREADS_CONSUMER_SHARING
211 yamop ANSWER_RESOLUTION_COMPLETION_[1];
212#endif /* THREADS_CONSUMER_SHARING */
213#endif /* TABLING */
214/* */
215/* PREG just before we enter $spy. We use that to find out the clause which */
216/* was calling the debugged goal. */
217/* */
218 yamop *P_before_spy_;
219/* support recorded_k */
220 yamop *RETRY_C_RECORDEDP_CODE_;
221 yamop *RETRY_C_RECORDED_K_CODE_;
222/* compiler flags */
223 int PROFILING_;
224 int CALL_COUNTING_;
225 int optimizer_on_;
226 int compile_mode_;
227 int profiling_;
228 int call_counting_;
229/********* whether we should try to compile array references ******************/
230 int compile_arrays_;
231/* DBTerms: pre-compiled ground terms */
232#if defined(YAPOR) || defined(THREADS)
233 lockvar DBTermsListLock_;
234#endif
235 struct dbterm_list *DBTermsList_;
236/* JITI support */
237 yamop *ExpandClausesFirst_;
238 yamop *ExpandClausesLast_;
239 UInt Yap_ExpandClauses_;
240#if defined(YAPOR) || defined(THREADS)
241 lockvar ExpandClausesListLock_;
242 lockvar OpListLock_;
243#endif
244/* instrumentation */
245#ifdef DEBUG
246 UInt Yap_NewCps_;
247 UInt Yap_LiveCps_;
248 UInt Yap_DirtyCps_;
249 UInt Yap_FreedCps_;
250#endif
251 UInt Yap_expand_clauses_sz_;
252/* UDI support */
253 struct udi_info *UdiControlBlocks_;
254/* data-base statistics */
255/* system boots in compile mode */
256 Int STATIC_PREDICATES_MARKED_;
257/* Internal Database */
258 Prop *INT_KEYS_;
259 Prop *INT_LU_KEYS_;
260 Prop *INT_BB_KEYS_;
261/* Internal Database Statistics */
262 UInt INT_KEYS_SIZE_;
263 UInt INT_KEYS_TIMESTAMP_;
264 UInt INT_BB_KEYS_SIZE_;
265/* Internal Data-Base Control */
266 int UPDATE_MODE_;
267/* nasty IDB stuff */
268 struct DB_STRUCT *DBErasedMarker_;
269 struct logic_upd_clause *LogDBErasedMarker_;
270/* Dead clauses and IDB entries */
271 struct static_clause *DeadStaticClauses_;
272 struct static_mega_clause *DeadMegaClauses_;
273 struct static_index *DeadStaticIndices_;
274 struct logic_upd_clause *DBErasedList_;
275 struct logic_upd_index *DBErasedIList_;
276#if defined(YAPOR) || defined(THREADS)
277 lockvar DeadStaticClausesLock_;
278 lockvar DeadMegaClausesLock_;
279 lockvar DeadStaticIndicesLock_;
280#endif
281#ifdef COROUTINING
282/* number of attribute modules */
283 int NUM_OF_ATTS_;
284/* initialised by memory allocator */
285 UInt Yap_AttsSize_;
286#endif
288 UInt setup_call_catcher_cleanup_tag_;
289/* Operators */
290 struct operator_entry *OpList_;
291/* foreign code loaded */
292 struct ForeignLoadItem *ForeignCodeLoaded_;
293 ADDR ForeignCodeBase_;
294 ADDR ForeignCodeTop_;
295 ADDR ForeignCodeMax_;
296/* recorded terms */
297 struct record_list *Yap_Records_;
298 Atom EmptyWakeups_[MAX_EMPTY_WAKEUPS];
299 int MaxEmptyWakeups_;
300/* SWI blobs */
301 struct _PL_blob_t *BlobTypes_;
302 struct AtomEntryStruct *Blobs_;
303 UInt NOfBlobs_;
304 UInt NOfBlobsMax_;
305#if defined(YAPOR) || defined(THREADS)
306 lockvar Blobs_Lock_;
307#endif
308
Definition: alloc.h:63
Definition: YapHeap.h:81
Module property: low-level data used to manage modes.
Definition: Yatom.h:209
Definition: Yatom.h:295
Definition: Yatom.h:544
Definition: amidefs.h:264
a flag is represented as a Prolog term
Definition: YapFlags.h:189