1 ;;;; various array operations that are too expensive (in space) to do
4 ;;;; This software is part of the SBCL system. See the README file for
7 ;;;; This software is derived from the CMU CL system, which was
8 ;;;; written at Carnegie Mellon University and released into the
9 ;;;; public domain. The software is in the public domain and is
10 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
11 ;;;; files for more information.
17 (define-assembly-routine (allocate-vector
19 (:translate allocate-vector)
20 (:arg-types positive-fixnum
23 ((:arg type unsigned-reg eax-offset)
24 (:arg length any-reg ebx-offset)
25 (:arg words any-reg ecx-offset)
26 (:res result descriptor-reg edx-offset))
27 (inst mov result (+ (1- (ash 1 n-lowtag-bits))
28 (* vector-data-offset n-word-bytes)))
29 (inst add result words)
30 (inst and result (lognot lowtag-mask))
32 (allocation result result)
33 (inst lea result (make-ea :byte :base result :disp other-pointer-lowtag))
34 (storew type result 0 other-pointer-lowtag)
35 (storew length result vector-length-slot other-pointer-lowtag))
38 ;;;; Note: CMU CL had assembly language primitives for hashing strings,
39 ;;;; but SBCL doesn't.