cpu.x86,bootstrap.assembler.*: making sure 0 is the relocation dummy value everywhere
In some places it was 0xffffffff, but it should always be 0 MOV for consistency.locals-and-roots
parent
9f0cd740c8
commit
0fc8fb22ca
|
@ -107,7 +107,7 @@ IN: bootstrap.x86
|
||||||
\ lazy-jit-compile define-combinator-primitive
|
\ lazy-jit-compile define-combinator-primitive
|
||||||
|
|
||||||
[
|
[
|
||||||
temp2 0xffffffff MOV f rc-absolute-cell rel-literal
|
temp2 0 MOV f rc-absolute-cell rel-literal
|
||||||
temp1 temp2 CMP
|
temp1 temp2 CMP
|
||||||
] PIC-CHECK-TUPLE jit-define
|
] PIC-CHECK-TUPLE jit-define
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,15 @@ IN: cpu.x86.tests
|
||||||
assert=
|
assert=
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
! (%compare-tagged)
|
||||||
|
cpu x86.64? [
|
||||||
|
{
|
||||||
|
B{ 72 129 248 255 255 255 255 }
|
||||||
|
} [
|
||||||
|
init-relocation [ RAX RAX (%compare-tagged) ] B{ } make
|
||||||
|
] unit-test
|
||||||
|
] when
|
||||||
|
|
||||||
! %add-imm
|
! %add-imm
|
||||||
{
|
{
|
||||||
B{ 72 255 192 }
|
B{ 72 255 192 }
|
||||||
|
@ -21,6 +30,14 @@ IN: cpu.x86.tests
|
||||||
[ RAX RAX 29 %add-imm ] B{ } make
|
[ RAX RAX 29 %add-imm ] B{ } make
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
! %alien-invoke
|
||||||
|
{ 1 } [
|
||||||
|
init-relocation init-gc-maps [
|
||||||
|
{ } { } { } { } 0 0 { } "dll" T{ gc-map { scrub-d V{ 0 } } } %alien-invoke
|
||||||
|
] B{ } make drop
|
||||||
|
gc-maps get length
|
||||||
|
] unit-test
|
||||||
|
|
||||||
! %call-gc
|
! %call-gc
|
||||||
{ V{ } } [
|
{ V{ } } [
|
||||||
init-relocation init-gc-maps
|
init-relocation init-gc-maps
|
||||||
|
@ -34,20 +51,22 @@ IN: cpu.x86.tests
|
||||||
gc-maps get length
|
gc-maps get length
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
! %alien-invoke
|
|
||||||
{ 1 } [
|
|
||||||
init-relocation init-gc-maps [
|
|
||||||
{ } { } { } { } 0 0 { } "dll" T{ gc-map { scrub-d V{ 0 } } } %alien-invoke
|
|
||||||
] B{ } make drop
|
|
||||||
gc-maps get length
|
|
||||||
] unit-test
|
|
||||||
|
|
||||||
! %clear
|
! %clear
|
||||||
{ t } [
|
{ t } [
|
||||||
[ D: 0 %clear ] B{ } make
|
[ D: 0 %clear ] B{ } make
|
||||||
cpu x86.32? B{ 199 6 144 18 0 0 } B{ 73 199 6 144 18 0 0 } ? =
|
cpu x86.32? B{ 199 6 144 18 0 0 } B{ 73 199 6 144 18 0 0 } ? =
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
! %dispatch
|
||||||
|
cpu x86.64? [
|
||||||
|
{
|
||||||
|
B{ 72 187 0 0 0 0 0 0 0 0 72 255 100 3 6 0 }
|
||||||
|
}
|
||||||
|
[
|
||||||
|
init-relocation [ RAX RBX %dispatch ] B{ } make
|
||||||
|
] unit-test
|
||||||
|
] when
|
||||||
|
|
||||||
! %prologue
|
! %prologue
|
||||||
{ t } [
|
{ t } [
|
||||||
[ 2 cells %prologue ] B{ } make
|
[ 2 cells %prologue ] B{ } make
|
||||||
|
@ -58,3 +77,13 @@ IN: cpu.x86.tests
|
||||||
[ 8 cells %prologue ] B{ } make
|
[ 8 cells %prologue ] B{ } make
|
||||||
[ stack-reg 7 cells SUB ] B{ } make =
|
[ stack-reg 7 cells SUB ] B{ } make =
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
! %replace-imm
|
||||||
|
cpu x86.64? [
|
||||||
|
{
|
||||||
|
B{ 73 199 6 0 0 0 0 }
|
||||||
|
}
|
||||||
|
[
|
||||||
|
init-relocation [ 34.0 D: 0 %replace-imm ] B{ } make
|
||||||
|
] unit-test
|
||||||
|
] when
|
||||||
|
|
|
@ -87,7 +87,7 @@ M: x86 %replace-imm
|
||||||
{
|
{
|
||||||
{ [ dup not ] [ drop \ f type-number MOV ] }
|
{ [ dup not ] [ drop \ f type-number MOV ] }
|
||||||
{ [ dup fixnum? ] [ tag-fixnum MOV ] }
|
{ [ dup fixnum? ] [ tag-fixnum MOV ] }
|
||||||
[ [ 0xffffffff MOV ] dip rc-absolute rel-literal ]
|
[ [ 0 MOV ] dip rc-absolute rel-literal ]
|
||||||
} cond ;
|
} cond ;
|
||||||
|
|
||||||
M: x86 %clear ( loc -- )
|
M: x86 %clear ( loc -- )
|
||||||
|
@ -598,9 +598,9 @@ M:: x86 %compare-imm-branch ( label src1 src2 cc -- )
|
||||||
|
|
||||||
M:: x86 %dispatch ( src temp -- )
|
M:: x86 %dispatch ( src temp -- )
|
||||||
! Load jump table base.
|
! Load jump table base.
|
||||||
temp 0xffffffff MOV
|
temp 0 MOV
|
||||||
building get length :> start
|
|
||||||
0 rc-absolute-cell rel-here
|
0 rc-absolute-cell rel-here
|
||||||
|
building get length :> start
|
||||||
! Add jump table base
|
! Add jump table base
|
||||||
temp src 0x7f [++] JMP
|
temp src 0x7f [++] JMP
|
||||||
building get length :> end
|
building get length :> end
|
||||||
|
|
Loading…
Reference in New Issue