]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/cfg/instructions/instructions.factor
compiler.*: removing the check-d and check-r slots from gc-map and adjusting code...
[factor.git] / basis / compiler / cfg / instructions / instructions.factor
1 ! Copyright (C) 2008, 2011 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors compiler.cfg.instructions.syntax kernel math
4 namespaces ;
5 IN: compiler.cfg.instructions
6
7 <<
8 SYMBOL: insn-classes
9 V{ } clone insn-classes set-global
10 >>
11
12 : new-insn ( ... class -- insn ) f swap boa ; inline
13
14 TUPLE: insn ;
15
16 TUPLE: vreg-insn < insn ;
17
18 TUPLE: flushable-insn < vreg-insn ;
19
20 TUPLE: foldable-insn < flushable-insn ;
21
22 ! Constants
23 FOLDABLE-INSN: ##load-integer
24 def: dst/int-rep
25 literal: val ;
26
27 FOLDABLE-INSN: ##load-reference
28 def: dst/tagged-rep
29 literal: obj ;
30
31 ! These four are inserted by representation selection
32 FLUSHABLE-INSN: ##load-tagged
33 def: dst/tagged-rep
34 literal: val ;
35
36 FLUSHABLE-INSN: ##load-float
37 def: dst/float-rep
38 literal: val ;
39
40 FLUSHABLE-INSN: ##load-double
41 def: dst/double-rep
42 literal: val ;
43
44 FLUSHABLE-INSN: ##load-vector
45 def: dst
46 literal: val rep ;
47
48 ! Stack operations
49 FLUSHABLE-INSN: ##peek
50 def: dst/tagged-rep
51 literal: loc ;
52
53 VREG-INSN: ##replace
54 use: src/tagged-rep
55 literal: loc ;
56
57 INSN: ##replace-imm
58 literal: src loc ;
59
60 INSN: ##inc
61 literal: loc ;
62
63 ! Subroutine calls
64 INSN: ##call
65 literal: word ;
66
67 INSN: ##jump
68 literal: word ;
69
70 INSN: ##prologue ;
71
72 INSN: ##epilogue ;
73
74 INSN: ##return ;
75
76 INSN: ##safepoint ;
77
78 INSN: ##no-tco ;
79
80 ! Jump tables
81 VREG-INSN: ##dispatch
82 use: src/int-rep
83 temp: temp/int-rep ;
84
85 ! Slot access
86 FLUSHABLE-INSN: ##slot
87 def: dst/tagged-rep
88 use: obj/tagged-rep slot/int-rep
89 literal: scale tag ;
90
91 FLUSHABLE-INSN: ##slot-imm
92 def: dst/tagged-rep
93 use: obj/tagged-rep
94 literal: slot tag ;
95
96 VREG-INSN: ##set-slot
97 use: src/tagged-rep obj/tagged-rep slot/int-rep
98 literal: scale tag ;
99
100 VREG-INSN: ##set-slot-imm
101 use: src/tagged-rep obj/tagged-rep
102 literal: slot tag ;
103
104 ! Register transfers
105 FOLDABLE-INSN: ##copy
106 def: dst
107 use: src
108 literal: rep ;
109
110 ! Only used by compiler.cfg.cssa
111 FLUSHABLE-INSN: ##parallel-copy
112 literal: values ;
113
114 FOLDABLE-INSN: ##tagged>integer
115 def: dst/int-rep
116 use: src/tagged-rep ;
117
118 ! Integer arithmetic
119 FOLDABLE-INSN: ##add
120 def: dst/int-rep
121 use: src1/int-rep src2/int-rep ;
122
123 FOLDABLE-INSN: ##add-imm
124 def: dst/int-rep
125 use: src1/int-rep
126 literal: src2 ;
127
128 FOLDABLE-INSN: ##sub
129 def: dst/int-rep
130 use: src1/int-rep src2/int-rep ;
131
132 FOLDABLE-INSN: ##sub-imm
133 def: dst/int-rep
134 use: src1/int-rep
135 literal: src2 ;
136
137 FOLDABLE-INSN: ##mul
138 def: dst/int-rep
139 use: src1/int-rep src2/int-rep ;
140
141 FOLDABLE-INSN: ##mul-imm
142 def: dst/int-rep
143 use: src1/int-rep
144 literal: src2 ;
145
146 FOLDABLE-INSN: ##and
147 def: dst/int-rep
148 use: src1/int-rep src2/int-rep ;
149
150 FOLDABLE-INSN: ##and-imm
151 def: dst/int-rep
152 use: src1/int-rep
153 literal: src2 ;
154
155 FOLDABLE-INSN: ##or
156 def: dst/int-rep
157 use: src1/int-rep src2/int-rep ;
158
159 FOLDABLE-INSN: ##or-imm
160 def: dst/int-rep
161 use: src1/int-rep
162 literal: src2 ;
163
164 FOLDABLE-INSN: ##xor
165 def: dst/int-rep
166 use: src1/int-rep src2/int-rep ;
167
168 FOLDABLE-INSN: ##xor-imm
169 def: dst/int-rep
170 use: src1/int-rep
171 literal: src2 ;
172
173 FOLDABLE-INSN: ##shl
174 def: dst/int-rep
175 use: src1/int-rep src2/int-rep ;
176
177 FOLDABLE-INSN: ##shl-imm
178 def: dst/int-rep
179 use: src1/int-rep
180 literal: src2 ;
181
182 FOLDABLE-INSN: ##shr
183 def: dst/int-rep
184 use: src1/int-rep src2/int-rep ;
185
186 FOLDABLE-INSN: ##shr-imm
187 def: dst/int-rep
188 use: src1/int-rep
189 literal: src2 ;
190
191 FOLDABLE-INSN: ##sar
192 def: dst/int-rep
193 use: src1/int-rep src2/int-rep ;
194
195 FOLDABLE-INSN: ##sar-imm
196 def: dst/int-rep
197 use: src1/int-rep
198 literal: src2 ;
199
200 FOLDABLE-INSN: ##min
201 def: dst/int-rep
202 use: src1/int-rep src2/int-rep ;
203
204 FOLDABLE-INSN: ##max
205 def: dst/int-rep
206 use: src1/int-rep src2/int-rep ;
207
208 FOLDABLE-INSN: ##not
209 def: dst/int-rep
210 use: src/int-rep ;
211
212 FOLDABLE-INSN: ##neg
213 def: dst/int-rep
214 use: src/int-rep ;
215
216 FOLDABLE-INSN: ##log2
217 def: dst/int-rep
218 use: src/int-rep ;
219
220 FOLDABLE-INSN: ##bit-count
221 def: dst/int-rep
222 use: src/int-rep ;
223
224 ! Float arithmetic
225 FOLDABLE-INSN: ##add-float
226 def: dst/double-rep
227 use: src1/double-rep src2/double-rep ;
228
229 FOLDABLE-INSN: ##sub-float
230 def: dst/double-rep
231 use: src1/double-rep src2/double-rep ;
232
233 FOLDABLE-INSN: ##mul-float
234 def: dst/double-rep
235 use: src1/double-rep src2/double-rep ;
236
237 FOLDABLE-INSN: ##div-float
238 def: dst/double-rep
239 use: src1/double-rep src2/double-rep ;
240
241 FOLDABLE-INSN: ##min-float
242 def: dst/double-rep
243 use: src1/double-rep src2/double-rep ;
244
245 FOLDABLE-INSN: ##max-float
246 def: dst/double-rep
247 use: src1/double-rep src2/double-rep ;
248
249 FOLDABLE-INSN: ##sqrt
250 def: dst/double-rep
251 use: src/double-rep ;
252
253 ! Single/double float conversion
254 FOLDABLE-INSN: ##single>double-float
255 def: dst/double-rep
256 use: src/float-rep ;
257
258 FOLDABLE-INSN: ##double>single-float
259 def: dst/float-rep
260 use: src/double-rep ;
261
262 ! Float/integer conversion
263 FOLDABLE-INSN: ##float>integer
264 def: dst/int-rep
265 use: src/double-rep ;
266
267 FOLDABLE-INSN: ##integer>float
268 def: dst/double-rep
269 use: src/int-rep ;
270
271 ! SIMD operations
272 FOLDABLE-INSN: ##zero-vector
273 def: dst
274 literal: rep ;
275
276 FOLDABLE-INSN: ##fill-vector
277 def: dst
278 literal: rep ;
279
280 FOLDABLE-INSN: ##gather-vector-2
281 def: dst
282 use: src1/scalar-rep src2/scalar-rep
283 literal: rep ;
284
285 FOLDABLE-INSN: ##gather-int-vector-2
286 def: dst
287 use: src1/int-rep src2/int-rep
288 literal: rep ;
289
290 FOLDABLE-INSN: ##gather-vector-4
291 def: dst
292 use: src1/scalar-rep src2/scalar-rep src3/scalar-rep src4/scalar-rep
293 literal: rep ;
294
295 FOLDABLE-INSN: ##gather-int-vector-4
296 def: dst
297 use: src1/int-rep src2/int-rep src3/int-rep src4/int-rep
298 literal: rep ;
299
300 FOLDABLE-INSN: ##select-vector
301 def: dst/int-rep
302 use: src
303 literal: n rep ;
304
305 FOLDABLE-INSN: ##shuffle-vector
306 def: dst
307 use: src shuffle
308 literal: rep ;
309
310 FOLDABLE-INSN: ##shuffle-vector-halves-imm
311 def: dst
312 use: src1 src2
313 literal: shuffle rep ;
314
315 FOLDABLE-INSN: ##shuffle-vector-imm
316 def: dst
317 use: src
318 literal: shuffle rep ;
319
320 FOLDABLE-INSN: ##tail>head-vector
321 def: dst
322 use: src
323 literal: rep ;
324
325 FOLDABLE-INSN: ##merge-vector-head
326 def: dst
327 use: src1 src2
328 literal: rep ;
329
330 FOLDABLE-INSN: ##merge-vector-tail
331 def: dst
332 use: src1 src2
333 literal: rep ;
334
335 FOLDABLE-INSN: ##float-pack-vector
336 def: dst
337 use: src
338 literal: rep ;
339
340 FOLDABLE-INSN: ##signed-pack-vector
341 def: dst
342 use: src1 src2
343 literal: rep ;
344
345 FOLDABLE-INSN: ##unsigned-pack-vector
346 def: dst
347 use: src1 src2
348 literal: rep ;
349
350 FOLDABLE-INSN: ##unpack-vector-head
351 def: dst
352 use: src
353 literal: rep ;
354
355 FOLDABLE-INSN: ##unpack-vector-tail
356 def: dst
357 use: src
358 literal: rep ;
359
360 FOLDABLE-INSN: ##integer>float-vector
361 def: dst
362 use: src
363 literal: rep ;
364
365 FOLDABLE-INSN: ##float>integer-vector
366 def: dst
367 use: src
368 literal: rep ;
369
370 FOLDABLE-INSN: ##compare-vector
371 def: dst
372 use: src1 src2
373 literal: rep cc ;
374
375 FOLDABLE-INSN: ##move-vector-mask
376 def: dst/int-rep
377 use: src
378 literal: rep ;
379
380 FOLDABLE-INSN: ##test-vector
381 def: dst/tagged-rep
382 use: src1
383 temp: temp/int-rep
384 literal: rep vcc ;
385
386 VREG-INSN: ##test-vector-branch
387 use: src1
388 temp: temp/int-rep
389 literal: rep vcc ;
390
391 FOLDABLE-INSN: ##add-vector
392 def: dst
393 use: src1 src2
394 literal: rep ;
395
396 FOLDABLE-INSN: ##saturated-add-vector
397 def: dst
398 use: src1 src2
399 literal: rep ;
400
401 FOLDABLE-INSN: ##add-sub-vector
402 def: dst
403 use: src1 src2
404 literal: rep ;
405
406 FOLDABLE-INSN: ##sub-vector
407 def: dst
408 use: src1 src2
409 literal: rep ;
410
411 FOLDABLE-INSN: ##saturated-sub-vector
412 def: dst
413 use: src1 src2
414 literal: rep ;
415
416 FOLDABLE-INSN: ##mul-vector
417 def: dst
418 use: src1 src2
419 literal: rep ;
420
421 FOLDABLE-INSN: ##mul-high-vector
422 def: dst
423 use: src1 src2
424 literal: rep ;
425
426 FOLDABLE-INSN: ##mul-horizontal-add-vector
427 def: dst
428 use: src1 src2
429 literal: rep ;
430
431 FOLDABLE-INSN: ##saturated-mul-vector
432 def: dst
433 use: src1 src2
434 literal: rep ;
435
436 FOLDABLE-INSN: ##div-vector
437 def: dst
438 use: src1 src2
439 literal: rep ;
440
441 FOLDABLE-INSN: ##min-vector
442 def: dst
443 use: src1 src2
444 literal: rep ;
445
446 FOLDABLE-INSN: ##max-vector
447 def: dst
448 use: src1 src2
449 literal: rep ;
450
451 FOLDABLE-INSN: ##avg-vector
452 def: dst
453 use: src1 src2
454 literal: rep ;
455
456 FOLDABLE-INSN: ##dot-vector
457 def: dst/scalar-rep
458 use: src1 src2
459 literal: rep ;
460
461 FOLDABLE-INSN: ##sad-vector
462 def: dst
463 use: src1 src2
464 literal: rep ;
465
466 FOLDABLE-INSN: ##horizontal-add-vector
467 def: dst
468 use: src1 src2
469 literal: rep ;
470
471 FOLDABLE-INSN: ##horizontal-sub-vector
472 def: dst
473 use: src1 src2
474 literal: rep ;
475
476 FOLDABLE-INSN: ##horizontal-shl-vector-imm
477 def: dst
478 use: src1
479 literal: src2 rep ;
480
481 FOLDABLE-INSN: ##horizontal-shr-vector-imm
482 def: dst
483 use: src1
484 literal: src2 rep ;
485
486 FOLDABLE-INSN: ##abs-vector
487 def: dst
488 use: src
489 literal: rep ;
490
491 FOLDABLE-INSN: ##sqrt-vector
492 def: dst
493 use: src
494 literal: rep ;
495
496 FOLDABLE-INSN: ##and-vector
497 def: dst
498 use: src1 src2
499 literal: rep ;
500
501 FOLDABLE-INSN: ##andn-vector
502 def: dst
503 use: src1 src2
504 literal: rep ;
505
506 FOLDABLE-INSN: ##or-vector
507 def: dst
508 use: src1 src2
509 literal: rep ;
510
511 FOLDABLE-INSN: ##xor-vector
512 def: dst
513 use: src1 src2
514 literal: rep ;
515
516 FOLDABLE-INSN: ##not-vector
517 def: dst
518 use: src
519 literal: rep ;
520
521 FOLDABLE-INSN: ##shl-vector-imm
522 def: dst
523 use: src1
524 literal: src2 rep ;
525
526 FOLDABLE-INSN: ##shr-vector-imm
527 def: dst
528 use: src1
529 literal: src2 rep ;
530
531 FOLDABLE-INSN: ##shl-vector
532 def: dst
533 use: src1 src2/int-scalar-rep
534 literal: rep ;
535
536 FOLDABLE-INSN: ##shr-vector
537 def: dst
538 use: src1 src2/int-scalar-rep
539 literal: rep ;
540
541 ! Scalar/vector conversion
542 FOLDABLE-INSN: ##scalar>integer
543 def: dst/int-rep
544 use: src
545 literal: rep ;
546
547 FOLDABLE-INSN: ##integer>scalar
548 def: dst
549 use: src/int-rep
550 literal: rep ;
551
552 FOLDABLE-INSN: ##vector>scalar
553 def: dst/scalar-rep
554 use: src
555 literal: rep ;
556
557 FOLDABLE-INSN: ##scalar>vector
558 def: dst
559 use: src/scalar-rep
560 literal: rep ;
561
562 ! Boxing and unboxing aliens
563 FOLDABLE-INSN: ##box-alien
564 def: dst/tagged-rep
565 use: src/int-rep
566 temp: temp/int-rep ;
567
568 FOLDABLE-INSN: ##box-displaced-alien
569 def: dst/tagged-rep
570 use: displacement/int-rep base/tagged-rep
571 temp: temp/int-rep
572 literal: base-class ;
573
574 FOLDABLE-INSN: ##unbox-any-c-ptr
575 def: dst/int-rep
576 use: src/tagged-rep ;
577
578 FOLDABLE-INSN: ##unbox-alien
579 def: dst/int-rep
580 use: src/tagged-rep ;
581
582 ! Zero-extending and sign-extending integers
583 FOLDABLE-INSN: ##convert-integer
584 def: dst/int-rep
585 use: src/int-rep
586 literal: c-type ;
587
588 ! Raw memory accessors
589 FLUSHABLE-INSN: ##load-memory
590 def: dst
591 use: base/int-rep displacement/int-rep
592 literal: scale offset rep c-type ;
593
594 FLUSHABLE-INSN: ##load-memory-imm
595 def: dst
596 use: base/int-rep
597 literal: offset rep c-type ;
598
599 VREG-INSN: ##store-memory
600 use: src base/int-rep displacement/int-rep
601 literal: scale offset rep c-type ;
602
603 VREG-INSN: ##store-memory-imm
604 use: src base/int-rep
605 literal: offset rep c-type ;
606
607 ! Memory allocation
608 FLUSHABLE-INSN: ##allot
609 def: dst/tagged-rep
610 literal: size class-of
611 temp: temp/int-rep ;
612
613 VREG-INSN: ##write-barrier
614 use: src/tagged-rep slot/int-rep
615 literal: scale tag
616 temp: temp1/int-rep temp2/int-rep ;
617
618 VREG-INSN: ##write-barrier-imm
619 use: src/tagged-rep
620 literal: slot tag
621 temp: temp1/int-rep temp2/int-rep ;
622
623 FLUSHABLE-INSN: ##alien-global
624 def: dst/int-rep
625 literal: symbol library ;
626
627 FLUSHABLE-INSN: ##vm-field
628 def: dst/tagged-rep
629 literal: offset ;
630
631 VREG-INSN: ##set-vm-field
632 use: src/tagged-rep
633 literal: offset ;
634
635 ! FFI
636 FOLDABLE-INSN: ##unbox
637 def: dst
638 use: src/tagged-rep
639 literal: unboxer rep ;
640
641 FOLDABLE-INSN: ##unbox-long-long
642 def: dst1/int-rep dst2/int-rep
643 use: src/tagged-rep
644 literal: unboxer ;
645
646 FLUSHABLE-INSN: ##local-allot
647 def: dst/int-rep
648 literal: size align offset ;
649
650 FOLDABLE-INSN: ##box
651 def: dst/tagged-rep
652 use: src
653 literal: boxer rep gc-map ;
654
655 FOLDABLE-INSN: ##box-long-long
656 def: dst/tagged-rep
657 use: src1/int-rep src2/int-rep
658 literal: boxer gc-map ;
659
660 ! Alien call inputs and outputs are arrays of triples with shape
661 ! { vreg rep stack#/reg }
662
663 VREG-INSN: ##alien-invoke
664 literal: reg-inputs stack-inputs reg-outputs dead-outputs cleanup stack-size symbols dll gc-map ;
665
666 VREG-INSN: ##alien-indirect
667 use: src/int-rep
668 literal: reg-inputs stack-inputs reg-outputs dead-outputs cleanup stack-size gc-map ;
669
670 VREG-INSN: ##alien-assembly
671 literal: reg-inputs stack-inputs reg-outputs dead-outputs cleanup stack-size quot ;
672
673 VREG-INSN: ##callback-inputs
674 literal: reg-outputs stack-outputs ;
675
676 VREG-INSN: ##callback-outputs
677 literal: reg-inputs ;
678
679 ! Control flow
680 FLUSHABLE-INSN: ##phi
681 def: dst
682 literal: inputs ;
683
684 INSN: ##branch ;
685
686 ! Tagged conditionals
687 VREG-INSN: ##compare-branch
688 use: src1/tagged-rep src2/tagged-rep
689 literal: cc ;
690
691 VREG-INSN: ##compare-imm-branch
692 use: src1/tagged-rep
693 literal: src2 cc ;
694
695 FOLDABLE-INSN: ##compare
696 def: dst/tagged-rep
697 use: src1/tagged-rep src2/tagged-rep
698 literal: cc
699 temp: temp/int-rep ;
700
701 FOLDABLE-INSN: ##compare-imm
702 def: dst/tagged-rep
703 use: src1/tagged-rep
704 literal: src2 cc
705 temp: temp/int-rep ;
706
707 ! Integer conditionals
708 VREG-INSN: ##compare-integer-branch
709 use: src1/int-rep src2/int-rep
710 literal: cc ;
711
712 VREG-INSN: ##compare-integer-imm-branch
713 use: src1/int-rep
714 literal: src2 cc ;
715
716 VREG-INSN: ##test-branch
717 use: src1/int-rep src2/int-rep
718 literal: cc ;
719
720 VREG-INSN: ##test-imm-branch
721 use: src1/int-rep
722 literal: src2 cc ;
723
724 FOLDABLE-INSN: ##compare-integer
725 def: dst/tagged-rep
726 use: src1/int-rep src2/int-rep
727 literal: cc
728 temp: temp/int-rep ;
729
730 FOLDABLE-INSN: ##compare-integer-imm
731 def: dst/tagged-rep
732 use: src1/int-rep
733 literal: src2 cc
734 temp: temp/int-rep ;
735
736 FOLDABLE-INSN: ##test
737 def: dst/tagged-rep
738 use: src1/int-rep src2/int-rep
739 literal: cc
740 temp: temp/int-rep ;
741
742 FOLDABLE-INSN: ##test-imm
743 def: dst/tagged-rep
744 use: src1/int-rep
745 literal: src2 cc
746 temp: temp/int-rep ;
747
748 ! Float conditionals
749 VREG-INSN: ##compare-float-ordered-branch
750 use: src1/double-rep src2/double-rep
751 literal: cc ;
752
753 VREG-INSN: ##compare-float-unordered-branch
754 use: src1/double-rep src2/double-rep
755 literal: cc ;
756
757 FOLDABLE-INSN: ##compare-float-ordered
758 def: dst/tagged-rep
759 use: src1/double-rep src2/double-rep
760 literal: cc
761 temp: temp/int-rep ;
762
763 FOLDABLE-INSN: ##compare-float-unordered
764 def: dst/tagged-rep
765 use: src1/double-rep src2/double-rep
766 literal: cc
767 temp: temp/int-rep ;
768
769 ! Overflowing arithmetic
770 VREG-INSN: ##fixnum-add
771 def: dst/tagged-rep
772 use: src1/tagged-rep src2/tagged-rep
773 literal: cc ;
774
775 VREG-INSN: ##fixnum-sub
776 def: dst/tagged-rep
777 use: src1/tagged-rep src2/tagged-rep
778 literal: cc ;
779
780 VREG-INSN: ##fixnum-mul
781 def: dst/tagged-rep
782 use: src1/tagged-rep src2/int-rep
783 literal: cc ;
784
785 VREG-INSN: ##save-context
786 temp: temp1/int-rep temp2/int-rep ;
787
788 ! GC checks
789 VREG-INSN: ##check-nursery-branch
790 literal: size cc
791 temp: temp1/int-rep temp2/int-rep ;
792
793 INSN: ##call-gc
794 literal: gc-map ;
795
796 ! Spills and reloads, inserted by register allocator
797 TUPLE: spill-slot { n integer } ;
798 C: <spill-slot> spill-slot
799
800 VREG-INSN: ##spill
801 use: src
802 literal: rep dst ;
803
804 VREG-INSN: ##reload
805 def: dst
806 literal: rep src ;
807
808 UNION: ##allocation
809 ##allot
810 ##box-alien
811 ##box-displaced-alien ;
812
813 UNION: conditional-branch-insn
814 ##compare-branch
815 ##compare-imm-branch
816 ##compare-integer-branch
817 ##compare-integer-imm-branch
818 ##test-branch
819 ##test-imm-branch
820 ##compare-float-ordered-branch
821 ##compare-float-unordered-branch
822 ##test-vector-branch
823 ##check-nursery-branch
824 ##fixnum-add
825 ##fixnum-sub
826 ##fixnum-mul ;
827
828 ! For alias analysis
829 UNION: ##read ##slot ##slot-imm ##vm-field ##alien-global ;
830 UNION: ##write ##set-slot ##set-slot-imm ##set-vm-field ;
831
832 UNION: alien-call-insn
833     ##alien-assembly
834     ##alien-indirect
835     ##alien-invoke ;
836
837 UNION: gc-map-insn
838     ##call-gc
839     ##box
840     ##box-long-long
841     ##alien-indirect
842     ##alien-invoke ;
843
844 M: gc-map-insn clone call-next-method [ clone ] change-gc-map ;
845
846 TUPLE: gc-map scrub-d scrub-r gc-roots derived-roots ;
847
848 : <gc-map> ( -- gc-map ) gc-map new ;
849
850 ! Instructions that clobber registers. They receive inputs and
851 ! produce outputs in spill slots.
852 UNION: hairy-clobber-insn
853 ##call-gc
854 alien-call-insn
855 ##callback-inputs
856 ##callback-outputs
857 ##unbox-long-long ;
858
859 ! Instructions that clobber registers but are allowed to produce
860 ! outputs in registers. Inputs are in spill slots, except for
861 ! inputs coalesced with the output, in which case that input
862 ! will be in a register.
863 UNION: clobber-insn
864 hairy-clobber-insn
865 ##unbox
866 ##box
867 ##box-long-long ;
868
869 UNION: def-is-use-insn
870 ##box-alien
871 ##box-displaced-alien
872 ##unbox-any-c-ptr ;