factor/basis/compiler/constants/constants.factor

26 lines
1.2 KiB
Factor
Raw Normal View History

2008-01-02 19:36:36 -05:00
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: math kernel layouts system ;
IN: compiler.constants
! These constants must match vm/memory.h
2008-05-09 19:48:48 -04:00
: card-bits 8 ;
: deck-bits 18 ;
2008-06-08 16:32:55 -04:00
: card-mark ( -- n ) HEX: 40 HEX: 80 bitor ;
2008-01-02 19:36:36 -05:00
! These constants must match vm/layouts.h
2008-06-08 16:32:55 -04:00
: header-offset ( -- n ) object tag-number neg ;
: float-offset ( -- n ) 8 float tag-number - ;
: string-offset ( -- n ) 4 bootstrap-cells object tag-number - ;
: profile-count-offset ( -- n ) 7 bootstrap-cells object tag-number - ;
: byte-array-offset ( -- n ) 2 bootstrap-cells object tag-number - ;
: alien-offset ( -- n ) 3 bootstrap-cells object tag-number - ;
: underlying-alien-offset ( -- n ) bootstrap-cell object tag-number - ;
: tuple-class-offset ( -- n ) bootstrap-cell tuple tag-number - ;
: class-hash-offset ( -- n ) bootstrap-cell object tag-number - ;
: word-xt-offset ( -- n ) 9 bootstrap-cells object tag-number - ;
2008-06-08 16:32:55 -04:00
: quot-xt-offset ( -- n ) 3 bootstrap-cells object tag-number - ;
: word-code-offset ( -- n ) 10 bootstrap-cells object tag-number - ;
2008-06-08 16:32:55 -04:00
: array-start-offset ( -- n ) 2 bootstrap-cells object tag-number - ;
: compiled-header-size ( -- n ) 4 bootstrap-cells ;