YAP 7.1.0
rhstruct.h
1
2 /* This file, rhstruct.h, was generated automatically by "yap -L misc/buildlocalglobal"
3 please do not update, update H/HEAPFIELDS instead */
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33#if USE_DL_MALLOC
34#if defined(YAPOR) || defined(THREADS)
35 REINIT_LOCK(DLMallocLock);
36#endif
37#endif
38#if USE_DL_MALLOC || (USE_SYSTEM_MALLOC && HAVE_MALLINFO)
39#ifndef HeapUsed
40#define HeapUsed Yap_givemallinfo()
41#endif
42
43#else
44
45#endif
46
47
48
49
50#if defined(YAPOR) || defined(THREADS)
51 REINIT_LOCK(FreeBlocksLock);
52 REINIT_LOCK(HeapUsedLock);
53 REINIT_LOCK(HeapTopLock);
54
55#endif
56
57
58
59
60#if USE_THREADED_CODE
61 OP_RTABLE = OpRTableAdjust(OP_RTABLE);
62#endif
63
64 EITHER_OPCODE = Yap_opcode(_execute_cpred);
65 EXECUTE_CPRED_OPCODE = Yap_opcode(_execute_cpred);
66 EXECUTE_CPRED_OP_CODE = Yap_opcode(_execute_cpred);
67 EXPAND_OP_CODE = Yap_opcode(_expand_index);
68 FAIL_OPCODE = Yap_opcode(_op_fail);
69 INDEX_OPCODE = Yap_opcode(_index_pred);
70 LOCKPRED_OPCODE = Yap_opcode(_lock_pred);
71 ORLAST_OPCODE = Yap_opcode(_or_last);
72 UNDEF_OPCODE = Yap_opcode(_undef_p);
73 RETRY_USERC_OPCODE = Yap_opcode(_retry_userc);
74 EXECUTE_CPRED_OPCODE = Yap_opcode(_execute_cpred);
75 FCALL_OPCODE = Yap_opcode(_fcall);
76
77
78
79
80
81 RestoreInvisibleAtoms();
82 RestoreWideAtoms();
83 RestoreAtoms();
84
85#include "ratoms.h"
86#ifdef EUROTRA
87 TermDollarU = AtomTermAdjust(TermDollarU);
88#endif
89
90 USER_MODULE = AtomTermAdjust(USER_MODULE);
91 IDB_MODULE = AtomTermAdjust(IDB_MODULE);
92 ATTRIBUTES_MODULE = AtomTermAdjust(ATTRIBUTES_MODULE);
93 CHARSIO_MODULE = AtomTermAdjust(CHARSIO_MODULE);
94 CHTYPE_MODULE = AtomTermAdjust(CHTYPE_MODULE);
95 TERMS_MODULE = AtomTermAdjust(TERMS_MODULE);
96 SYSTEM_MODULE = AtomTermAdjust(SYSTEM_MODULE);
97 READUTIL_MODULE = AtomTermAdjust(READUTIL_MODULE);
98 HACKS_MODULE = AtomTermAdjust(HACKS_MODULE);
99 ARG_MODULE = AtomTermAdjust(ARG_MODULE);
100 GLOBALS_MODULE = AtomTermAdjust(GLOBALS_MODULE);
101 SWI_MODULE = AtomTermAdjust(SWI_MODULE);
102 DBLOAD_MODULE = AtomTermAdjust(DBLOAD_MODULE);
103 RANGE_MODULE = AtomTermAdjust(RANGE_MODULE);
104 ERROR_MODULE = AtomTermAdjust(ERROR_MODULE);
105
106
107
108 CurrentModules = ModEntryPtrAdjust(CurrentModules);
109
110
111
112
113 RestoreHiddenPredicates();
114
115
116
117
118 RestoreFlags(GLOBAL_flagCount);
119
120
121
122
123
124 RestorePredHash();
125#if defined(YAPOR) || defined(THREADS)
126
127#endif
128
129 CreepCode = PtoPredAdjust(CreepCode);
130 UndefHook = PtoPredAdjust(UndefHook);
131 UndefHook0 = PtoPredAdjust(UndefHook0);
132 UserUndefHook = PtoPredAdjust(UserUndefHook);
133 SpyCode = PtoPredAdjust(SpyCode);
134 PredFail = PtoPredAdjust(PredFail);
135 PredTrue = PtoPredAdjust(PredTrue);
136#ifdef COROUTINING
137 WakeUpCode = PtoPredAdjust(WakeUpCode);
138#endif
139 PredCsult = PtoPredAdjust(PredCsult);
140 PredDollarCatch = PtoPredAdjust(PredDollarCatch);
141#ifdef YAPOR
142 PredGetwork = PtoPredAdjust(PredGetwork);
143#endif /* YAPOR */
144 PredGoalExpansion = PtoPredAdjust(PredGoalExpansion);
145 PredHandleThrow = PtoPredAdjust(PredHandleThrow);
146 PredIs = PtoPredAdjust(PredIs);
147 PredLogUpdClause = PtoPredAdjust(PredLogUpdClause);
148 PredLogUpdClauseErase = PtoPredAdjust(PredLogUpdClauseErase);
149 PredLogUpdClause0 = PtoPredAdjust(PredLogUpdClause0);
150 PredCall = PtoPredAdjust(PredCall);
151 PredMetaCall = PtoPredAdjust(PredMetaCall);
152 PredPrologCutTo = PtoPredAdjust(PredPrologCutTo);
153 PredProtectStack = PtoPredAdjust(PredProtectStack);
154 PredRecordedWithKey = PtoPredAdjust(PredRecordedWithKey);
155 PredRestoreRegs = PtoPredAdjust(PredRestoreRegs);
156 PredSafeCallCleanup = PtoPredAdjust(PredSafeCallCleanup);
157 PredStaticClause = PtoPredAdjust(PredStaticClause);
158 PredThrow = PtoPredAdjust(PredThrow);
159 PredTraceMetaCall = PtoPredAdjust(PredTraceMetaCall);
160 PredCommentHook = PtoPredAdjust(PredCommentHook);
161 PredProcedure = PtoPredAdjust(PredProcedure);
162 PredUndefinedQuery = PtoPredAdjust(PredUndefinedQuery);
163 PredComma = PtoPredAdjust(PredComma);
164 PredCatch = PtoPredAdjust(PredCatch);
165
166#ifdef LOW_LEVEL_TRACER
167
168#if defined(YAPOR) || defined(THREADS)
169 REINIT_LOCK(Yap_low_level_trace_lock);
170#endif
171#endif
172
173
174
175
176
177
178
179
180
181
182
183
184 DUMMYCODE->opc = Yap_opcode(_op_fail);
185 FAILCODE->opc = Yap_opcode(_op_fail);
186 NOCODE->opc = Yap_opcode(_Nstop);
187 EXITCODE->opc = Yap_opcode(_Nstop);
188 RestoreEnvInst(ENV_FOR_TRUSTFAIL,&TRUSTFAILCODE,_trust_fail,PredFail);
189
190 RestoreEnvInst(ENV_FOR_YESCODE,&YESCODE,_Ystop,PredFail);
191
192 RestoreOtaplInst(RTRYCODE,_retry_and_mark,PredFail);
193#ifdef BEAM
194 BEAM_RETRY_CODE->opc = Yap_opcode(_beam_retry_code);
195#endif /* BEAM */
196#ifdef YAPOR
197 RestoreOtaplInst(GETWORK,_getwork,PredGetwork);
198 RestoreOtaplInst(GETWORK_SEQ,_getwork_seq,PredGetworkSeq);
199 GETWORK_FIRST_TIME->opc = Yap_opcode(_getwork_first_time);
200#endif /* YAPOR */
201#ifdef TABLING
202 RestoreOtaplInst(LOAD_ANSWER,_table_load_answer,PredFail);
203 RestoreOtaplInst(TRY_ANSWER,_table_try_answer,PredFail);
204 RestoreOtaplInst(ANSWER_RESOLUTION,_table_answer_resolution,PredFail);
205 RestoreOtaplInst(COMPLETION,_table_completion,PredFail);
206#ifdef THREADS_CONSUMER_SHARING
207 RestoreOtaplInst(ANSWER_RESOLUTION_COMPLETION,_table_answer_resolution_completion,PredFail);
208#endif /* THREADS_CONSUMER_SHARING */
209#endif /* TABLING */
210
211
212
213
214 P_before_spy = PtoOpAdjust(P_before_spy);
215
216 RETRY_C_RECORDEDP_CODE = PtoOpAdjust(RETRY_C_RECORDEDP_CODE);
217 RETRY_C_RECORDED_K_CODE = PtoOpAdjust(RETRY_C_RECORDED_K_CODE);
218
219
220
221
222
223
224
225
226
227
228#if defined(YAPOR) || defined(THREADS)
229 REINIT_LOCK(DBTermsListLock);
230#endif
231 RestoreDBTermsList();
232
233
234 RestoreExpandList();
235
236#if defined(YAPOR) || defined(THREADS)
237 REINIT_LOCK(ExpandClausesListLock);
238 REINIT_LOCK(OpListLock);
239#endif
240
241#ifdef DEBUG
242
243
244
245
246#endif
247
248
249 RestoreUdiControlBlocks();
250
251
252
253
254 RestoreIntKeys();
255 RestoreIntLUKeys();
256 RestoreIntBBKeys();
257
258
259
260
261
262
263
264 RestoreDBErasedMarker();
265 RestoreLogDBErasedMarker();
266
267 RestoreDeadStaticClauses();
268 RestoreDeadMegaClauses();
269 RestoreDeadStaticIndices();
270 RestoreDBErasedList();
271 RestoreDBErasedIList();
272#if defined(YAPOR) || defined(THREADS)
273 REINIT_LOCK(DeadStaticClausesLock);
274 REINIT_LOCK(DeadMegaClausesLock);
275 REINIT_LOCK(DeadStaticIndicesLock);
276#endif
277#ifdef COROUTINING
278
279
280
281
282#endif
283
284
285
286 OpList = OpListAdjust(OpList);
287
288 RestoreForeignCode();
289
290
291
292
293 RestoreYapRecords();
294 RestoreEmptyWakeups();
295
296
297 RestoreBlobTypes();
298 RestoreBlobs();
299
300
301#if defined(YAPOR) || defined(THREADS)
302 REINIT_LOCK(Blobs_Lock);
303#endif
304