On second thought this only will help with saving memory in this case if
there is more than one TranslationUnit  with the same source filename.

On Wed, Jan 6, 2010 at 12:00 AM, Henry Minsky <[email protected]>wrote:

> Oh I just realized I need to keep the srcFilename pointer around in each
> TranslationUnit, in case an error message comes back from the flex compiler
> which needs to print out the original source filename that it corresponds
> to.
>
>  I guess this would be a good place to store the filename as an interned
> string (using java's String.intern()).
>
> Similar to what Tucker was suggesting with compressing string references,
> are there any other places we could benefit from using interned strings in
> the compiler?
>
>
> On Tue, Jan 5, 2010 at 5:53 PM, Henry Minsky <[email protected]>wrote:
>
>> Change 20100105-hqm-n by [email protected] on 2010-01-05 17:30:43 EST
>>    in /Users/hqm/openlaszlo/trunk
>>    for http://svn.openlaszlo.org/openlaszlo/trunk
>>
>> Summary: improve memory usage of swf10 compiler
>>
>> New Features:
>>
>> Bugs Fixed:
>>
>> Technical Reviewer: ptw
>> QA Reviewer: max
>> Doc Reviewer: (pending)
>>
>> Documentation:
>>
>> Release Notes:
>>
>> Overview:
>>
>>
>> Details:
>>
>> SWF9Generator:
>>
>> + Iterate over the children of the top level node in the AST, running
>> the ParseTreePrinter over each child. This generates a list of
>> translation units for the child, and we iterate over this list,
>> writing the AS3 files, and then we reclaim as much memory as we can
>> from the translation units by nulling out their content pointers. (We
>> keep the TranslationUnit objects around because they contain the
>> classnames, which we need to build the flex compiler command line)
>>
>> Note that the "main" or "default" translation unit must be held and
>> emitted as the final action, because global definitions from all the
>> other translation units get poked into it.
>>
>> SWF9ParseTreePrinter: pass in a pointer to the 'default translation unit',
>> e.g.,
>> the place where all globals get put. This comes from the loop in
>> SWF9Generator.
>>
>>
>> ParseTreePrinter: needed to check when DirectiveBlocks are emitted,
>> because otherwise
>> you get empty ones which then confuse the flex compiler with empty "{..}"
>> statements.
>>
>> TranslationUnit: there was some fencepost error in computing the maximum
>> line number
>> when doing insertion of one translation unit stream into another. Not sure
>> why, but I
>> fudged it.
>>
>> + added a method to clear out all the content of a
>> TranslationUnit,except for it's classname.  Once a TU has been written
>> to it's file, we clear it's fields to reclaim memory.
>>
>>
>>
>>
>> Tests:
>>
>> ant runlzunit, tests run in all three runtimes
>> amazon in swf9,dhtml
>> calendar in swf9,dhtml
>> components sampler in swf9, dhtml, swf8
>>
>>
>> Files:
>> M       WEB-INF/bin/mxmlc
>> M       WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9Generator.java
>> M       WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9ParseTreePrinter.java
>> M       WEB-INF/lps/server/src/org/openlaszlo/sc/ParseTreePrinter.java
>> M       WEB-INF/lps/server/src/org/openlaszlo/sc/TranslationUnit.java
>> M       build.properties
>> M       build.xml
>>
>> Changeset:
>> http://svn.openlaszlo.org/openlaszlo/patches/20100105-hqm-n.tar
>>
>
>
>
> --
> Henry Minsky
> Software Architect
> [email protected]
>
>
>


-- 
Henry Minsky
Software Architect
[email protected]
_______________________________________________
Laszlo-reviews mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-reviews

Reply via email to