2011-03-24 10:25:02 +00:00
|
|
|
// Stuff that must be considered local to a thread or worker
|
|
|
|
START_WORKER_LOCAL
|
|
|
|
|
|
|
|
// Streams
|
2011-05-11 18:22:58 +01:00
|
|
|
int c_input_stream =0
|
|
|
|
int c_output_stream =1
|
|
|
|
int c_error_stream =2
|
|
|
|
|
|
|
|
// Restore info
|
|
|
|
CELL* OldASP =NULL
|
|
|
|
CELL* OldLCL0 =NULL
|
|
|
|
tr_fr_ptr OldTR =NULL
|
|
|
|
CELL* OldGlobalBase =NULL
|
|
|
|
CELL* OldH =NULL
|
|
|
|
CELL* OldH0 =NULL
|
|
|
|
ADDR OldTrailBase =NULL
|
|
|
|
ADDR OldTrailTop =NULL
|
|
|
|
ADDR OldHeapBase =NULL
|
|
|
|
ADDR OldHeapTop =NULL
|
|
|
|
Int ClDiff =0L
|
|
|
|
Int GDiff =0L
|
|
|
|
Int HDiff =0L
|
|
|
|
Int GDiff0 =0L
|
2011-05-23 16:19:47 +01:00
|
|
|
CELL* GSplit =NULL
|
2011-05-11 18:22:58 +01:00
|
|
|
Int LDiff =0L
|
|
|
|
Int TrDiff =0L
|
|
|
|
Int XDiff =0L
|
|
|
|
Int DelayDiff =0L
|
|
|
|
Int BaseDiff =0L
|
|
|
|
|
|
|
|
// Reduction counters
|
|
|
|
YAP_ULONG_LONG ReductionsCounter =0L
|
|
|
|
YAP_ULONG_LONG PredEntriesCounter =0L
|
|
|
|
YAP_ULONG_LONG RetriesCounter =0L
|
|
|
|
int ReductionsCounterOn =0L
|
|
|
|
int PredEntriesCounterOn =0L
|
|
|
|
int RetriesCounterOn =0L
|
2011-03-24 10:25:02 +00:00
|
|
|
|
|
|
|
// support for consulting files
|
|
|
|
/* current consult stack */
|
2011-05-11 18:22:58 +01:00
|
|
|
union CONSULT_OBJ* ConsultSp =NULL
|
2011-03-24 10:25:02 +00:00
|
|
|
/* current maximum number of cells in consult stack */
|
2011-05-11 18:22:58 +01:00
|
|
|
UInt ConsultCapacity void
|
2011-03-24 10:25:02 +00:00
|
|
|
/* top of consult stack */
|
2011-05-11 18:22:58 +01:00
|
|
|
union CONSULT_OBJ* ConsultBase =NULL
|
2011-03-24 10:25:02 +00:00
|
|
|
/* low-water mark for consult */
|
2011-05-11 18:22:58 +01:00
|
|
|
union CONSULT_OBJ* ConsultLow =NULL
|
2011-03-24 10:25:02 +00:00
|
|
|
|
|
|
|
//global variables
|
2011-05-11 18:22:58 +01:00
|
|
|
Term GlobalArena =0L TermToGlobalOrAtomAdjust
|
|
|
|
UInt GlobalArenaOverflows =0L
|
|
|
|
Int ArenaOverflows =0L
|
|
|
|
Int DepthArenas =0
|
|
|
|
|
|
|
|
int ArithError =FALSE
|
|
|
|
struct pred_entry* LastAssertedPred =NULL
|
|
|
|
int DebugOn =FALSE
|
|
|
|
char* ScannerStack =NULL
|
|
|
|
struct scanner_extra_alloc* ScannerExtraBlocks =NULL
|
|
|
|
struct DB_TERM* BallTerm =NULL RestoreBallTerm(wid)
|
|
|
|
UInt ActiveSignals =0L
|
|
|
|
UInt IPredArity =0L
|
|
|
|
yamop* ProfEnd =NULL
|
|
|
|
int UncaughtThrow =FALSE
|
|
|
|
int DoingUndefp =FALSE
|
|
|
|
Int StartLine =0L
|
|
|
|
scratch_block ScratchPad InitScratchPad(wid)
|
2011-03-24 10:25:02 +00:00
|
|
|
#ifdef COROUTINING
|
2011-05-11 18:22:58 +01:00
|
|
|
Term WokenGoals =0L TermToGlobalAdjust
|
|
|
|
Term AttsMutableList =0L TermToGlobalAdjust
|
2011-03-24 10:25:02 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// gc_stuff
|
2011-05-11 18:22:58 +01:00
|
|
|
Term GcGeneration =0L TermToGlobalAdjust
|
|
|
|
Term GcPhase =0L TermToGlobalAdjust
|
|
|
|
UInt GcCurrentPhase =0L
|
|
|
|
UInt GcCalls =0L
|
|
|
|
Int TotGcTime =0L
|
|
|
|
YAP_ULONG_LONG TotGcRecovered =0L
|
|
|
|
Int LastGcTime =0L
|
|
|
|
Int LastSSTime =0L
|
2011-03-24 10:25:02 +00:00
|
|
|
|
2011-05-05 17:41:05 +01:00
|
|
|
/* in a single gc */
|
2011-05-11 18:22:58 +01:00
|
|
|
Int total_marked =0L
|
|
|
|
Int total_oldies =0L
|
|
|
|
struct choicept* current_B =NULL
|
|
|
|
CELL* prev_HB =NULL
|
|
|
|
CELL* HGEN =NULL
|
|
|
|
CELL** iptop =NULL
|
|
|
|
|
2011-05-05 17:41:05 +01:00
|
|
|
#if defined(GC_NO_TAGS)
|
2011-05-11 18:22:58 +01:00
|
|
|
char* bp =NULL
|
2011-03-24 10:25:02 +00:00
|
|
|
#endif
|
2011-05-11 18:22:58 +01:00
|
|
|
tr_fr_ptr sTR =NULL
|
|
|
|
tr_fr_ptr sTR0 =NULL
|
|
|
|
tr_fr_ptr new_TR =NULL
|
|
|
|
struct gc_mark_continuation* cont_top0 =NULL
|
|
|
|
struct gc_mark_continuation* cont_top =NULL
|
|
|
|
int discard_trail_entries =0
|
|
|
|
gc_ma_hash_entry gc_ma_hash_table[GC_MAVARS_HASH_SIZE] void
|
|
|
|
gc_ma_hash_entry* gc_ma_h_top =NULL
|
|
|
|
gc_ma_hash_entry* gc_ma_h_list =NULL
|
|
|
|
UInt gc_timestamp =0L
|
|
|
|
ADDR db_vec =NULL
|
|
|
|
ADDR db_vec0 =NULL
|
|
|
|
struct RB_red_blk_node* db_root =NULL
|
|
|
|
struct RB_red_blk_node* db_nil =NULL
|
|
|
|
|
|
|
|
sigjmp_buf gc_restore void
|
|
|
|
struct array_entry* DynamicArrays =NULL PtoArrayEAdjust
|
|
|
|
struct static_array_entry* StaticArrays =NULL PtoArraySAdjust
|
|
|
|
struct global_entry* GlobalVariables =NULL PtoGlobalEAdjust
|
|
|
|
int AllowRestart =FALSE
|
|
|
|
|
|
|
|
// Thread Local Area for Fast Storage of Intermediate Compiled Code
|
|
|
|
struct mem_blk* CMemFirstBlock =NULL
|
|
|
|
UInt CMemFirstBlockSz =0L
|
|
|
|
|
|
|
|
// Thread Local Area for Labels
|
|
|
|
Int* LabelFirstArray =NULL
|
|
|
|
UInt LabelFirstArraySz =0L
|
2011-03-24 10:25:02 +00:00
|
|
|
|
|
|
|
// Thread Local Area for SWI-Prolog emulation routines.
|
2011-05-11 18:22:58 +01:00
|
|
|
struct PL_local_data* PL_local_data_p =Yap_InitThreadIO(wid)
|
2011-03-24 10:25:02 +00:00
|
|
|
|
|
|
|
#ifdef THREADS
|
2011-05-11 18:22:58 +01:00
|
|
|
struct thandle ThreadHandle InitThreadHandle(wid)
|
2011-05-09 19:55:06 +01:00
|
|
|
#endif /* THREADS */
|
2011-03-24 10:25:02 +00:00
|
|
|
|
2011-05-09 19:36:51 +01:00
|
|
|
#if defined(YAPOR) || defined(TABLING)
|
2011-05-11 18:22:58 +01:00
|
|
|
struct local_optyap_data optyap_data Yap_init_local_optyap_data(wid)
|
2011-05-09 19:36:51 +01:00
|
|
|
#endif /* YAPOR || TABLING */
|
|
|
|
|
2011-05-11 18:22:58 +01:00
|
|
|
int InterruptsDisabled =FALSE
|
2011-05-09 20:19:49 +01:00
|
|
|
|
2011-05-11 18:22:58 +01:00
|
|
|
struct open_query_struct* execution =NULL
|
|
|
|
|
|
|
|
#if LOW_LEVEL_TRACER
|
|
|
|
Int total_choicepoints =0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int consult_level =0
|
|
|
|
|
|
|
|
#if defined(YAPOR) || defined(THREADS)
|
|
|
|
lockvar SignalLock MkLock
|
|
|
|
#endif
|
2011-05-09 20:19:49 +01:00
|
|
|
|
2011-05-23 16:19:47 +01:00
|
|
|
// Variables related to memory allocation
|
|
|
|
ADDR LocalBase =REMOTE_LocalBase(0)
|
|
|
|
ADDR GlobalBase =REMOTE_GlobalBase(0)
|
|
|
|
ADDR TrailBase =REMOTE_TrailBase(0)
|
|
|
|
ADDR TrailTop =REMOTE_TrailTop(0)
|
|
|
|
char* ErrorMessage =REMOTE_ErrorMessage(0)
|
|
|
|
Term Error_Term =REMOTE_Error_Term(0)
|
|
|
|
#ifdef THREADS
|
|
|
|
Term Error_TYPE =REMOTE_Error_TYPE(0)
|
|
|
|
#else
|
|
|
|
yap_error_number Error_TYPE =REMOTE_Error_TYPE(0)
|
|
|
|
#endif
|
|
|
|
UInt Error_Size =REMOTE_Error_Size(0)
|
|
|
|
char ErrorSay[MAX_ERROR_MSG_SIZE] void
|
|
|
|
jmp_buf IOBotch void
|
|
|
|
TokEntry* tokptr =REMOTE_tokptr(0)
|
|
|
|
TokEntry* toktide =REMOTE_toktide(0)
|
|
|
|
VarEntry* VarTable =REMOTE_VarTable(0)
|
|
|
|
VarEntry* AnonVarTable =REMOTE_AnonVarTable(0)
|
|
|
|
sigjmp_buf RestartEnv void
|
|
|
|
char FileNameBuf[YAP_FILENAME_MAX] void
|
|
|
|
char FileNameBuf2[YAP_FILENAME_MAX] void
|
|
|
|
|
|
|
|
|
2011-03-24 10:25:02 +00:00
|
|
|
END_WORKER_LOCAL
|
|
|
|
|