This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

tree-serialize-branch created


I've created the tree-serialize branch, which contains code to
(surprise!) serialize trees. Or will, as soon as anoncvs's lock goes away.

This makes it pretty trivial to do PCH (it's a matter of knowing which
trees to serialize, and saving the asm output).
It would also allow us to not deal with deferring functions at all.
We could just reload the trees at will, if we decide we want to inline
something.
Heck, we could keep all the trees for a given compilation, and get
cross-file inlining and whatnot.


Currently, it requires either GDBM or SDBM (or anything DBM
compatible. You can use sleepycat's db3, you just need a few extra
defines. However, i don't have configure searching for it).
GDBM is going to be pretty slow, since i'm currently using the DBM
interface, and GDBM syncs on each write in this mode.

Serialization is based on modified versions of the various marking
functions.
The stored format is simply a memcpy of the structure, with the
pointers replaced.
As one would expect, we abuse the marking functions of the collector
to know when we've serialized a tree before.

Unpickling works, except for the language specific parts, which i
haven't quite finished yet, but should have done by the end of the
day.

However, before I started on the lang specific portions, i could
write and then read a tree, and we'd properly end up with the exact
same tree, with the addresses changed.

In other words, it's coming along quite nicely, but it's a work in
progress.
Anyone should feel free to jump in and help, just post patches before
committing them.

A last note: The size of the database is large, because our trees are
large.
There are a couple ways to deal with this:
1. At the expense of speed of pickling, pickle each field, rather than
   memcpy + replacing pointers. Thus, null's would take up one or two
   bytes, rather than 4 or 8.
2. Modify GDBM or SDBM to use gzip'd pages.

The pickled trees compresses very well. Even basic huffman reduces it
by 70-80%. This is because most of the pointers are NULL.

I don't care enough about this issue yet to do something about it.
--Dan

-- 
"In my house there's this light switch that doesn't do anything.
Every so often I would flick it on and off just to check.
Yesterday, I got a call from a woman in Germany.  She said, "Cut
it out."
"-Steven Wright


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]