bytecode optimizer: allow inline of unsafe-undefined
Restores some function inlining that was lost by the change to optional-argument expansion.
This commit is contained in:
parent
bbbdee2853
commit
44b8e56ed0
|
@ -4319,6 +4319,23 @@
|
|||
(test-comp '(lambda () (bytes=? #"123" #"456"))
|
||||
'(lambda () #f))
|
||||
|
||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Check inlining with optional arguments
|
||||
|
||||
(test-comp '(lambda (x)
|
||||
(define (f z [y 2])
|
||||
(+ z y))
|
||||
(f x))
|
||||
'(lambda (x)
|
||||
(+ x 2)))
|
||||
|
||||
(test-comp '(lambda (x)
|
||||
(define (f z [y (+ 1 1)])
|
||||
(+ z y))
|
||||
(f x))
|
||||
'(lambda (x)
|
||||
(+ x 2)))
|
||||
|
||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Check that the type information is shifted in the
|
||||
;; right direction while inlining.
|
||||
|
|
|
@ -2269,6 +2269,7 @@ int scheme_ir_duplicate_ok(Scheme_Object *fb, int cross_linklet)
|
|||
{
|
||||
return (SCHEME_VOIDP(fb)
|
||||
|| SAME_OBJ(fb, scheme_true)
|
||||
|| SAME_OBJ(fb, scheme_undefined)
|
||||
|| SCHEME_FALSEP(fb)
|
||||
|| (SCHEME_SYMBOLP(fb)
|
||||
&& (!cross_linklet || (!SCHEME_SYM_WEIRDP(fb)
|
||||
|
|
Loading…
Reference in New Issue
Block a user