optime access to execute_cpred

This commit is contained in:
Vítor Santos Costa 2008-09-01 16:48:05 +01:00
parent 84ad9adff0
commit 8f69c35e7f
5 changed files with 14 additions and 11 deletions

View File

@ -4975,7 +4975,7 @@ fetch_next_lu_clause(PredEntry *pe, yamop *i_code, Term th, Term tb, Term tr, ya
}
/* don't need no ENV */
if (first_time &&
P->opc != Yap_opcode(_execute_cpred)) {
P->opc != EXECUTE_CPRED_OP_CODE) {
CP = P;
ENV = YENV;
YENV = ASP;
@ -5046,7 +5046,7 @@ p_log_update_clause(void)
Int ret;
yamop *new_cp;
if (P->opc == Yap_opcode(_execute_cpred)) {
if (P->opc == EXECUTE_CPRED_OP_CODE) {
new_cp = CP;
} else {
new_cp = P;
@ -5116,7 +5116,7 @@ fetch_next_lu_clause_erase(PredEntry *pe, yamop *i_code, Term th, Term tb, Term
}
/* don't need no ENV */
if (first_time &&
P->opc != Yap_opcode(_execute_cpred)) {
P->opc != EXECUTE_CPRED_OP_CODE) {
CP = P;
ENV = YENV;
YENV = ASP;
@ -5191,7 +5191,7 @@ p_log_update_clause_erase(void)
Int ret;
yamop *new_cp;
if (P->opc == Yap_opcode(_execute_cpred)) {
if (P->opc == EXECUTE_CPRED_OP_CODE) {
new_cp = CP;
} else {
new_cp = P;
@ -5247,7 +5247,7 @@ fetch_next_lu_clause0(PredEntry *pe, yamop *i_code, Term th, Term tb, yamop *cp_
}
/* don't need no ENV */
if (first_time &&
P->opc != Yap_opcode(_execute_cpred)) {
P->opc != EXECUTE_CPRED_OP_CODE) {
CP = P;
ENV = YENV;
YENV = ASP;
@ -5301,7 +5301,7 @@ p_log_update_clause0(void)
Int ret;
yamop *new_cp;
if (P->opc == Yap_opcode(_execute_cpred)) {
if (P->opc == EXECUTE_CPRED_OP_CODE) {
new_cp = CP;
} else {
new_cp = P;
@ -5529,7 +5529,7 @@ fetch_next_static_clause(PredEntry *pe, yamop *i_code, Term th, Term tb, Term tr
XREGS[i+1] = pt[i];
}
/* don't need no ENV */
if (first_time && P->opc != Yap_opcode(_execute_cpred)) {
if (first_time && P->opc != EXECUTE_CPRED_OP_CODE) {
CP = P;
ENV = YENV;
YENV = ASP;
@ -5555,7 +5555,7 @@ fetch_next_static_clause(PredEntry *pe, yamop *i_code, Term th, Term tb, Term tr
}
/* don't need no ENV */
if (first_time &&
P->opc != Yap_opcode(_execute_cpred)) {
P->opc != EXECUTE_CPRED_OP_CODE) {
CP = P;
ENV = YENV;
YENV = ASP;
@ -5632,7 +5632,7 @@ p_static_clause(void)
Term t1 = Deref(ARG1);
yamop * new_cp;
if (P->opc == Yap_opcode(_execute_cpred)) {
if (P->opc == EXECUTE_CPRED_OP_CODE) {
new_cp = CP;
} else {
new_cp = P;

View File

@ -69,7 +69,7 @@ CallPredicate(PredEntry *pen, choiceptr cut_pt, yamop *code) {
} else if (pen->ModuleOfPred)
DEPTH -= MkIntConstant(2);
#endif /* DEPTH_LIMIT */
if (P->opc != Yap_opcode(_execute_cpred)) {
if (P->opc != EXECUTE_CPRED_OP_CODE) {
CP = P;
ENV = YENV;
YENV = ASP;

View File

@ -927,6 +927,7 @@ InitCodes(void)
INIT_YAMOP_LTT(&(Yap_heap_regs->table_answer_resolution_code), 0);
#endif /* YAPOR */
#endif /* TABLING */
Yap_heap_regs->execute_cpred_op_code = Yap_opcode(_execute_cpred);
Yap_heap_regs->expand_op_code = Yap_opcode(_expand_index);
INIT_LOCK(Yap_heap_regs->expand_clauses_list_lock);
#ifdef LOW_LEVEL_TRACER

View File

@ -251,7 +251,7 @@ typedef struct various_codes {
yamop table_answer_resolution_code;
yamop table_completion_code;
#endif /* TABLING */
OPCODE expand_op_code;
OPCODE execute_cpred_op_code, expand_op_code;
yamop *expand_clauses_first, *expand_clauses_last;
UInt expand_clauses;
#if defined(YAPOR) || defined(THREADS)
@ -629,6 +629,7 @@ extern struct various_codes *Yap_heap_regs;
#define ANSWER_RESOLUTION ((yamop *)&(Yap_heap_regs->table_answer_resolution_code))
#define COMPLETION ((yamop *)&(Yap_heap_regs->table_completion_code))
#endif /* TABLING */
#define EXECUTE_CPRED_OP_CODE Yap_heap_regs->execute_cpred_op_code
#define EXPAND_OP_CODE Yap_heap_regs->expand_op_code
#define ExpandClausesFirst Yap_heap_regs->expand_clauses_first
#define ExpandClausesLast Yap_heap_regs->expand_clauses_last

View File

@ -623,6 +623,7 @@ restore_codes(void)
INIT_YAMOP_LTT(&(Yap_heap_regs->table_answer_resolution_code), 0);
#endif /* YAPOR */
#endif /* TABLING */
Yap_heap_regs->execute_cpred_op_code = Yap_opcode(_execute_cpred);
Yap_heap_regs->expand_op_code = Yap_opcode(_expand_index);
if (Yap_heap_regs->expand_clauses_first)
Yap_heap_regs->expand_clauses_first = PtoOpAdjust(Yap_heap_regs->expand_clauses_first);