0 Replies Latest reply on Jun 12, 2009 7:18 AM by Paul Reilly

    [svn:fx-trunk] 7782: * Fixed some particularly tricky issues with the global swc cache.

    Paul Reilly Level 1

      Revision: 7782

      Author:   preilly@adobe.com

      Date:     2009-06-12 07:18:35 -0700 (Fri, 12 Jun 2009)

       

      Log Message:

      ***********

      • Fixed some particularly tricky issues with the global swc cache.

       

      tests Passed: checkintests

       

      Needs QA: NO, already cycloned.

       

      Needs DOC: NO

       

      Bug fixes: SDK-21460, SDK-21164

       

      API Change: NO

       

      Reviewer: Pete F., Peter D.

       

      Cycloner: Gaurav

       

      Code-level description of changes:

       

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

       

          Modified processInputs() to favor CompilerSwcContext sources over

          SourcePath sources when the CompilerSwcContext source is cached

          and the timestamps are the same.  This matches logic in

          CompilerAPI.findDefinition().

       

        compiler/src/java/flex2/compiler/Source.java

       

          Modified removeCompilationUnit() to only remove the type

          information for SwcScript based CompilationUnits, because these

          can't easily be recreated without recreating the Source.  Another

          alternative is to factor out the CompilationUnit creation from

          CompilerSwcContext.createSource() and modify AbcCompiler.parse1()

          to call it when the CompilationUnit is null.  This option seemed

          the easiest and should minimize object creation.

       

          Renamed copyMetaData() to copyCompilationUnit() and modified it to

          directly copy the dependencies before copying the dependency

          histories.  This is necessary, because SwcScript based

          CompilationUnit's get there dependencies from catalog.xml.

       

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

       

          Modified getSource() to populate def2source with all of the

          SwcScript's definitions, so that they can all share one Source and

          CompilationUnit.  Otherwise, we have separate

          Source/CompilationUnit pairs for all the definitions in the player

          which are defined in files with multiple definitions, like Object,

          Array, Clipboard, etc.

       

          Updated updateObsoletedSources() to reflect change to SwcScript.

       

          Removed cachedSources variable, modified getCachedScript() to have

          a QName parameter, and modified cachedSources() to no longer cache

          the result, since getCachedScript() uses def2script directly.

       

        compiler/src/java/flex2/compiler/CompilerAPI.java

       

          Modified validateCompilationUnits() to check for instances of

          MultiName when validating dependencies.  Dependencies are

          MultiNames when they are read in from a cache file.  Also added

          call to removeVectorTypes().

       

          Modified logReasonAndRemoveCompilationUnit() to use the

          topLevelDefinitions when cleaning up the SwcScript cached

          CompilationUnits.

       

          Added removeVectorTypes() to clean up all the Vector based types

          created in the previous compilation.  These types are created on

          the fly by ReferenceValue.bindToTypeParamSlot() and they don't fit

          into the Flex Compiler design, because there isn't a Source and/or

          CompilationUnit for them.  As a result, there is no way to

          invalidate them or swap them out when things like playerglobal.swc

          or airglobal.swc is swapped in or out of the library or external

          library path.  This is what was causing the following error:

       

            Implicit coercion of a value of type flash.display:GraphicsStroke to an unrelated type flash.display:IGraphicsData. Line.as flex4/flex4/src/spark/primitives line 264 Flex Problem

       

          The reason was Line was passing a playerglobal.swc based

          Vector.<flash.display.IGraphicsData> into a function that was

          expecting an airglobal.swc based

          Vector.<flash.display.IGraphicsData>.  Both Vector and

          flash.display.IGraphicsData had been properly swapped out, but the

          airglobal.swc based Vector.<flash.display.IGraphicsData> was

          spilling over from the airframework project compilation.

       

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

       

          Modified updateMaps() to reflect the SwcScript changes.

       

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

       

          Replaced the compilationUnits variable with compilationUnit now

          that all the SwcScript definitions share a single

          Source/CompilationUnit pair.  Updated the related accessors.

       

          Modified toString() to make it easier to see that SwcScript's can

          contain multiple definitions.

       

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

       

          Modified buildLibrary() to reflect the SwcScript changes.

       

        swfutils/src/java/flash/swf/tools/SyntaxTreeDumper.java

       

          Modified evaluate(Context cx, ParameterNode node) to also dump the

          init field.

       

        compiler/src/java/flex2/compiler/as3/binding/BindableSecondPassEvaluator.java

       

          Modified moveMetaDataToNewDefinition() to check that

          fromDefinition is not null before using it.  This should fix

          SDK-21164.

       

      Ticket Links:

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

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

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

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

       

      Modified Paths:

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

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/CompilerAPI.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/CompilerSwcContext.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/Source.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/binding/BindableSecondPassEva luator.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/Swc.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcGroup.java

          flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcScript.java

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

          flex/sdk/trunk/modules/swfutils/src/java/flash/swf/tools/SyntaxTreeDumper.java