Compiler tweaks

parent 88f677ff
......@@ -939,7 +939,7 @@ constant = #(nlocals nstack constants code)
(define-syntax-rule (RESTORE-STATE-SOFT s p tag fp nstack)
(<let> ((int v (scm->int tag)))
(<=> p (SVAR-REF fp nstack v))))
(<=> p (SVAR-REF fp nstack v))))
(define-syntax-rule (NEXT inst-pt)
(<let> (((void *) jmp (<ref> *operations*
......@@ -1436,8 +1436,7 @@ constant = #(nlocals nstack constants code)
(<if> (op x y)
(BACKTRACK p instructions inst-pt fp sp))
(<if> (<call> scm_is_true (<call> schmop x y))
(BACKTRACK p instructions inst-pt fp sp)))
(CLEAR 1 sp)))
(BACKTRACK p instructions inst-pt fp sp)))))
(define-syntax-rule (NOTCMP-XX op schmop p instructions inst-pt fp sp nstack
variables)
......@@ -1457,8 +1456,7 @@ constant = #(nlocals nstack constants code)
(<if> (op x y)
(BACKTRACK p instructions inst-pt fp sp))
(<if> (<call> scm_is_true (<call> schmop x y))
(BACKTRACK p instructions inst-pt fp sp)))
(CLEAR 1 sp)))
(BACKTRACK p instructions inst-pt fp sp)))))
(define-syntax-rule (MUL x y)
(<if> (<and> (<call> SCM_I_INUMP x) (<call> SCM_I_INUMP y))
......@@ -1860,17 +1858,19 @@ constant = #(nlocals nstack constants code)
(LABEL store-state)
(PRSTACK sp fp)
(<let> ((SCM np (<ref> inst-pt (<c> 0))))
(<=> inst-pt (<+> inst-pt (<c> 1)))
(STORE-STATE-SOFT s np p fp nstack)
(<let> ((SCM tag (<ref> inst-pt (<c> 0)))
(SCM np (<ref> inst-pt (<c> 1))))
(<=> inst-pt (<+> inst-pt (<c> 2)))
(STORE-STATE-SOFT s tag p fp nstack)
(<call> INTERUPT)
(NEXT inst-pt))
(LABEL newframe-light)
(PRSTACK sp fp)
(<let> ((SCM np (<ref> inst-pt (<c> 0))))
(<=> inst-pt (<+> inst-pt (<c> 1)))
(STORE-STATE-SOFT s np p fp nstack)
(<let> ((SCM tag (<ref> inst-pt (<c> 0)))
(SCM np (<ref> inst-pt (<c> 1))))
(<=> inst-pt (<+> inst-pt (<c> 2)))
(STORE-STATE-SOFT s tag p fp nstack)
(<=> p np)
(<call> INTERUPT)
(NEXT inst-pt))
......
......@@ -201,7 +201,7 @@ compile_goal(';'(|X),Tail,V,[L,LL]) :- !,
(
var_p(Var),
add_var_f(Var,V,F,LabA),
L = [['newframe-light',LabA ] | LX]
L = [['newframe-light',LabA,Lab] | LX]
);
(
Lab=LabA,
......
......@@ -96,11 +96,11 @@ handle(['softie-light',[[S,V,Q],N,F|_]],I,II,L,LL) :-
L=[['softie-light',VC]|LL],
II is I + 2.
handle(['newframe-light',[[S,V,Q],N,F|_]],I,II,L,LL) :-
handle(['newframe-light',[[S,V,Q],N,F|_],A],I,II,L,LL) :-
new_var(V,Q,S),
V=[VC|_],
L=[['newframe-light',VC]|LL],
II is I + 2.
L=[['newframe-light',VC,A]|LL],
II is I + 3.
handle(['unwind-light-tail',[[S,V,Q],N,F|_]],I,II,L,LL) :-
new_var(V,Q,S),
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment