fix save_cp
This commit is contained in:
parent
9372231bcf
commit
fdd05abd38
@ -2841,7 +2841,7 @@ p_rmspy( USES_REGS1 )
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#if THREADS
|
#if THREADS
|
||||||
if (!(pred->PredFlags & ThreadLocalPredFlag)) {
|
if (pred->PredFlags & ThreadLocalPredFlag) {
|
||||||
pred->OpcodeOfPred = Yap_opcode(_thread_local);
|
pred->OpcodeOfPred = Yap_opcode(_thread_local);
|
||||||
pred->PredFlags ^= SpiedPredFlag;
|
pred->PredFlags ^= SpiedPredFlag;
|
||||||
UNLOCKPE(39,pred);
|
UNLOCKPE(39,pred);
|
||||||
@ -5288,8 +5288,6 @@ p_continue_static_clause( USES_REGS1 )
|
|||||||
static void
|
static void
|
||||||
add_code_in_lu_index(LogUpdIndex *cl, PredEntry *pp)
|
add_code_in_lu_index(LogUpdIndex *cl, PredEntry *pp)
|
||||||
{
|
{
|
||||||
CACHE_REGS
|
|
||||||
|
|
||||||
char *code_end = (char *)cl + cl->ClSize;
|
char *code_end = (char *)cl + cl->ClSize;
|
||||||
Yap_inform_profiler_of_clause(cl, code_end, pp, GPROF_LU_INDEX);
|
Yap_inform_profiler_of_clause(cl, code_end, pp, GPROF_LU_INDEX);
|
||||||
cl = cl->ChildIndex;
|
cl = cl->ChildIndex;
|
||||||
@ -5302,7 +5300,6 @@ add_code_in_lu_index(LogUpdIndex *cl, PredEntry *pp)
|
|||||||
static void
|
static void
|
||||||
add_code_in_static_index(StaticIndex *cl, PredEntry *pp)
|
add_code_in_static_index(StaticIndex *cl, PredEntry *pp)
|
||||||
{
|
{
|
||||||
CACHE_REGS
|
|
||||||
char *code_end = (char *)cl + cl->ClSize;
|
char *code_end = (char *)cl + cl->ClSize;
|
||||||
Yap_inform_profiler_of_clause(cl, code_end, pp, GPROF_STATIC_INDEX);
|
Yap_inform_profiler_of_clause(cl, code_end, pp, GPROF_STATIC_INDEX);
|
||||||
cl = cl->ChildIndex;
|
cl = cl->ChildIndex;
|
||||||
@ -5315,7 +5312,6 @@ add_code_in_static_index(StaticIndex *cl, PredEntry *pp)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
add_code_in_pred(PredEntry *pp) {
|
add_code_in_pred(PredEntry *pp) {
|
||||||
CACHE_REGS
|
|
||||||
yamop *clcode;
|
yamop *clcode;
|
||||||
|
|
||||||
PELOCK(49,pp);
|
PELOCK(49,pp);
|
||||||
@ -5387,7 +5383,6 @@ add_code_in_pred(PredEntry *pp) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
Yap_dump_code_area_for_profiler(void) {
|
Yap_dump_code_area_for_profiler(void) {
|
||||||
CACHE_REGS
|
|
||||||
ModEntry *me = CurrentModules;
|
ModEntry *me = CurrentModules;
|
||||||
|
|
||||||
while (me) {
|
while (me) {
|
||||||
|
18
C/compiler.c
18
C/compiler.c
@ -916,6 +916,22 @@ c_test(Int Op, Term t1, compiler_struct *cglobs) {
|
|||||||
CACHE_REGS
|
CACHE_REGS
|
||||||
Term t = Deref(t1);
|
Term t = Deref(t1);
|
||||||
|
|
||||||
|
/* be caareful, has to be first occurrence */
|
||||||
|
if (Op == _save_by) {
|
||||||
|
if (!IsNewVar(t)) {
|
||||||
|
char s[32];
|
||||||
|
|
||||||
|
LOCAL_Error_TYPE = TYPE_ERROR_VARIABLE;
|
||||||
|
LOCAL_Error_Term = t;
|
||||||
|
LOCAL_ErrorMessage = LOCAL_ErrorSay;
|
||||||
|
Yap_bip_name(Op, s);
|
||||||
|
sprintf(LOCAL_ErrorMessage, "compiling %s/2 on bound variable", s);
|
||||||
|
save_machine_regs();
|
||||||
|
siglongjmp(cglobs->cint.CompilerBotch,1);
|
||||||
|
}
|
||||||
|
c_var(t, save_b_flag, 1, 0, cglobs);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!IsVarTerm(t) || IsNewVar(t)) {
|
if (!IsVarTerm(t) || IsNewVar(t)) {
|
||||||
Term tn = MkVarTerm();
|
Term tn = MkVarTerm();
|
||||||
c_eq(t, tn, cglobs);
|
c_eq(t, tn, cglobs);
|
||||||
@ -923,8 +939,6 @@ c_test(Int Op, Term t1, compiler_struct *cglobs) {
|
|||||||
}
|
}
|
||||||
if (Op == _cut_by)
|
if (Op == _cut_by)
|
||||||
c_var(t, commit_b_flag, 1, 0, cglobs);
|
c_var(t, commit_b_flag, 1, 0, cglobs);
|
||||||
else if (Op == _save_by)
|
|
||||||
c_var(t, save_b_flag, 1, 0, cglobs);
|
|
||||||
else
|
else
|
||||||
c_var(t, f_flag,(unsigned int)Op, 0, cglobs);
|
c_var(t, f_flag,(unsigned int)Op, 0, cglobs);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user