[Anthy-dev 2532] Re: ScmObjInternalのCompacting

Back to archive index

YamaKen yamak****@bp*****
2005年 10月 14日 (金) 08:38:02 JST


At Fri, 14 Oct 2005 07:51:04 +0900,
yamak****@bp***** wrote:
> 上記の事情を踏まえて以下のようなフォーマットはどうでしょう。
> 
>       S        Type
> 0000000|00G : #f      (S = 0)
> .......|00G : Cons
> ------------------------------
> 0000000|01G : ()      (S = 0)
> .......|01G : Closure
> ------------------------------
> 0000000|10G : Unbound (S = 0)
> .......|10G : Others
> ------------------------------
> ......0|11G : Integer (imm)
> ------------------------------
> ......1|11G : Char    (imm)
> ------------------------------
> 
> S->Y of Others
>    O           Type                 content of O
> ........|001 : Symbol             : vcell
> ........|011 : String             : string length
> ........|101 : Vector             : vector length
> .....|000111 : Values             : unused, all 0 (for efficiency)
> .....|001111 : Func               : ScmFuncTypeCode
> .....|010111 : Port               : ScmPortDirection
> .....|011111 : Continuation       : unused, all 0
> .....|100111 : C Pointer          : pointer type (0 = void *, 1 = ScmFuncType)
> .....|101111 : Reserved
> .....|110111 : Special Constant   : constant ID
>                                     1 : #t
>                                     2 : EOF
>                                     3 : Undef
> .....|111111 : FreeCell           : unused, all 1 (for efficiency)

stringとvectorのlengthが通常のintegerより無駄にbit幅が広かったの
で改訂。ついでにFreeCellとSpecial Constantをひとまとめに。

S->Y of Others
   O           Type                 content of O
........|001 : Symbol             : vcell
.......|0011 : String             : string length
.......|1011 : Vector             : vector length
......|00101 : Values             : unused, all 0 (for efficiency)
......|00111 : Func               : ScmFuncTypeCode
......|01101 : Port               : ScmPortDirection
......|01111 : Continuation       : unused, all 0
......|10101 : C Pointer          : pointer type (0 = void *, 1 = ScmFuncType)
......|10111 : Reserved
......|11101 : Reserved
......|11111 : Special Constant   : constant ID
                                    1 : #t
                                    2 : EOF
                                    3 : Undef
111111|11111 : FreeCell           : all 1

-------------------------------
ヤマケン yamak****@bp*****



Anthy-dev メーリングリストの案内
Back to archive index