don't inline == and \= for now.

This commit is contained in:
Vítor Santos Costa 2016-03-30 01:24:34 +01:00
parent f3e8b8b3da
commit 4103aa6e83
5 changed files with 33 additions and 8 deletions

View File

@ -628,7 +628,7 @@ static int interrupt_deallocate(USES_REGS1) {
/* /*
don't do a creep here; also, if our instruction is followed by don't do a creep here; also, if our instruction is followed by
a execute_c, just wait a bit more */ a execute_c, just wait a bit more */
if (Yap_only_has_signal(YAP_CREEP_SIGNAL) || if (Yap_only_has_signals(YAP_CREEP_SIGNAL, YAP_WAKEUP_SIGNAL) ||
/* keep on going if there is something else */ /* keep on going if there is something else */
(P->opc != Yap_opcode(_procceed) && P->opc != Yap_opcode(_cut_e))) { (P->opc != Yap_opcode(_procceed) && P->opc != Yap_opcode(_cut_e))) {
execute_dealloc(PASS_REGS1); execute_dealloc(PASS_REGS1);
@ -655,7 +655,10 @@ static int interrupt_deallocate(USES_REGS1) {
} else { } else {
pe = RepPredProp(Yap_GetPredPropByAtom(AtomTrue, 0)); pe = RepPredProp(Yap_GetPredPropByAtom(AtomTrue, 0));
} }
return interrupt_handler(pe PASS_REGS); // deallocate moves P one step forward.
bool rc = interrupt_handler(pe PASS_REGS);
P = NEXTOP(P,p);
return rc;
} }
if (!Yap_locked_gc(0, ENV, YESCODE)) { if (!Yap_locked_gc(0, ENV, YESCODE)) {
Yap_NilError(RESOURCE_ERROR_STACK, LOCAL_ErrorMessage); Yap_NilError(RESOURCE_ERROR_STACK, LOCAL_ErrorMessage);

View File

@ -1418,15 +1418,17 @@ a_p(op_numbers opcode, clause_info *clinfo, yamop *code_p, int pass_no, struct i
case _equal: case _equal:
op = _p_equal; op = _p_equal;
break; break;
#if INLINE_BIG_COMPARISONS
case _dif: case _dif:
op = _p_dif; op = _p_dif;
is_test = TRUE; is_test = true;
break; break;
case _eq: case _eq:
op = _p_eq; op = _p_eq;
is_test = TRUE; is_test = true;
break; break;
case _functor: #endif
case _functor:
code_p = check_alloc(clinfo, code_p, pass_no, cip); code_p = check_alloc(clinfo, code_p, pass_no, cip);
op = _p_functor; op = _p_functor;
break; break;

View File

@ -1982,7 +1982,7 @@ bool is_cleanup_cp(choiceptr cp_b) {
static Int JumpToEnv() { static Int JumpToEnv() {
choiceptr handler = B, oh = NULL; choiceptr handler = B, oh = NULL;
/* just keep the throwm object away, we don't need to care about it /* just keep the thrown object away, we don't need to care about it
*/ */
/* careful, previous step may have caused a stack shift, /* careful, previous step may have caused a stack shift,
so get pointers here */ so get pointers here */

View File

@ -1120,8 +1120,13 @@ Yap_InitInlines(void)
Yap_InitAsmPred("compound", 1, _compound, p_compound, SafePredFlag); Yap_InitAsmPred("compound", 1, _compound, p_compound, SafePredFlag);
Yap_InitAsmPred("float", 1, _float, p_float, SafePredFlag); Yap_InitAsmPred("float", 1, _float, p_float, SafePredFlag);
Yap_InitAsmPred("=", 2, _equal, p_equal, SafePredFlag); Yap_InitAsmPred("=", 2, _equal, p_equal, SafePredFlag);
Yap_InitAsmPred("\\=", 2, _dif, p_dif, SafePredFlag); #if INLINE_BIG_COMPARISONS
Yap_InitAsmPred("==", 2, _eq, p_eq, SafePredFlag); Yap_InitAsmPred("\\=", 2, _dif, p_dif, SafePredFlag|TestPredFlag);
Yap_InitAsmPred("==", 2, _eq, p_eq, SafePredFlag|TestPredFlag);
#else
Yap_InitCPred("\\=", 2, p_dif, SafePredFlag);
Yap_InitCPred("==", 2, p_eq, SafePredFlag);
#endif
Yap_InitAsmPred("arg", 3, _arg, p_arg, SafePredFlag); Yap_InitAsmPred("arg", 3, _arg, p_arg, SafePredFlag);
Yap_InitAsmPred("functor", 3, _functor, p_functor, 0); Yap_InitAsmPred("functor", 3, _functor, p_functor, 0);
Yap_InitAsmPred("$label_ctl", 2, _p_label_ctl, p_erroneous_call, SafePredFlag); Yap_InitAsmPred("$label_ctl", 2, _p_label_ctl, p_erroneous_call, SafePredFlag);

View File

@ -2045,6 +2045,7 @@
GONext(); GONext();
ENDOp(); ENDOp();
#if INLINE_BIG_COMPARISONS
Op(p_dif, l); Op(p_dif, l);
#ifdef LOW_LEVEL_TRACER #ifdef LOW_LEVEL_TRACER
if (Yap_do_low_level_trace) if (Yap_do_low_level_trace)
@ -2168,6 +2169,12 @@
ENDOp(); ENDOp();
Op(p_eq, l); Op(p_eq, l);
#ifdef COROUTINING
CACHE_Y_AS_ENV(YREG);
check_stack(NoStackEq, HR);
ENDCACHE_Y_AS_ENV();
do_eq:
#endif
#ifdef LOW_LEVEL_TRACER #ifdef LOW_LEVEL_TRACER
if (Yap_do_low_level_trace) if (Yap_do_low_level_trace)
low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorSame,0)),XREGS+1); low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorSame,0)),XREGS+1);
@ -2334,7 +2341,15 @@
ENDP(pt0); ENDP(pt0);
ENDD(d0); ENDD(d0);
#ifdef COROUTINING
/* Problem: have I got an environment or not? */
NoStackEq:
PROCESS_INT(interrupt_eq, do_eq);
#endif
ENDOp(); ENDOp();
#endif /* INLINE_BIG_COMPARISONS */
Op(p_arg_vv, xxx); Op(p_arg_vv, xxx);
#ifdef LOW_LEVEL_TRACER #ifdef LOW_LEVEL_TRACER