Opened 11 years ago
Last modified 11 years ago
#2456 accepted defect
Change the garbage collector
Reported by: | Martin Sjölund | Owned by: | Martin Sjölund |
---|---|---|---|
Priority: | normal | Milestone: | Future |
Component: | Code Generation | Version: | trunk |
Keywords: | Cc: | Adrian Pop, Adeel Asghar, Peter Aronsson |
Description
We need to change our data structures slightly in order to achieve a better performance and perhaps remove the need for boxptr-functions (marshalling, box/unbox).
(16:22:18) Martin Sjölund: I think in general the way we tag pointers is wrong
(16:22:32) Martin Sjölund: we should tag integers instead
(16:22:33) Adrian Pop: yes, probably tagging pointers is confusing the hell out of GC
(16:22:49) Adrian Pop: we could probably not tag anything anymore
(16:23:03) Martin Sjölund: maybe
(16:23:11) Adrian Pop: as that is needed only for the previous RML gc
(16:23:19) Adrian Pop: and have 32 bit integers
(16:23:49) Martin Sjölund: !!!
(16:23:55) Martin Sjölund: that would be great actually
(16:24:19) Martin Sjölund: would probably be a good performance boost, too
(16:24:23) Adrian Pop: the only problem i think it might be with debugging
(16:24:40) Martin Sjölund: only problem is knowing what is integer and what is not
(16:25:15) Martin Sjölund: or we box integers too
(16:28:56) Martin Sjölund: I mean... allocating data could be as simple as:
void*[2] = {header,double_word}; 64-bit
void*[3] = {header,double_word1,double_word2}; 32-bit
void*[2] = {header,word}; 32-bit, 64-bit
char*[2] = {headerbyte1,headerbyte2,headerbyte3,headerbyte4,char1,...,charn}; 32-bit, 64-bit
(16:30:28) Martin Sjölund: since GC is simplified, we need less bits for book-keeping too
(16:31:22) Martin Sjölund: could just be a bitset for int|double|enum|string|list|option|record = 3 bits to tag what data it is
(16:31:32) Adrian Pop: true
(16:32:21) Martin Sjölund: runtime could be quite simple with that
(16:32:47) Martin Sjölund: oh, I forgot array as type (of course)
(16:33:14) Martin Sjölund: but still 3 bits... and arrays could have 3 bits to say what is stored in it (same 8 types)
(16:33:51) Martin Sjölund: and same for lists
(16:34:09) Martin Sjölund: lists of unboxed data could be cool
(16:35:06) Martin Sjölund: and I guess 28-bit arrays still fine length
(16:37:03) Martin Sjölund: and uniontypes with only atomic members (many of them) could be allocated atomic too...
(16:37:10) Martin Sjölund: so many things that can be done...
(16:37:20) Adrian Pop: :)
(16:37:35) Martin Sjölund: do you think we should move in this direction?
(16:38:09) Martin Sjölund: before we rely too much on the eclipse debugger :D
(16:38:26) Adrian Pop: i think we should not do that yet
(16:38:38) Adrian Pop: wait until we move to the bootstrapped compiler
(16:38:46) Adrian Pop: and then we can do changes
Change History (1)
comment:1 by , 11 years ago
Owner: | changed from | to
---|---|
Priority: | high → normal |
Status: | new → accepted |