964a2cf5be22246c407d73ce990824e9a079d7fa
[ghc-hetmet.git] / ghc / docs / NOTES.arbitary-ints
1
2 Boxed structure of BigInts
3
4
5 ---->   Info1   Pointer
6                 |               Pointer passed to BigNum package
7                 |               |
8                 \/              \/
9                 Info2   Size    Integer ....
10
11                         (size excludes info ptr & size field)
12
13 Unboxed (Compiler must place on pointer stack not data stack
14          Must also tell GC if it is in a register when GC invoked)
15
16 ---->   Info2   Size    Integer
17
18
19
20 Info1:
21         SPEC_INFO_TABLE(Info1, BigNum_entry, 1, 1);     (Min Size 2 ?)
22
23         Entering this returns the BigNum using agreed return convention
24
25 Info2:
26         DATA_INFO_TABLE(Info2, Dummy_entry);
27
28         This never actually entered -- just required for GC.
29
30 ------------------------------------------------------------------------------
31
32 Boxed structure of BigInts (the alternative one)
33
34                         Pointer passed to BigNum package
35                         |
36                         \/
37 ---->   Info    Size    Integer ....
38
39                 (size excludes info ptr & size field)
40
41 Unboxed (Compiler must place on pointer stack not data stack
42          Must also tell GC if it is in a register when GC invoked)
43
44
45 Info:
46         DATA_INFO_TABLE(Info, BigNum_entry);
47
48         Entering this returns the BigNum using agreed return convention
49
50
51
52 Note that the Boxed and Unboxed representation are identical !!!
53
54 (unboxing represents evaluationhood, not pointerhood)