compiler.cfg.intrinsics.misc: use the vm-special-object-offset word

db4
Björn Lindqvist 2015-08-31 02:08:01 +02:00
parent de4917e6a1
commit 9725169ca7
2 changed files with 3 additions and 7 deletions

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors classes.algebra compiler.cfg.builder.blocks USING: accessors classes.algebra compiler.cfg.builder.blocks
compiler.cfg.comparisons compiler.cfg.hats compiler.cfg.comparisons compiler.cfg.hats
compiler.cfg.instructions compiler.cfg.stacks compiler.cfg.instructions compiler.cfg.stacks compiler.constants
compiler.tree.propagation.info cpu.architecture kernel layouts compiler.tree.propagation.info cpu.architecture kernel layouts
math namespaces sequences vm ; math namespaces sequences vm ;
IN: compiler.cfg.intrinsics.misc IN: compiler.cfg.intrinsics.misc
@ -14,20 +14,17 @@ IN: compiler.cfg.intrinsics.misc
node-input-infos first2 [ class>> fixnum class<= ] both? node-input-infos first2 [ class>> fixnum class<= ] both?
[ [ cc= ^^compare-integer ] binary-op ] [ [ cc= ^^compare ] binary-op ] if ; [ [ cc= ^^compare-integer ] binary-op ] [ [ cc= ^^compare ] binary-op ] if ;
: special-object-offset ( n -- offset )
cells "special-objects" vm-field-offset + ;
: emit-special-object ( node -- ) : emit-special-object ( node -- )
dup node-input-infos first literal>> [ dup node-input-infos first literal>> [
ds-drop ds-drop
special-object-offset ^^vm-field vm-special-object-offset ^^vm-field
ds-push ds-push
] [ emit-primitive ] ?if ; ] [ emit-primitive ] ?if ;
: emit-set-special-object ( node -- ) : emit-set-special-object ( node -- )
dup node-input-infos second literal>> [ dup node-input-infos second literal>> [
ds-drop ds-drop
[ ds-pop ] dip special-object-offset ##set-vm-field, [ ds-pop ] dip vm-special-object-offset ##set-vm-field,
] [ emit-primitive ] ?if ; ] [ emit-primitive ] ?if ;
: context-object-offset ( n -- n ) : context-object-offset ( n -- n )

View File

@ -35,7 +35,6 @@ CONSTANT: deck-bits 18
: vm-signal-handler-addr-offset ( -- n ) 8 bootstrap-cells ; inline : vm-signal-handler-addr-offset ( -- n ) 8 bootstrap-cells ; inline
: vm-fault-flag-offset ( -- n ) 9 bootstrap-cells ; inline : vm-fault-flag-offset ( -- n ) 9 bootstrap-cells ; inline
: vm-special-object-offset ( n -- offset ) : vm-special-object-offset ( n -- offset )
! Can't reuse the one in compiler.cfg.intrinsics.misc :(
bootstrap-cells 10 bootstrap-cells + ; bootstrap-cells 10 bootstrap-cells + ;
! Relocation classes ! Relocation classes