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:
Vítor Santos Costa 2008-09-05 18:34:26 +01:00
parent fdf762e326
commit d70cb39c1d
3 changed files with 217 additions and 220 deletions

View File

@ -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

View File

@ -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

View File

@ -527,35 +527,9 @@
ENDPBOp();
PBOp(trie_try_null, 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;
store_trie_node(TrNode_next(node));
cp_trie_null_instr();
ENDPBOp();
PBOp(trie_retry_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;
restore_trie_node(TrNode_next(node));
cp_trie_null_instr();
ENDPBOp();
PBOp(trie_trust_null, e)
register ans_node_ptr node = (ans_node_ptr) PREG;
register CELL *aux_ptr = (CELL *) (B + 1);
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);
@ -578,6 +552,32 @@
ENDPBOp();
PBOp(trie_try_null, 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;
store_trie_node(TrNode_next(node));
cp_trie_null_instr();
ENDPBOp();
PBOp(trie_retry_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;
restore_trie_node(TrNode_next(node));
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,37 +591,9 @@
ENDPBOp();
PBOp(trie_try_var, e)
register ans_node_ptr node = (ans_node_ptr) PREG;
register CELL *aux_ptr = YENV;
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;
store_trie_node(TrNode_next(node));
cp_trie_var_instr();
ENDPBOp();
PBOp(trie_retry_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;
restore_trie_node(TrNode_next(node));
cp_trie_var_instr();
ENDPBOp();
PBOp(trie_trust_var, e)
register ans_node_ptr node = (ans_node_ptr) PREG;
register CELL *aux_ptr = (CELL *) (B + 1);
register CELL *aux_ptr = (CELL *)(B+1);
register CELL var_ptr;
int heap_arity = *aux_ptr;
int vars_arity = *(aux_ptr + heap_arity + 1);
@ -645,6 +617,34 @@
ENDPBOp();
PBOp(trie_try_var, e)
register ans_node_ptr node = (ans_node_ptr) PREG;
register CELL *aux_ptr = YENV;
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;
store_trie_node(TrNode_next(node));
cp_trie_var_instr();
ENDPBOp();
PBOp(trie_retry_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;
restore_trie_node(TrNode_next(node));
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,39 +659,9 @@
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;
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);
@ -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,35 +729,9 @@
ENDPBOp();
PBOp(trie_try_atom, 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;
store_trie_node(TrNode_next(node));
cp_trie_atom_instr();
ENDPBOp();
PBOp(trie_retry_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;
restore_trie_node(TrNode_next(node));
cp_trie_atom_instr();
ENDPBOp();
PBOp(trie_trust_atom, e)
register ans_node_ptr node = (ans_node_ptr) PREG;
register CELL *aux_ptr = (CELL *) (B + 1);
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);
@ -779,6 +754,32 @@
ENDPBOp();
PBOp(trie_try_atom, 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;
store_trie_node(TrNode_next(node));
cp_trie_atom_instr();
ENDPBOp();
PBOp(trie_retry_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;
restore_trie_node(TrNode_next(node));
cp_trie_atom_instr();
ENDPBOp();
PBOp(trie_do_list, e)
register ans_node_ptr node = (ans_node_ptr) PREG;
register CELL *aux_ptr = YENV;
@ -791,35 +792,9 @@
ENDPBOp();
PBOp(trie_try_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;
store_trie_node(TrNode_next(node));
cp_trie_list_instr();
ENDPBOp();
PBOp(trie_retry_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;
restore_trie_node(TrNode_next(node));
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);
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);
@ -842,6 +817,32 @@
ENDPBOp();
PBOp(trie_try_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;
store_trie_node(TrNode_next(node));
cp_trie_list_instr();
ENDPBOp();
PBOp(trie_retry_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;
restore_trie_node(TrNode_next(node));
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,39 +857,9 @@
ENDPBOp();
PBOp(trie_try_struct, 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);
Functor func = (Functor) RepAppl(TrNode_entry(node));
int func_arity = ArityOfFunctor(func);
int i;
store_trie_node(TrNode_next(node));
cp_trie_struct_instr();
ENDPBOp();
PBOp(trie_retry_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;
restore_trie_node(TrNode_next(node));
cp_trie_struct_instr();
ENDPBOp();
PBOp(trie_trust_struct, e)
register ans_node_ptr node = (ans_node_ptr) PREG;
register CELL *aux_ptr = (CELL *) (B + 1);
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);
@ -913,6 +884,36 @@
ENDPBOp();
PBOp(trie_try_struct, 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);
Functor func = (Functor) RepAppl(TrNode_entry(node));
int func_arity = ArityOfFunctor(func);
int i;
store_trie_node(TrNode_next(node));
cp_trie_struct_instr();
ENDPBOp();
PBOp(trie_retry_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;
restore_trie_node(TrNode_next(node));
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,35 +923,9 @@
ENDPBOp();
PBOp(trie_try_extension, 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;
store_trie_node(TrNode_next(node));
cp_trie_extension_instr();
ENDPBOp();
PBOp(trie_retry_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;
restore_trie_node(TrNode_next(node));
cp_trie_extension_instr();
ENDPBOp();
PBOp(trie_trust_extension, e)
register ans_node_ptr node = (ans_node_ptr) PREG;
register CELL *aux_ptr = (CELL *) (B + 1);
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);
@ -973,6 +948,32 @@
ENDPBOp();
PBOp(trie_try_extension, 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;
store_trie_node(TrNode_next(node));
cp_trie_extension_instr();
ENDPBOp();
PBOp(trie_retry_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;
restore_trie_node(TrNode_next(node));
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();