boxing.factor: Use count
parent
aba3d66849
commit
7349f9d953
|
@ -13,21 +13,17 @@ SYMBOL: struct-return-area
|
||||||
SYMBOLS: int-reg-reps float-reg-reps ;
|
SYMBOLS: int-reg-reps float-reg-reps ;
|
||||||
|
|
||||||
: record-reg-reps ( reps -- reps )
|
: record-reg-reps ( reps -- reps )
|
||||||
dup [
|
dup ! reps: { { reg-rep on-stack? odd-register? } ... }
|
||||||
dup second not [ ! on-stack?: f
|
[ [ [ second not ] [ first int-rep? ] bi and ] count int-reg-reps +@ ]
|
||||||
first int-rep? int-reg-reps float-reg-reps ?
|
[ [ [ second not ] [ first int-rep? not ] bi and ] count float-reg-reps +@ ]
|
||||||
dup get [ inc ] [ drop ] if
|
bi ;
|
||||||
] [ drop ] if
|
|
||||||
] each ;
|
|
||||||
|
|
||||||
: unrecord-reg-reps ( reps -- reps )
|
: unrecord-reg-reps ( reps -- reps )
|
||||||
dup [
|
dup
|
||||||
dup second not [ ! on-stack?: f
|
[ [ [ second not ] [ first int-rep? ] bi and ] count -1 * int-reg-reps +@ ]
|
||||||
first int-rep? int-reg-reps float-reg-reps ?
|
[ [ [ second not ] [ first int-rep? not ] bi and ] count -1 * float-reg-reps +@ ]
|
||||||
dup get [ dec ] [ drop ] if
|
bi ;
|
||||||
] [ drop ] if
|
|
||||||
] each ;
|
|
||||||
|
|
||||||
GENERIC: flatten-c-type ( c-type -- pairs )
|
GENERIC: flatten-c-type ( c-type -- pairs )
|
||||||
|
|
||||||
M: c-type flatten-c-type
|
M: c-type flatten-c-type
|
||||||
|
|
Loading…
Reference in New Issue