Another compiler fix
parent
8048a4235a
commit
88168656dd
|
@ -157,3 +157,33 @@ SYMBOL: template-chosen
|
|||
! This is empty since we didn't change the stack
|
||||
[ t ] [ [ end-basic-block ] { } make empty? ] unit-test
|
||||
] with-scope
|
||||
|
||||
! Regression
|
||||
[
|
||||
[ ] [ init-templates ] unit-test
|
||||
|
||||
[ ] [ { object object } set-operand-classes ] unit-test
|
||||
|
||||
! 2dup
|
||||
[ ] [
|
||||
T{ effect f { "x" "y" } { "x" "y" "x" "y" } }
|
||||
phantom-shuffle
|
||||
] unit-test
|
||||
|
||||
[ ] [
|
||||
2 phantom-d get phantom-input
|
||||
[ { { f "a" } { f "b" } } lazy-load ] { } make drop
|
||||
] unit-test
|
||||
|
||||
[ t ] [
|
||||
phantom-d get [ cached? ] all?
|
||||
] unit-test
|
||||
|
||||
! >r
|
||||
[ ] [
|
||||
1 phantom->r
|
||||
] unit-test
|
||||
|
||||
! This should not fail
|
||||
[ ] [ [ end-basic-block ] { } make drop ] unit-test
|
||||
] with-scope
|
||||
|
|
|
@ -213,3 +213,8 @@ TUPLE: my-tuple ;
|
|||
0 alien-cell type
|
||||
] compile-1 alien type-number =
|
||||
] unit-test
|
||||
|
||||
[ 2 1 ] [
|
||||
2 1
|
||||
[ 2dup fixnum< [ >r die r> ] when ] compile-1
|
||||
] unit-test
|
||||
|
|
|
@ -116,8 +116,8 @@ M: cached live-vregs* cached-vreg live-vregs* ;
|
|||
M: cached live-loc? cached-loc live-loc? ;
|
||||
M: cached (lazy-load) >r cached-vreg r> (lazy-load) ;
|
||||
M: cached lazy-store
|
||||
2dup cached-loc =
|
||||
[ 2drop ] [ "live-locs" get at %move ] if ;
|
||||
2dup cached-loc live-loc?
|
||||
[ "live-locs" get at %move ] [ 2drop ] if ;
|
||||
M: cached minimal-ds-loc* cached-loc minimal-ds-loc* ;
|
||||
|
||||
INSTANCE: cached value
|
||||
|
@ -433,17 +433,19 @@ M: loc lazy-store
|
|||
#! We don't have enough free registers to load all shuffle
|
||||
#! inputs, so we use a single temporary register, together
|
||||
#! with the area of the data stack above the stack pointer
|
||||
find-tmp-loc slow-shuffle-mapping
|
||||
[
|
||||
[ swap dup cached? [ cached-vreg ] when %move ] assoc-each
|
||||
] keep
|
||||
>hashtable do-shuffle ;
|
||||
find-tmp-loc slow-shuffle-mapping [
|
||||
[
|
||||
swap dup cached? [ cached-vreg ] when %move
|
||||
] assoc-each
|
||||
] keep >hashtable do-shuffle ;
|
||||
|
||||
: fast-shuffle? ( live-locs -- ? )
|
||||
#! Test if we have enough free registers to load all
|
||||
#! shuffle inputs at once.
|
||||
T{ int-regs } free-vregs [ length ] 2apply <= ;
|
||||
|
||||
USING: io prettyprint ;
|
||||
|
||||
: finalize-locs ( -- )
|
||||
#! Perform any deferred stack shuffling.
|
||||
[
|
||||
|
|
Loading…
Reference in New Issue