compiler: r: d:

modern-harvey2
Doug Coleman 2017-08-26 13:30:18 -05:00
parent a2eb7b854d
commit fbb5f871c4
32 changed files with 941 additions and 941 deletions

View File

@ -12,13 +12,13 @@ IN: compiler.cfg.alias-analysis.tests
! Redundant load elimination ! Redundant load elimination
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##slot-imm f 1 0 1 0 } T{ ##slot-imm f 1 0 1 0 }
T{ ##copy f 2 1 any-rep } T{ ##copy f 2 1 any-rep }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##slot-imm f 1 0 1 0 } T{ ##slot-imm f 1 0 1 0 }
T{ ##slot-imm f 2 0 1 0 } T{ ##slot-imm f 2 0 1 0 }
} test-alias-analysis } test-alias-analysis
@ -27,15 +27,15 @@ IN: compiler.cfg.alias-analysis.tests
! Store-load forwarding ! Store-load forwarding
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##set-slot-imm f 1 0 1 0 } T{ ##set-slot-imm f 1 0 1 0 }
T{ ##copy f 2 1 any-rep } T{ ##copy f 2 1 any-rep }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##set-slot-imm f 1 0 1 0 } T{ ##set-slot-imm f 1 0 1 0 }
T{ ##slot-imm f 2 0 1 0 } T{ ##slot-imm f 2 0 1 0 }
} test-alias-analysis } test-alias-analysis
@ -44,16 +44,16 @@ IN: compiler.cfg.alias-analysis.tests
! Dead store elimination ! Dead store elimination
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##peek f 2 D: 2 } T{ ##peek f 2 d: 2 }
T{ ##set-slot-imm f 2 0 1 0 } T{ ##set-slot-imm f 2 0 1 0 }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##peek f 2 D: 2 } T{ ##peek f 2 d: 2 }
T{ ##set-slot-imm f 1 0 1 0 } T{ ##set-slot-imm f 1 0 1 0 }
T{ ##set-slot-imm f 2 0 1 0 } T{ ##set-slot-imm f 2 0 1 0 }
} test-alias-analysis } test-alias-analysis
@ -61,18 +61,18 @@ IN: compiler.cfg.alias-analysis.tests
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##peek f 2 D: 2 } T{ ##peek f 2 d: 2 }
T{ ##peek f 3 D: 3 } T{ ##peek f 3 d: 3 }
T{ ##set-slot-imm f 3 0 1 0 } T{ ##set-slot-imm f 3 0 1 0 }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##peek f 2 D: 2 } T{ ##peek f 2 d: 2 }
T{ ##peek f 3 D: 3 } T{ ##peek f 3 d: 3 }
T{ ##set-slot-imm f 1 0 1 0 } T{ ##set-slot-imm f 1 0 1 0 }
T{ ##set-slot-imm f 2 0 1 0 } T{ ##set-slot-imm f 2 0 1 0 }
T{ ##set-slot-imm f 3 0 1 0 } T{ ##set-slot-imm f 3 0 1 0 }
@ -82,12 +82,12 @@ IN: compiler.cfg.alias-analysis.tests
! Redundant store elimination ! Redundant store elimination
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##slot-imm f 1 0 1 0 } T{ ##slot-imm f 1 0 1 0 }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##slot-imm f 1 0 1 0 } T{ ##slot-imm f 1 0 1 0 }
T{ ##set-slot-imm f 1 0 1 0 } T{ ##set-slot-imm f 1 0 1 0 }
} test-alias-analysis } test-alias-analysis
@ -95,13 +95,13 @@ IN: compiler.cfg.alias-analysis.tests
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##slot-imm f 1 0 1 0 } T{ ##slot-imm f 1 0 1 0 }
T{ ##copy f 2 1 any-rep } T{ ##copy f 2 1 any-rep }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##slot-imm f 1 0 1 0 } T{ ##slot-imm f 1 0 1 0 }
T{ ##copy f 2 1 any-rep } T{ ##copy f 2 1 any-rep }
T{ ##set-slot-imm f 2 0 1 0 } T{ ##set-slot-imm f 2 0 1 0 }
@ -111,16 +111,16 @@ IN: compiler.cfg.alias-analysis.tests
! Not a redundant load ! Not a redundant load
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##slot-imm f 1 0 1 0 } T{ ##slot-imm f 1 0 1 0 }
T{ ##set-slot-imm f 0 1 1 0 } T{ ##set-slot-imm f 0 1 1 0 }
T{ ##slot-imm f 2 0 1 0 } T{ ##slot-imm f 2 0 1 0 }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##slot-imm f 1 0 1 0 } T{ ##slot-imm f 1 0 1 0 }
T{ ##set-slot-imm f 0 1 1 0 } T{ ##set-slot-imm f 0 1 1 0 }
T{ ##slot-imm f 2 0 1 0 } T{ ##slot-imm f 2 0 1 0 }
@ -130,20 +130,20 @@ IN: compiler.cfg.alias-analysis.tests
! Not a redundant store ! Not a redundant store
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##peek f 2 D: 2 } T{ ##peek f 2 d: 2 }
T{ ##peek f 3 D: 3 } T{ ##peek f 3 d: 3 }
T{ ##set-slot-imm f 2 1 1 0 } T{ ##set-slot-imm f 2 1 1 0 }
T{ ##slot-imm f 4 0 1 0 } T{ ##slot-imm f 4 0 1 0 }
T{ ##set-slot-imm f 3 1 1 0 } T{ ##set-slot-imm f 3 1 1 0 }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##peek f 2 D: 2 } T{ ##peek f 2 d: 2 }
T{ ##peek f 3 D: 3 } T{ ##peek f 3 d: 3 }
T{ ##set-slot-imm f 2 1 1 0 } T{ ##set-slot-imm f 2 1 1 0 }
T{ ##slot-imm f 4 0 1 0 } T{ ##slot-imm f 4 0 1 0 }
T{ ##set-slot-imm f 3 1 1 0 } T{ ##set-slot-imm f 3 1 1 0 }
@ -153,10 +153,10 @@ IN: compiler.cfg.alias-analysis.tests
! There's a redundant load, but not a redundant store ! There's a redundant load, but not a redundant store
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##peek f 2 D: 2 } T{ ##peek f 2 d: 2 }
T{ ##peek f 3 D: 3 } T{ ##peek f 3 d: 3 }
T{ ##slot-imm f 4 0 1 0 } T{ ##slot-imm f 4 0 1 0 }
T{ ##set-slot-imm f 2 0 1 0 } T{ ##set-slot-imm f 2 0 1 0 }
T{ ##slot f 5 0 3 0 0 } T{ ##slot f 5 0 3 0 0 }
@ -165,10 +165,10 @@ IN: compiler.cfg.alias-analysis.tests
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##peek f 2 D: 2 } T{ ##peek f 2 d: 2 }
T{ ##peek f 3 D: 3 } T{ ##peek f 3 d: 3 }
T{ ##slot-imm f 4 0 1 0 } T{ ##slot-imm f 4 0 1 0 }
T{ ##set-slot-imm f 2 0 1 0 } T{ ##set-slot-imm f 2 0 1 0 }
T{ ##slot f 5 0 3 0 0 } T{ ##slot f 5 0 3 0 0 }
@ -182,9 +182,9 @@ IN: compiler.cfg.alias-analysis.tests
! Redundant load elimination ! Redundant load elimination
{ {
V{ V{
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##peek f 2 D: 2 } T{ ##peek f 2 d: 2 }
T{ ##peek f 3 D: 3 } T{ ##peek f 3 d: 3 }
T{ ##allot f 4 16 array } T{ ##allot f 4 16 array }
T{ ##set-slot-imm f 3 4 1 0 } T{ ##set-slot-imm f 3 4 1 0 }
T{ ##set-slot-imm f 2 1 1 0 } T{ ##set-slot-imm f 2 1 1 0 }
@ -192,9 +192,9 @@ IN: compiler.cfg.alias-analysis.tests
} }
} [ } [
V{ V{
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##peek f 2 D: 2 } T{ ##peek f 2 d: 2 }
T{ ##peek f 3 D: 3 } T{ ##peek f 3 d: 3 }
T{ ##allot f 4 16 array } T{ ##allot f 4 16 array }
T{ ##set-slot-imm f 3 4 1 0 } T{ ##set-slot-imm f 3 4 1 0 }
T{ ##set-slot-imm f 2 1 1 0 } T{ ##set-slot-imm f 2 1 1 0 }
@ -205,18 +205,18 @@ IN: compiler.cfg.alias-analysis.tests
! Redundant store elimination ! Redundant store elimination
{ {
V{ V{
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##peek f 2 D: 2 } T{ ##peek f 2 d: 2 }
T{ ##peek f 3 D: 3 } T{ ##peek f 3 d: 3 }
T{ ##allot f 4 16 array } T{ ##allot f 4 16 array }
T{ ##slot-imm f 5 1 1 0 } T{ ##slot-imm f 5 1 1 0 }
T{ ##set-slot-imm f 3 4 1 0 } T{ ##set-slot-imm f 3 4 1 0 }
} }
} [ } [
V{ V{
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##peek f 2 D: 2 } T{ ##peek f 2 d: 2 }
T{ ##peek f 3 D: 3 } T{ ##peek f 3 d: 3 }
T{ ##allot f 4 16 array } T{ ##allot f 4 16 array }
T{ ##set-slot-imm f 1 4 1 0 } T{ ##set-slot-imm f 1 4 1 0 }
T{ ##slot-imm f 5 1 1 0 } T{ ##slot-imm f 5 1 1 0 }
@ -228,10 +228,10 @@ IN: compiler.cfg.alias-analysis.tests
! can now alias the new ac ! can now alias the new ac
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##peek f 2 D: 2 } T{ ##peek f 2 d: 2 }
T{ ##peek f 3 D: 3 } T{ ##peek f 3 d: 3 }
T{ ##allot f 4 16 array } T{ ##allot f 4 16 array }
T{ ##set-slot-imm f 0 4 1 0 } T{ ##set-slot-imm f 0 4 1 0 }
T{ ##set-slot-imm f 4 2 1 0 } T{ ##set-slot-imm f 4 2 1 0 }
@ -241,10 +241,10 @@ IN: compiler.cfg.alias-analysis.tests
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##peek f 2 D: 2 } T{ ##peek f 2 d: 2 }
T{ ##peek f 3 D: 3 } T{ ##peek f 3 d: 3 }
T{ ##allot f 4 16 array } T{ ##allot f 4 16 array }
T{ ##set-slot-imm f 0 4 1 0 } T{ ##set-slot-imm f 0 4 1 0 }
T{ ##set-slot-imm f 4 2 1 0 } T{ ##set-slot-imm f 4 2 1 0 }
@ -257,13 +257,13 @@ IN: compiler.cfg.alias-analysis.tests
! Compares between objects which cannot alias are eliminated ! Compares between objects which cannot alias are eliminated
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##allot f 1 16 array } T{ ##allot f 1 16 array }
T{ ##load-reference f 2 f } T{ ##load-reference f 2 f }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##allot f 1 16 array } T{ ##allot f 1 16 array }
T{ ##compare f 2 0 1 cc= } T{ ##compare f 2 0 1 cc= }
} test-alias-analysis } test-alias-analysis
@ -292,14 +292,14 @@ IN: compiler.cfg.alias-analysis.tests
! instructions which can call back into Factor code ! instructions which can call back into Factor code
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##slot-imm f 1 0 1 0 } T{ ##slot-imm f 1 0 1 0 }
T{ ##alien-invoke f { } { } { } { } 0 0 "free" } T{ ##alien-invoke f { } { } { } { } 0 0 "free" }
T{ ##slot-imm f 2 0 1 0 } T{ ##slot-imm f 2 0 1 0 }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##slot-imm f 1 0 1 0 } T{ ##slot-imm f 1 0 1 0 }
T{ ##alien-invoke f { } { } { } { } 0 0 "free" } T{ ##alien-invoke f { } { } { } { } 0 0 "free" }
T{ ##slot-imm f 2 0 1 0 } T{ ##slot-imm f 2 0 1 0 }
@ -308,16 +308,16 @@ IN: compiler.cfg.alias-analysis.tests
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##set-slot-imm f 1 0 1 0 } T{ ##set-slot-imm f 1 0 1 0 }
T{ ##alien-invoke f { } { } { } { } 0 0 "free" } T{ ##alien-invoke f { } { } { } { } 0 0 "free" }
T{ ##slot-imm f 2 0 1 0 } T{ ##slot-imm f 2 0 1 0 }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##set-slot-imm f 1 0 1 0 } T{ ##set-slot-imm f 1 0 1 0 }
T{ ##alien-invoke f { } { } { } { } 0 0 "free" } T{ ##alien-invoke f { } { } { } { } 0 0 "free" }
T{ ##slot-imm f 2 0 1 0 } T{ ##slot-imm f 2 0 1 0 }
@ -326,18 +326,18 @@ IN: compiler.cfg.alias-analysis.tests
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##peek f 2 D: 2 } T{ ##peek f 2 d: 2 }
T{ ##set-slot-imm f 1 0 1 0 } T{ ##set-slot-imm f 1 0 1 0 }
T{ ##alien-invoke f { } { } { } { } 0 0 "free" } T{ ##alien-invoke f { } { } { } { } 0 0 "free" }
T{ ##set-slot-imm f 2 0 1 0 } T{ ##set-slot-imm f 2 0 1 0 }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##peek f 2 D: 2 } T{ ##peek f 2 d: 2 }
T{ ##set-slot-imm f 1 0 1 0 } T{ ##set-slot-imm f 1 0 1 0 }
T{ ##alien-invoke f { } { } { } { } 0 0 "free" } T{ ##alien-invoke f { } { } { } { } 0 0 "free" }
T{ ##set-slot-imm f 2 0 1 0 } T{ ##set-slot-imm f 2 0 1 0 }
@ -346,14 +346,14 @@ IN: compiler.cfg.alias-analysis.tests
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##slot-imm f 1 0 1 0 } T{ ##slot-imm f 1 0 1 0 }
T{ ##alien-invoke f { } { } { } { } 0 0 "free" } T{ ##alien-invoke f { } { } { } { } 0 0 "free" }
T{ ##set-slot-imm f 1 0 1 0 } T{ ##set-slot-imm f 1 0 1 0 }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##slot-imm f 1 0 1 0 } T{ ##slot-imm f 1 0 1 0 }
T{ ##alien-invoke f { } { } { } { } 0 0 "free" } T{ ##alien-invoke f { } { } { } { } 0 0 "free" }
T{ ##set-slot-imm f 1 0 1 0 } T{ ##set-slot-imm f 1 0 1 0 }
@ -381,7 +381,7 @@ IN: compiler.cfg.alias-analysis.tests
{ {
V{ V{
T{ ##allot f 0 } T{ ##allot f 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##set-slot-imm f 1 0 1 0 } T{ ##set-slot-imm f 1 0 1 0 }
T{ ##alien-invoke f { } { } { } { } 0 0 "free" } T{ ##alien-invoke f { } { } { } { } 0 0 "free" }
T{ ##copy f 2 1 any-rep } T{ ##copy f 2 1 any-rep }
@ -389,7 +389,7 @@ IN: compiler.cfg.alias-analysis.tests
} [ } [
V{ V{
T{ ##allot f 0 } T{ ##allot f 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##set-slot-imm f 1 0 1 0 } T{ ##set-slot-imm f 1 0 1 0 }
T{ ##alien-invoke f { } { } { } { } 0 0 "free" } T{ ##alien-invoke f { } { } { } { } 0 0 "free" }
T{ ##slot-imm f 2 0 1 0 } T{ ##slot-imm f 2 0 1 0 }
@ -399,8 +399,8 @@ IN: compiler.cfg.alias-analysis.tests
{ {
V{ V{
T{ ##allot f 0 } T{ ##allot f 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##peek f 2 D: 2 } T{ ##peek f 2 d: 2 }
T{ ##set-slot-imm f 1 0 1 0 } T{ ##set-slot-imm f 1 0 1 0 }
T{ ##alien-invoke f { } { } { } { } 0 0 "free" } T{ ##alien-invoke f { } { } { } { } 0 0 "free" }
T{ ##set-slot-imm f 2 0 1 0 } T{ ##set-slot-imm f 2 0 1 0 }
@ -408,8 +408,8 @@ IN: compiler.cfg.alias-analysis.tests
} [ } [
V{ V{
T{ ##allot f 0 } T{ ##allot f 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##peek f 2 D: 2 } T{ ##peek f 2 d: 2 }
T{ ##set-slot-imm f 1 0 1 0 } T{ ##set-slot-imm f 1 0 1 0 }
T{ ##alien-invoke f { } { } { } { } 0 0 "free" } T{ ##alien-invoke f { } { } { } { } 0 0 "free" }
T{ ##set-slot-imm f 2 0 1 0 } T{ ##set-slot-imm f 2 0 1 0 }

View File

@ -33,7 +33,7 @@ IN: compiler.cfg.builder.alien.tests
T{ ##load-integer { dst 2 } { val 3 } } T{ ##load-integer { dst 2 } { val 3 } }
T{ ##copy { dst 4 } { src 1 } { rep any-rep } } T{ ##copy { dst 4 } { src 1 } { rep any-rep } }
T{ ##copy { dst 3 } { src 2 } { rep any-rep } } T{ ##copy { dst 3 } { src 2 } { rep any-rep } }
T{ ##inc { loc D: 2 } } T{ ##inc { loc d: 2 } }
T{ ##branch } T{ ##branch }
} }
} [ } [

View File

@ -37,7 +37,7 @@ T{ basic-block
STRING: ex-make-input-map STRING: ex-make-input-map
USING: compiler.cfg.builder prettyprint ; USING: compiler.cfg.builder prettyprint ;
T{ #shuffle { in-d { 37 81 92 } } } make-input-map . T{ #shuffle { in-d { 37 81 92 } } } make-input-map .
{ { 37 D: 2 } { 81 D: 1 } { 92 D: 0 } } { { 37 d: 2 } { 81 d: 1 } { 92 d: 0 } }
; ;
>> >>

View File

@ -368,9 +368,9 @@ SYMBOL: foo
! ! #shuffle ! ! #shuffle
{ {
T{ height-state f 0 0 1 0 } T{ height-state f 0 0 1 0 }
H{ { D: -1 4 } { D: 0 4 } } H{ { d: -1 4 } { d: 0 4 } }
} [ } [
4 D: 0 replace-loc 4 d: 0 replace-loc
f T{ #shuffle f T{ #shuffle
{ mapping { { 2 4 } { 3 4 } } } { mapping { { 2 4 } { 3 4 } } }
{ in-d V{ 4 } } { in-d V{ 4 } }
@ -405,21 +405,21 @@ SYMBOL: foo
! make-input-map ! make-input-map
{ {
{ { 37 D: 2 } { 81 D: 1 } { 92 D: 0 } } { { 37 d: 2 } { 81 d: 1 } { 92 d: 0 } }
} [ } [
T{ #shuffle { in-d { 37 81 92 } } } make-input-map T{ #shuffle { in-d { 37 81 92 } } } make-input-map
] unit-test ] unit-test
! store-shuffle ! store-shuffle
{ {
H{ { D: 2 1 } } H{ { d: 2 1 } }
} [ } [
f T{ #shuffle { in-d { 7 3 0 } } { out-d { 55 } } { mapping { { 55 3 } } } } f T{ #shuffle { in-d { 7 3 0 } } { out-d { 55 } } { mapping { { 55 3 } } } }
emit-node drop replaces get emit-node drop replaces get
] cfg-unit-test ] cfg-unit-test
{ {
H{ { D: -1 1 } { D: 0 1 } } H{ { d: -1 1 } { d: 0 1 } }
} [ } [
f T{ #shuffle f T{ #shuffle
{ in-d { 7 } } { in-d { 7 } }

View File

@ -13,12 +13,12 @@ V{
} 0 test-bb } 0 test-bb
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##branch } T{ ##branch }
} 1 test-bb } 1 test-bb
V{ V{
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##branch } T{ ##branch }
} 2 test-bb } 2 test-bb
@ -36,9 +36,9 @@ V{
V{ V{
T{ ##copy f 6 4 any-rep } T{ ##copy f 6 4 any-rep }
T{ ##replace f 3 D: 0 } T{ ##replace f 3 d: 0 }
T{ ##replace f 5 D: 1 } T{ ##replace f 5 d: 1 }
T{ ##replace f 6 D: 2 } T{ ##replace f 6 d: 2 }
T{ ##branch } T{ ##branch }
} 5 test-bb } 5 test-bb
@ -57,9 +57,9 @@ V{
{ {
V{ V{
T{ ##replace f 0 D: 0 } T{ ##replace f 0 d: 0 }
T{ ##replace f 4 D: 1 } T{ ##replace f 4 d: 1 }
T{ ##replace f 4 D: 2 } T{ ##replace f 4 d: 2 }
T{ ##branch } T{ ##branch }
} }
} [ 5 get instructions>> ] unit-test } [ 5 get instructions>> ] unit-test
@ -71,7 +71,7 @@ V{
} 0 test-bb } 0 test-bb
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##branch } T{ ##branch }
} 1 test-bb } 1 test-bb
@ -82,7 +82,7 @@ V{
} 2 test-bb } 2 test-bb
V{ V{
T{ ##replace f 2 D: 1 } T{ ##replace f 2 d: 1 }
T{ ##branch } T{ ##branch }
} 3 test-bb } 3 test-bb
@ -100,7 +100,7 @@ V{
{ {
V{ V{
T{ ##replace f 0 D: 1 } T{ ##replace f 0 d: 1 }
T{ ##branch } T{ ##branch }
} }
} [ 3 get instructions>> ] unit-test } [ 3 get instructions>> ] unit-test

View File

@ -11,12 +11,12 @@ IN: compiler.cfg.dce.tests
T{ ##load-integer { dst 1 } { val 8 } } T{ ##load-integer { dst 1 } { val 8 } }
T{ ##load-integer { dst 2 } { val 16 } } T{ ##load-integer { dst 2 } { val 16 } }
T{ ##add { dst 3 } { src1 1 } { src2 2 } } T{ ##add { dst 3 } { src1 1 } { src2 2 } }
T{ ##replace { src 3 } { loc D: 0 } } T{ ##replace { src 3 } { loc d: 0 } }
} } [ V{ } } [ V{
T{ ##load-integer { dst 1 } { val 8 } } T{ ##load-integer { dst 1 } { val 8 } }
T{ ##load-integer { dst 2 } { val 16 } } T{ ##load-integer { dst 2 } { val 16 } }
T{ ##add { dst 3 } { src1 1 } { src2 2 } } T{ ##add { dst 3 } { src1 1 } { src2 2 } }
T{ ##replace { src 3 } { loc D: 0 } } T{ ##replace { src 3 } { loc d: 0 } }
} test-dce ] unit-test } test-dce ] unit-test
{ V{ } } [ V{ { V{ } } [ V{
@ -40,30 +40,30 @@ IN: compiler.cfg.dce.tests
T{ ##load-integer { dst 3 } { val 8 } } T{ ##load-integer { dst 3 } { val 8 } }
T{ ##allot { dst 1 } { temp 2 } } T{ ##allot { dst 1 } { temp 2 } }
T{ ##set-slot-imm { obj 1 } { src 3 } } T{ ##set-slot-imm { obj 1 } { src 3 } }
T{ ##replace { src 1 } { loc D: 0 } } T{ ##replace { src 1 } { loc d: 0 } }
} } [ V{ } } [ V{
T{ ##load-integer { dst 3 } { val 8 } } T{ ##load-integer { dst 3 } { val 8 } }
T{ ##allot { dst 1 } { temp 2 } } T{ ##allot { dst 1 } { temp 2 } }
T{ ##set-slot-imm { obj 1 } { src 3 } } T{ ##set-slot-imm { obj 1 } { src 3 } }
T{ ##replace { src 1 } { loc D: 0 } } T{ ##replace { src 1 } { loc d: 0 } }
} test-dce ] unit-test } test-dce ] unit-test
{ V{ { V{
T{ ##allot { dst 1 } { temp 2 } } T{ ##allot { dst 1 } { temp 2 } }
T{ ##replace { src 1 } { loc D: 0 } } T{ ##replace { src 1 } { loc d: 0 } }
} } [ V{ } } [ V{
T{ ##allot { dst 1 } { temp 2 } } T{ ##allot { dst 1 } { temp 2 } }
T{ ##replace { src 1 } { loc D: 0 } } T{ ##replace { src 1 } { loc d: 0 } }
} test-dce ] unit-test } test-dce ] unit-test
{ V{ { V{
T{ ##allot { dst 1 } { temp 2 } } T{ ##allot { dst 1 } { temp 2 } }
T{ ##replace { src 1 } { loc D: 0 } } T{ ##replace { src 1 } { loc d: 0 } }
T{ ##load-integer { dst 3 } { val 8 } } T{ ##load-integer { dst 3 } { val 8 } }
T{ ##set-slot-imm { obj 1 } { src 3 } } T{ ##set-slot-imm { obj 1 } { src 3 } }
} } [ V{ } } [ V{
T{ ##allot { dst 1 } { temp 2 } } T{ ##allot { dst 1 } { temp 2 } }
T{ ##replace { src 1 } { loc D: 0 } } T{ ##replace { src 1 } { loc d: 0 } }
T{ ##load-integer { dst 3 } { val 8 } } T{ ##load-integer { dst 3 } { val 8 } }
T{ ##set-slot-imm { obj 1 } { src 3 } } T{ ##set-slot-imm { obj 1 } { src 3 } }
} test-dce ] unit-test } test-dce ] unit-test

View File

@ -19,7 +19,7 @@ HELP: defs-vregs
{ $examples { $examples
{ $example { $example
"USING: compiler.cfg.def-use compiler.cfg.instructions compiler.cfg.registers prettyprint ;" "USING: compiler.cfg.def-use compiler.cfg.instructions compiler.cfg.registers prettyprint ;"
"T{ ##peek f 37 D: 0 0 } defs-vregs ." "T{ ##peek f 37 d: 0 0 } defs-vregs ."
"{ 37 }" "{ 37 }"
} }
} }
@ -44,7 +44,7 @@ HELP: uses-vregs
{ $examples { $examples
{ $example { $example
"USING: compiler.cfg.def-use compiler.cfg.instructions compiler.cfg.registers prettyprint ;" "USING: compiler.cfg.def-use compiler.cfg.instructions compiler.cfg.registers prettyprint ;"
"T{ ##replace f 37 D: 1 6 } uses-vregs ." "T{ ##replace f 37 d: 1 6 } uses-vregs ."
"{ 37 }" "{ 37 }"
} }
} ; } ;

View File

@ -7,23 +7,23 @@ IN: compiler.cfg.def-use.tests
! compute-insns ! compute-insns
{ {
T{ ##peek f 123 D: 0 f } T{ ##peek f 123 d: 0 f }
} [ } [
{ T{ ##peek f 123 D: 0 } } 0 insns>block block>cfg compute-insns { T{ ##peek f 123 d: 0 } } 0 insns>block block>cfg compute-insns
123 insn-of 123 insn-of
] unit-test ] unit-test
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 0 } T{ ##peek f 1 d: 0 }
T{ ##peek f 2 D: 0 } T{ ##peek f 2 d: 0 }
} 1 test-bb } 1 test-bb
V{ V{
T{ ##replace f 2 D: 0 } T{ ##replace f 2 d: 0 }
} 2 test-bb } 2 test-bb
1 2 edge 1 2 edge
V{ V{
T{ ##replace f 0 D: 0 } T{ ##replace f 0 d: 0 }
} 3 test-bb } 3 test-bb
2 3 edge 2 3 edge
V{ } 4 test-bb V{ } 4 test-bb

View File

@ -144,7 +144,7 @@ IN: compiler.cfg.gc-checks.tests
V{ V{
T{ ##inc f 3 } T{ ##inc f 3 }
T{ ##replace f 0 D: 1 } T{ ##replace f 0 d: 1 }
} 0 test-bb } 0 test-bb
V{ V{
@ -181,8 +181,8 @@ V{
} 0 test-bb } 0 test-bb
V{ V{
T{ ##peek f 2 D: 0 } T{ ##peek f 2 d: 0 }
T{ ##inc { loc D: 3 } } T{ ##inc { loc d: 3 } }
T{ ##branch } T{ ##branch }
} 1 test-bb } 1 test-bb
@ -196,7 +196,7 @@ V{
} 3 test-bb } 3 test-bb
V{ V{
T{ ##replace f 2 D: 1 } T{ ##replace f 2 d: 1 }
T{ ##branch } T{ ##branch }
} 4 test-bb } 4 test-bb

View File

@ -42,7 +42,7 @@ IN: compiler.cfg.intrinsics.fixnum.tests
{ src 321 } { src 321 }
{ rep any-rep } { rep any-rep }
} }
T{ ##inc { loc D: -1 } } T{ ##inc { loc d: -1 } }
T{ ##branch } T{ ##branch }
} }
77 77

View File

@ -41,7 +41,7 @@ IN: compiler.cfg.intrinsics.fixnum
'[ _ ^^compare-integer ] binary-op ; '[ _ ^^compare-integer ] binary-op ;
: emit-no-overflow-case ( dst block -- final-bb ) : emit-no-overflow-case ( dst block -- final-bb )
[ swap D: -2 inc-stack ds-push ] with-branch ; [ swap d: -2 inc-stack ds-push ] with-branch ;
: emit-overflow-case ( word block -- final-bb ) : emit-overflow-case ( word block -- final-bb )
[ -1 swap [ emit-call-block ] keep ] with-branch ; [ -1 swap [ emit-call-block ] keep ] with-branch ;

View File

@ -131,10 +131,10 @@ CONSTANT: binary/param [ [ -2 <ds-loc> inc-stack 2inputs ] dip ]
CONSTANT: quaternary CONSTANT: quaternary
[ [
ds-drop ds-drop
D: 3 peek-loc d: 3 peek-loc
D: 2 peek-loc d: 2 peek-loc
D: 1 peek-loc d: 1 peek-loc
D: 0 peek-loc d: 0 peek-loc
-4 <ds-loc> inc-stack -4 <ds-loc> inc-stack
] ]

View File

@ -56,27 +56,27 @@ IN: compiler.cfg.linear-scan.assignment.tests
} [ } [
H{ { 37 RAX } } pending-interval-assoc set H{ { 37 RAX } } pending-interval-assoc set
{ { 37 int-rep 37 f } } setup-vreg-spills { { 37 int-rep 37 f } } setup-vreg-spills
T{ ##peek f 37 D: 0 0 } [ assign-insn-defs ] keep T{ ##peek f 37 d: 0 0 } [ assign-insn-defs ] keep
] unit-test ] unit-test
! assign-all-registers ! assign-all-registers
{ {
T{ ##replace-imm f 20 D: 0 f } T{ ##replace-imm f 20 d: 0 f }
T{ ##replace f RAX D: 0 f } T{ ##replace f RAX d: 0 f }
} [ } [
! It doesn't do anything because ##replace-imm isn't a vreg-insn. ! It doesn't do anything because ##replace-imm isn't a vreg-insn.
T{ ##replace-imm { src 20 } { loc D: 0 } } [ assign-all-registers ] keep T{ ##replace-imm { src 20 } { loc d: 0 } } [ assign-all-registers ] keep
! This one does something. ! This one does something.
H{ { 37 RAX } } pending-interval-assoc set H{ { 37 RAX } } pending-interval-assoc set
H{ { 37 37 } } leader-map set H{ { 37 37 } } leader-map set
T{ ##replace { src 37 } { loc D: 0 } } clone T{ ##replace { src 37 } { loc d: 0 } } clone
[ assign-all-registers ] keep [ assign-all-registers ] keep
] unit-test ] unit-test
! assign-registers ! assign-registers
{ } [ { } [
V{ T{ ##inc { loc D: 3 } { insn# 7 } } } 0 insns>block block>cfg { } V{ T{ ##inc { loc d: 3 } { insn# 7 } } } 0 insns>block block>cfg { }
assign-registers assign-registers
] unit-test ] unit-test
@ -85,7 +85,7 @@ IN: compiler.cfg.linear-scan.assignment.tests
V{ T{ ##inc { loc T{ ds-loc { n 3 } } } { insn# 7 } } } V{ T{ ##inc { loc T{ ds-loc { n 3 } } } { insn# 7 } } }
} [ } [
{ } init-assignment { } init-assignment
V{ T{ ##inc { loc D: 3 } { insn# 7 } } } 0 insns>block V{ T{ ##inc { loc d: 3 } { insn# 7 } } } 0 insns>block
[ assign-registers-in-block ] keep instructions>> [ assign-registers-in-block ] keep instructions>>
] unit-test ] unit-test

View File

@ -33,7 +33,7 @@ check-numbering? on
! live range ! live range
{ {
T{ ##load-integer f 1 0 } T{ ##load-integer f 1 0 }
T{ ##replace-imm f D: 0 "hi" } T{ ##replace-imm f d: 0 "hi" }
T{ ##branch } T{ ##branch }
} insns>cfg } insns>cfg
[ cfg set ] [ number-instructions ] [ compute-live-intervals ] tri [ cfg set ] [ number-instructions ] [ compute-live-intervals ] tri

View File

@ -75,17 +75,17 @@ IN: compiler.cfg.liveness.tests
! gen-uses ! gen-uses
{ H{ { 37 37 } } } [ { H{ { 37 37 } } } [
H{ } clone [ T{ ##replace f 37 D: 0 0 } gen-uses ] keep H{ } clone [ T{ ##replace f 37 d: 0 0 } gen-uses ] keep
] unit-test ] unit-test
! kill-defs ! kill-defs
{ H{ } } [ { H{ } } [
H{ } dup T{ ##peek f 37 D: 0 0 } kill-defs H{ } dup T{ ##peek f 37 d: 0 0 } kill-defs
] unit-test ] unit-test
{ H{ { 3 3 } } } [ { H{ { 3 3 } } } [
H{ { 37 99 } { 99 99 } { 2 99 } } leader-map set H{ { 37 99 } { 99 99 } { 2 99 } } leader-map set
H{ { 37 37 } { 3 3 } } dup T{ ##peek f 2 D: 0 0 } kill-defs H{ { 37 37 } { 3 3 } } dup T{ ##peek f 2 d: 0 0 } kill-defs
] unit-test ] unit-test
! liveness-step ! liveness-step
@ -108,21 +108,21 @@ IN: compiler.cfg.liveness.tests
cpu x86.64? [ cpu x86.64? [
{ f } [ { f } [
H{ } base-pointers set H{ } base-pointers set
H{ { 123 T{ ##peek { dst RCX } { loc D: 1 } { insn# 6 } } } } insns set H{ { 123 T{ ##peek { dst RCX } { loc d: 1 } { insn# 6 } } } } insns set
123 lookup-base-pointer 123 lookup-base-pointer
] unit-test ] unit-test
] when ] when
! lookup-base-pointer* ! lookup-base-pointer*
{ f } [ { f } [
456 T{ ##peek f 123 D: 0 } lookup-base-pointer* 456 T{ ##peek f 123 d: 0 } lookup-base-pointer*
] unit-test ] unit-test
! transfer-liveness ! transfer-liveness
{ {
H{ { 37 37 } } H{ { 37 37 } }
} [ } [
H{ } clone dup { T{ ##replace f 37 D: 1 6 } T{ ##peek f 37 D: 0 0 } } H{ } clone dup { T{ ##replace f 37 d: 1 6 } T{ ##peek f 37 d: 0 0 } }
transfer-liveness transfer-liveness
] unit-test ] unit-test
@ -141,12 +141,12 @@ cpu x86.64? [
! visit-insn ! visit-insn
{ H{ } } [ { H{ } } [
H{ } clone [ T{ ##peek f 0 D: 0 } visit-insn ] keep H{ } clone [ T{ ##peek f 0 d: 0 } visit-insn ] keep
] unit-test ] unit-test
{ H{ { 48 48 } { 37 37 } } } [ { H{ { 48 48 } { 37 37 } } } [
H{ { 48 tagged-rep } } representations set H{ { 48 tagged-rep } } representations set
H{ { 48 48 } } clone [ T{ ##replace f 37 D: 1 6 } visit-insn ] keep H{ { 48 48 } } clone [ T{ ##replace f 37 d: 1 6 } visit-insn ] keep
] unit-test ] unit-test
{ {
@ -167,20 +167,20 @@ cpu x86.64? [
! Sanity check... ! Sanity check...
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##replace f 0 D: 0 } T{ ##replace f 0 d: 0 }
T{ ##replace f 1 D: 1 } T{ ##replace f 1 d: 1 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##branch } T{ ##branch }
} 1 test-bb } 1 test-bb
V{ V{
T{ ##replace f 2 D: 0 } T{ ##replace f 2 d: 0 }
T{ ##branch } T{ ##branch }
} 2 test-bb } 2 test-bb
V{ V{
T{ ##replace f 3 D: 0 } T{ ##replace f 3 d: 0 }
T{ ##return } T{ ##return }
} 3 test-bb } 3 test-bb
@ -201,7 +201,7 @@ unit-test
! Tricky case; defs must be killed before uses ! Tricky case; defs must be killed before uses
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##branch } T{ ##branch }
} 1 test-bb } 1 test-bb
@ -223,12 +223,12 @@ V{
} 0 test-bb } 0 test-bb
V{ V{
T{ ##inc { loc R: 2 } } T{ ##inc { loc r: 2 } }
T{ ##inc { loc D: -2 } } T{ ##inc { loc d: -2 } }
T{ ##peek f 21 D: -1 } T{ ##peek f 21 d: -1 }
T{ ##peek f 22 D: -2 } T{ ##peek f 22 d: -2 }
T{ ##replace f 21 R: 0 } T{ ##replace f 21 r: 0 }
T{ ##replace f 22 R: 1 } T{ ##replace f 22 r: 1 }
T{ ##branch } T{ ##branch }
} 1 test-bb } 1 test-bb
@ -238,10 +238,10 @@ V{
} 2 test-bb } 2 test-bb
V{ V{
T{ ##inc { loc R: -1 } } T{ ##inc { loc r: -1 } }
T{ ##inc { loc D: 1 } } T{ ##inc { loc d: 1 } }
T{ ##peek f 25 R: -1 } T{ ##peek f 25 r: -1 }
T{ ##replace f 25 D: 0 } T{ ##replace f 25 d: 0 }
T{ ##branch } T{ ##branch }
} 3 test-bb } 3 test-bb
@ -251,35 +251,35 @@ V{
} 4 test-bb } 4 test-bb
V{ V{
T{ ##inc f R: -1 } T{ ##inc f r: -1 }
T{ ##inc f D: 2 } T{ ##inc f d: 2 }
T{ ##peek f 27 R: -1 } T{ ##peek f 27 r: -1 }
T{ ##peek f 28 D: 2 } T{ ##peek f 28 d: 2 }
T{ ##peek f 29 D: 3 } T{ ##peek f 29 d: 3 }
T{ ##load-integer f 30 1 } T{ ##load-integer f 30 1 }
T{ ##load-integer f 31 0 } T{ ##load-integer f 31 0 }
T{ ##compare-imm-branch f 27 f cc/= } T{ ##compare-imm-branch f 27 f cc/= }
} 5 test-bb } 5 test-bb
V{ V{
T{ ##inc f D: -1 } T{ ##inc f d: -1 }
T{ ##branch } T{ ##branch }
} 6 test-bb } 6 test-bb
V{ V{
T{ ##inc f D: -1 } T{ ##inc f d: -1 }
T{ ##branch } T{ ##branch }
} 7 test-bb } 7 test-bb
V{ V{
T{ ##phi f 36 H{ { 6 30 } { 7 31 } } } T{ ##phi f 36 H{ { 6 30 } { 7 31 } } }
T{ ##inc f D: -2 } T{ ##inc f d: -2 }
T{ ##unbox f 37 29 "alien_offset" int-rep } T{ ##unbox f 37 29 "alien_offset" int-rep }
T{ ##unbox f 38 28 "to_double" double-rep } T{ ##unbox f 38 28 "to_double" double-rep }
T{ ##unbox f 39 36 "to_cell" int-rep } T{ ##unbox f 39 36 "to_cell" int-rep }
T{ ##alien-invoke f f V{ } V{ { 37 int-rep 0 } { 38 double-rep 4 } { 39 int-rep 12 } } { { 40 int-rep EAX } } { } 0 16 "CFRunLoopRunInMode" f T{ gc-map } } T{ ##alien-invoke f f V{ } V{ { 37 int-rep 0 } { 38 double-rep 4 } { 39 int-rep 12 } } { { 40 int-rep EAX } } { } 0 16 "CFRunLoopRunInMode" f T{ gc-map } }
T{ ##box f 41 40 "from_signed_cell" int-rep T{ gc-map } } T{ ##box f 41 40 "from_signed_cell" int-rep T{ gc-map } }
T{ ##replace f 41 D: 0 } T{ ##replace f 41 d: 0 }
T{ ##branch } T{ ##branch }
} 8 test-bb } 8 test-bb
@ -334,7 +334,7 @@ V{
} 5 test-bb } 5 test-bb
V{ V{
T{ ##replace f 2 D: 0 } T{ ##replace f 2 d: 0 }
T{ ##branch } T{ ##branch }
} 6 test-bb } 6 test-bb
@ -368,12 +368,12 @@ V{
} 0 test-bb } 0 test-bb
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##tagged>integer f 1 0 } T{ ##tagged>integer f 1 0 }
T{ ##call-gc f T{ gc-map } } T{ ##call-gc f T{ gc-map } }
T{ ##replace f 0 D: 0 } T{ ##replace f 0 d: 0 }
T{ ##call-gc f T{ gc-map } } T{ ##call-gc f T{ gc-map } }
T{ ##replace f 1 D: 0 } T{ ##replace f 1 d: 0 }
T{ ##branch } T{ ##branch }
} 1 test-bb } 1 test-bb

View File

@ -3,6 +3,6 @@ IN: compiler.cfg.registers.tests
! Ensure prettyprinting of ds/rs-loc is right ! Ensure prettyprinting of ds/rs-loc is right
{ "D: 3\nR: -1\n" } [ { "d: 3\nr: -1\n" } [
[ D: 3 . R: -1 . ] with-string-writer [ d: 3 . r: -1 . ] with-string-writer
] unit-test ] unit-test

View File

@ -32,5 +32,5 @@ C: <ds-loc> ds-loc
TUPLE: rs-loc < loc ; TUPLE: rs-loc < loc ;
C: <rs-loc> rs-loc C: <rs-loc> rs-loc
SYNTAX: D: scan-number <ds-loc> suffix! ; SYNTAX: d: scan-number <ds-loc> suffix! ;
SYNTAX: R: scan-number <rs-loc> suffix! ; SYNTAX: r: scan-number <rs-loc> suffix! ;

View File

@ -12,7 +12,7 @@ V{
} 0 test-bb } 0 test-bb
V{ V{
T{ ##peek f 2 D: 0 } T{ ##peek f 2 d: 0 }
T{ ##load-integer f 0 0 } T{ ##load-integer f 0 0 }
T{ ##branch } T{ ##branch }
} 1 test-bb } 1 test-bb

View File

@ -59,12 +59,12 @@ V{
} 0 test-bb } 0 test-bb
V{ V{
T{ ##peek f 1 D: 0 } T{ ##peek f 1 d: 0 }
T{ ##peek f 2 D: 1 } T{ ##peek f 2 d: 1 }
T{ ##add-float f 3 1 2 } T{ ##add-float f 3 1 2 }
T{ ##replace f 3 D: 0 } T{ ##replace f 3 d: 0 }
T{ ##replace f 3 D: 1 } T{ ##replace f 3 d: 1 }
T{ ##replace f 3 D: 2 } T{ ##replace f 3 d: 2 }
T{ ##branch } T{ ##branch }
} 1 test-bb } 1 test-bb
@ -87,20 +87,20 @@ V{
} 0 test-bb } 0 test-bb
V{ V{
T{ ##peek f 1 D: 0 } T{ ##peek f 1 d: 0 }
T{ ##branch } T{ ##branch }
} 1 test-bb } 1 test-bb
V{ V{
T{ ##add-float f 2 1 1 } T{ ##add-float f 2 1 1 }
T{ ##replace f 2 D: 0 } T{ ##replace f 2 d: 0 }
T{ ##epilogue } T{ ##epilogue }
T{ ##return } T{ ##return }
} 2 test-bb } 2 test-bb
V{ V{
T{ ##add-float f 3 1 1 } T{ ##add-float f 3 1 1 }
T{ ##replace f 3 D: 0 } T{ ##replace f 3 d: 0 }
T{ ##epilogue } T{ ##epilogue }
T{ ##return } T{ ##return }
} 3 test-bb } 3 test-bb
@ -112,7 +112,7 @@ V{
{ {
V{ V{
T{ ##peek f 1 D: 0 } T{ ##peek f 1 d: 0 }
T{ ##branch } T{ ##branch }
} }
} [ 1 get instructions>> ] unit-test } [ 1 get instructions>> ] unit-test
@ -125,19 +125,19 @@ V{
} 0 test-bb } 0 test-bb
V{ V{
T{ ##peek f 1 D: 0 } T{ ##peek f 1 d: 0 }
T{ ##branch } T{ ##branch }
} 1 test-bb } 1 test-bb
V{ V{
T{ ##replace f 1 R: 0 } T{ ##replace f 1 r: 0 }
T{ ##epilogue } T{ ##epilogue }
T{ ##return } T{ ##return }
} 2 test-bb } 2 test-bb
V{ V{
T{ ##mul f 2 1 1 } T{ ##mul f 2 1 1 }
T{ ##replace f 2 D: 0 } T{ ##replace f 2 d: 0 }
T{ ##branch } T{ ##branch }
} 3 test-bb } 3 test-bb
@ -155,7 +155,7 @@ V{
{ {
V{ V{
T{ ##peek f 1 D: 0 } T{ ##peek f 1 d: 0 }
T{ ##branch } T{ ##branch }
} }
} [ 1 get instructions>> ] unit-test } [ 1 get instructions>> ] unit-test
@ -168,7 +168,7 @@ V{
} 0 test-bb } 0 test-bb
V{ V{
T{ ##peek f 1 D: 0 } T{ ##peek f 1 d: 0 }
T{ ##branch } T{ ##branch }
} 1 test-bb } 1 test-bb
@ -180,8 +180,8 @@ V{
V{ V{
T{ ##add f 2 1 1 } T{ ##add f 2 1 1 }
T{ ##mul f 3 1 1 } T{ ##mul f 3 1 1 }
T{ ##replace f 2 D: 0 } T{ ##replace f 2 d: 0 }
T{ ##replace f 3 D: 1 } T{ ##replace f 3 d: 1 }
T{ ##branch } T{ ##branch }
} 3 test-bb } 3 test-bb
@ -201,7 +201,7 @@ V{
{ {
V{ V{
T{ ##peek f 4 D: 0 } T{ ##peek f 4 d: 0 }
T{ ##sar-imm f 1 4 $[ tag-bits get ] } T{ ##sar-imm f 1 4 $[ tag-bits get ] }
T{ ##branch } T{ ##branch }
} }
@ -214,10 +214,10 @@ V{
} 0 test-bb } 0 test-bb
V{ V{
T{ ##peek f 1 D: 0 } T{ ##peek f 1 d: 0 }
T{ ##peek f 2 D: 0 } T{ ##peek f 2 d: 0 }
T{ ##vector>scalar f 3 2 int-4-rep } T{ ##vector>scalar f 3 2 int-4-rep }
T{ ##replace f 3 D: 0 } T{ ##replace f 3 d: 0 }
T{ ##branch } T{ ##branch }
} 1 test-bb } 1 test-bb
@ -251,7 +251,7 @@ V{
V{ V{
T{ ##phi f 3 H{ { 1 1 } { 2 2 } } } T{ ##phi f 3 H{ { 1 1 } { 2 2 } } }
T{ ##replace f 3 D: 0 } T{ ##replace f 3 d: 0 }
T{ ##branch } T{ ##branch }
} 3 test-bb } 3 test-bb
@ -282,8 +282,8 @@ V{
} 0 test-bb } 0 test-bb
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##add f 2 0 1 } T{ ##add f 2 0 1 }
T{ ##branch } T{ ##branch }
} 1 test-bb } 1 test-bb
@ -295,7 +295,7 @@ V{
V{ V{
T{ ##phi f 4 H{ { 1 2 } { 2 3 } } } T{ ##phi f 4 H{ { 1 2 } { 2 3 } } }
T{ ##replace f 4 D: 0 } T{ ##replace f 4 d: 0 }
T{ ##branch } T{ ##branch }
} 3 test-bb } 3 test-bb
@ -323,10 +323,10 @@ cpu x86.32? [
} 0 test-bb } 0 test-bb
V{ V{
T{ ##peek f 1 D: 0 } T{ ##peek f 1 d: 0 }
T{ ##load-reference f 2 0.5 } T{ ##load-reference f 2 0.5 }
T{ ##add-float f 3 1 2 } T{ ##add-float f 3 1 2 }
T{ ##replace f 3 D: 0 } T{ ##replace f 3 d: 0 }
T{ ##branch } T{ ##branch }
} 1 test-bb } 1 test-bb
@ -349,7 +349,7 @@ cpu x86.32? [
} 0 test-bb } 0 test-bb
V{ V{
T{ ##peek f 1 D: 0 } T{ ##peek f 1 d: 0 }
T{ ##compare-imm-branch f 1 2 cc= } T{ ##compare-imm-branch f 1 2 cc= }
} 1 test-bb } 1 test-bb
@ -365,9 +365,9 @@ cpu x86.32? [
V{ V{
T{ ##phi f 4 H{ { 2 2 } { 3 3 } } } T{ ##phi f 4 H{ { 2 2 } { 3 3 } } }
T{ ##peek f 5 D: 0 } T{ ##peek f 5 d: 0 }
T{ ##add-float f 6 4 5 } T{ ##add-float f 6 4 5 }
T{ ##replace f 6 D: 0 } T{ ##replace f 6 d: 0 }
} 4 test-bb } 4 test-bb
V{ V{
@ -398,14 +398,14 @@ cpu x86.32? [
{ f } [ { f } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##tagged>integer f 2 1 } T{ ##tagged>integer f 2 1 }
T{ ##add-float f 3 0 0 } T{ ##add-float f 3 0 0 }
T{ ##store-memory-imm f 3 2 0 float-rep f } T{ ##store-memory-imm f 3 2 0 float-rep f }
T{ ##store-memory-imm f 3 2 4 float-rep f } T{ ##store-memory-imm f 3 2 4 float-rep f }
T{ ##mul-float f 4 0 0 } T{ ##mul-float f 4 0 0 }
T{ ##replace f 4 D: 0 } T{ ##replace f 4 d: 0 }
} test-peephole } test-peephole
[ ##single>double-float? ] any? [ ##single>double-float? ] any?
] unit-test ] unit-test
@ -414,12 +414,12 @@ cpu x86.32? [
{ {
V{ V{
T{ ##load-tagged f 1 $[ 100 tag-fixnum ] } T{ ##load-tagged f 1 $[ 100 tag-fixnum ] }
T{ ##replace f 1 D: 0 } T{ ##replace f 1 d: 0 }
} }
} [ } [
V{ V{
T{ ##load-integer f 1 100 } T{ ##load-integer f 1 100 }
T{ ##replace f 1 D: 0 } T{ ##replace f 1 d: 0 }
} test-peephole } test-peephole
] unit-test ] unit-test
@ -428,18 +428,18 @@ cpu x86.32? [
{ {
V{ V{
T{ ##peek f 1 D: 0 } T{ ##peek f 1 d: 0 }
T{ ##sar-imm f 2 1 1 } T{ ##sar-imm f 2 1 1 }
T{ ##add f 4 2 2 } T{ ##add f 4 2 2 }
T{ ##shl-imm f 3 4 $[ tag-bits get ] } T{ ##shl-imm f 3 4 $[ tag-bits get ] }
T{ ##replace f 3 D: 0 } T{ ##replace f 3 d: 0 }
} }
} [ } [
V{ V{
T{ ##peek f 1 D: 0 } T{ ##peek f 1 d: 0 }
T{ ##shl-imm f 2 1 3 } T{ ##shl-imm f 2 1 3 }
T{ ##add f 3 2 2 } T{ ##add f 3 2 2 }
T{ ##replace f 3 D: 0 } T{ ##replace f 3 d: 0 }
} test-peephole } test-peephole
] unit-test ] unit-test
@ -447,35 +447,35 @@ cpu x86.32? [
{ {
V{ V{
T{ ##peek f 1 D: 0 } T{ ##peek f 1 d: 0 }
T{ ##shl-imm f 2 1 $[ 10 tag-bits get - ] } T{ ##shl-imm f 2 1 $[ 10 tag-bits get - ] }
T{ ##add f 4 2 2 } T{ ##add f 4 2 2 }
T{ ##shl-imm f 3 4 $[ tag-bits get ] } T{ ##shl-imm f 3 4 $[ tag-bits get ] }
T{ ##replace f 3 D: 0 } T{ ##replace f 3 d: 0 }
} }
} [ } [
V{ V{
T{ ##peek f 1 D: 0 } T{ ##peek f 1 d: 0 }
T{ ##shl-imm f 2 1 10 } T{ ##shl-imm f 2 1 10 }
T{ ##add f 3 2 2 } T{ ##add f 3 2 2 }
T{ ##replace f 3 D: 0 } T{ ##replace f 3 d: 0 }
} test-peephole } test-peephole
] unit-test ] unit-test
{ {
V{ V{
T{ ##peek f 1 D: 0 } T{ ##peek f 1 d: 0 }
T{ ##copy f 2 1 int-rep } T{ ##copy f 2 1 int-rep }
T{ ##add f 5 2 2 } T{ ##add f 5 2 2 }
T{ ##shl-imm f 3 5 $[ tag-bits get ] } T{ ##shl-imm f 3 5 $[ tag-bits get ] }
T{ ##replace f 3 D: 0 } T{ ##replace f 3 d: 0 }
} }
} [ } [
V{ V{
T{ ##peek f 1 D: 0 } T{ ##peek f 1 d: 0 }
T{ ##shl-imm f 2 1 $[ tag-bits get ] } T{ ##shl-imm f 2 1 $[ tag-bits get ] }
T{ ##add f 3 2 2 } T{ ##add f 3 2 2 }
T{ ##replace f 3 D: 0 } T{ ##replace f 3 d: 0 }
} test-peephole } test-peephole
] unit-test ] unit-test
@ -484,13 +484,13 @@ cpu x86.32? [
V{ V{
T{ ##load-integer f 1 100 } T{ ##load-integer f 1 100 }
T{ ##shl-imm f 2 1 $[ 3 tag-bits get + ] } T{ ##shl-imm f 2 1 $[ 3 tag-bits get + ] }
T{ ##replace f 2 D: 0 } T{ ##replace f 2 d: 0 }
} }
} [ } [
V{ V{
T{ ##load-integer f 1 100 } T{ ##load-integer f 1 100 }
T{ ##shl-imm f 2 1 3 } T{ ##shl-imm f 2 1 3 }
T{ ##replace f 2 D: 0 } T{ ##replace f 2 d: 0 }
} test-peephole } test-peephole
] unit-test ] unit-test
@ -498,15 +498,15 @@ cpu x86.32? [
! need to be tagged ! need to be tagged
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##shl-imm f 1 0 3 } T{ ##shl-imm f 1 0 3 }
T{ ##replace f 1 D: 0 } T{ ##replace f 1 d: 0 }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##shl-imm f 1 0 3 } T{ ##shl-imm f 1 0 3 }
T{ ##replace f 1 D: 0 } T{ ##replace f 1 d: 0 }
} test-peephole } test-peephole
] unit-test ] unit-test
@ -534,16 +534,16 @@ cpu x86.32? [
! Peephole optimization if input to ##sar-imm is tagged ! Peephole optimization if input to ##sar-imm is tagged
{ {
V{ V{
T{ ##peek f 1 D: 0 } T{ ##peek f 1 d: 0 }
T{ ##sar-imm f 7 1 $[ 3 tag-bits get + ] } T{ ##sar-imm f 7 1 $[ 3 tag-bits get + ] }
T{ ##shl-imm f 2 7 $[ tag-bits get ] } T{ ##shl-imm f 2 7 $[ tag-bits get ] }
T{ ##replace f 2 D: 0 } T{ ##replace f 2 d: 0 }
} }
} [ } [
V{ V{
T{ ##peek f 1 D: 0 } T{ ##peek f 1 d: 0 }
T{ ##sar-imm f 2 1 3 } T{ ##sar-imm f 2 1 3 }
T{ ##replace f 2 D: 0 } T{ ##replace f 2 d: 0 }
} test-peephole } test-peephole
] unit-test ] unit-test
@ -555,13 +555,13 @@ cpu x86.32? [
T{ ##load-integer f 1 100 } T{ ##load-integer f 1 100 }
T{ ##sar-imm f 7 1 3 } T{ ##sar-imm f 7 1 3 }
T{ ##shl-imm f 2 7 $[ tag-bits get ] } T{ ##shl-imm f 2 7 $[ tag-bits get ] }
T{ ##replace f 2 D: 0 } T{ ##replace f 2 d: 0 }
} }
} [ } [
V{ V{
T{ ##load-integer f 1 100 } T{ ##load-integer f 1 100 }
T{ ##sar-imm f 2 1 3 } T{ ##sar-imm f 2 1 3 }
T{ ##replace f 2 D: 0 } T{ ##replace f 2 d: 0 }
} test-peephole } test-peephole
] unit-test ] unit-test
@ -569,7 +569,7 @@ cpu x86.32? [
! need to be tagged ! need to be tagged
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##sar-imm f 1 0 $[ 3 tag-bits get + ] } T{ ##sar-imm f 1 0 $[ 3 tag-bits get + ] }
T{ ##load-integer f 3 100 } T{ ##load-integer f 3 100 }
T{ ##load-integer f 4 100 } T{ ##load-integer f 4 100 }
@ -577,7 +577,7 @@ cpu x86.32? [
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##sar-imm f 1 0 3 } T{ ##sar-imm f 1 0 3 }
T{ ##load-integer f 3 100 } T{ ##load-integer f 3 100 }
T{ ##load-integer f 4 100 } T{ ##load-integer f 4 100 }
@ -638,7 +638,7 @@ cpu x86.32? [
T{ ##load-integer f 3 100 } T{ ##load-integer f 3 100 }
T{ ##add f 7 2 3 } T{ ##add f 7 2 3 }
T{ ##shl-imm f 4 7 $[ tag-bits get ] } T{ ##shl-imm f 4 7 $[ tag-bits get ] }
T{ ##replace f 4 D: 0 } T{ ##replace f 4 d: 0 }
} }
} [ } [
V{ V{
@ -647,38 +647,38 @@ cpu x86.32? [
T{ ##sar-imm f 2 1 3 } T{ ##sar-imm f 2 1 3 }
T{ ##load-integer f 3 100 } T{ ##load-integer f 3 100 }
T{ ##add f 4 2 3 } T{ ##add f 4 2 3 }
T{ ##replace f 4 D: 0 } T{ ##replace f 4 d: 0 }
} test-peephole } test-peephole
] unit-test ] unit-test
! Tag/untag elimination ! Tag/untag elimination
{ {
V{ V{
T{ ##peek f 1 D: 0 } T{ ##peek f 1 d: 0 }
T{ ##add-imm f 2 1 $[ 100 tag-fixnum ] } T{ ##add-imm f 2 1 $[ 100 tag-fixnum ] }
T{ ##replace f 2 D: 0 } T{ ##replace f 2 d: 0 }
} }
} [ } [
V{ V{
T{ ##peek f 1 D: 0 } T{ ##peek f 1 d: 0 }
T{ ##add-imm f 2 1 100 } T{ ##add-imm f 2 1 100 }
T{ ##replace f 2 D: 0 } T{ ##replace f 2 d: 0 }
} test-peephole } test-peephole
] unit-test ] unit-test
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##add f 2 0 1 } T{ ##add f 2 0 1 }
T{ ##replace f 2 D: 0 } T{ ##replace f 2 d: 0 }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##add f 2 0 1 } T{ ##add f 2 0 1 }
T{ ##replace f 2 D: 0 } T{ ##replace f 2 d: 0 }
} test-peephole } test-peephole
] unit-test ] unit-test
@ -688,17 +688,17 @@ cpu x86.64? [
[ [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##sar-imm f 5 0 $[ tag-bits get ] } T{ ##sar-imm f 5 0 $[ tag-bits get ] }
T{ ##add-imm f 6 5 $[ 30 2^ ] } T{ ##add-imm f 6 5 $[ 30 2^ ] }
T{ ##shl-imm f 2 6 $[ tag-bits get ] } T{ ##shl-imm f 2 6 $[ tag-bits get ] }
T{ ##replace f 2 D: 0 } T{ ##replace f 2 d: 0 }
} }
] [ ] [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##add-imm f 2 0 $[ 30 2^ ] } T{ ##add-imm f 2 0 $[ 30 2^ ] }
T{ ##replace f 2 D: 0 } T{ ##replace f 2 d: 0 }
} test-peephole } test-peephole
] unit-test ] unit-test
@ -707,13 +707,13 @@ cpu x86.64? [
T{ ##load-integer f 0 100 } T{ ##load-integer f 0 100 }
T{ ##mul-imm f 7 0 $[ 30 2^ ] } T{ ##mul-imm f 7 0 $[ 30 2^ ] }
T{ ##shl-imm f 1 7 $[ tag-bits get ] } T{ ##shl-imm f 1 7 $[ tag-bits get ] }
T{ ##replace f 1 D: 0 } T{ ##replace f 1 d: 0 }
} }
] [ ] [
V{ V{
T{ ##load-integer f 0 100 } T{ ##load-integer f 0 100 }
T{ ##mul-imm f 1 0 $[ 30 2^ ] } T{ ##mul-imm f 1 0 $[ 30 2^ ] }
T{ ##replace f 1 D: 0 } T{ ##replace f 1 d: 0 }
} test-peephole } test-peephole
] unit-test ] unit-test
] when ] when
@ -721,15 +721,15 @@ cpu x86.64? [
! Tag/untag elimination for ##mul-imm ! Tag/untag elimination for ##mul-imm
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##mul-imm f 1 0 100 } T{ ##mul-imm f 1 0 100 }
T{ ##replace f 1 D: 0 } T{ ##replace f 1 d: 0 }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##mul-imm f 1 0 100 } T{ ##mul-imm f 1 0 100 }
T{ ##replace f 1 D: 0 } T{ ##replace f 1 d: 0 }
} test-peephole } test-peephole
] unit-test ] unit-test
@ -737,108 +737,108 @@ cpu x86.64? [
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##sar-imm f 5 1 $[ tag-bits get ] } T{ ##sar-imm f 5 1 $[ tag-bits get ] }
T{ ##add-imm f 2 5 30 } T{ ##add-imm f 2 5 30 }
T{ ##mul-imm f 3 2 $[ 100 tag-fixnum ] } T{ ##mul-imm f 3 2 $[ 100 tag-fixnum ] }
T{ ##replace f 3 D: 0 } T{ ##replace f 3 d: 0 }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##add-imm f 2 1 30 } T{ ##add-imm f 2 1 30 }
T{ ##mul-imm f 3 2 100 } T{ ##mul-imm f 3 2 100 }
T{ ##replace f 3 D: 0 } T{ ##replace f 3 d: 0 }
} test-peephole } test-peephole
] unit-test ] unit-test
! Tag/untag elimination for ##compare-integer and ##test ! Tag/untag elimination for ##compare-integer and ##test
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##test f 2 0 1 cc= } T{ ##test f 2 0 1 cc= }
T{ ##replace f 2 D: 0 } T{ ##replace f 2 d: 0 }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##test f 2 0 1 cc= } T{ ##test f 2 0 1 cc= }
T{ ##replace f 2 D: 0 } T{ ##replace f 2 d: 0 }
} test-peephole } test-peephole
] unit-test ] unit-test
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##compare-integer f 2 0 1 cc= } T{ ##compare-integer f 2 0 1 cc= }
T{ ##replace f 2 D: 0 } T{ ##replace f 2 d: 0 }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##compare-integer f 2 0 1 cc= } T{ ##compare-integer f 2 0 1 cc= }
T{ ##replace f 2 D: 0 } T{ ##replace f 2 d: 0 }
} test-peephole } test-peephole
] unit-test ] unit-test
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##compare-integer-branch f 0 1 cc= } T{ ##compare-integer-branch f 0 1 cc= }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##compare-integer-branch f 0 1 cc= } T{ ##compare-integer-branch f 0 1 cc= }
} test-peephole } test-peephole
] unit-test ] unit-test
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##test-branch f 0 1 cc= } T{ ##test-branch f 0 1 cc= }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##test-branch f 0 1 cc= } T{ ##test-branch f 0 1 cc= }
} test-peephole } test-peephole
] unit-test ] unit-test
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##compare-integer-imm-branch f 0 $[ 10 tag-fixnum ] cc= } T{ ##compare-integer-imm-branch f 0 $[ 10 tag-fixnum ] cc= }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##compare-integer-imm-branch f 0 10 cc= } T{ ##compare-integer-imm-branch f 0 10 cc= }
} test-peephole } test-peephole
] unit-test ] unit-test
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##test-imm-branch f 0 $[ 10 tag-fixnum ] cc= } T{ ##test-imm-branch f 0 $[ 10 tag-fixnum ] cc= }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##test-imm-branch f 0 10 cc= } T{ ##test-imm-branch f 0 10 cc= }
} test-peephole } test-peephole
] unit-test ] unit-test
@ -846,15 +846,15 @@ cpu x86.64? [
! Tag/untag elimination for ##neg ! Tag/untag elimination for ##neg
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##neg f 1 0 } T{ ##neg f 1 0 }
T{ ##replace f 1 D: 0 } T{ ##replace f 1 d: 0 }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##neg f 1 0 } T{ ##neg f 1 0 }
T{ ##replace f 1 D: 0 } T{ ##replace f 1 d: 0 }
} test-peephole } test-peephole
] unit-test ] unit-test
@ -862,21 +862,21 @@ cpu x86.64? [
{ {
V{ V{
T{ ##peek { dst 0 } { loc D: 0 } } T{ ##peek { dst 0 } { loc d: 0 } }
T{ ##peek { dst 1 } { loc D: 1 } } T{ ##peek { dst 1 } { loc d: 1 } }
T{ ##sar-imm { dst 5 } { src1 0 } { src2 4 } } T{ ##sar-imm { dst 5 } { src1 0 } { src2 4 } }
T{ ##sar-imm { dst 6 } { src1 1 } { src2 4 } } T{ ##sar-imm { dst 6 } { src1 1 } { src2 4 } }
T{ ##mul { dst 2 } { src1 5 } { src2 6 } } T{ ##mul { dst 2 } { src1 5 } { src2 6 } }
T{ ##mul-imm { dst 3 } { src1 2 } { src2 -16 } } T{ ##mul-imm { dst 3 } { src1 2 } { src2 -16 } }
T{ ##replace { src 3 } { loc D: 0 } } T{ ##replace { src 3 } { loc d: 0 } }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 1 D: 1 } T{ ##peek f 1 d: 1 }
T{ ##mul f 2 0 1 } T{ ##mul f 2 0 1 }
T{ ##neg f 3 2 } T{ ##neg f 3 2 }
T{ ##replace f 3 D: 0 } T{ ##replace f 3 d: 0 }
} test-peephole } test-peephole
] unit-test ] unit-test
@ -885,16 +885,16 @@ cpu x86.64? [
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##not f 3 0 } T{ ##not f 3 0 }
T{ ##xor-imm f 1 3 $[ tag-mask get ] } T{ ##xor-imm f 1 3 $[ tag-mask get ] }
T{ ##replace f 1 D: 0 } T{ ##replace f 1 d: 0 }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##not f 1 0 } T{ ##not f 1 0 }
T{ ##replace f 1 D: 0 } T{ ##replace f 1 d: 0 }
} test-peephole } test-peephole
] unit-test ] unit-test
@ -903,15 +903,15 @@ cpu x86.64? [
{ {
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##bit-count f 3 0 } T{ ##bit-count f 3 0 }
T{ ##shl-imm f 1 3 $[ tag-bits get ] } T{ ##shl-imm f 1 3 $[ tag-bits get ] }
T{ ##replace f 1 D: 0 } T{ ##replace f 1 d: 0 }
} }
} [ } [
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##bit-count f 1 0 } T{ ##bit-count f 1 0 }
T{ ##replace f 1 D: 0 } T{ ##replace f 1 d: 0 }
} test-peephole } test-peephole
] unit-test ] unit-test

View File

@ -36,7 +36,7 @@ V{
4 vreg-counter set-global 4 vreg-counter set-global
V{ V{
T{ ##inc f D: 3 } T{ ##inc f d: 3 }
T{ ##box f 4 3 "from_signed_4" int-rep T{ ##box f 4 3 "from_signed_4" int-rep
T{ gc-map { gc-roots { } } } T{ gc-map { gc-roots { } } }
} }
@ -46,7 +46,7 @@ V{
{ {
V{ V{
T{ ##inc f D: 3 } T{ ##inc f d: 3 }
T{ ##save-context f 5 6 } T{ ##save-context f 5 6 }
T{ ##box f 4 3 "from_signed_4" int-rep T{ ##box f 4 3 "from_signed_4" int-rep
T{ gc-map { gc-roots { } } } T{ gc-map { gc-roots { } } }

View File

@ -62,7 +62,7 @@ V{
} 2 test-bb } 2 test-bb
V{ V{
T{ ##replace f 3 D: 0 } T{ ##replace f 3 d: 0 }
T{ ##return } T{ ##return }
} 3 test-bb } 3 test-bb
@ -98,7 +98,7 @@ V{
{ {
V{ V{
T{ ##phi f 6 H{ { 1 4 } { 2 5 } } } T{ ##phi f 6 H{ { 1 4 } { 2 5 } } }
T{ ##replace f 6 D: 0 } T{ ##replace f 6 d: 0 }
T{ ##return } T{ ##return }
} }
} [ } [
@ -111,9 +111,9 @@ reset-counters
V{ } 0 test-bb V{ } 0 test-bb
V{ } 1 test-bb V{ } 1 test-bb
V{ T{ ##peek f 0 D: 0 } } 2 test-bb V{ T{ ##peek f 0 d: 0 } } 2 test-bb
V{ T{ ##peek f 0 D: 0 } } 3 test-bb V{ T{ ##peek f 0 d: 0 } } 3 test-bb
V{ T{ ##replace f 0 D: 0 } } 4 test-bb V{ T{ ##replace f 0 d: 0 } } 4 test-bb
V{ } 5 test-bb V{ } 5 test-bb
V{ } 6 test-bb V{ } 6 test-bb
@ -129,7 +129,7 @@ V{ } 6 test-bb
{ {
V{ V{
T{ ##phi f 3 H{ { 2 1 } { 3 2 } } } T{ ##phi f 3 H{ { 2 1 } { 3 2 } } }
T{ ##replace f 3 D: 0 } T{ ##replace f 3 d: 0 }
} }
} [ } [
4 get instructions>> 4 get instructions>>

View File

@ -30,19 +30,19 @@ IN: compiler.cfg.ssa.interference.tests
[ [ <test-vreg-info> ] map ] bi@ sets-interfere? ; [ [ <test-vreg-info> ] map ] bi@ sets-interfere? ;
V{ V{
T{ ##peek f 0 D: 0 } T{ ##peek f 0 d: 0 }
T{ ##peek f 2 D: 0 } T{ ##peek f 2 d: 0 }
T{ ##copy f 1 0 } T{ ##copy f 1 0 }
T{ ##copy f 3 2 } T{ ##copy f 3 2 }
T{ ##branch } T{ ##branch }
} 0 test-bb } 0 test-bb
V{ V{
T{ ##peek f 4 D: 0 } T{ ##peek f 4 d: 0 }
T{ ##peek f 5 D: 0 } T{ ##peek f 5 d: 0 }
T{ ##replace f 3 D: 0 } T{ ##replace f 3 d: 0 }
T{ ##peek f 6 D: 0 } T{ ##peek f 6 d: 0 }
T{ ##replace f 5 D: 0 } T{ ##replace f 5 d: 0 }
T{ ##return } T{ ##return }
} 1 test-bb } 1 test-bb
@ -72,11 +72,11 @@ V{
V{ V{
T{ ##inc f D: -3 } T{ ##inc f d: -3 }
T{ ##peek f 12 D: -2 } T{ ##peek f 12 d: -2 }
T{ ##peek f 23 D: -1 } T{ ##peek f 23 d: -1 }
T{ ##sar-imm f 13 23 4 } T{ ##sar-imm f 13 23 4 }
T{ ##peek f 24 D: -3 } T{ ##peek f 24 d: -3 }
T{ ##sar-imm f 14 24 4 } T{ ##sar-imm f 14 24 4 }
T{ ##mul f 15 13 13 } T{ ##mul f 15 13 13 }
T{ ##mul f 16 15 15 } T{ ##mul f 16 15 15 }
@ -103,8 +103,8 @@ V{
} 0 test-bb } 0 test-bb
V{ V{
T{ ##inc f D: 2 } T{ ##inc f d: 2 }
T{ ##peek f 32 D: 2 } T{ ##peek f 32 d: 2 }
T{ ##load-reference f 33 ##check-nursery-branch } T{ ##load-reference f 33 ##check-nursery-branch }
T{ ##load-integer f 34 11 } T{ ##load-integer f 34 11 }
T{ ##tagged>integer f 35 32 } T{ ##tagged>integer f 35 32 }
@ -120,10 +120,10 @@ V{
} 2 test-bb } 2 test-bb
V{ V{
T{ ##inc f D: -2 } T{ ##inc f d: -2 }
T{ ##slot-imm f 57 48 11 2 } T{ ##slot-imm f 57 48 11 2 }
T{ ##compare f 58 33 57 cc= 20 } T{ ##compare f 58 33 57 cc= 20 }
T{ ##replace f 58 D: 0 } T{ ##replace f 58 d: 0 }
T{ ##branch f } T{ ##branch f }
} 3 test-bb } 3 test-bb
@ -133,8 +133,8 @@ V{
} 4 test-bb } 4 test-bb
V{ V{
T{ ##inc f D: -2 } T{ ##inc f d: -2 }
T{ ##replace-imm f f D: 0 } T{ ##replace-imm f f d: 0 }
T{ ##branch f } T{ ##branch f }
} 5 test-bb } 5 test-bb
@ -144,8 +144,8 @@ V{
} 6 test-bb } 6 test-bb
V{ V{
T{ ##inc f D: -2 } T{ ##inc f d: -2 }
T{ ##replace-imm f f D: 0 } T{ ##replace-imm f f d: 0 }
T{ ##branch f } T{ ##branch f }
} 7 test-bb } 7 test-bb
@ -185,13 +185,13 @@ V{
} 2 test-bb } 2 test-bb
V{ V{
T{ ##inc f D: 1 } T{ ##inc f d: 1 }
T{ ##load-reference f 37 T{ bab } } T{ ##load-reference f 37 T{ bab } }
T{ ##load-reference f 38 { gfg 1 1 tuple 57438726 gfg 7785907 } } T{ ##load-reference f 38 { gfg 1 1 tuple 57438726 gfg 7785907 } }
T{ ##allot f 40 12 tuple 4 } T{ ##allot f 40 12 tuple 4 }
T{ ##set-slot-imm f 38 40 1 7 } T{ ##set-slot-imm f 38 40 1 7 }
T{ ##set-slot-imm f 37 40 2 7 } T{ ##set-slot-imm f 37 40 2 7 }
T{ ##replace f 40 D: 0 } T{ ##replace f 40 d: 0 }
T{ ##branch } T{ ##branch }
} 3 test-bb } 3 test-bb
@ -201,17 +201,17 @@ V{
} 4 test-bb } 4 test-bb
V{ V{
T{ ##inc f R: 1 } T{ ##inc f r: 1 }
T{ ##inc f D: 1 } T{ ##inc f d: 1 }
T{ ##peek f 43 D: 1 } T{ ##peek f 43 d: 1 }
T{ ##peek f 44 D: 2 } T{ ##peek f 44 d: 2 }
T{ ##tagged>integer f 45 43 } T{ ##tagged>integer f 45 43 }
T{ ##and-imm f 46 45 15 } T{ ##and-imm f 46 45 15 }
T{ ##compare-integer-imm-branch f 46 7 cc= } T{ ##compare-integer-imm-branch f 46 7 cc= }
} 5 test-bb } 5 test-bb
V{ V{
T{ ##inc f D: 1 } T{ ##inc f d: 1 }
T{ ##slot-imm f 58 43 1 7 } T{ ##slot-imm f 58 43 1 7 }
T{ ##slot-imm f 60 58 7 2 } T{ ##slot-imm f 60 58 7 2 }
T{ ##compare-imm-branch f 60 bab cc= } T{ ##compare-imm-branch f 60 bab cc= }
@ -222,8 +222,8 @@ V{
} 7 test-bb } 7 test-bb
V{ V{
T{ ##inc f R: -1 } T{ ##inc f r: -1 }
T{ ##inc f D: -1 } T{ ##inc f d: -1 }
T{ ##set-slot-imm f 43 44 2 7 } T{ ##set-slot-imm f 43 44 2 7 }
T{ ##write-barrier-imm f 44 2 7 34 35 } T{ ##write-barrier-imm f 44 2 7 34 35 }
T{ ##branch } T{ ##branch }
@ -235,9 +235,9 @@ V{
} 9 test-bb } 9 test-bb
V{ V{
T{ ##inc f D: 1 } T{ ##inc f d: 1 }
T{ ##replace f 44 R: 0 } T{ ##replace f 44 r: 0 }
T{ ##replace-imm f bab D: 0 } T{ ##replace-imm f bab d: 0 }
T{ ##branch } T{ ##branch }
} 10 test-bb } 10 test-bb
@ -251,14 +251,14 @@ V{
} 12 test-bb } 12 test-bb
V{ V{
T{ ##inc f D: -1 } T{ ##inc f d: -1 }
T{ ##branch } T{ ##branch }
} 13 test-bb } 13 test-bb
V{ V{
T{ ##inc f D: 1 } T{ ##inc f d: 1 }
T{ ##replace f 44 R: 0 } T{ ##replace f 44 r: 0 }
T{ ##replace-imm f bab D: 0 } T{ ##replace-imm f bab d: 0 }
T{ ##branch } T{ ##branch }
} 14 test-bb } 14 test-bb
@ -312,8 +312,8 @@ V{
V{ V{
T{ ##inc f D: 1 } T{ ##inc f d: 1 }
T{ ##peek f 31 D: 1 } T{ ##peek f 31 d: 1 }
T{ ##sar-imm f 16 31 4 } T{ ##sar-imm f 16 31 4 }
T{ ##load-integer f 17 0 } T{ ##load-integer f 17 0 }
T{ ##copy f 33 17 int-rep } T{ ##copy f 33 17 int-rep }
@ -332,7 +332,7 @@ V{
} 3 test-bb } 3 test-bb
V{ V{
T{ ##inc f D: -2 } T{ ##inc f d: -2 }
T{ ##branch f } T{ ##branch f }
} 4 test-bb } 4 test-bb

View File

@ -5,28 +5,28 @@ IN: compiler.cfg.stacks.clearing
ARTICLE: "compiler.cfg.stacks.clearing" "Uninitialized stack location clearing" ARTICLE: "compiler.cfg.stacks.clearing" "Uninitialized stack location clearing"
"A compiler pass that inserts " { $link ##clear } " instructions front of instructions which requires the whole stack to be initialized. Consider the following sequence of instructions:" "A compiler pass that inserts " { $link ##clear } " instructions front of instructions which requires the whole stack to be initialized. Consider the following sequence of instructions:"
{ $code { $code
"##inc D: 2" "##inc d: 2"
"..." "..."
"##allot" "##allot"
"##replace ... D: 0" "##replace ... d: 0"
"##replace ... D: 1" "##replace ... d: 1"
} }
"The GC check runs before stack locations 0 and 1 have been initialized, so they need to be cleared as they can contain garbage data which could crash Factor if it tries to trace them. This is achieved by computing uninitialized locations with a dataflow analysis (see " { $vocab-link "compiler.cfg.stacks.padding" } ") and then inserting clears so that the instruction sequence becomes:" "The GC check runs before stack locations 0 and 1 have been initialized, so they need to be cleared as they can contain garbage data which could crash Factor if it tries to trace them. This is achieved by computing uninitialized locations with a dataflow analysis (see " { $vocab-link "compiler.cfg.stacks.padding" } ") and then inserting clears so that the instruction sequence becomes:"
{ $code { $code
"##inc D: 2" "##inc d: 2"
"..." "..."
"##clear D: 0" "##clear d: 0"
"##clear D: 1" "##clear d: 1"
"##allot" "##allot"
"##replace ... D: 0" "##replace ... d: 0"
"##replace ... D: 1" "##replace ... d: 1"
} }
"Similar dangerous stack 'holes' needs to be padded in the same way to guard unsafe " { $link ##peek } " instructions. E.g:" "Similar dangerous stack 'holes' needs to be padded in the same way to guard unsafe " { $link ##peek } " instructions. E.g:"
{ $code { $code
"##inc D: 2" "##inc d: 2"
"##peek RCX D: 2" "##peek RCX d: 2"
} }
"Here the ##peek can cause a stack underflow and then there will be two uninitialized locations on the captured data stack that can't be traced. As in the previous example, ##clears are inserted on locations D: 0 and D: 1." ; "Here the ##peek can cause a stack underflow and then there will be two uninitialized locations on the captured data stack that can't be traced. As in the previous example, ##clears are inserted on locations d: 0 and d: 1." ;
HELP: dangerous-insn? HELP: dangerous-insn?
{ $values { "state" "a stack state" } { "insn" insn } { "?" boolean } } { $values { "state" "a stack state" } { "insn" insn } { "?" boolean } }
@ -34,12 +34,12 @@ HELP: dangerous-insn?
{ $examples { $examples
{ $example { $example
"USING: compiler.cfg.instructions compiler.cfg.registers compiler.cfg.stacks.clearing prettyprint ;" "USING: compiler.cfg.instructions compiler.cfg.registers compiler.cfg.stacks.clearing prettyprint ;"
"{ { 0 { } } { 0 { } } } T{ ##peek { loc D: 0 } } dangerous-insn? ." "{ { 0 { } } { 0 { } } } T{ ##peek { loc d: 0 } } dangerous-insn? ."
"t" "t"
} }
{ $example { $example
"USING: compiler.cfg.instructions compiler.cfg.registers compiler.cfg.stacks.clearing prettyprint ;" "USING: compiler.cfg.instructions compiler.cfg.registers compiler.cfg.stacks.clearing prettyprint ;"
"{ { 0 { } } { 2 { } } } T{ ##peek { loc R: 0 } } dangerous-insn? ." "{ { 0 { } } { 2 { } } } T{ ##peek { loc r: 0 } } dangerous-insn? ."
"f" "f"
} }
{ $example { $example

View File

@ -6,13 +6,13 @@ IN: compiler.cfg.stacks.clearing.tests
! clear-uninitialized ! clear-uninitialized
{ {
V{ V{
T{ ##inc { loc D: 2 } { insn# 0 } } T{ ##inc { loc d: 2 } { insn# 0 } }
T{ ##clear { loc T{ ds-loc { n 1 } } } } T{ ##clear { loc T{ ds-loc { n 1 } } } }
T{ ##clear { loc T{ ds-loc } } } T{ ##clear { loc T{ ds-loc } } }
T{ ##peek { loc D: 2 } { insn# 1 } } T{ ##peek { loc d: 2 } { insn# 1 } }
} }
} [ } [
{ T{ ##inc f D: 2 } T{ ##peek f f D: 2 } } insns>cfg { T{ ##inc f d: 2 } T{ ##peek f f d: 2 } } insns>cfg
dup clear-uninitialized cfg>insns dup clear-uninitialized cfg>insns
] unit-test ] unit-test
@ -20,9 +20,9 @@ IN: compiler.cfg.stacks.clearing.tests
{ {
t f t t t f t t
} [ } [
{ { 0 { } } { 0 { } } } T{ ##peek { loc D: 0 } } dangerous-insn? { { 0 { } } { 0 { } } } T{ ##peek { loc d: 0 } } dangerous-insn?
{ { 1 { } } { 0 { } } } T{ ##peek { loc D: 0 } } dangerous-insn? { { 1 { } } { 0 { } } } T{ ##peek { loc d: 0 } } dangerous-insn?
{ { 2 { 0 1 } } { 0 { } } } T{ ##peek { loc D: 2 } } dangerous-insn? { { 2 { 0 1 } } { 0 { } } } T{ ##peek { loc d: 2 } } dangerous-insn?
{ { 0 { } } { 3 { } } } T{ ##call-gc } dangerous-insn? { { 0 { } } { 3 { } } } T{ ##call-gc } dangerous-insn?
] unit-test ] unit-test

View File

@ -58,7 +58,7 @@ HELP: height-state>insns
{ $example { $example
"USING: compiler.cfg.stacks.local prettyprint ;" "USING: compiler.cfg.stacks.local prettyprint ;"
"T{ height-state f 0 0 4 -2 } height-state>insns ." "T{ height-state f 0 0 4 -2 } height-state>insns ."
"{ T{ ##inc { loc D: 4 } } T{ ##inc { loc R: -2 } } }" "{ T{ ##inc { loc d: 4 } } T{ ##inc { loc r: -2 } } }"
} }
} ; } ;
@ -105,7 +105,7 @@ ARTICLE: "compiler.cfg.stacks.local" "Local stack analysis"
{ $list { $list
{ { $slot "peeks" } " all stack locations that the block reads before writing" } { { $slot "peeks" } " all stack locations that the block reads before writing" }
{ { $slot "replaces" } " all stack locations that the block writes" } { { $slot "replaces" } " all stack locations that the block writes" }
{ { $slot "kills" } " all stack locations which become unavailable after the block ends because of the stack height being decremented. For example, if the block contains " { $link drop } ", then D: 0 will be contained in kills because that stack location will not be live anymore." } { { $slot "kills" } " all stack locations which become unavailable after the block ends because of the stack height being decremented. For example, if the block contains " { $link drop } ", then d: 0 will be contained in kills because that stack location will not be live anymore." }
} }
"This is done while constructing the CFG. These sets are then used by the " { $link end-stack-analysis } " word to emit optimal sequences of " { $link ##peek } " and " { $link ##replace } " instructions to the cfg." "This is done while constructing the CFG. These sets are then used by the " { $link end-stack-analysis } " word to emit optimal sequences of " { $link ##peek } " and " { $link ##replace } " instructions to the cfg."
$nl $nl

View File

@ -18,26 +18,26 @@ IN: compiler.cfg.stacks.local.tests
] cfg-unit-test ] cfg-unit-test
{ {
HS{ D: 3 } HS{ d: 3 }
} [ } [
V{ } 137 insns>block V{ } 137 insns>block
[ [ 3 D: 3 replace-loc "eh" , end-local-analysis ] V{ } make drop ] [ [ 3 d: 3 replace-loc "eh" , end-local-analysis ] V{ } make drop ]
[ replaces>> ] bi [ replaces>> ] bi
] cfg-unit-test ] cfg-unit-test
! local-loc>global ! local-loc>global
{ D: 6 } [ { d: 6 } [
D: 3 3 0 0 0 height-state boa d: 3 3 0 0 0 height-state boa
local-loc>global local-loc>global
] unit-test ] unit-test
{ {
D: 4 d: 4
R: 5 r: 5
} [ } [
3 4 0 0 height-state boa 3 4 0 0 height-state boa
[ D: 1 swap local-loc>global ] [ d: 1 swap local-loc>global ]
[ R: 1 swap local-loc>global ] bi [ r: 1 swap local-loc>global ] bi
] unit-test ] unit-test
! kill-locations ! kill-locations
@ -57,13 +57,13 @@ IN: compiler.cfg.stacks.local.tests
! loc>vreg ! loc>vreg
{ 1 } [ { 1 } [
D: 0 loc>vreg d: 0 loc>vreg
] cfg-unit-test ] cfg-unit-test
! replace-loc ! replace-loc
{ 80 } [ { 80 } [
80 D: 77 replace-loc 80 d: 77 replace-loc
D: 77 peek-loc d: 77 peek-loc
] cfg-unit-test ] cfg-unit-test
! stack-changes ! stack-changes
@ -73,15 +73,15 @@ IN: compiler.cfg.stacks.local.tests
T{ ##copy { dst 2 } { src 26 } { rep any-rep } } T{ ##copy { dst 2 } { src 26 } { rep any-rep } }
} }
} [ } [
{ { D: 0 25 } { R: 0 26 } } replaces>copy-insns { { d: 0 25 } { r: 0 26 } } replaces>copy-insns
] cfg-unit-test ] cfg-unit-test
! remove-redundant-replaces ! remove-redundant-replaces
{ {
H{ { T{ ds-loc { n 3 } } 7 } } H{ { T{ ds-loc { n 3 } } 7 } }
} [ } [
D: 0 loc>vreg D: 2 loc>vreg 2drop d: 0 loc>vreg d: 2 loc>vreg 2drop
2 D: 2 replace-loc 7 D: 3 replace-loc 2 d: 2 replace-loc 7 d: 3 replace-loc
replaces get remove-redundant-replaces replaces get remove-redundant-replaces
] cfg-unit-test ] cfg-unit-test
@ -92,7 +92,7 @@ IN: compiler.cfg.stacks.local.tests
"eh" "eh"
} }
} [ } [
3 D: 0 replace-loc [ 3 d: 0 replace-loc [
"eh" , "eh" ,
replaces get height-state get emit-insns replaces get height-state get emit-insns
] V{ } make ] V{ } make
@ -103,41 +103,41 @@ IN: compiler.cfg.stacks.local.tests
0 0 0 0 height-state boa compute-local-kill-set 0 0 0 0 height-state boa compute-local-kill-set
] unit-test ] unit-test
{ HS{ R: -4 } } [ { HS{ r: -4 } } [
0 4 0 -1 height-state boa compute-local-kill-set 0 4 0 -1 height-state boa compute-local-kill-set
] unit-test ] unit-test
{ HS{ D: -1 D: -2 } } [ { HS{ d: -1 d: -2 } } [
2 0 -2 0 height-state boa compute-local-kill-set 2 0 -2 0 height-state boa compute-local-kill-set
] unit-test ] unit-test
! global-loc>local ! global-loc>local
{ D: 2 } [ { d: 2 } [
D: 3 1 0 0 0 height-state boa global-loc>local d: 3 1 0 0 0 height-state boa global-loc>local
] unit-test ] unit-test
! height-state ! height-state
{ {
T{ height-state f 0 0 3 0 } T{ height-state f 0 0 3 0 }
} [ } [
D: 3 inc-stack height-state get d: 3 inc-stack height-state get
] cfg-unit-test ] cfg-unit-test
{ {
T{ height-state f 2 0 3 0 } T{ height-state f 2 0 3 0 }
} [ } [
2 0 0 0 height-state boa height-state set 2 0 0 0 height-state boa height-state set
D: 3 inc-stack height-state get d: 3 inc-stack height-state get
] cfg-unit-test ] cfg-unit-test
{ {
{ T{ ##inc { loc D: 4 } } T{ ##inc { loc R: -2 } } } { T{ ##inc { loc d: 4 } } T{ ##inc { loc r: -2 } } }
} [ } [
0 0 4 -2 height-state boa height-state>insns 0 0 4 -2 height-state boa height-state>insns
] unit-test ] unit-test
{ H{ { D: -1 40 } } } [ { H{ { d: -1 40 } } } [
D: 1 inc-stack 40 D: 0 replace-loc replaces get d: 1 inc-stack 40 d: 0 replace-loc replaces get
] cfg-unit-test ] cfg-unit-test
! Compiling these words used to make the compiler hang due to a bug in ! Compiling these words used to make the compiler hang due to a bug in

View File

@ -64,13 +64,13 @@ IN: compiler.cfg.stacks.padding.tests
{ {
{ { 0 { } } { 0 { } } } { { 0 { } } { 0 { } } }
} [ } [
{ { 3 { 0 } } { 0 { } } } T{ ##inc { loc D: -3 } } visit-insn { { 3 { 0 } } { 0 { } } } T{ ##inc { loc d: -3 } } visit-insn
] unit-test ] unit-test
{ {
{ { 3 { 0 1 2 } } { 0 { } } } { { 3 { 0 1 2 } } { 0 { } } }
} [ } [
{ { 0 { } } { 0 { } } } T{ ##inc { loc D: 3 } } visit-insn { { 0 { } } { 0 { } } } T{ ##inc { loc d: 3 } } visit-insn
] unit-test ] unit-test
! visit-insn ##call ! visit-insn ##call
@ -101,7 +101,7 @@ IN: compiler.cfg.stacks.padding.tests
{ {
{ { 3 { 0 } } { 0 { } } } { { 3 { 0 } } { 0 { } } }
} [ } [
{ { 3 { 0 } } { 0 { } } } T{ ##peek { dst 1 } { loc D: 1 } } visit-insn { { 3 { 0 } } { 0 { } } } T{ ##peek { dst 1 } { loc d: 1 } } visit-insn
] unit-test ] unit-test
! After a ##peek that can cause a stack underflow, it is certain that ! After a ##peek that can cause a stack underflow, it is certain that
@ -110,14 +110,14 @@ IN: compiler.cfg.stacks.padding.tests
{ { 0 { } } { 2 { } } } { { 0 { } } { 2 { } } }
{ { 2 { } } { 0 { } } } { { 2 { } } { 0 { } } }
} [ } [
{ { 0 { } } { 2 { 0 1 } } } T{ ##peek { dst 1 } { loc R: 2 } } visit-insn { { 0 { } } { 2 { 0 1 } } } T{ ##peek { dst 1 } { loc r: 2 } } visit-insn
{ { 2 { 0 1 } } { 0 { } } } T{ ##peek { dst 1 } { loc D: 2 } } visit-insn { { 2 { 0 1 } } { 0 { } } } T{ ##peek { dst 1 } { loc d: 2 } } visit-insn
] unit-test ] unit-test
! If the ##peek can't cause a stack underflow, then we don't have the ! If the ##peek can't cause a stack underflow, then we don't have the
! same guarantees. ! same guarantees.
[ [
{ { 3 { 0 1 2 } } { 0 { } } } T{ ##peek { dst 1 } { loc D: 0 } } visit-insn { { 3 { 0 1 2 } } { 0 { } } } T{ ##peek { dst 1 } { loc d: 0 } } visit-insn
] [ vacant-peek? ] must-fail-with ] [ vacant-peek? ] must-fail-with
: following-stack-state ( insns -- state ) : following-stack-state ( insns -- state )
@ -142,9 +142,9 @@ IN: compiler.cfg.stacks.padding.tests
} }
} [ } [
{ {
T{ ##inc f D: 2 } T{ ##inc f d: 2 }
T{ ##peek f f D: 2 } T{ ##peek f f d: 2 }
T{ ##inc f D: 0 } T{ ##inc f d: 0 }
} insns>cfg trace-stack-state } insns>cfg trace-stack-state
] unit-test ] unit-test
@ -168,8 +168,8 @@ IN: compiler.cfg.stacks.padding.tests
} }
} [ } [
V{ V{
T{ ##inc f D: 3 } T{ ##inc f d: 3 }
T{ ##peek { loc D: 3 } } T{ ##peek { loc d: 3 } }
T{ ##branch } T{ ##branch }
} }
insns>cfg trace-stack-state insns>cfg trace-stack-state
@ -177,12 +177,12 @@ IN: compiler.cfg.stacks.padding.tests
: cfg1 ( -- cfg ) : cfg1 ( -- cfg )
V{ V{
T{ ##inc f D: 1 } T{ ##inc f d: 1 }
T{ ##replace { src 10 } { loc D: 0 } } T{ ##replace { src 10 } { loc d: 0 } }
} 0 insns>block } 0 insns>block
V{ V{
T{ ##peek { dst 37 } { loc D: 0 } } T{ ##peek { dst 37 } { loc d: 0 } }
T{ ##inc f D: -1 } T{ ##inc f d: -1 }
} 1 insns>block } 1 insns>block
1vector >>successors block>cfg ; 1vector >>successors block>cfg ;
@ -202,9 +202,9 @@ IN: compiler.cfg.stacks.padding.tests
{ 0 V{ T{ ##safepoint } T{ ##prologue } T{ ##branch } } } { 0 V{ T{ ##safepoint } T{ ##prologue } T{ ##branch } } }
{ {
1 V{ 1 V{
T{ ##inc f D: 2 } T{ ##inc f d: 2 }
T{ ##replace { src 0 } { loc D: 1 } } T{ ##replace { src 0 } { loc d: 1 } }
T{ ##replace { src 0 } { loc D: 0 } } T{ ##replace { src 0 } { loc d: 0 } }
} }
} }
{ {
@ -214,29 +214,29 @@ IN: compiler.cfg.stacks.padding.tests
} }
{ {
3 V{ 3 V{
T{ ##peek { dst 0 } { loc D: 0 } } T{ ##peek { dst 0 } { loc d: 0 } }
T{ ##peek { dst 0 } { loc D: 1 } } T{ ##peek { dst 0 } { loc d: 1 } }
T{ ##inc f D: 2 } T{ ##inc f d: 2 }
T{ ##replace { src 0 } { loc D: 2 } } T{ ##replace { src 0 } { loc d: 2 } }
T{ ##replace { src 0 } { loc D: 3 } } T{ ##replace { src 0 } { loc d: 3 } }
T{ ##replace { src 0 } { loc D: 1 } } T{ ##replace { src 0 } { loc d: 1 } }
} }
} }
{ {
8 V{ 8 V{
T{ ##peek { dst 0 } { loc D: 2 } } T{ ##peek { dst 0 } { loc d: 2 } }
T{ ##peek { dst 0 } { loc D: 1 } } T{ ##peek { dst 0 } { loc d: 1 } }
T{ ##inc f D: 3 } T{ ##inc f d: 3 }
T{ ##replace { src 0 } { loc D: 0 } } T{ ##replace { src 0 } { loc d: 0 } }
T{ ##replace { src 0 } { loc D: 1 } } T{ ##replace { src 0 } { loc d: 1 } }
T{ ##replace { src 0 } { loc D: 2 } } T{ ##replace { src 0 } { loc d: 2 } }
T{ ##replace { src 0 } { loc D: 3 } } T{ ##replace { src 0 } { loc d: 3 } }
} }
} }
{ {
10 V{ 10 V{
T{ ##inc f D: -3 } T{ ##inc f d: -3 }
T{ ##peek { dst 0 } { loc D: 0 } } T{ ##peek { dst 0 } { loc d: 0 } }
T{ ##alien-invoke { gc-map T{ gc-map } } } T{ ##alien-invoke { gc-map T{ gc-map } } }
} }
} }
@ -281,10 +281,10 @@ IN: compiler.cfg.stacks.padding.tests
{ 0 V{ } } { 0 V{ } }
{ {
1 V{ 1 V{
T{ ##inc f D: 3 } T{ ##inc f d: 3 }
T{ ##replace { src 0 } { loc D: 2 } } T{ ##replace { src 0 } { loc d: 2 } }
T{ ##replace { src 0 } { loc D: 0 } } T{ ##replace { src 0 } { loc d: 0 } }
T{ ##replace { src 0 } { loc D: 1 } } T{ ##replace { src 0 } { loc d: 1 } }
} }
} }
{ {
@ -294,11 +294,11 @@ IN: compiler.cfg.stacks.padding.tests
} }
{ {
3 V{ 3 V{
T{ ##peek { dst 0 } { loc D: 1 } } T{ ##peek { dst 0 } { loc d: 1 } }
T{ ##peek { dst 0 } { loc D: 0 } } T{ ##peek { dst 0 } { loc d: 0 } }
T{ ##inc f D: 1 } T{ ##inc f d: 1 }
T{ ##inc f R: 1 } T{ ##inc f r: 1 }
T{ ##replace { src 0 } { loc R: 0 } } T{ ##replace { src 0 } { loc r: 0 } }
} }
} }
{ {
@ -306,14 +306,14 @@ IN: compiler.cfg.stacks.padding.tests
} }
{ {
5 V{ 5 V{
T{ ##inc f D: -2 } T{ ##inc f d: -2 }
T{ ##inc f R: 5 } T{ ##inc f r: 5 }
T{ ##replace { src 0 } { loc R: 3 } } T{ ##replace { src 0 } { loc r: 3 } }
T{ ##replace { src 0 } { loc D: 0 } } T{ ##replace { src 0 } { loc d: 0 } }
T{ ##replace { src 0 } { loc R: 4 } } T{ ##replace { src 0 } { loc r: 4 } }
T{ ##replace { src 0 } { loc R: 2 } } T{ ##replace { src 0 } { loc r: 2 } }
T{ ##replace { src 0 } { loc R: 1 } } T{ ##replace { src 0 } { loc r: 1 } }
T{ ##replace { src 0 } { loc R: 0 } } T{ ##replace { src 0 } { loc r: 0 } }
} }
} }
{ {
@ -323,14 +323,14 @@ IN: compiler.cfg.stacks.padding.tests
} }
{ {
7 V{ 7 V{
T{ ##peek { dst 0 } { loc D: 0 } } T{ ##peek { dst 0 } { loc d: 0 } }
T{ ##peek { dst 0 } { loc R: 3 } } T{ ##peek { dst 0 } { loc r: 3 } }
T{ ##peek { dst 0 } { loc R: 2 } } T{ ##peek { dst 0 } { loc r: 2 } }
T{ ##peek { dst 0 } { loc R: 1 } } T{ ##peek { dst 0 } { loc r: 1 } }
T{ ##peek { dst 0 } { loc R: 0 } } T{ ##peek { dst 0 } { loc r: 0 } }
T{ ##peek { dst 0 } { loc R: 4 } } T{ ##peek { dst 0 } { loc r: 4 } }
T{ ##inc f D: 2 } T{ ##inc f d: 2 }
T{ ##inc f R: -5 } T{ ##inc f r: -5 }
} }
} }
{ 8 V{ } } { 8 V{ } }
@ -343,11 +343,11 @@ IN: compiler.cfg.stacks.padding.tests
} }
{ {
12 V{ 12 V{
T{ ##peek { dst 0 } { loc R: 0 } } T{ ##peek { dst 0 } { loc r: 0 } }
T{ ##inc f D: -3 } T{ ##inc f d: -3 }
T{ ##inc f D: 1 } T{ ##inc f d: 1 }
T{ ##inc f R: -1 } T{ ##inc f r: -1 }
T{ ##replace { src 0 } { loc D: 0 } } T{ ##replace { src 0 } { loc d: 0 } }
} }
} }
{ {
@ -402,7 +402,7 @@ IN: compiler.cfg.stacks.padding.tests
{ 25 { { 2 { } } { 6 { } } } } { 25 { { 2 { } } { 6 { } } } }
{ 26 { { 4 { 0 1 } } { 6 { } } } } { 26 { { 4 { 0 1 } } { 6 { } } } }
{ 27 { { 4 { 0 1 } } { 1 { } } } } { 27 { { 4 { 0 1 } } { 1 { } } } }
! gc-map here scrubbing D: 0 and D: 1 ! gc-map here scrubbing d: 0 and d: 1
{ 28 { { 4 { 0 1 } } { 1 { } } } } { 28 { { 4 { 0 1 } } { 1 { } } } }
{ 29 { { 4 { 0 1 } } { 1 { } } } } { 29 { { 4 { 0 1 } } { 1 { } } } }
{ 30 { { 1 { } } { 1 { } } } } { 30 { { 1 { } } { 1 { } } } }
@ -416,65 +416,65 @@ IN: compiler.cfg.stacks.padding.tests
{ 0 V{ } } { 0 V{ } }
{ {
1 V{ 1 V{
T{ ##peek { loc D: 0 } } T{ ##peek { loc d: 0 } }
T{ ##peek { loc D: 1 } } T{ ##peek { loc d: 1 } }
T{ ##inc { loc D: -1 } } T{ ##inc { loc d: -1 } }
} }
} }
{ {
2 V{ 2 V{
T{ ##inc { loc D: -1 } } T{ ##inc { loc d: -1 } }
T{ ##replace { loc D: 1 } } T{ ##replace { loc d: 1 } }
T{ ##replace { loc D: 0 } } T{ ##replace { loc d: 0 } }
T{ ##inc { loc D: 1 } } T{ ##inc { loc d: 1 } }
T{ ##replace { loc D: 0 } } T{ ##replace { loc d: 0 } }
} }
} }
{ 3 V{ T{ ##call } } } { 3 V{ T{ ##call } } }
{ 4 V{ } } { 4 V{ } }
{ 5 V{ T{ ##call } } } { 5 V{ T{ ##call } } }
{ 6 V{ T{ ##peek { loc D: 0 } } } } { 6 V{ T{ ##peek { loc d: 0 } } } }
{ 7 V{ } } { 7 V{ } }
{ {
8 V{ 8 V{
T{ ##replace { loc D: 2 } } T{ ##replace { loc d: 2 } }
T{ ##replace { loc D: 1 } } T{ ##replace { loc d: 1 } }
T{ ##replace { loc D: 0 } } T{ ##replace { loc d: 0 } }
} }
} }
{ 9 V{ T{ ##call } } } { 9 V{ T{ ##call } } }
{ {
10 V{ 10 V{
T{ ##inc { loc D: 1 } } T{ ##inc { loc d: 1 } }
T{ ##replace { loc D: 0 } } T{ ##replace { loc d: 0 } }
} }
} }
{ 11 V{ T{ ##call } } } { 11 V{ T{ ##call } } }
{ 12 V{ } } { 12 V{ } }
{ 13 V{ T{ ##call } } } { 13 V{ T{ ##call } } }
{ 14 V{ T{ ##peek { loc D: 0 } } } } { 14 V{ T{ ##peek { loc d: 0 } } } }
{ 15 V{ } } { 15 V{ } }
{ {
16 V{ 16 V{
T{ ##inc { loc D: 1 } } T{ ##inc { loc d: 1 } }
T{ ##replace { loc D: 0 } } T{ ##replace { loc d: 0 } }
} }
} }
{ 17 V{ T{ ##call } } } { 17 V{ T{ ##call } } }
{ {
18 V{ 18 V{
T{ ##peek { loc D: 2 } } T{ ##peek { loc d: 2 } }
T{ ##peek { loc D: 1 } } T{ ##peek { loc d: 1 } }
T{ ##peek { loc D: 0 } } T{ ##peek { loc d: 0 } }
T{ ##inc { loc D: 1 } } T{ ##inc { loc d: 1 } }
} }
} }
{ 19 V{ } } { 19 V{ } }
{ 20 V{ } } { 20 V{ } }
{ {
21 V{ 21 V{
T{ ##inc { loc D: -3 } } T{ ##inc { loc d: -3 } }
T{ ##replace { loc D: 0 } } T{ ##replace { loc d: 0 } }
} }
} }
{ 22 V{ T{ ##call } } } { 22 V{ T{ ##call } } }
@ -482,8 +482,8 @@ IN: compiler.cfg.stacks.padding.tests
{ 24 V{ T{ ##call } } } { 24 V{ T{ ##call } } }
{ {
25 V{ 25 V{
T{ ##peek { loc D: 0 } } T{ ##peek { loc d: 0 } }
T{ ##inc { loc D: 3 } } T{ ##inc { loc d: 3 } }
} }
} }
{ 26 V{ } } { 26 V{ } }
@ -494,9 +494,9 @@ IN: compiler.cfg.stacks.padding.tests
{ 31 V{ } } { 31 V{ } }
{ {
32 V{ 32 V{
T{ ##inc { loc D: -4 } } T{ ##inc { loc d: -4 } }
T{ ##inc { loc D: 1 } } T{ ##inc { loc d: 1 } }
T{ ##replace { loc D: 0 } } T{ ##replace { loc d: 0 } }
} }
} }
{ 33 V{ } } { 33 V{ } }
@ -563,7 +563,7 @@ IN: compiler.cfg.stacks.padding.tests
{ 22 { { -1 { } } { 0 { } } } } { 22 { { -1 { } } { 0 { } } } }
{ 23 { { -1 { } } { 0 { } } } } { 23 { { -1 { } } { 0 { } } } }
{ 24 { { -1 { } } { 0 { } } } } { 24 { { -1 { } } { 0 { } } } }
! gc-map here scrubbing D: 0, D: 1 and D: 2 ! gc-map here scrubbing d: 0, d: 1 and d: 2
{ 25 { { 2 { 0 1 2 } } { 0 { } } } } { 25 { { 2 { 0 1 2 } } { 0 { } } } }
{ 26 { { 2 { 0 1 2 } } { 0 { } } } } { 26 { { 2 { 0 1 2 } } { 0 { } } } }
{ 27 { { -2 { } } { 0 { } } } } { 27 { { -2 { } } { 0 { } } } }
@ -589,18 +589,18 @@ IN: compiler.cfg.stacks.padding.tests
{ {
{ { 1 { 0 } } { 0 { } } } { { 1 { 0 } } { 0 { } } }
} [ V{ T{ ##inc f D: 1 } } following-stack-state ] unit-test } [ V{ T{ ##inc f d: 1 } } following-stack-state ] unit-test
{ {
{ { 0 { } } { 1 { 0 } } } { { 0 { } } { 1 { 0 } } }
} [ V{ T{ ##inc f R: 1 } } following-stack-state ] unit-test } [ V{ T{ ##inc f r: 1 } } following-stack-state ] unit-test
! Here the peek refers to a parameter of the word. ! Here the peek refers to a parameter of the word.
{ {
{ { 0 { } } { 0 { } } } { { 0 { } } { 0 { } } }
} [ } [
V{ V{
T{ ##peek { loc D: 25 } } T{ ##peek { loc d: 25 } }
} following-stack-state } following-stack-state
] unit-test ] unit-test
@ -608,9 +608,9 @@ IN: compiler.cfg.stacks.padding.tests
{ { 0 { } } { 0 { } } } { { 0 { } } { 0 { } } }
} [ } [
V{ V{
T{ ##replace { src 10 } { loc D: 0 } } T{ ##replace { src 10 } { loc d: 0 } }
T{ ##replace { src 10 } { loc D: 1 } } T{ ##replace { src 10 } { loc d: 1 } }
T{ ##replace { src 10 } { loc D: 2 } } T{ ##replace { src 10 } { loc d: 2 } }
} following-stack-state } following-stack-state
] unit-test ] unit-test
@ -618,9 +618,9 @@ IN: compiler.cfg.stacks.padding.tests
{ { 1 { } } { 0 { } } } { { 1 { } } { 0 { } } }
} [ } [
V{ V{
T{ ##replace { src 10 } { loc D: 0 } } T{ ##replace { src 10 } { loc d: 0 } }
T{ ##inc f D: 1 } T{ ##inc f d: 1 }
T{ ##replace { src 10 } { loc D: 0 } } T{ ##replace { src 10 } { loc d: 0 } }
} following-stack-state } following-stack-state
] unit-test ] unit-test
@ -628,10 +628,10 @@ IN: compiler.cfg.stacks.padding.tests
{ { 0 { } } { 0 { } } } { { 0 { } } { 0 { } } }
} [ } [
V{ V{
T{ ##replace { src 10 } { loc D: 0 } } T{ ##replace { src 10 } { loc d: 0 } }
T{ ##inc f D: 1 } T{ ##inc f d: 1 }
T{ ##replace { src 10 } { loc D: 0 } } T{ ##replace { src 10 } { loc d: 0 } }
T{ ##inc f D: -1 } T{ ##inc f d: -1 }
} following-stack-state } following-stack-state
] unit-test ] unit-test
@ -639,9 +639,9 @@ IN: compiler.cfg.stacks.padding.tests
{ { 0 { } } { 0 { } } } { { 0 { } } { 0 { } } }
} [ } [
V{ V{
T{ ##inc f D: 1 } T{ ##inc f d: 1 }
T{ ##replace { src 10 } { loc D: 0 } } T{ ##replace { src 10 } { loc d: 0 } }
T{ ##inc f D: -1 } T{ ##inc f d: -1 }
} following-stack-state } following-stack-state
] unit-test ] unit-test
@ -650,8 +650,8 @@ IN: compiler.cfg.stacks.padding.tests
{ { -1 { } } { 0 { } } } { { -1 { } } { 0 { } } }
} [ } [
V{ V{
T{ ##replace { src 10 } { loc D: 0 } } T{ ##replace { src 10 } { loc d: 0 } }
T{ ##inc f D: -1 } T{ ##inc f d: -1 }
T{ ##call } T{ ##call }
} following-stack-state } following-stack-state
] unit-test ] unit-test
@ -659,22 +659,22 @@ IN: compiler.cfg.stacks.padding.tests
! Should not be ok because the value wasn't initialized when gc ran. ! Should not be ok because the value wasn't initialized when gc ran.
[ [
V{ V{
T{ ##inc f D: 1 } T{ ##inc f d: 1 }
T{ ##alien-invoke { gc-map T{ gc-map } } } T{ ##alien-invoke { gc-map T{ gc-map } } }
T{ ##peek { loc D: 0 } } T{ ##peek { loc d: 0 } }
} following-stack-state } following-stack-state
] [ vacant-peek? ] must-fail-with ] [ vacant-peek? ] must-fail-with
[ [
V{ V{
T{ ##inc f D: 1 } T{ ##inc f d: 1 }
T{ ##peek { loc D: 0 } } T{ ##peek { loc d: 0 } }
} following-stack-state } following-stack-state
] [ vacant-peek? ] must-fail-with ] [ vacant-peek? ] must-fail-with
[ [
V{ V{
T{ ##inc f R: 1 } T{ ##inc f r: 1 }
T{ ##peek { loc R: 0 } } T{ ##peek { loc r: 0 } }
} following-stack-state } following-stack-state
] [ vacant-peek? ] must-fail-with ] [ vacant-peek? ] must-fail-with

View File

@ -5,7 +5,7 @@ IN: compiler.cfg.stacks.tests
! store-vregs ! store-vregs
{ {
H{ { D: 1 4 } { D: 2 3 } { D: 0 5 } } H{ { d: 1 4 } { d: 2 3 } { d: 0 5 } }
T{ height-state f 0 0 0 0 } T{ height-state f 0 0 0 0 }
} [ } [
{ 3 4 5 } ds-loc store-vregs { 3 4 5 } ds-loc store-vregs
@ -14,7 +14,7 @@ IN: compiler.cfg.stacks.tests
] cfg-unit-test ] cfg-unit-test
! stack-locs ! stack-locs
{ { D: 4 D: 3 D: 2 D: 1 D: 0 } } [ { { d: 4 d: 3 d: 2 d: 1 d: 0 } } [
ds-loc 5 stack-locs >array ds-loc 5 stack-locs >array
] unit-test ] unit-test

View File

@ -36,14 +36,14 @@ IN: compiler.cfg.stacks
over length stack-locs [ replace-loc ] 2each ; over length stack-locs [ replace-loc ] 2each ;
! Utility ! Utility
: ds-drop ( -- ) D: -1 inc-stack ; : ds-drop ( -- ) d: -1 inc-stack ;
: ds-peek ( -- vreg ) D: 0 peek-loc ; : ds-peek ( -- vreg ) d: 0 peek-loc ;
: ds-pop ( -- vreg ) ds-peek ds-drop ; : ds-pop ( -- vreg ) ds-peek ds-drop ;
: ds-push ( vreg -- ) : ds-push ( vreg -- )
D: 1 inc-stack D: 0 replace-loc ; d: 1 inc-stack d: 0 replace-loc ;
: (2inputs) ( -- vreg1 vreg2 ) : (2inputs) ( -- vreg1 vreg2 )
2 ds-loc (load-vregs) first2 ; 2 ds-loc (load-vregs) first2 ;

View File

@ -4,6 +4,6 @@ IN: compiler.prettyprint
: pprint-loc ( loc word -- ) <block pprint-word n>> pprint* block> ; : pprint-loc ( loc word -- ) <block pprint-word n>> pprint* block> ;
M: ds-loc pprint* \ D: pprint-loc ; M: ds-loc pprint* \ d: pprint-loc ;
M: rs-loc pprint* \ R: pprint-loc ; M: rs-loc pprint* \ r: pprint-loc ;

View File

@ -23,8 +23,8 @@ IN: compiler.tests.low-level-ir
: compile-test-bb ( insns -- result ) : compile-test-bb ( insns -- result )
V{ T{ ##prologue } T{ ##branch } } [ clone ] map 0 test-bb V{ T{ ##prologue } T{ ##branch } } [ clone ] map 0 test-bb
V{ V{
T{ ##inc f D: 1 } T{ ##inc f d: 1 }
T{ ##replace f 0 D: 0 } T{ ##replace f 0 d: 0 }
T{ ##branch } T{ ##branch }
} [ clone ] map append 1 test-bb } [ clone ] map append 1 test-bb
V{ V{