From 7155fbec22959537270681b258eae1c9302dc665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Manuel=20de=20Morais=20Santos=20Costa?= Date: Wed, 18 Nov 2009 15:48:29 +0000 Subject: [PATCH] fix bad ordering in HEAPFIELDS: OPERANDS must be well placed before we can recover atom table and dependent preds. --- H/dhstruct.h | 24 ++++++++++++------------ H/hstruct.h | 24 ++++++++++++------------ H/ihstruct.h | 24 ++++++++++++------------ H/rhstruct.h | 24 ++++++++++++------------ misc/HEAPFIELDS | 28 ++++++++++++++-------------- packages/chr | 2 +- packages/jpl | 2 +- 7 files changed, 64 insertions(+), 64 deletions(-) diff --git a/H/dhstruct.h b/H/dhstruct.h index aa9b9ca13..c3e7d4c8a 100644 --- a/H/dhstruct.h +++ b/H/dhstruct.h @@ -75,6 +75,18 @@ #define HeapTopOwner Yap_heap_regs->heap_top_owner #endif + +#if USE_THREADED_CODE +#define OP_RTABLE Yap_heap_regs->op_rtable +#endif + +#define EXECUTE_CPRED_OP_CODE Yap_heap_regs->execute_cpred_op_code +#define EXPAND_OP_CODE Yap_heap_regs->expand_op_code +#define FAIL_OPCODE Yap_heap_regs->fail_op +#define INDEX_OPCODE Yap_heap_regs->index_op +#define LOCKPRED_OPCODE Yap_heap_regs->lockpred_op +#define UNDEF_OPCODE Yap_heap_regs->undef_op + #define NOfAtoms Yap_heap_regs->n_of_atoms #define AtomHashTableSize Yap_heap_regs->atom_hash_table_size #define WideAtomHashTableSize Yap_heap_regs->wide_atom_hash_table_size @@ -108,20 +120,8 @@ - -#if USE_THREADED_CODE -#define OP_RTABLE Yap_heap_regs->op_rtable -#endif - #define Yap_ExecutionMode Yap_heap_regs->execution_mode -#define EXECUTE_CPRED_OP_CODE Yap_heap_regs->execute_cpred_op_code -#define EXPAND_OP_CODE Yap_heap_regs->expand_op_code -#define FAIL_OPCODE Yap_heap_regs->fail_op -#define INDEX_OPCODE Yap_heap_regs->index_op -#define LOCKPRED_OPCODE Yap_heap_regs->lockpred_op -#define UNDEF_OPCODE Yap_heap_regs->undef_op - #define PredHash Yap_heap_regs->pred_hash #if defined(YAPOR) || defined(THREADS) #define PredHashRWLock Yap_heap_regs->pred_hash_rw_lock diff --git a/H/hstruct.h b/H/hstruct.h index e845f87df..dc526569a 100644 --- a/H/hstruct.h +++ b/H/hstruct.h @@ -75,6 +75,18 @@ int heap_top_owner; #endif + +#if USE_THREADED_CODE + opentry *op_rtable; +#endif + + OPCODE execute_cpred_op_code; + OPCODE expand_op_code; + OPCODE fail_op; + OPCODE index_op; + OPCODE lockpred_op; + OPCODE undef_op; + UInt n_of_atoms; UInt atom_hash_table_size; UInt wide_atom_hash_table_size; @@ -108,20 +120,8 @@ - -#if USE_THREADED_CODE - opentry *op_rtable; -#endif - yap_exec_mode execution_mode; - OPCODE execute_cpred_op_code; - OPCODE expand_op_code; - OPCODE fail_op; - OPCODE index_op; - OPCODE lockpred_op; - OPCODE undef_op; - struct pred_entry **pred_hash; #if defined(YAPOR) || defined(THREADS) rwlock_t pred_hash_rw_lock; diff --git a/H/ihstruct.h b/H/ihstruct.h index 56fff7295..36c794525 100644 --- a/H/ihstruct.h +++ b/H/ihstruct.h @@ -76,6 +76,18 @@ #endif +#if USE_THREADED_CODE + +#endif + + Yap_heap_regs->execute_cpred_op_code = Yap_opcode(_execute_cpred); + Yap_heap_regs->expand_op_code = Yap_opcode(_expand_index); + Yap_heap_regs->fail_op = Yap_opcode(_op_fail); + Yap_heap_regs->index_op = Yap_opcode(_index_pred); + Yap_heap_regs->lockpred_op = Yap_opcode(_lock_pred); + Yap_heap_regs->undef_op = Yap_opcode(_undef_p); + + @@ -108,20 +120,8 @@ Yap_InitModules(); - -#if USE_THREADED_CODE - -#endif - Yap_heap_regs->execution_mode = INTERPRETED; - Yap_heap_regs->execute_cpred_op_code = Yap_opcode(_execute_cpred); - Yap_heap_regs->expand_op_code = Yap_opcode(_expand_index); - Yap_heap_regs->fail_op = Yap_opcode(_op_fail); - Yap_heap_regs->index_op = Yap_opcode(_index_pred); - Yap_heap_regs->lockpred_op = Yap_opcode(_lock_pred); - Yap_heap_regs->undef_op = Yap_opcode(_undef_p); - InitPredHash(); #if defined(YAPOR) || defined(THREADS) diff --git a/H/rhstruct.h b/H/rhstruct.h index 4507baa94..68bf30896 100644 --- a/H/rhstruct.h +++ b/H/rhstruct.h @@ -76,6 +76,18 @@ #endif +#if USE_THREADED_CODE + Yap_heap_regs->op_rtable = OpRTableAdjust(Yap_heap_regs->op_rtable); +#endif + + Yap_heap_regs->execute_cpred_op_code = Yap_opcode(_execute_cpred); + Yap_heap_regs->expand_op_code = Yap_opcode(_expand_index); + Yap_heap_regs->fail_op = Yap_opcode(_op_fail); + Yap_heap_regs->index_op = Yap_opcode(_index_pred); + Yap_heap_regs->lockpred_op = Yap_opcode(_lock_pred); + Yap_heap_regs->undef_op = Yap_opcode(_undef_p); + + @@ -109,18 +121,6 @@ -#if USE_THREADED_CODE - Yap_heap_regs->op_rtable = OpRTableAdjust(Yap_heap_regs->op_rtable); -#endif - - - - Yap_heap_regs->execute_cpred_op_code = Yap_opcode(_execute_cpred); - Yap_heap_regs->expand_op_code = Yap_opcode(_expand_index); - Yap_heap_regs->fail_op = Yap_opcode(_op_fail); - Yap_heap_regs->index_op = Yap_opcode(_index_pred); - Yap_heap_regs->lockpred_op = Yap_opcode(_lock_pred); - Yap_heap_regs->undef_op = Yap_opcode(_undef_p); RestorePredHash(); #if defined(YAPOR) || defined(THREADS) diff --git a/misc/HEAPFIELDS b/misc/HEAPFIELDS index f8eadea4e..8f2942b4a 100644 --- a/misc/HEAPFIELDS +++ b/misc/HEAPFIELDS @@ -78,6 +78,20 @@ int heap_top_owner HeapTopOwner =-1 void #endif +/* execution info */ +/* OPCODE TABLE, needed to recover op tables */ +#if USE_THREADED_CODE +opentry *op_rtable OP_RTABLE void OpRTableAdjust +#endif + +/* popular opcodes */ +OPCODE execute_cpred_op_code EXECUTE_CPRED_OP_CODE MkOp _execute_cpred +OPCODE expand_op_code EXPAND_OP_CODE MkOp _expand_index +OPCODE fail_op FAIL_OPCODE MkOp _op_fail +OPCODE index_op INDEX_OPCODE MkOp _index_pred +OPCODE lockpred_op LOCKPRED_OPCODE MkOp _lock_pred +OPCODE undef_op UNDEF_OPCODE MkOp _undef_p + /* atom tables */ UInt n_of_atoms NOfAtoms void void UInt atom_hash_table_size AtomHashTableSize void void @@ -115,23 +129,9 @@ struct mod_entry *current_modules CurrentModules =NULL ModEntryPtrAdjust // don't actually want to define a field void void void Yap_InitModules() void -/* execution info */ -/* OPCODE TABLE */ -#if USE_THREADED_CODE -opentry *op_rtable OP_RTABLE void OpRTableAdjust -#endif - /* Anderson's JIT */ yap_exec_mode execution_mode Yap_ExecutionMode =INTERPRETED void -/* popular opcodes */ -OPCODE execute_cpred_op_code EXECUTE_CPRED_OP_CODE MkOp _execute_cpred -OPCODE expand_op_code EXPAND_OP_CODE MkOp _expand_index -OPCODE fail_op FAIL_OPCODE MkOp _op_fail -OPCODE index_op INDEX_OPCODE MkOp _index_pred -OPCODE lockpred_op LOCKPRED_OPCODE MkOp _lock_pred -OPCODE undef_op UNDEF_OPCODE MkOp _undef_p - /* The Predicate Hash Table: fast access to predicates. */ struct pred_entry **pred_hash PredHash InitPredHash() RestorePredHash() #if defined(YAPOR) || defined(THREADS) diff --git a/packages/chr b/packages/chr index e071f01c1..c325e4564 160000 --- a/packages/chr +++ b/packages/chr @@ -1 +1 @@ -Subproject commit e071f01c1d9015e6d3fabc73092a6e902541485a +Subproject commit c325e4564bb8d4e32c27f2061df85f13d315974e diff --git a/packages/jpl b/packages/jpl index eb6d27251..a2d2f0310 160000 --- a/packages/jpl +++ b/packages/jpl @@ -1 +1 @@ -Subproject commit eb6d27251c2548c25e6d37fff2a27a014caaa7aa +Subproject commit a2d2f03107eecd45462cd61a678035132cf06326