[Newcompiler] Properties for AST
Marcus Denker
denker at iam.unibe.ch
Sat Apr 7 07:57:24 UTC 2007
Hello,
Yesterday I merged some work done earlier into the current version of
the AST package.
The problem with the RB AST ist size: Just using the AST and
NewCompiler as is, the AST
is quite huge. An image that keeps the complete AST of all methods is
ca. 800MB in size.
The reason for that is that far too much information is retained: the
AST holds on the original text,
all the scanner tokens, the Intermediate representation, information
from semantic analysis... and
all this information is saved in instance variables of the Node
objects, which in turn are nil most
of the time. (once you have 1.5 Million objects of something, an
instance variable that is nil
does indeed cost memory ;-))
Over the next weeks/months I will slowly work on making the
representation far more compact.
As a first step, there is now a property interface on RBProgramNode.
This allows to reduce the amount
of instance variables: The idea is to have the AST encode just what
realy is the AST directly (including
names of variables), keeping all the transient data (e.g. semantic
analysis data of the compiler) or
meta-data (formatting, comments) as properties.
The next step will be to get rid of the Scanner Tokens.
Marcus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3947 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/newcompiler/attachments/20070407/308073e9/smime.bin
More information about the Newcompiler
mailing list