]> gitweb.factorcode.org Git - factor.git/blob - extra/tools/image-analyzer/vm/vm.factor
b871130649aad02f477378a05047fe43f99489e4
[factor.git] / extra / tools / image-analyzer / vm / vm.factor
1 USING: alien.c-types assocs classes.struct kernel kernel.private vm ;
2 IN: tools.image-analyzer.vm
3
4 ! These structs and words correspond to vm/image.hpp
5 STRUCT: image-header
6     { magic cell_t }
7     { version cell_t }
8     { data-relocation-base cell_t }
9     { data-size cell_t }
10     { code-relocation-base cell_t }
11     { code-size cell_t }
12     { reserved-1 cell_t }
13     { reserved-2 cell_t }
14     { reserved-3 cell_t }
15     { reserved-4 cell_t }
16     { special-objects cell_t[special-object-count] } ;
17
18 ! These structs and words correspond to vm/layouts.hpp
19 STRUCT: object
20     { header cell_t } ;
21
22 STRUCT: alien
23     { header cell_t }
24     { base cell_t }
25     { expired cell_t }
26     { displacement cell_t }
27     { address cell_t } ;
28
29 STRUCT: array
30     { header cell_t }
31     { capacity cell_t } ;
32
33 STRUCT: bignum
34     { header cell_t }
35     { capacity cell_t } ;
36
37
38 STRUCT: callstack
39     { header cell_t }
40     { length cell_t } ;
41
42 STRUCT: dll
43     { header cell_t }
44     { path cell_t }
45     { handle void* } ;
46
47 STRUCT: quotation
48     { header cell_t }
49     { array cell_t }
50     { cached_effect cell_t }
51     { cache_counter cell_t }
52     { entry_point cell_t } ;
53
54 STRUCT: string
55     { header cell_t }
56     { length cell_t }
57     { aux cell_t }
58     { hashcode cell_t } ;
59
60 STRUCT: tuple
61     { header cell_t }
62     { layout cell_t } ;
63
64 STRUCT: tuple-layout
65     { header cell_t }
66     { capacity cell_t }
67     { klass cell_t }
68     { size cell_t }
69     { echelon cell_t } ;
70
71 STRUCT: word
72     { header cell_t }
73     { hashcode cell_t }
74     { name cell_t }
75     { vocabulary cell_t }
76     { def cell_t }
77     { props cell_t }
78     { pic_def cell_t }
79     { pic_tail_def cell_t }
80     { subprimitive cell_t }
81     { entry_point cell_t } ;
82
83 STRUCT: wrapper
84     { header cell_t }
85     { object cell_t } ;
86
87 ! These structs and words correspond to vm/code_blocks.hpp
88 STRUCT: code-block
89     { header cell_t }
90     { owner cell_t }
91     { parameters cell_t }
92     { relocation cell_t } ;
93
94 TUPLE: heap-node address object payload ;
95
96 TUPLE: code-heap-node < heap-node free? gc-maps ;