optimizer: don't move expressions into a with-continuation-mark
... unless the optimizer can prove that the expression doesn't inspect continuation marks.
This commit is contained in:
parent
6112d337b3
commit
a01b12e5ef
|
@ -2248,7 +2248,17 @@
|
|||
(list (c? (c-q (c 1 2 3))))
|
||||
5)))
|
||||
|
||||
|
||||
(test-comp `(lambda (b)
|
||||
(let ([v (unbox b)])
|
||||
(with-continuation-mark 'x 'y (unbox v))))
|
||||
`(lambda (b)
|
||||
(with-continuation-mark 'x 'y (unbox (unbox b))))
|
||||
#f)
|
||||
(test-comp `(lambda (b)
|
||||
(let ([v (box b)])
|
||||
(with-continuation-mark 'x 'y (box v))))
|
||||
`(lambda (b)
|
||||
(with-continuation-mark 'x 'y (box (box b)))))
|
||||
|
||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Check splitting of definitions
|
||||
|
|
|
@ -3252,6 +3252,11 @@ static Scheme_Object *optimize_wcm(Scheme_Object *o, Optimize_Info *info, int co
|
|||
|
||||
v = scheme_optimize_expr(wcm->val, info, 0);
|
||||
|
||||
/* The presence of a key can be detected by other expressions,
|
||||
to increment vclock to prevent expressions incorrectly
|
||||
moving under the mark: */
|
||||
info->vclock++;
|
||||
|
||||
b = scheme_optimize_expr(wcm->body, info, scheme_optimize_tail_context(context));
|
||||
|
||||
if (omittable_key(k, info)
|
||||
|
|
Loading…
Reference in New Issue
Block a user