0 Replies Latest reply on Feb 5, 2010 10:42 AM by Paul Reilly

    [svn:sb-sherlock] 14005: * Global SWC cache memory reduction.

    Paul Reilly Level 1

      Revision: 14005

      Revision: 14005

      Author:   preilly@adobe.com

      Date:     2010-02-05 10:42:05 -0800 (Fri, 05 Feb 2010)

      Log Message:

      ***********

      • Global SWC cache memory reduction.

       

      QE notes:

      Doc notes:

      Bugs: SHERLOCK-3 (SDK-24472)

      Reviewer: tharwood

      Tests run: checkintests, performance testsuite

      Is noteworthy for integration: yes, reduces global swc cache memory use

      Code-level description of changes:

       

        modules/compiler/src/java/flex2/tools/oem/Library.java

       

          Added tracing to SwcException catch blocks.

       

          Changed from using SwcDynamicArchive to SwcLazyReadArchive when

          compiling libraries, so that downstream compilations only pull

          into memory those things which are actually used.

       

        modules/compiler/src/java/flex2/compiler/media/MovieTranscoder.java

       

          Modified doTranscode() and it's helpers to only call

          getInputStream() if we need to read from it.

       

          Modified getDictionary() and getSwfSize() to close the Source

          after we are done decoding the SWF. This cause the cached bytes to

          be nulled out.

       

        modules/compiler/src/java/flex2/compiler/CompilerSwcContext.java

       

          Removed dead code.

       

          Modified createSource() to use new SwcScript.getABC() method.

       

        modules/compiler/src/java/flex2/compiler/swc/SwcLazyReadArchive.java

       

          Removed zipFile field and close().

       

          Modified load() use a local zipFile variable.

       

        modules/compiler/src/java/flex2/compiler/swc/SwcDynamicArchive.java

       

          Modified save() to null out "files".

       

          Modified getFiles() and getFile() to load on demand.

       

        modules/compiler/src/java/flex2/compiler/swc/SwcGroup.java

       

          Modified updateMaps() to skip an expensive assert that required

          decoding library.swf.

       

        modules/compiler/src/java/flex2/compiler/swc/SwcScript.java

       

          Replaced "DoABC doABC" field and "byte[] abc" field and updated

          accessors.

       

          Modified getLibrary() to no longer force a parse.

       

          Modified setCompilationUnit() to initialize "abc" if it hasn't

          been initialized yet.

       

        modules/compiler/src/java/flex2/compiler/swc/SwcLibrary.java

       

          Modified getSymbol() to check for null. If we are just using a

          cached SWC from an upstream compilation, def2symbol will be null,

          because it's only filled in if we do a SWF decode. For Flex based

          SWF's, def2symbol is always empty.

       

          Modified parse() to close library.swf after we finish decoding it,

          so the bytes can be nulled out.

       

        modules/compiler/src/java/flex2/compiler/swc/SwcAPI.java

       

          Modified exportSwc() to trace the exception before the rethrow.

          Otherwise, the trace is skipped.

       

        modules/compiler/src/java/flex2/compiler/swc/Swc.java

       

          Removed the catalogFiles field, because it's just a copy of what's

          in the archive.

       

          Modified read() to close catalog.xml after it's been parsed, so

          it's bytes can be nulled.

       

        modules/compiler/src/java/flex2/compiler/io/InMemoryFile.java

       

          Folded init() into the constructor, because it's only called from

          the constructor.

       

          Modified close() to null out the bytes.

       

        modules/compiler/src/java/flex2/compiler/io/VirtualZipFile.java

       

          Modified close() to null out the bytes instead of closing the

          zipFile.

       

          Refactored getInputStream() by moving the duplicate code out into

          readBytes().

       

          Removed the private, one line method, getEntry(), because it

          seemed silly.

       

      Ticket Links:

      ***********

          http://bugs.adobe.com/jira/browse/SHERLOCK-3

          http://bugs.adobe.com/jira/browse/SDK-24472

       

      Modified Paths:

      **************

          flex/sdk/sandbox/sherlock/modules/compiler/src/java/flex2/compiler/CompilerSwcContext.jav a

          flex/sdk/sandbox/sherlock/modules/compiler/src/java/flex2/compiler/io/InMemoryFile.java

          flex/sdk/sandbox/sherlock/modules/compiler/src/java/flex2/compiler/io/VirtualZipFile.java

          flex/sdk/sandbox/sherlock/modules/compiler/src/java/flex2/compiler/media/MovieTranscoder. java

          flex/sdk/sandbox/sherlock/modules/compiler/src/java/flex2/compiler/swc/Swc.java

          flex/sdk/sandbox/sherlock/modules/compiler/src/java/flex2/compiler/swc/SwcAPI.java

          flex/sdk/sandbox/sherlock/modules/compiler/src/java/flex2/compiler/swc/SwcCache.java

          flex/sdk/sandbox/sherlock/modules/compiler/src/java/flex2/compiler/swc/SwcDynamicArchive. java

          flex/sdk/sandbox/sherlock/modules/compiler/src/java/flex2/compiler/swc/SwcGroup.java

          flex/sdk/sandbox/sherlock/modules/compiler/src/java/flex2/compiler/swc/SwcLazyReadArchive .java

          flex/sdk/sandbox/sherlock/modules/compiler/src/java/flex2/compiler/swc/SwcLibrary.java

          flex/sdk/sandbox/sherlock/modules/compiler/src/java/flex2/compiler/swc/SwcScript.java

          flex/sdk/sandbox/sherlock/modules/compiler/src/java/flex2/tools/oem/Library.java