Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3
This commit is contained in:
@@ -80,16 +80,16 @@ static inline qg_sol_fr_ptr CUT_prune_solution_frames(qg_sol_fr_ptr, int);
|
||||
#define YAMOP_LTT_BITS OOOOPPS!!! Unknown Integer Sizeof
|
||||
#endif /* SIZEOF_INT */
|
||||
|
||||
#define YAMOP_OR_ARG(INST) ((INST)->u.Otapl.or_arg)
|
||||
#define YAMOP_LTT(INST) (((INST)->u.Otapl.or_arg) & YAMOP_LTT_BITS)
|
||||
#define YAMOP_SEQ(INST) (((INST)->u.Otapl.or_arg) & YAMOP_SEQ_FLAG)
|
||||
#define YAMOP_CUT(INST) (((INST)->u.Otapl.or_arg) & YAMOP_CUT_FLAG)
|
||||
#define YAMOP_FLAGS(INST) (((INST)->u.Otapl.or_arg) & YAMOP_FLAGS_BITS)
|
||||
#define YAMOP_OR_ARG(INST) ((INST)->y_u.Otapl.or_arg)
|
||||
#define YAMOP_LTT(INST) (((INST)->y_u.Otapl.or_arg) & YAMOP_LTT_BITS)
|
||||
#define YAMOP_SEQ(INST) (((INST)->y_u.Otapl.or_arg) & YAMOP_SEQ_FLAG)
|
||||
#define YAMOP_CUT(INST) (((INST)->y_u.Otapl.or_arg) & YAMOP_CUT_FLAG)
|
||||
#define YAMOP_FLAGS(INST) (((INST)->y_u.Otapl.or_arg) & YAMOP_FLAGS_BITS)
|
||||
|
||||
#define INIT_YAMOP_LTT(INST, LTT) ((INST)->u.Otapl.or_arg = LTT+1)
|
||||
#define PUT_YAMOP_LTT(INST, LTT) (INST)->u.Otapl.or_arg = YAMOP_FLAGS(INST) | (LTT+1)
|
||||
#define PUT_YAMOP_SEQ(INST) (INST)->u.Otapl.or_arg |= YAMOP_SEQ_FLAG
|
||||
#define PUT_YAMOP_CUT(INST) (INST)->u.Otapl.or_arg |= YAMOP_CUT_FLAG
|
||||
#define INIT_YAMOP_LTT(INST, LTT) ((INST)->y_u.Otapl.or_arg = LTT+1)
|
||||
#define PUT_YAMOP_LTT(INST, LTT) (INST)->y_u.Otapl.or_arg = YAMOP_FLAGS(INST) | (LTT+1)
|
||||
#define PUT_YAMOP_SEQ(INST) (INST)->y_u.Otapl.or_arg |= YAMOP_SEQ_FLAG
|
||||
#define PUT_YAMOP_CUT(INST) (INST)->y_u.Otapl.or_arg |= YAMOP_CUT_FLAG
|
||||
|
||||
#define BRANCH(WORKER, DEPTH) GLOBAL_branch(WORKER, DEPTH)
|
||||
#define BRANCH_LTT(WORKER, DEPTH) (BRANCH(WORKER, DEPTH) & YAMOP_LTT_BITS)
|
||||
|
@@ -434,14 +434,14 @@
|
||||
if (PREG->opc == Yap_opcode(_table_try)) {
|
||||
/* table_try */
|
||||
code_ap = NEXTOP(PREG,Otapl);
|
||||
PREG = PREG->u.Otapl.d;
|
||||
PREG = PREG->y_u.Otapl.d;
|
||||
} else if (PREG->opc == Yap_opcode(_table_try_single)) {
|
||||
/* table_try_single */
|
||||
code_ap = COMPLETION;
|
||||
PREG = PREG->u.Otapl.d;
|
||||
PREG = PREG->y_u.Otapl.d;
|
||||
} else {
|
||||
/* table_try_me */
|
||||
code_ap = PREG->u.Otapl.d;
|
||||
code_ap = PREG->y_u.Otapl.d;
|
||||
PREG = NEXTOP(PREG,Otapl);
|
||||
}
|
||||
PREFETCH_OP(PREG);
|
||||
@@ -453,7 +453,7 @@
|
||||
GONext();
|
||||
}
|
||||
#else
|
||||
PREG = PREG->u.Otapl.d;
|
||||
PREG = PREG->y_u.Otapl.d;
|
||||
PREFETCH_OP(PREG);
|
||||
GONext();
|
||||
#endif /* INCOMPLETE_TABLING */
|
||||
@@ -470,7 +470,7 @@
|
||||
sg_fr_ptr sg_fr;
|
||||
|
||||
check_trail(TR);
|
||||
tab_ent = PREG->u.Otapl.te;
|
||||
tab_ent = PREG->y_u.Otapl.te;
|
||||
YENV2MEM;
|
||||
sg_fr = subgoal_search(PREG, YENV_ADDRESS);
|
||||
MEM2YENV;
|
||||
@@ -488,7 +488,7 @@
|
||||
#ifdef THREADS_CONSUMER_SHARING
|
||||
if (SgFr_state(sg_fr) == ready_external) {
|
||||
init_subgoal_frame(sg_fr);
|
||||
store_generator_consumer_node(tab_ent, sg_fr, TRUE, PREG->u.Otapl.s);
|
||||
store_generator_consumer_node(tab_ent, sg_fr, TRUE, PREG->y_u.Otapl.s);
|
||||
PREFETCH_OP(PREG);
|
||||
allocate_environment();
|
||||
check_for_deadlock(sg_fr);
|
||||
@@ -505,9 +505,9 @@
|
||||
} else
|
||||
#endif /* DETERMINISTIC_TABLING */
|
||||
{
|
||||
store_generator_node(tab_ent, sg_fr, PREG->u.Otapl.s, COMPLETION);
|
||||
store_generator_node(tab_ent, sg_fr, PREG->y_u.Otapl.s, COMPLETION);
|
||||
}
|
||||
PREG = PREG->u.Otapl.d; /* should work also with PREG = NEXTOP(PREG,Otapl); */
|
||||
PREG = PREG->y_u.Otapl.d; /* should work also with PREG = NEXTOP(PREG,Otapl); */
|
||||
PREFETCH_OP(PREG);
|
||||
allocate_environment();
|
||||
GONext();
|
||||
@@ -522,7 +522,7 @@
|
||||
init_subgoal_frame(sg_fr);
|
||||
UNLOCK_SG_FR(sg_fr);
|
||||
SgFr_try_answer(sg_fr) = ans_node;
|
||||
store_generator_node(tab_ent, sg_fr, PREG->u.Otapl.s, TRY_ANSWER);
|
||||
store_generator_node(tab_ent, sg_fr, PREG->y_u.Otapl.s, TRY_ANSWER);
|
||||
PREG = (yamop *) CPREG;
|
||||
PREFETCH_OP(PREG);
|
||||
load_answer(ans_node, subs_ptr);
|
||||
@@ -638,7 +638,7 @@
|
||||
sg_fr_ptr sg_fr;
|
||||
|
||||
check_trail(TR);
|
||||
tab_ent = PREG->u.Otapl.te;
|
||||
tab_ent = PREG->y_u.Otapl.te;
|
||||
YENV2MEM;
|
||||
sg_fr = subgoal_search(PREG, YENV_ADDRESS);
|
||||
MEM2YENV;
|
||||
@@ -657,7 +657,7 @@
|
||||
if (SgFr_state(sg_fr) == ready_external) {
|
||||
init_subgoal_frame(sg_fr);
|
||||
UNLOCK_SG_FR(sg_fr);
|
||||
store_generator_consumer_node(tab_ent, sg_fr, TRUE, PREG->u.Otapl.s);
|
||||
store_generator_consumer_node(tab_ent, sg_fr, TRUE, PREG->y_u.Otapl.s);
|
||||
PREFETCH_OP(PREG);
|
||||
allocate_environment();
|
||||
check_for_deadlock(sg_fr);
|
||||
@@ -668,7 +668,7 @@
|
||||
/* subgoal new */
|
||||
init_subgoal_frame(sg_fr);
|
||||
UNLOCK_SG_FR(sg_fr);
|
||||
store_generator_node(tab_ent, sg_fr, PREG->u.Otapl.s, PREG->u.Otapl.d);
|
||||
store_generator_node(tab_ent, sg_fr, PREG->y_u.Otapl.s, PREG->y_u.Otapl.d);
|
||||
PREG = NEXTOP(PREG, Otapl);
|
||||
PREFETCH_OP(PREG);
|
||||
allocate_environment();
|
||||
@@ -684,7 +684,7 @@
|
||||
init_subgoal_frame(sg_fr);
|
||||
UNLOCK_SG_FR(sg_fr);
|
||||
SgFr_try_answer(sg_fr) = ans_node;
|
||||
store_generator_node(tab_ent, sg_fr, PREG->u.Otapl.s, TRY_ANSWER);
|
||||
store_generator_node(tab_ent, sg_fr, PREG->y_u.Otapl.s, TRY_ANSWER);
|
||||
PREG = (yamop *) CPREG;
|
||||
PREFETCH_OP(PREG);
|
||||
load_answer(ans_node, subs_ptr);
|
||||
@@ -788,7 +788,7 @@
|
||||
sg_fr_ptr sg_fr;
|
||||
|
||||
check_trail(TR);
|
||||
tab_ent = PREG->u.Otapl.te;
|
||||
tab_ent = PREG->y_u.Otapl.te;
|
||||
YENV2MEM;
|
||||
sg_fr = subgoal_search(PREG, YENV_ADDRESS);
|
||||
MEM2YENV;
|
||||
@@ -807,7 +807,7 @@
|
||||
if (SgFr_state(sg_fr) == ready_external) {
|
||||
init_subgoal_frame(sg_fr);
|
||||
UNLOCK_SG_FR(sg_fr);
|
||||
store_generator_consumer_node(tab_ent, sg_fr, TRUE , PREG->u.Otapl.s);
|
||||
store_generator_consumer_node(tab_ent, sg_fr, TRUE , PREG->y_u.Otapl.s);
|
||||
PREFETCH_OP(PREG);
|
||||
allocate_environment();
|
||||
check_for_deadlock(sg_fr);
|
||||
@@ -818,8 +818,8 @@
|
||||
/* subgoal new */
|
||||
init_subgoal_frame(sg_fr);
|
||||
UNLOCK_SG_FR(sg_fr);
|
||||
store_generator_node(tab_ent, sg_fr, PREG->u.Otapl.s, NEXTOP(PREG,Otapl));
|
||||
PREG = PREG->u.Otapl.d;
|
||||
store_generator_node(tab_ent, sg_fr, PREG->y_u.Otapl.s, NEXTOP(PREG,Otapl));
|
||||
PREG = PREG->y_u.Otapl.d;
|
||||
PREFETCH_OP(PREG);
|
||||
allocate_environment();
|
||||
GONext();
|
||||
@@ -834,7 +834,7 @@
|
||||
init_subgoal_frame(sg_fr);
|
||||
UNLOCK_SG_FR(sg_fr);
|
||||
SgFr_try_answer(sg_fr) = ans_node;
|
||||
store_generator_node(tab_ent, sg_fr, PREG->u.Otapl.s, TRY_ANSWER);
|
||||
store_generator_node(tab_ent, sg_fr, PREG->y_u.Otapl.s, TRY_ANSWER);
|
||||
PREG = (yamop *) CPREG;
|
||||
PREFETCH_OP(PREG);
|
||||
load_answer(ans_node, subs_ptr);
|
||||
@@ -946,7 +946,7 @@
|
||||
************************************************************************/
|
||||
|
||||
Op(table_retry_me, Otapl)
|
||||
restore_generator_node(PREG->u.Otapl.s, PREG->u.Otapl.d);
|
||||
restore_generator_node(PREG->y_u.Otapl.s, PREG->y_u.Otapl.d);
|
||||
YENV = (CELL *) PROTECT_FROZEN_B(B);
|
||||
set_cut(YENV, B->cp_b);
|
||||
SET_BB(NORM_CP(YENV));
|
||||
@@ -962,12 +962,12 @@
|
||||
************************************************************************/
|
||||
|
||||
Op(table_retry, Otapl)
|
||||
restore_generator_node(PREG->u.Otapl.s, NEXTOP(PREG,Otapl));
|
||||
restore_generator_node(PREG->y_u.Otapl.s, NEXTOP(PREG,Otapl));
|
||||
YENV = (CELL *) PROTECT_FROZEN_B(B);
|
||||
set_cut(YENV, B->cp_b);
|
||||
SET_BB(NORM_CP(YENV));
|
||||
allocate_environment();
|
||||
PREG = PREG->u.Otapl.d;
|
||||
PREG = PREG->y_u.Otapl.d;
|
||||
GONext();
|
||||
ENDOp();
|
||||
|
||||
@@ -978,10 +978,10 @@
|
||||
************************************************************************/
|
||||
|
||||
Op(table_trust_me, Otapl)
|
||||
restore_generator_node(PREG->u.Otapl.s, COMPLETION);
|
||||
restore_generator_node(PREG->y_u.Otapl.s, COMPLETION);
|
||||
#ifdef DETERMINISTIC_TABLING
|
||||
if (B_FZ > B && IS_BATCHED_NORM_GEN_CP(B)) {
|
||||
CELL *subs_ptr = (CELL *)(GEN_CP(B) + 1) + PREG->u.Otapl.s;
|
||||
CELL *subs_ptr = (CELL *)(GEN_CP(B) + 1) + PREG->y_u.Otapl.s;
|
||||
choiceptr gcp = NORM_CP(DET_GEN_CP(subs_ptr) - 1);
|
||||
sg_fr_ptr sg_fr = GEN_CP(B)->cp_sg_fr;
|
||||
DET_GEN_CP(gcp)->cp_sg_fr = sg_fr;
|
||||
@@ -1010,10 +1010,10 @@
|
||||
************************************************************************/
|
||||
|
||||
Op(table_trust, Otapl)
|
||||
restore_generator_node(PREG->u.Otapl.s, COMPLETION);
|
||||
restore_generator_node(PREG->y_u.Otapl.s, COMPLETION);
|
||||
#ifdef DETERMINISTIC_TABLING
|
||||
if (B_FZ > B && IS_BATCHED_NORM_GEN_CP(B)) {
|
||||
CELL *subs_ptr = (CELL *)(GEN_CP(B) + 1) + PREG->u.Otapl.s;
|
||||
CELL *subs_ptr = (CELL *)(GEN_CP(B) + 1) + PREG->y_u.Otapl.s;
|
||||
choiceptr gcp = NORM_CP(DET_GEN_CP(subs_ptr) - 1);
|
||||
sg_fr_ptr sg_fr = GEN_CP(B)->cp_sg_fr;
|
||||
DET_GEN_CP(gcp)->cp_sg_fr = sg_fr;
|
||||
@@ -1031,7 +1031,7 @@
|
||||
set_cut(YENV, B->cp_b);
|
||||
SET_BB(NORM_CP(YENV));
|
||||
allocate_environment();
|
||||
PREG = PREG->u.Otapl.d;
|
||||
PREG = PREG->y_u.Otapl.d;
|
||||
GONext();
|
||||
ENDOp();
|
||||
|
||||
@@ -1056,7 +1056,7 @@
|
||||
#endif /* DETERMINISTIC_TABLING */
|
||||
{
|
||||
sg_fr = GEN_CP(gcp)->cp_sg_fr;
|
||||
subs_ptr = (CELL *)(GEN_CP(gcp) + 1) + PREG->u.s.s;
|
||||
subs_ptr = (CELL *)(GEN_CP(gcp) + 1) + PREG->y_u.s.s;
|
||||
}
|
||||
#if defined(DEBUG_TABLING) && !defined(DETERMINISTIC_TABLING)
|
||||
{
|
||||
@@ -1064,7 +1064,7 @@
|
||||
CELL *aux_args;
|
||||
CELL *aux_subs;
|
||||
|
||||
arity_args = PREG->u.s.s;
|
||||
arity_args = PREG->y_u.s.s;
|
||||
arity_subs = *subs_ptr;
|
||||
aux_args = (CELL *)(GEN_CP(gcp) + 1);
|
||||
aux_subs = subs_ptr;
|
||||
|
@@ -271,8 +271,8 @@ typedef struct subgoal_entry {
|
||||
|
||||
#define SgEnt_lock(X) ((X)->lock)
|
||||
#define SgEnt_code(X) ((X)->code_of_subgoal)
|
||||
#define SgEnt_tab_ent(X) (((X)->code_of_subgoal)->u.Otapl.te)
|
||||
#define SgEnt_arity(X) (((X)->code_of_subgoal)->u.Otapl.s)
|
||||
#define SgEnt_tab_ent(X) (((X)->code_of_subgoal)->y_u.Otapl.te)
|
||||
#define SgEnt_arity(X) (((X)->code_of_subgoal)->y_u.Otapl.s)
|
||||
#define SgEnt_hash_chain(X) ((X)->hash_chain)
|
||||
#define SgEnt_answer_trie(X) ((X)->answer_trie)
|
||||
#define SgEnt_first_answer(X) ((X)->first_answer)
|
||||
@@ -316,8 +316,8 @@ typedef struct subgoal_frame {
|
||||
#endif /* THREADS_FULL_SHARING || THREADS_CONSUMER_SHARING */
|
||||
#define SgFr_lock(X) (SUBGOAL_ENTRY(X) lock)
|
||||
#define SgFr_code(X) (SUBGOAL_ENTRY(X) code_of_subgoal)
|
||||
#define SgFr_tab_ent(X) ((SUBGOAL_ENTRY(X) code_of_subgoal)->u.Otapl.te)
|
||||
#define SgFr_arity(X) ((SUBGOAL_ENTRY(X) code_of_subgoal)->u.Otapl.s)
|
||||
#define SgFr_tab_ent(X) ((SUBGOAL_ENTRY(X) code_of_subgoal)->y_u.Otapl.te)
|
||||
#define SgFr_arity(X) ((SUBGOAL_ENTRY(X) code_of_subgoal)->y_u.Otapl.s)
|
||||
#define SgFr_hash_chain(X) (SUBGOAL_ENTRY(X) hash_chain)
|
||||
#define SgFr_answer_trie(X) (SUBGOAL_ENTRY(X) answer_trie)
|
||||
#define SgFr_first_answer(X) (SUBGOAL_ENTRY(X) first_answer)
|
||||
|
@@ -1071,8 +1071,8 @@ sg_fr_ptr subgoal_search(yamop *preg, CELL **Yaddr) {
|
||||
|
||||
stack_vars = *Yaddr;
|
||||
subs_arity = 0;
|
||||
pred_arity = preg->u.Otapl.s;
|
||||
tab_ent = preg->u.Otapl.te;
|
||||
pred_arity = preg->y_u.Otapl.s;
|
||||
tab_ent = preg->y_u.Otapl.te;
|
||||
current_sg_node = get_insert_subgoal_trie(tab_ent PASS_REGS);
|
||||
LOCK_SUBGOAL_TRIE(tab_ent);
|
||||
|
||||
|
Reference in New Issue
Block a user