[ ] [
{
- T{ ##load-indirect f V int-regs 1 "hello" }
+ T{ ##load-reference f V int-regs 1 "hello" }
T{ ##slot-imm f V int-regs 0 V int-regs 1 0 3 }
} alias-analysis drop
] unit-test
M: ##load-immediate analyze-aliases*
dup [ val>> ] [ dst>> ] bi constants get set-at ;
-M: ##load-indirect analyze-aliases*
+M: ##load-reference analyze-aliases*
dup dst>> set-heap-ac ;
M: ##alien-global analyze-aliases*
! Stack operations
INSN: ##load-immediate < ##pure { val integer } ;
-INSN: ##load-indirect < ##pure obj ;
+INSN: ##load-reference < ##pure obj ;
GENERIC: ##load-literal ( dst value -- )
M: fixnum ##load-literal tag-fixnum ##load-immediate ;
M: f ##load-literal drop \ f tag-number ##load-immediate ;
-M: object ##load-literal ##load-indirect ;
+M: object ##load-literal ##load-reference ;
INSN: ##peek < ##read { loc loc } ;
INSN: ##replace < ##write { loc loc } ;
M: ##load-immediate >expr val>> <constant> ;
-M: ##load-indirect >expr obj>> <constant> ;
-
M: ##unary >expr
[ class ] [ src>> vreg>vn ] bi unary-expr boa ;
[
{
- T{ ##load-indirect f V int-regs 1 + }
+ T{ ##load-reference f V int-regs 1 + }
T{ ##peek f V int-regs 2 D 0 }
T{ ##compare f V int-regs 4 V int-regs 2 V int-regs 1 cc> }
T{ ##compare f V int-regs 6 V int-regs 2 V int-regs 1 cc> }
}
] [
{
- T{ ##load-indirect f V int-regs 1 + }
+ T{ ##load-reference f V int-regs 1 + }
T{ ##peek f V int-regs 2 D 0 }
T{ ##compare f V int-regs 4 V int-regs 2 V int-regs 1 cc> }
T{ ##compare-imm f V int-regs 6 V int-regs 4 7 cc/= }
[
{
- T{ ##load-indirect f V int-regs 1 + }
+ T{ ##load-reference f V int-regs 1 + }
T{ ##peek f V int-regs 2 D 0 }
T{ ##compare f V int-regs 4 V int-regs 2 V int-regs 1 cc<= }
T{ ##compare f V int-regs 6 V int-regs 2 V int-regs 1 cc> }
}
] [
{
- T{ ##load-indirect f V int-regs 1 + }
+ T{ ##load-reference f V int-regs 1 + }
T{ ##peek f V int-regs 2 D 0 }
T{ ##compare f V int-regs 4 V int-regs 2 V int-regs 1 cc<= }
T{ ##compare-imm f V int-regs 6 V int-regs 4 7 cc= }
M: ##load-immediate generate-insn
[ dst>> register ] [ val>> ] bi %load-immediate ;
-M: ##load-indirect generate-insn
- [ dst>> register ] [ obj>> ] bi %load-indirect ;
+M: ##load-reference generate-insn
+ [ dst>> register ] [ obj>> ] bi %load-reference ;
M: ##peek generate-insn
[ dst>> register ] [ loc>> ] bi %peek ;
[ 4 ] [ 2 [ dup fixnum* ] compile-call ] unit-test
[ 7 ] [ 2 [ dup fixnum* 3 fixnum+fast ] compile-call ] unit-test
-SINGLETON: cucumber
+TUPLE: cucumber ;
M: cucumber equal? "The cucumber has no equal" throw ;
HOOK: two-operand? cpu ( -- ? )
HOOK: %load-immediate cpu ( reg obj -- )
-HOOK: %load-indirect cpu ( reg obj -- )
+HOOK: %load-reference cpu ( reg obj -- )
HOOK: %peek cpu ( vreg loc -- )
HOOK: %replace cpu ( vreg loc -- )
M: ppc %load-immediate ( reg n -- ) swap LOAD ;
-M: ppc %load-indirect ( reg obj -- )
+M: ppc %load-reference ( reg obj -- )
[ 0 swap LOAD32 ] [ rc-absolute-ppc-2/2 rel-immediate ] bi* ;
M: ppc %alien-global ( register symbol dll -- )
M:: ppc %integer>bignum ( dst src temp -- )
[
"end" define-label
- dst 0 >bignum %load-indirect
+ dst 0 >bignum %load-reference
! Is it zero? Then just go to the end and return this zero
0 src 0 CMPI
"end" get BEQ
scratch-reg dup HEX: 8000 XORIS
scratch-reg 1 4 scratch@ STW
dst 1 0 scratch@ LFD
- scratch-reg 4503601774854144.0 %load-indirect
+ scratch-reg 4503601774854144.0 %load-reference
fp-scratch-reg scratch-reg float-offset LFD
dst dst fp-scratch-reg FSUB ;
"end" define-label
dst \ f tag-number %load-immediate
"end" get word execute
- dst \ t %load-indirect
+ dst \ t %load-reference
"end" get resolve-label ; inline
: %boolean ( dst temp cc -- )
[ 11 ] 2dip %alien-global 11 MTLR BLRL ;
M: ppc %alien-callback ( quot -- )
- 3 swap %load-indirect "c_to_factor" f %alien-invoke ;
+ 3 swap %load-reference "c_to_factor" f %alien-invoke ;
M: ppc %prepare-alien-indirect ( -- )
"unbox_alien" f %alien-invoke
M: x86.32 %alien-callback ( quot -- )
4 [
- EAX swap %load-indirect
+ EAX swap %load-reference
EAX PUSH
"c_to_factor" f %alien-invoke
] with-aligned-stack ;
RBP CALL ;
M: x86.64 %alien-callback ( quot -- )
- param-reg-1 swap %load-indirect
+ param-reg-1 swap %load-reference
"c_to_factor" f %alien-invoke ;
M: x86.64 %callback-value ( ctype -- )
M: x86 %load-immediate MOV ;
-M: x86 %load-indirect swap 0 MOV rc-absolute-cell rel-immediate ;
+M: x86 %load-reference swap 0 MOV rc-absolute-cell rel-immediate ;
HOOK: ds-reg cpu ( -- reg )
HOOK: rs-reg cpu ( -- reg )
[
"end" define-label
! Load cached zero value
- dst 0 >bignum %load-indirect
+ dst 0 >bignum %load-reference
src 0 CMP
! Is it zero? Then just go to the end and return this zero
"end" get JE