compiler: D: d: R: r:

locals-and-roots
Doug Coleman 2016-06-05 12:35:12 -07:00
parent 277b81c44f
commit dfc87db5df
40 changed files with 1393 additions and 1391 deletions

View File

@ -212,7 +212,7 @@ HELP: %replace-imm
{ $examples { $examples
{ $unchecked-example { $unchecked-example
"USING: cpu.architecture make ;" "USING: cpu.architecture make ;"
"[ 777 D: 0 %replace-imm ] B{ } make disassemble" "[ 777 d: 0 %replace-imm ] B{ } make disassemble"
"0000000000aad8c0: 49c70690300000 mov qword [r14], 0x3090" "0000000000aad8c0: 49c70690300000 mov qword [r14], 0x3090"
} }
} ; } ;

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

@ -54,7 +54,7 @@ cpu x86.32?
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

@ -368,9 +368,9 @@ symbol: foo
! ! #shuffle ! ! #shuffle
{ {
{ { 1 1 } { 0 0 } } { { 1 1 } { 0 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 } }
@ -400,21 +400,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

@ -88,9 +88,9 @@ M: insn insn. tuple>array but-last [
! Prettyprinting ! Prettyprinting
: 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 ;
: resolve-phis ( bb -- ) : resolve-phis ( bb -- )
[ [

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

@ -8,23 +8,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

@ -40,4 +40,4 @@ M: avail transfer-set drop defined assoc-union ;
: make-available ( vreg -- ) : make-available ( vreg -- )
basic-block get avail-ins get [ dupd clone ?set-at ] assocs:change-at ; basic-block get avail-ins get [ dupd clone ?set-at ] assocs:change-at ;
RENAMING: >avail [ ] [ dup >avail-vreg swap or ] [ ] RENAMING: >avail [ ] [ dup >avail-vreg swap or ] [ ] ;

File diff suppressed because it is too large Load Diff

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

@ -88,7 +88,7 @@ symbol: machine-live-outs
[ pending-interval-heap get expire-old-intervals ] [ pending-interval-heap get expire-old-intervals ]
[ unhandled-intervals get activate-new-intervals ] bi ; [ unhandled-intervals get activate-new-intervals ] bi ;
RENAMING: assign [ vreg>reg ] [ vreg>reg ] [ vreg>reg ] RENAMING: assign [ vreg>reg ] [ vreg>reg ] [ vreg>reg ] ;
: assign-all-registers ( insn -- ) : assign-all-registers ( insn -- )
[ assign-insn-defs ] [ assign-insn-uses ] [ assign-insn-temps ] tri ; [ assign-insn-defs ] [ assign-insn-uses ] [ assign-insn-temps ] tri ;

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

@ -76,17 +76,17 @@ qualified: sets
! 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
@ -109,21 +109,21 @@ qualified: sets
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
@ -142,12 +142,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
{ {
@ -168,20 +168,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
@ -202,7 +202,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
@ -224,12 +224,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
@ -239,10 +239,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
@ -252,35 +252,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 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 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
@ -335,7 +335,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
@ -369,12 +369,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

@ -32,5 +32,7 @@ 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: d: scan-number <ds-loc> suffix! ;
SYNTAX: r: scan-number <rs-loc> suffix! ;
SYNTAX: r: scan-number <rs-loc> suffix! ;

View File

@ -85,4 +85,4 @@ insn-classes get [ insn-temp-slots empty? ] reject [
;FUNCTOR ;FUNCTOR
SYNTAX: RENAMING: scan-token scan-object scan-object scan-object define-renaming ; SYNTAX: RENAMING: scan-token scan-object scan-object scan-object ";" expect define-renaming ;

View File

@ -9,4 +9,4 @@ symbol: renamings
: rename-value ( vreg -- vreg' ) : rename-value ( vreg -- vreg' )
renamings get ?at drop ; renamings get ?at drop ;
RENAMING: rename [ rename-value ] [ rename-value ] [ drop next-vreg ] RENAMING: rename [ rename-value ] [ rename-value ] [ drop next-vreg ] ;

View File

@ -16,7 +16,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

@ -61,12 +61,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
@ -89,20 +89,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
@ -114,7 +114,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
@ -127,19 +127,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
@ -157,7 +157,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
@ -170,7 +170,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
@ -182,8 +182,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
@ -203,7 +203,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 }
} }
@ -216,10 +216,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
@ -253,7 +253,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
@ -284,8 +284,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
@ -297,7 +297,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
@ -325,10 +325,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
@ -351,7 +351,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
@ -367,9 +367,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{
@ -400,14 +400,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
@ -416,12 +416,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
@ -430,18 +430,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
@ -449,35 +449,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
@ -486,13 +486,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
@ -500,15 +500,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
@ -536,16 +536,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
@ -557,13 +557,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
@ -571,7 +571,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 }
@ -579,7 +579,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 }
@ -640,7 +640,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{
@ -649,38 +649,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
@ -690,17 +690,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
@ -709,13 +709,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
@ -723,15 +723,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
@ -739,108 +739,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
@ -848,15 +848,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
@ -864,21 +864,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
@ -887,15 +887,15 @@ 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

View File

@ -66,7 +66,7 @@ SYMBOLS: renaming-set needs-renaming? ;
: converted-value ( vreg -- vreg' ) : converted-value ( vreg -- vreg' )
renaming-set get pop first2 [ assert= ] dip ; renaming-set get pop first2 [ assert= ] dip ;
RENAMING: convert [ converted-value ] [ converted-value ] [ ] RENAMING: convert [ converted-value ] [ converted-value ] [ ] ;
: perform-renaming ( insn -- ) : perform-renaming ( insn -- )
needs-renaming? get [ needs-renaming? get [

View File

@ -37,7 +37,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 { scrub-d B{ 0 0 0 } } { scrub-r B{ } } { gc-roots { } } } T{ gc-map { scrub-d B{ 0 0 0 } } { scrub-r B{ } } { gc-roots { } } }
} }
@ -47,7 +47,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 { scrub-d B{ 0 0 0 } } { scrub-r B{ } } { gc-roots { } } } T{ gc-map { scrub-d B{ 0 0 0 } } { scrub-r B{ } } { gc-roots { } } }

View File

@ -64,7 +64,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
@ -100,7 +100,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 }
} }
} [ } [
@ -113,9 +113,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
@ -131,7 +131,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

@ -73,7 +73,7 @@ SYMBOLS: stacks pushed ;
(top-name) (top-name)
dup [ dup used-vregs get push-front ] when ; dup [ dup used-vregs get push-front ] when ;
RENAMING: ssa-rename [ gen-name ] [ top-name ] [ ] RENAMING: ssa-rename [ gen-name ] [ top-name ] [ ] ;
GENERIC: rename-insn ( insn -- ) ; GENERIC: rename-insn ( insn -- ) ;

View File

@ -33,19 +33,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
@ -75,11 +75,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 }
@ -106,8 +106,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 }
@ -123,10 +123,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
@ -136,8 +136,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
@ -147,8 +147,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
@ -188,13 +188,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
@ -204,17 +204,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= }
@ -225,8 +225,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 }
@ -238,9 +238,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
@ -254,14 +254,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
@ -315,8 +315,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 }
@ -335,7 +335,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,15 +5,15 @@ 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 ##replace-imm } " instructions front of unsafe " { $link ##peek } " instructions in the " { $link cfg } ". Consider the following sequence of instructions." "A compiler pass that inserts " { $link ##replace-imm } " instructions front of unsafe " { $link ##peek } " instructions in the " { $link cfg } ". Consider the following sequence of instructions."
{ $code { $code
"##inc D: 2" "##inc d: 2"
"##peek RCX D: 2" "##peek RCX d: 2"
} }
"The ##peek can cause a stack underflow and then there will be two uninitialized locations on the data stack that can't be traced. To counteract that, this pass modifies the instruction sequence so that it becomes:" "The ##peek can cause a stack underflow and then there will be two uninitialized locations on the data stack that can't be traced. To counteract that, this pass modifies the instruction sequence so that it becomes:"
{ $code { $code
"##inc D: 2" "##inc d: 2"
"##replace-imm 17 D: 0" "##replace-imm 17 d: 0"
"##replace-imm 17 D: 1" "##replace-imm 17 d: 1"
"##peek RCX D: 2" "##peek RCX d: 2"
} ; } ;
HELP: dangerous-insn? HELP: dangerous-insn?
@ -22,12 +22,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"
} }
} ; } ;

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 f 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?
] unit-test ] unit-test
! state>clears ! state>clears

View File

@ -9,6 +9,6 @@ in: compiler.cfg.stacks.height.tests
begin-stack-analysis begin-stack-analysis
3 4 T{ basic-block } 3 4 T{ basic-block }
[ record-stack-heights ] [ record-stack-heights ]
[ D: 1 swap untranslate-loc ] [ d: 1 swap untranslate-loc ]
[ R: 1 swap untranslate-loc ] tri [ r: 1 swap untranslate-loc ] tri
] unit-test ] unit-test

View File

@ -22,7 +22,7 @@ HELP: height-state>insns
{ $example { $example
"USING: compiler.cfg.stacks.local prettyprint ;" "USING: compiler.cfg.stacks.local prettyprint ;"
"{ { 0 4 } { 0 -2 } } height-state>insns ." "{ { 0 4 } { 0 -2 } } height-state>insns ."
"{ T{ ##inc { loc D: 4 } } T{ ##inc { loc R: -2 } } }" "{ T{ ##inc { loc d: 4 } } T{ ##inc { loc r: -2 } } }"
} }
} ; } ;

View File

@ -8,7 +8,7 @@ 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
! stack-changes ! stack-changes
@ -18,13 +18,13 @@ 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
! 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
! end-local-analysis ! end-local-analysis
@ -40,11 +40,11 @@ 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
[ 0 0 rot record-stack-heights ] [ 0 0 rot record-stack-heights ]
[ [ 3 D: 3 replace-loc "eh" , end-local-analysis ] V{ } make drop ] [ [ 3 d: 3 replace-loc "eh" , end-local-analysis ] V{ } make drop ]
[ replace-sets get at ] tri [ replace-sets get at ] tri
] cfg-unit-test ] cfg-unit-test
@ -52,8 +52,8 @@ in: compiler.cfg.stacks.local.tests
{ {
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
@ -64,7 +64,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-changes replaces get height-state get emit-changes
] V{ } make ] V{ } make
@ -76,45 +76,45 @@ in: compiler.cfg.stacks.local.tests
compute-local-kill-set sets:cardinality compute-local-kill-set sets:cardinality
] unit-test ] unit-test
{ HS{ R: -4 } } [ { HS{ r: -4 } } [
V{ } 0 insns>block 4 4 pick record-stack-heights V{ } 0 insns>block 4 4 pick record-stack-heights
{ { 8 0 } { 3 0 } } height-state set { { 8 0 } { 3 0 } } height-state set
compute-local-kill-set compute-local-kill-set
] unit-test ] unit-test
{ HS{ D: -1 D: -2 } } [ { HS{ d: -1 d: -2 } } [
V{ } 0 insns>block [ 2 0 rot record-stack-heights ] keep V{ } 0 insns>block [ 2 0 rot record-stack-heights ] keep
{ { 0 0 } { 0 0 } } height-state set { { 0 0 } { 0 0 } } height-state set
compute-local-kill-set compute-local-kill-set
] cfg-unit-test ] cfg-unit-test
! translate-local-loc ! translate-local-loc
{ D: 2 } [ { d: 2 } [
D: 3 { { 1 2 } { 3 4 } } translate-local-loc d: 3 { { 1 2 } { 3 4 } } translate-local-loc
] unit-test ] unit-test
! height-state ! height-state
{ {
{ { 3 3 } { 0 0 } } { { 3 3 } { 0 0 } }
} [ } [
D: 3 inc-stack height-state get d: 3 inc-stack height-state get
] cfg-unit-test ] cfg-unit-test
{ {
{ { 5 3 } { 0 0 } } { { 5 3 } { 0 0 } }
} [ } [
{ { 2 0 } { 0 0 } } height-state set { { 2 0 } { 0 0 } } 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 4 } { 0 -2 } } height-state>insns { { 0 4 } { 0 -2 } } 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-state2 } insns>cfg trace-stack-state2
] 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-state2 insns>cfg trace-stack-state2
@ -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 { scrub-d { } } } } } T{ ##alien-invoke { gc-map T{ gc-map { scrub-d { } } } } }
} }
} }
@ -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 { scrub-d { } } } } } T{ ##alien-invoke { gc-map T{ gc-map { scrub-d { } } } } }
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

@ -4,7 +4,7 @@ namespaces tools.test ;
in: compiler.cfg.stacks.tests in: compiler.cfg.stacks.tests
{ {
H{ { D: 1 4 } { D: 2 3 } { D: 0 5 } } H{ { d: 1 4 } { d: 2 3 } { d: 0 5 } }
{ { 0 0 } { 0 0 } } { { 0 0 } { 0 0 } }
} [ } [
{ 3 4 5 } ds-loc store-vregs { 3 4 5 } ds-loc store-vregs
@ -13,7 +13,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

@ -39,14 +39,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

@ -5,11 +5,11 @@ in: compiler.cfg.stacks.vacant
ARTICLE: "compiler.cfg.stacks.vacant" "Uninitialized/overinitialized stack location analysis" ARTICLE: "compiler.cfg.stacks.vacant" "Uninitialized/overinitialized stack location analysis"
"Consider the following sequence of instructions:" "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, and so the GC needs to scrub them so that they don't get traced. This is achieved by computing uninitialized locations with a dataflow analysis, and recording the information in GC maps. The call_frame_slot_visitor object in vm/slot_visitor.hpp reads this information from GC maps and performs the scrubbing." ; "The GC check runs before stack locations 0 and 1 have been initialized, and so the GC needs to scrub them so that they don't get traced. This is achieved by computing uninitialized locations with a dataflow analysis, and recording the information in GC maps. The call_frame_slot_visitor object in vm/slot_visitor.hpp reads this information from GC maps and performs the scrubbing." ;

View File

@ -24,8 +24,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{