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:




          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





          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.




          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.




          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



          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.




          Modified updateMaps() to reflect the SwcScript changes.




          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.




          Modified buildLibrary() to reflect the SwcScript changes.




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

          init field.




          Modified moveMetaDataToNewDefinition() to check that

          fromDefinition is not null before using it.  This should fix



      Ticket Links:






      Modified Paths:





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