improve code for disjunctions by trying to avoid permanent variables.

This commit is contained in:
Vitor Santos Costa
2009-03-10 16:24:26 +00:00
parent e4d6b529c7
commit fc2e01f320
7 changed files with 115 additions and 608 deletions

View File

@@ -1383,18 +1383,6 @@ IsTrueGoal(Term t) {
return(t == MkAtomTerm(AtomTrue));
}
static void
c_p_put(Term Goal, op_numbers op_var, op_numbers op_val, compiler_struct * cglobs)
{
Term t = Deref(ArgOfTerm(2, Goal));
int new = check_var(t, 1, 0, cglobs);
t = Deref(t);
Yap_emit((new ?
(++cglobs->nvars,op_var) : op_val), t, IntegerOfTerm(ArgOfTerm(1, Goal)), &cglobs->cint);
tag_var(t, new, cglobs);
}
static void
emit_special_label(Term Goal, compiler_struct *cglobs)
{
@@ -1814,6 +1802,12 @@ c_goal(Term Goal, int mod, compiler_struct *cglobs)
}
return;
}
else if (f == FunctorSafe) {
Ventry *v = (Ventry *)ArgOfTerm(1, Goal);
/* This variable must be known before */
v->FlagsOfVE |= SafeVar;
return;
}
else if (p->PredFlags & AsmPredFlag) {
int op = p->PredFlags & 0x7f;