fix answer_trie compilation and execution:
- YapOpcodes.h should have do/trust/try/trust: force this order in tab.tries.insts.i - retry and trust instructions should not trust YENV
This commit is contained in:
parent
fdf762e326
commit
d70cb39c1d
@ -164,10 +164,6 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args)
|
||||
LOCK(Yap_heap_regs->low_level_trace_lock);
|
||||
sc = Yap_heap_regs;
|
||||
vsc_count++;
|
||||
if (vsc_count < 88000)
|
||||
return;
|
||||
if (vsc_count == 88483LL)
|
||||
jmp_deb(1);
|
||||
#ifdef THREADS
|
||||
Yap_heap_regs->thread_handle[worker_id].thread_inst_count++;
|
||||
#endif
|
||||
|
@ -339,41 +339,41 @@
|
||||
OPCODE(table_answer_resolution ,Otapl),
|
||||
OPCODE(table_completion ,Otapl),
|
||||
OPCODE(trie_do_null ,e),
|
||||
OPCODE(trie_trust_null ,e),
|
||||
OPCODE(trie_try_null ,e),
|
||||
OPCODE(trie_retry_null ,e),
|
||||
OPCODE(trie_trust_null ,e),
|
||||
OPCODE(trie_do_var ,e),
|
||||
OPCODE(trie_trust_var ,e),
|
||||
OPCODE(trie_try_var ,e),
|
||||
OPCODE(trie_retry_var ,e),
|
||||
OPCODE(trie_trust_var ,e),
|
||||
OPCODE(trie_do_val ,e),
|
||||
OPCODE(trie_trust_val ,e),
|
||||
OPCODE(trie_try_val ,e),
|
||||
OPCODE(trie_retry_val ,e),
|
||||
OPCODE(trie_trust_val ,e),
|
||||
OPCODE(trie_do_atom ,e),
|
||||
OPCODE(trie_trust_atom ,e),
|
||||
OPCODE(trie_try_atom ,e),
|
||||
OPCODE(trie_retry_atom ,e),
|
||||
OPCODE(trie_trust_atom ,e),
|
||||
OPCODE(trie_do_list ,e),
|
||||
OPCODE(trie_trust_list ,e),
|
||||
OPCODE(trie_try_list ,e),
|
||||
OPCODE(trie_retry_list ,e),
|
||||
OPCODE(trie_trust_list ,e),
|
||||
OPCODE(trie_do_struct ,e),
|
||||
OPCODE(trie_trust_struct ,e),
|
||||
OPCODE(trie_try_struct ,e),
|
||||
OPCODE(trie_retry_struct ,e),
|
||||
OPCODE(trie_trust_struct ,e),
|
||||
OPCODE(trie_do_extension ,e),
|
||||
OPCODE(trie_trust_extension ,e),
|
||||
OPCODE(trie_try_extension ,e),
|
||||
OPCODE(trie_retry_extension ,e),
|
||||
OPCODE(trie_trust_extension ,e),
|
||||
OPCODE(trie_do_float ,e),
|
||||
OPCODE(trie_trust_float ,e),
|
||||
OPCODE(trie_try_float ,e),
|
||||
OPCODE(trie_retry_float ,e),
|
||||
OPCODE(trie_trust_float ,e),
|
||||
OPCODE(trie_do_long ,e),
|
||||
OPCODE(trie_trust_long ,e),
|
||||
OPCODE(trie_try_long ,e),
|
||||
OPCODE(trie_retry_long ,e),
|
||||
OPCODE(trie_trust_long ,e),
|
||||
#endif
|
||||
/* this instruction is hardwired */
|
||||
#ifdef YAPOR
|
||||
|
@ -527,6 +527,31 @@
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_trust_null, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = (CELL *)(B+1);
|
||||
int heap_arity = *aux_ptr;
|
||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||
int i;
|
||||
|
||||
#ifdef YAPOR
|
||||
if (SCH_top_shared_cp(B)) {
|
||||
restore_trie_node(NULL);
|
||||
cp_trie_null_instr();
|
||||
} else
|
||||
#endif /* YAPOR */
|
||||
{
|
||||
pop_trie_node();
|
||||
if ((choiceptr) YENV == B_FZ) {
|
||||
cp_trie_null_instr();
|
||||
} else {
|
||||
no_cp_trie_null_instr();
|
||||
}
|
||||
}
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_try_null, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = YENV;
|
||||
@ -553,31 +578,6 @@
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_trust_null, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = (CELL *) (B + 1);
|
||||
int heap_arity = *aux_ptr;
|
||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||
int i;
|
||||
|
||||
#ifdef YAPOR
|
||||
if (SCH_top_shared_cp(B)) {
|
||||
restore_trie_node(NULL);
|
||||
cp_trie_null_instr();
|
||||
} else
|
||||
#endif /* YAPOR */
|
||||
{
|
||||
pop_trie_node();
|
||||
if ((choiceptr) YENV == B_FZ) {
|
||||
cp_trie_null_instr();
|
||||
} else {
|
||||
no_cp_trie_null_instr();
|
||||
}
|
||||
}
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_do_var, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = YENV;
|
||||
@ -591,6 +591,32 @@
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_trust_var, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = (CELL *)(B+1);
|
||||
register CELL var_ptr;
|
||||
int heap_arity = *aux_ptr;
|
||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||
int i;
|
||||
|
||||
#ifdef YAPOR
|
||||
if (SCH_top_shared_cp(B)) {
|
||||
restore_trie_node(NULL);
|
||||
cp_trie_var_instr();
|
||||
} else
|
||||
#endif /* YAPOR */
|
||||
{
|
||||
pop_trie_node();
|
||||
if ((choiceptr) YENV == B_FZ) {
|
||||
cp_trie_var_instr();
|
||||
} else {
|
||||
no_cp_trie_var_instr();
|
||||
}
|
||||
}
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_try_var, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = YENV;
|
||||
@ -619,32 +645,6 @@
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_trust_var, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = (CELL *) (B + 1);
|
||||
register CELL var_ptr;
|
||||
int heap_arity = *aux_ptr;
|
||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||
int i;
|
||||
|
||||
#ifdef YAPOR
|
||||
if (SCH_top_shared_cp(B)) {
|
||||
restore_trie_node(NULL);
|
||||
cp_trie_var_instr();
|
||||
} else
|
||||
#endif /* YAPOR */
|
||||
{
|
||||
pop_trie_node();
|
||||
if ((choiceptr) YENV == B_FZ) {
|
||||
cp_trie_var_instr();
|
||||
} else {
|
||||
no_cp_trie_var_instr();
|
||||
}
|
||||
}
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_do_val, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = YENV, *subs_ptr;
|
||||
@ -659,36 +659,6 @@
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_try_val, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = YENV, *subs_ptr;
|
||||
register CELL aux, subs;
|
||||
int heap_arity = *aux_ptr;
|
||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||
int var_index = VarIndexOfTableTerm(TrNode_entry(node));
|
||||
int i;
|
||||
|
||||
store_trie_node(TrNode_next(node));
|
||||
cp_trie_val_instr();
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_retry_val, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = (CELL *) (B + 1), *subs_ptr;
|
||||
register CELL aux, subs;
|
||||
int heap_arity = *aux_ptr;
|
||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||
int var_index = VarIndexOfTableTerm(TrNode_entry(node));
|
||||
int i;
|
||||
|
||||
restore_trie_node(TrNode_next(node));
|
||||
cp_trie_val_instr();
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_trust_val, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = (CELL *)(B+1), *subs_ptr;
|
||||
@ -716,6 +686,37 @@
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_try_val, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = YENV;
|
||||
register CELL *subs_ptr;
|
||||
register CELL aux, subs;
|
||||
int heap_arity = *aux_ptr;
|
||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||
int var_index = VarIndexOfTableTerm(TrNode_entry(node));
|
||||
int i;
|
||||
|
||||
store_trie_node(TrNode_next(node));
|
||||
cp_trie_val_instr();
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_retry_val, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = (CELL *)(B+1), *subs_ptr;
|
||||
register CELL aux, subs;
|
||||
int heap_arity = *aux_ptr;
|
||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||
int var_index = VarIndexOfTableTerm(TrNode_entry(node));
|
||||
int i;
|
||||
|
||||
restore_trie_node(TrNode_next(node));
|
||||
cp_trie_val_instr();
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_do_atom, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = YENV;
|
||||
@ -728,6 +729,31 @@
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_trust_atom, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = (CELL *)(B+1);
|
||||
int heap_arity = *aux_ptr;
|
||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||
int i;
|
||||
|
||||
#ifdef YAPOR
|
||||
if (SCH_top_shared_cp(B)) {
|
||||
restore_trie_node(NULL);
|
||||
cp_trie_atom_instr();
|
||||
} else
|
||||
#endif /* YAPOR */
|
||||
{
|
||||
pop_trie_node();
|
||||
if ((choiceptr) YENV == B_FZ) {
|
||||
cp_trie_atom_instr();
|
||||
} else {
|
||||
no_cp_trie_atom_instr();
|
||||
}
|
||||
}
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_try_atom, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = YENV;
|
||||
@ -754,7 +780,19 @@
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_trust_atom, e)
|
||||
PBOp(trie_do_list, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = YENV;
|
||||
int heap_arity = *aux_ptr;
|
||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||
int i;
|
||||
|
||||
no_cp_trie_list_instr();
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_trust_list, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = (CELL *)(B+1);
|
||||
int heap_arity = *aux_ptr;
|
||||
@ -765,29 +803,17 @@
|
||||
#ifdef YAPOR
|
||||
if (SCH_top_shared_cp(B)) {
|
||||
restore_trie_node(NULL);
|
||||
cp_trie_atom_instr();
|
||||
cp_trie_list_instr();
|
||||
} else
|
||||
#endif /* YAPOR */
|
||||
{
|
||||
pop_trie_node();
|
||||
if ((choiceptr) YENV == B_FZ) {
|
||||
cp_trie_atom_instr();
|
||||
cp_trie_list_instr();
|
||||
} else {
|
||||
no_cp_trie_atom_instr();
|
||||
}
|
||||
}
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_do_list, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = YENV;
|
||||
int heap_arity = *aux_ptr;
|
||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||
int i;
|
||||
|
||||
no_cp_trie_list_instr();
|
||||
}
|
||||
}
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
@ -817,31 +843,6 @@
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_trust_list, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = (CELL *) (B + 1);
|
||||
int heap_arity = *aux_ptr;
|
||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||
int i;
|
||||
|
||||
#ifdef YAPOR
|
||||
if (SCH_top_shared_cp(B)) {
|
||||
restore_trie_node(NULL);
|
||||
cp_trie_list_instr();
|
||||
} else
|
||||
#endif /* YAPOR */
|
||||
{
|
||||
pop_trie_node();
|
||||
if ((choiceptr) YENV == B_FZ) {
|
||||
cp_trie_list_instr();
|
||||
} else {
|
||||
no_cp_trie_list_instr();
|
||||
}
|
||||
}
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_do_struct, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = YENV;
|
||||
@ -856,6 +857,33 @@
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_trust_struct, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = (CELL *)(B+1);
|
||||
int heap_arity = *aux_ptr;
|
||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||
Functor func = (Functor) RepAppl(TrNode_entry(node));
|
||||
int func_arity = ArityOfFunctor(func);
|
||||
int i;
|
||||
|
||||
#ifdef YAPOR
|
||||
if (SCH_top_shared_cp(B)) {
|
||||
restore_trie_node(NULL);
|
||||
cp_trie_struct_instr();
|
||||
} else
|
||||
#endif /* YAPOR */
|
||||
{
|
||||
pop_trie_node();
|
||||
if ((choiceptr) YENV == B_FZ) {
|
||||
cp_trie_struct_instr();
|
||||
} else {
|
||||
no_cp_trie_struct_instr();
|
||||
}
|
||||
}
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_try_struct, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = YENV;
|
||||
@ -886,33 +914,6 @@
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_trust_struct, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = (CELL *) (B + 1);
|
||||
int heap_arity = *aux_ptr;
|
||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||
Functor func = (Functor) RepAppl(TrNode_entry(node));
|
||||
int func_arity = ArityOfFunctor(func);
|
||||
int i;
|
||||
|
||||
#ifdef YAPOR
|
||||
if (SCH_top_shared_cp(B)) {
|
||||
restore_trie_node(NULL);
|
||||
cp_trie_struct_instr();
|
||||
} else
|
||||
#endif /* YAPOR */
|
||||
{
|
||||
pop_trie_node();
|
||||
if ((choiceptr) YENV == B_FZ) {
|
||||
cp_trie_struct_instr();
|
||||
} else {
|
||||
no_cp_trie_struct_instr();
|
||||
}
|
||||
}
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_do_extension, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = YENV;
|
||||
@ -922,6 +923,31 @@
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_trust_extension, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = (CELL *)(B+1);
|
||||
int heap_arity = *aux_ptr;
|
||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||
int i;
|
||||
|
||||
#ifdef YAPOR
|
||||
if (SCH_top_shared_cp(B)) {
|
||||
restore_trie_node(NULL);
|
||||
cp_trie_extension_instr();
|
||||
} else
|
||||
#endif /* YAPOR */
|
||||
{
|
||||
pop_trie_node();
|
||||
if ((choiceptr) YENV == B_FZ) {
|
||||
cp_trie_extension_instr();
|
||||
} else {
|
||||
no_cp_trie_extension_instr();
|
||||
}
|
||||
}
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_try_extension, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = YENV;
|
||||
@ -948,31 +974,6 @@
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_trust_extension, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = (CELL *) (B + 1);
|
||||
int heap_arity = *aux_ptr;
|
||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||
int i;
|
||||
|
||||
#ifdef YAPOR
|
||||
if (SCH_top_shared_cp(B)) {
|
||||
restore_trie_node(NULL);
|
||||
cp_trie_extension_instr();
|
||||
} else
|
||||
#endif /* YAPOR */
|
||||
{
|
||||
pop_trie_node();
|
||||
if ((choiceptr) YENV == B_FZ) {
|
||||
cp_trie_extension_instr();
|
||||
} else {
|
||||
no_cp_trie_extension_instr();
|
||||
}
|
||||
}
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(trie_do_float, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = YENV;
|
||||
@ -996,6 +997,11 @@
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
BOp(trie_trust_float, e)
|
||||
Yap_Error(INTERNAL_ERROR, TermNil, "invalid instruction (trie_trust_float)");
|
||||
ENDBOp();
|
||||
|
||||
|
||||
BOp(trie_try_float, e)
|
||||
Yap_Error(INTERNAL_ERROR, TermNil, "invalid instruction (trie_try_float)");
|
||||
ENDBOp();
|
||||
@ -1006,11 +1012,6 @@
|
||||
ENDBOp();
|
||||
|
||||
|
||||
BOp(trie_trust_float, e)
|
||||
Yap_Error(INTERNAL_ERROR, TermNil, "invalid instruction (trie_trust_float)");
|
||||
ENDBOp();
|
||||
|
||||
|
||||
PBOp(trie_do_long, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_ptr = YENV;
|
||||
@ -1023,6 +1024,9 @@
|
||||
no_cp_trie_float_longint_instr();
|
||||
ENDPBOp();
|
||||
|
||||
BOp(trie_trust_long, e)
|
||||
Yap_Error(INTERNAL_ERROR, TermNil, "invalid instruction (trie_trust_long)");
|
||||
ENDBOp();
|
||||
|
||||
BOp(trie_try_long, e)
|
||||
Yap_Error(INTERNAL_ERROR, TermNil, "invalid instruction (trie_try_long)");
|
||||
@ -1034,6 +1038,3 @@
|
||||
ENDBOp();
|
||||
|
||||
|
||||
BOp(trie_trust_long, e)
|
||||
Yap_Error(INTERNAL_ERROR, TermNil, "invalid instruction (trie_trust_long)");
|
||||
ENDBOp();
|
||||
|
Reference in New Issue
Block a user