restore clauses

This commit is contained in:
Vítor Santos Costa 2016-01-03 02:02:41 +00:00
parent 5ca49ae202
commit 7a7354fb2b
3 changed files with 85 additions and 85 deletions

View File

@ -2,66 +2,66 @@
/* This file, hglobals.h, was generated automatically by "yap -L misc/buildlocalglobal" /* This file, hglobals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/GLOBALS instead */ please do not update, update misc/GLOBALS instead */
//
// File defining fields in the Yap_GLOBAL global structure
//
// these fields used to spread all over the place, because they must be used in 3 ways:
// - they must be defined somewhere
// - they have an #ifdef to get a shorter name
// - they must be initialised somewhere
// - they may be of interest to restore
//
// The defs include 3+ components:
// Type
// name in structured / global name
// init code (optional)
// restore code (optional)
//
// Stuff that must be shared by all threads or workers
typedef struct global_data { typedef struct global_data {
// initialization: tell whether the system has been initialised and by whom.
int Initialised_; int Initialised_;
int InitialisedFromPL_; int InitialisedFromPL_;
int PL_Argc_; int PL_Argc_;
char** PL_Argv_; char** PL_Argv_;
bool FAST_BOOT_FLAG_; bool FAST_BOOT_FLAG_;
// halt hooks
struct halt_hook* HaltHooks_; struct halt_hook* HaltHooks_;
fptr_t JIT_finalizer_; fptr_t JIT_finalizer_;
// stack overflow expansion/gc control
int AllowLocalExpansion_; int AllowLocalExpansion_;
int AllowGlobalExpansion_; int AllowGlobalExpansion_;
int AllowTrailExpansion_; int AllowTrailExpansion_;
UInt SizeOfOverflow_; UInt SizeOfOverflow_;
// amount of space recovered in all garbage collections
UInt AGcThreshold_; UInt AGcThreshold_;
Agc_hook AGCHook_; Agc_hook AGCHook_;
#if __ANDROID__ #if __ANDROID__
// no need to perform initialization, it is done before we start the Prolog engine.
struct AAssetManager* assetManager_; struct AAssetManager* assetManager_;
char* AssetsWD_; char* AssetsWD_;
#endif #endif
/* multi-thread support */
#if THREADS #if THREADS
/* number of threads and processes in system */
UInt NOfThreads_; UInt NOfThreads_;
/* number of threads created since start */
UInt NOfThreadsCreated_; UInt NOfThreadsCreated_;
/* total run time for dead threads */
UInt ThreadsTotalTime_; UInt ThreadsTotalTime_;
// Threads Array
lockvar ThreadHandlesLock_; lockvar ThreadHandlesLock_;
#endif #endif
#if defined(YAPOR) || defined(THREADS) #if defined(YAPOR) || defined(THREADS)
// protect long critical regions
lockvar BGL_; lockvar BGL_;
#endif #endif
#if defined(YAPOR) || defined(TABLING) #if defined(YAPOR) || defined(TABLING)
struct global_optyap_data optyap_data_; struct global_optyap_data optyap_data_;
#endif /* YAPOR || TABLING */ #endif /* YAPOR || TABLING */
// whether Yap is responsible for signal handling
int PrologShouldHandleInterrupts_; int PrologShouldHandleInterrupts_;
/* This is the guy who actually started the system, and who has the correct registers */
#if defined(THREADS) #if defined(THREADS)
pthread_t master_thread_; pthread_t master_thread_;
struct thread_mbox* named_mboxes_; struct thread_mbox* named_mboxes_;
@ -69,39 +69,39 @@ typedef struct global_data {
UInt mbox_count_; UInt mbox_count_;
struct swi_mutex* WithMutex_; struct swi_mutex* WithMutex_;
#endif /* THREADS */ #endif /* THREADS */
// streams
struct stream_desc* Stream_; struct stream_desc* Stream_;
#if defined(THREADS)||defined(YAPOR) #if defined(THREADS)||defined(YAPOR)
lockvar StreamDescLock_; lockvar StreamDescLock_;
#endif #endif
// access to yap initial arguments
char** argv_; char** argv_;
int argc_; int argc_;
// extensions to Terms
#ifdef COROUTINING #ifdef COROUTINING
/* array with the ops for your favourite extensions */
ext_op attas_[attvars_ext+1]; ext_op attas_[attvars_ext+1];
#endif #endif
// agc.c
int agc_calls_; int agc_calls_;
YAP_ULONG_LONG agc_collected_; YAP_ULONG_LONG agc_collected_;
/* total time spent in GC */
Int tot_agc_time_; Int tot_agc_time_;
/* number of heap objects in all garbage collections */
Int tot_agc_recovered_; Int tot_agc_recovered_;
//arrays.c
#if HAVE_MMAP #if HAVE_MMAP
struct MMAP_ARRAY_BLOCK* mmap_arrays_; struct MMAP_ARRAY_BLOCK* mmap_arrays_;
#endif #endif
#ifdef DEBUG #ifdef DEBUG
//computils.c
char Option_[20]; char Option_[20];
YP_FILE* logfile_; YP_FILE* logfile_;
//init.c
//int output_msg =FALSE
#endif #endif
#if defined(COFF) || defined(A_OUT) #if defined(COFF) || defined(A_OUT)
// loada_coff.c && load_aout.c
char Executable_[YAP_FILENAME_MAX]; char Executable_[YAP_FILENAME_MAX];
#endif #endif
int OpaqueHandlersCount_; int OpaqueHandlersCount_;
@ -109,10 +109,10 @@ typedef struct global_data {
#if __simplescalar__ #if __simplescalar__
char pwd_[YAP_FILENAME_MAX]; char pwd_[YAP_FILENAME_MAX];
#endif #endif
//udi.c
//struct udi_control_block RtreeCmd void
char* RestoreFile_; char* RestoreFile_;
//gprof.c
Int ProfCalls_; Int ProfCalls_;
Int ProfGCs_; Int ProfGCs_;
Int ProfHGrows_; Int ProfHGrows_;
@ -129,18 +129,18 @@ typedef struct global_data {
FILE* FProf_; FILE* FProf_;
FILE* FPreds_; FILE* FPreds_;
#endif /* LOW_PROF */ #endif /* LOW_PROF */
// Mutexes
#if THREADS #if THREADS
struct swi_mutex* FreeMutexes_; struct swi_mutex* FreeMutexes_;
struct swi_mutex* mutex_backbone_; struct swi_mutex* mutex_backbone_;
lockvar MUT_ACCESS_; lockvar MUT_ACCESS_;
#endif #endif
char* Home_; char* Home_;
/* ISO char conversion: I will make no comments */
char* CharConversionTable_; char* CharConversionTable_;
char* CharConversionTable2_; char* CharConversionTable2_;
/* time */
void* LastWTimePtr_; void* LastWTimePtr_;
/* max priority */
int MaxPriority_; int MaxPriority_;
} w_shared; } w_shared;

View File

@ -2,9 +2,9 @@
/* This file, hlocals.h, was generated automatically by "yap -L misc/buildlocalglobal" /* This file, hlocals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/LOCALS instead */ please do not update, update misc/LOCALS instead */
// Stuff that must be considered local to a thread or worker
typedef struct worker_local { typedef struct worker_local {
// Streams
struct AliasDescS* FileAliases_; struct AliasDescS* FileAliases_;
int NOfFileAliases_; int NOfFileAliases_;
int SzOfFileAliases_; int SzOfFileAliases_;
@ -13,10 +13,10 @@ typedef struct worker_local {
int c_error_stream_; int c_error_stream_;
bool sockets_io_; bool sockets_io_;
bool within_print_message_; bool within_print_message_;
//
// Used by the prompts to check if they are after a newline, and then a
// prompt should be output, or if we are in the middle of a line.
//
bool newline_; bool newline_;
Atom AtPrompt_; Atom AtPrompt_;
char Prompt_[MAX_PROMPT+1]; char Prompt_[MAX_PROMPT+1];
@ -27,7 +27,7 @@ typedef struct worker_local {
UInt max_depth_; UInt max_depth_;
UInt max_list_; UInt max_list_;
UInt max_write_args_; UInt max_write_args_;
// Restore info
CELL* OldASP_; CELL* OldASP_;
CELL* OldLCL0_; CELL* OldLCL0_;
tr_fr_ptr OldTR_; tr_fr_ptr OldTR_;
@ -48,26 +48,26 @@ typedef struct worker_local {
Int XDiff_; Int XDiff_;
Int DelayDiff_; Int DelayDiff_;
Int BaseDiff_; Int BaseDiff_;
// Reduction counters
YAP_ULONG_LONG ReductionsCounter_; YAP_ULONG_LONG ReductionsCounter_;
YAP_ULONG_LONG PredEntriesCounter_; YAP_ULONG_LONG PredEntriesCounter_;
YAP_ULONG_LONG RetriesCounter_; YAP_ULONG_LONG RetriesCounter_;
int ReductionsCounterOn_; int ReductionsCounterOn_;
int PredEntriesCounterOn_; int PredEntriesCounterOn_;
int RetriesCounterOn_; int RetriesCounterOn_;
// support for consulting files
/* current consult stack */
union CONSULT_OBJ* ConsultSp_; union CONSULT_OBJ* ConsultSp_;
/* current maximum number of cells in consult stack */
UInt ConsultCapacity_; UInt ConsultCapacity_;
/* top of consult stack */
union CONSULT_OBJ* ConsultBase_; union CONSULT_OBJ* ConsultBase_;
/* low-water mark for consult */
union CONSULT_OBJ* ConsultLow_; union CONSULT_OBJ* ConsultLow_;
Term VarNames_; Term VarNames_;
Atom SourceFileName_; Atom SourceFileName_;
UInt SourceFileLineno_; UInt SourceFileLineno_;
//global variables
Term GlobalArena_; Term GlobalArena_;
UInt GlobalArenaOverflows_; UInt GlobalArenaOverflows_;
Int ArenaOverflows_; Int ArenaOverflows_;
@ -92,7 +92,7 @@ typedef struct worker_local {
Term WokenGoals_; Term WokenGoals_;
Term AttsMutableList_; Term AttsMutableList_;
#endif #endif
// gc_stuff
Term GcGeneration_; Term GcGeneration_;
Term GcPhase_; Term GcPhase_;
UInt GcCurrentPhase_; UInt GcCurrentPhase_;
@ -102,7 +102,7 @@ typedef struct worker_local {
Int LastGcTime_; Int LastGcTime_;
Int LastSSTime_; Int LastSSTime_;
CELL* OpenArray_; CELL* OpenArray_;
/* in a single gc */
Int total_marked_; Int total_marked_;
Int total_oldies_; Int total_oldies_;
struct choicept* current_B_; struct choicept* current_B_;
@ -135,16 +135,16 @@ typedef struct worker_local {
struct static_array_entry* StaticArrays_; struct static_array_entry* StaticArrays_;
struct global_entry* GlobalVariables_; struct global_entry* GlobalVariables_;
int AllowRestart_; int AllowRestart_;
// Thread Local Area for Fast Storage of Intermediate Compiled Code
struct mem_blk* CMemFirstBlock_; struct mem_blk* CMemFirstBlock_;
UInt CMemFirstBlockSz_; UInt CMemFirstBlockSz_;
// Variable used by the compiler to store number of permanent vars in a clause
int nperm_; int nperm_;
// Thread Local Area for Labels
Int* LabelFirstArray_; Int* LabelFirstArray_;
UInt LabelFirstArraySz_; UInt LabelFirstArraySz_;
// Thread Local Area for SWI-Prolog emulation routines.
// struct PL_local_data* PL_local_data_p =Yap_InitThreadIO(wid)
#ifdef THREADS #ifdef THREADS
struct thandle ThreadHandle_; struct thandle ThreadHandle_;
#endif /* THREADS */ #endif /* THREADS */
@ -158,7 +158,7 @@ typedef struct worker_local {
Int total_choicepoints_; Int total_choicepoints_;
#endif #endif
int consult_level_; int consult_level_;
// Variables related to memory allocation
ADDR LocalBase_; ADDR LocalBase_;
ADDR GlobalBase_; ADDR GlobalBase_;
ADDR TrailBase_; ADDR TrailBase_;
@ -185,27 +185,27 @@ const char* Error_Function_;
sigjmp_buf RestartEnv_; sigjmp_buf RestartEnv_;
char FileNameBuf_[YAP_FILENAME_MAX]; char FileNameBuf_[YAP_FILENAME_MAX];
char FileNameBuf2_[YAP_FILENAME_MAX]; char FileNameBuf2_[YAP_FILENAME_MAX];
// Prolog State
UInt BreakLevel_; UInt BreakLevel_;
Int PrologMode_; Int PrologMode_;
int CritLocks_; int CritLocks_;
// Prolog execution and state flags
union flagTerm* Flags_; union flagTerm* Flags_;
UInt flagCount_; UInt flagCount_;
//analyst.c
/* used to find out how many instructions of each kind are executed */
#ifdef ANALYST #ifdef ANALYST
YAP_ULONG_LONG opcount_[_std_top+1]; YAP_ULONG_LONG opcount_[_std_top+1];
YAP_ULONG_LONG 2opcount[_std_top+1][_std_top+1]_; YAP_ULONG_LONG 2opcount[_std_top+1][_std_top+1]_;
#endif /* ANALYST */ #endif /* ANALYST */
//dbase.c
struct db_globs* s_dbg_; struct db_globs* s_dbg_;
//eval.c
yap_error_number matherror_; yap_error_number matherror_;
Term mathtt_; Term mathtt_;
char* mathstring_; char* mathstring_;
yap_error_number CurrentError_; yap_error_number CurrentError_;
//grow.c
int heap_overflows_; int heap_overflows_;
Int total_heap_overflow_time_; Int total_heap_overflow_time_;
int stack_overflows_; int stack_overflows_;
@ -216,15 +216,15 @@ const char* Error_Function_;
Int total_trail_overflow_time_; Int total_trail_overflow_time_;
int atom_table_overflows_; int atom_table_overflows_;
Int total_atom_table_overflow_time_; Int total_atom_table_overflow_time_;
//load_dyld
#ifdef LOAD_DYLD #ifdef LOAD_DYLD
int dl_errno_; int dl_errno_;
#endif #endif
//tracer.c
#ifdef LOW_LEVEL_TRACER #ifdef LOW_LEVEL_TRACER
int do_trace_primitives_; int do_trace_primitives_;
#endif #endif
//quick loader
struct export_atom_hash_entry_struct *ExportAtomHashChain_; struct export_atom_hash_entry_struct *ExportAtomHashChain_;
UInt ExportAtomHashTableSize_; UInt ExportAtomHashTableSize_;
UInt ExportAtomHashTableNum_; UInt ExportAtomHashTableNum_;
@ -253,23 +253,23 @@ const char* Error_Function_;
UInt ImportDBRefHashTableNum_; UInt ImportDBRefHashTableNum_;
yamop *ImportFAILCODE_; yamop *ImportFAILCODE_;
#if __ANDROID__ #if __ANDROID__
// current virtual directory.
struct AAssetManager* assetManager_; struct AAssetManager* assetManager_;
char* InAssetDir_; char* InAssetDir_;
#endif #endif
// exo indexing
UInt ibnds_[256]; UInt ibnds_[256];
struct index_t* exo_it_; struct index_t* exo_it_;
CELL* exo_base_; CELL* exo_base_;
UInt exo_arity_; UInt exo_arity_;
UInt exo_arg_; UInt exo_arg_;
// atom completion
struct scan_atoms* search_atoms_; struct scan_atoms* search_atoms_;
// Slots
yhandle_t CurSlot_; yhandle_t CurSlot_;
yhandle_t NSlots_; yhandle_t NSlots_;
CELL* SlotBase_; CELL* SlotBase_;
// Mutexes
struct swi_mutex* Mutexes_; struct swi_mutex* Mutexes_;
Term SourceModule_; Term SourceModule_;
Term Including_; Term Including_;