JIT: fix inline allocation for large vectors

Cloaes #1800
This commit is contained in:
Matthew Flatt 2017-10-25 09:55:41 -07:00
parent 22e8af32f3
commit ce9894c8bf
2 changed files with 16 additions and 1 deletions

View File

@ -914,6 +914,18 @@
)) ))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Make sure that the JIT doesn't try to inline
;; a vector allocation that is too large
(parameterize ([current-namespace (make-base-namespace)])
(let loop ([i 10])
((eval `(lambda (x) (vector x ,@(for/list ([j (in-range i)])
j))))
i)
(when (i . < . 100000)
(loop (floor (* i #e1.25))))))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Check JIT handling of structure-reference sequences ;; Check JIT handling of structure-reference sequences

View File

@ -5250,7 +5250,10 @@ static int generate_vector_alloc(mz_jit_state *jitter, Scheme_Object *rator,
c = 2; c = 2;
} else { } else {
c = app->num_args; c = app->num_args;
if (c) if (c > 256) {
/* Too big for inline alloc */
return scheme_generate_app(app, NULL, c, c, jitter, 0, 0, 0, 0);
} else if (c)
scheme_generate_app(app, NULL, c, c, jitter, 0, 0, 0, 2); /* sync'd below */ scheme_generate_app(app, NULL, c, c, jitter, 0, 0, 0, 2); /* sync'd below */
} }
CHECK_LIMIT(); CHECK_LIMIT();