Cannot assume that just because a primitive deals with immutable objects that it is safe to inline.  A (set!) could still mutate variables the primitive is using, causing invalid behavior.
This commit is contained in:
Justin Ethier 2017-02-07 18:40:30 +00:00
parent d301592da6
commit 1f8fb3c20d

View file

@ -603,7 +603,11 @@
(cdr exp) (cdr exp)
(ast:lambda-formals->list (car exp))) (ast:lambda-formals->list (car exp)))
(or (or
(prim-calls-inlinable? (cdr exp)) ; Issue #172 - Cannot assume that just because a primitive
; deals with immutable objects that it is safe to inline.
; A (set!) could still mutate variables the primitive is
; using, causing invalid behavior.
;(prim-calls-inlinable? (cdr exp))
(inline-prim-call? (inline-prim-call?
(ast:lambda-body (car exp)) (ast:lambda-body (car exp))
(prim-calls->arg-variables (cdr exp)) (prim-calls->arg-variables (cdr exp))