2008-12-06 10:16:29 -05:00
|
|
|
! Copyright (C) 2008 Slava Pestov.
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2009-11-11 01:50:57 -05:00
|
|
|
USING: namespaces layouts sequences kernel math accessors
|
|
|
|
compiler.tree.propagation.info compiler.cfg.stacks
|
|
|
|
compiler.cfg.hats compiler.cfg.instructions
|
|
|
|
compiler.cfg.utilities ;
|
2008-12-06 10:16:29 -05:00
|
|
|
IN: compiler.cfg.intrinsics.misc
|
|
|
|
|
|
|
|
: emit-tag ( -- )
|
|
|
|
ds-pop tag-mask get ^^and-imm ^^tag-fixnum ds-push ;
|
|
|
|
|
2010-01-13 00:08:18 -05:00
|
|
|
: emit-special-object ( node -- )
|
|
|
|
"special-objects" ^^vm-field-ptr
|
2008-12-06 10:16:29 -05:00
|
|
|
swap node-input-infos first literal>>
|
2009-09-26 02:39:48 -04:00
|
|
|
[ ds-drop 0 ^^slot-imm ] [ ds-pop ^^offset>slot ^^slot ] if*
|
2008-12-06 10:16:29 -05:00
|
|
|
ds-push ;
|
2009-11-11 01:50:57 -05:00
|
|
|
|
|
|
|
: emit-identity-hashcode ( -- )
|
|
|
|
ds-pop tag-mask get bitnot ^^load-immediate ^^and 0 0 ^^slot-imm
|
|
|
|
hashcode-shift ^^shr-imm
|
|
|
|
^^tag-fixnum
|
|
|
|
ds-push ;
|