mirror of
https://github.com/open-goal/jak-project
synced 2026-06-03 02:30:13 -04:00
d86964985a
* before adding IRegSet stuff * use bitsets for live analysis * speed up * add stack structures * organize new better
32 lines
726 B
Common Lisp
32 lines
726 B
Common Lisp
(deftype test-stack-type (basic)
|
|
((name string)
|
|
(count uint32)
|
|
(pad uint8 12))
|
|
(:methods
|
|
(new ((allocation symbol) (type-to-make type) (init-count int)) _type_ 0)
|
|
)
|
|
)
|
|
|
|
(defmethod new test-stack-type ((allocation symbol) (type-to-make type) (init-count int))
|
|
(let ((obj (object-new)))
|
|
(set! (-> obj name) "this is my name")
|
|
(set! (-> obj count) init-count)
|
|
obj
|
|
)
|
|
)
|
|
|
|
|
|
(defun stack-test-2 ()
|
|
(let ((obj (new 'stack 'test-stack-type 12))
|
|
(obj2 (new 'stack 'test-stack-type 13)))
|
|
(if (and (= 4 (logand 15 (the uint obj)))
|
|
(= 4 (logand 15 (the uint obj2)))
|
|
(= 12 (-> obj count))
|
|
)
|
|
1234
|
|
0
|
|
)
|
|
)
|
|
)
|
|
|
|
(stack-test-2) |