compilers

Par Winzell zell at threerings.net
Wed Jun 11 15:29:51 PDT 2008


On 6/10/08 3:29 PM, Paul Reilly wrote:
> Alternatively, you could leave mxmlc as is and then use a modified
> swfdump, see flash.swf.tools.SwfxPrinter, to extract the abc blocks.
> The modification would just be to change doABC() to write the bytes to
> a file, kinda like -external does for defineBits().  This would allow
> the global optimizer to run and if desired the abc blocks would be
> merged.

Thank you! This is what I ended up doing. It was very simple to keep 
track of the bytecode as SwfxPrinter encountered them and then do a 
single Optimizer.optimize() merge on them at the end, before writing to 
file.

One remaining hiccup is that tamarin-central/core/String.as begins with 
this:

   AS3 native static function fromCharCode(... arguments):String
   String.fromCharCode = function(... arguments) {
     return AS3::fromCharCode.apply(String,arguments)
   }

and Compc just simply doesn't like that. It protests that assigning the 
function to String.fromCharCode is illegal.

I replaced the entire thing with just:

   public native static function fromCharCode(... arguments):String

which seems to work just fine, but to be honest I am not sure exactly 
what the original indirection code is meant to accomplish, so I can't 
tell what kind of devious damage I'm doing. :)

Vector.as also does not compile, but we don't use that.

Anyway, I'll surely bug you all again, but for now everything looks 
peachy. Thanks again!

Zell



More information about the Tamarin-devel mailing list