\ 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
] PIC-CHECK-TUPLE jit-define
assert=
] 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
{
B{ 72 255 192 }
[ RAX RAX 29 %add-imm ] B{ } make
] 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
{ V{ } } [
init-relocation init-gc-maps
gc-maps get length
] 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
{ t } [
[ D: 0 %clear ] B{ } make
cpu x86.32? B{ 199 6 144 18 0 0 } B{ 73 199 6 144 18 0 0 } ? =
] 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
{ t } [
[ 2 cells %prologue ] B{ } make
[ 8 cells %prologue ] B{ } make
[ stack-reg 7 cells SUB ] B{ } make =
] 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
{
{ [ dup not ] [ drop \ f type-number MOV ] }
{ [ dup fixnum? ] [ tag-fixnum MOV ] }
- [ [ 0xffffffff MOV ] dip rc-absolute rel-literal ]
+ [ [ 0 MOV ] dip rc-absolute rel-literal ]
} cond ;
M: x86 %clear ( loc -- )
M:: x86 %dispatch ( src temp -- )
! Load jump table base.
- temp 0xffffffff MOV
- building get length :> start
+ temp 0 MOV
0 rc-absolute-cell rel-here
+ building get length :> start
! Add jump table base
temp src 0x7f [++] JMP
building get length :> end