Bug 1035170 - Rewrite SWF parsing to a scan-first, parse tags on demand approach #1856
Conversation
Obviously still very much a work in progress |
/botio reftest |
From: Bot.io (Main)ReceivedCommand cmd_reftest from @tschneidereit received. Current queue size: 0 Live output at: http://areweflashyet.com:8081/1546ab7f7f7b8fd/output.txt |
From: Bot.io (Main)FailedFull output at http://areweflashyet.com:8081/1546ab7f7f7b8fd/output.txt Total script time: 5.19 mins
|
218174f
to
55e56e9
Compare
grunt reftest |
/botio reftest |
From: Bot.io (Main)ReceivedCommand cmd_reftest from @tschneidereit received. Current queue size: 0 Live output at: http://areweflashyet.com:8081/4e871ab0e5a569b/output.txt |
From: Bot.io (Main)FailedFull output at http://areweflashyet.com:8081/4e871ab0e5a569b/output.txt Total script time: 5.01 mins
|
8dc6187
to
0665fd2
Compare
/botio reftest |
From: Bot.io (Main)ReceivedCommand cmd_reftest from @tschneidereit received. Current queue size: 0 Live output at: http://areweflashyet.com:8081/5078b264d0d5ccf/output.txt |
From: Bot.io (Main)FailedFull output at http://areweflashyet.com:8081/5078b264d0d5ccf/output.txt Total script time: 5.71 mins
|
@@ -16,7 +16,7 @@ | |||
|
|||
///<reference path='references.ts' /> | |||
var jsGlobal = (function() { return this || (1, eval)('this'); })(); | |||
var inBrowser = typeof console != "undefined"; | |||
var inBrowser = 'plugins' in window.document; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
window
is undefined in the shell, i think this breaks shell testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we polyfilled that. I tried window but that didn't work. I'll make this more robust by checking for window
first, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we shall know if we are in browser. Can we polyfill shell with all needed stuff?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed almost all usages of inBrowser
now. For the remaining two, I'm unsure about how to fix them.
Changes in the AVM1 library looks good |
/botio reftest |
From: Bot.io (Main)ReceivedCommand cmd_reftest from @tschneidereit received. Current queue size: 0 Live output at: http://areweflashyet.com:8081/603e49376ef38a8/output.txt |
From: Bot.io (Main)FailedFull output at http://areweflashyet.com:8081/603e49376ef38a8/output.txt Total script time: 5.65 mins
|
/botio reftest |
From: Bot.io (Main)ReceivedCommand cmd_reftest from @tschneidereit received. Current queue size: 0 Live output at: http://areweflashyet.com:8081/8eb77ef48b7b276/output.txt |
From: Bot.io (Main)FailedFull output at http://areweflashyet.com:8081/8eb77ef48b7b276/output.txt Total script time: 5.66 mins
|
ecbb822
to
b425500
Compare
/botio reftest |
From: Bot.io (Main)ReceivedCommand cmd_reftest from @tschneidereit received. Current queue size: 0 Live output at: http://areweflashyet.com:8081/f0efa10d5a08021/output.txt |
From: Bot.io (Main)FailedFull output at http://areweflashyet.com:8081/f0efa10d5a08021/output.txt Total script time: 5.71 mins
|
/botio reftest |
From: Bot.io (Main)ReceivedCommand cmd_reftest from @tschneidereit received. Current queue size: 0 Live output at: http://areweflashyet.com:8081/e4233913650237b/output.txt |
From: Bot.io (Main)FailedFull output at http://areweflashyet.com:8081/e4233913650237b/output.txt Total script time: 5.64 mins
|
/botio test |
From: Bot.io (Main)ReceivedCommand cmd_test from @tschneidereit received. Current queue size: 0 Live output at: http://areweflashyet.com:8081/cfb4605c1e590ad/output.txt |
From: Bot.io (Main)FailedFull output at http://areweflashyet.com:8081/cfb4605c1e590ad/output.txt Total script time: 8.92 mins
|
ec7bf90
to
e6674d9
Compare
/botio reftest |
From: Bot.io (Main)ReceivedCommand cmd_reftest from @tschneidereit received. Current queue size: 0 Live output at: http://areweflashyet.com:8081/56c7aab621eca65/output.txt |
From: Bot.io (Main)FailedFull output at http://areweflashyet.com:8081/56c7aab621eca65/output.txt Total script time: 5.62 mins
|
This is a monster-patch as it's the result of squashing together 81 individual patches. It contains a full refactoring of how SWF files are parsed and the results managed. In the new system, SWFs aren't deeply parsed and all symbols and other tags extracted. Instead, they're scanned through, detecting all symbols, frames, and code blocks. The player is notified of these tags, but they're only deeply parsed upon first usage. Even then, the `SWFFile` class that represents the loaded SWF doesn't hold on to the parsed tag. It is up to the playback system to decide whether that's required or not. For now, it does happen in most cases, but we might decide to hold most parsing results temporarily only. In the following, I tried to include the important commit messages for the original patches squashed down into this one. The original patches themselves are available in [a branch](https://github.com/tschneidereit/shumway/tree/parser-unsquashed) in @tschneidereit's fork. Bug fix in SoundStreamHead: StreamSoundSampleCount field is a UI16, not UI32 Disable usage of DOM Workers in fakeSyncWorker.ts for now This creates lots and lots of IO events, overwhelming browsers in some cases. Also, it most certainly imposes substantial overhead. Move initialization of loaded frames from Loader into MovieClip Null out the SWFFile's decompressor after loading is completed, to free its memory. Don't treat BMPs as eagerly-decoded images Increases height of profiler output panel to accomodate parser timeline Remove some somewhatImplemented warnings These got in the way of trace tests after some changes to how logging of warnings works. Add timeouts to the GNU parallel command. (Original patch by @mbebenita) Add simple DOM stubs for Image, URL and Blob to the shell testing harness. (Original patch by @mbebenita) Adds profiling option -o to the shell driver. This let's you dumps out timeline events to stdout when verbose mode is also on. (Original patch by @mbebenita) Optimize DataBuffer access by providing methods for writing multiple values at the same time. Also, lazify the way views are allocated since not all views are always needed. (Original patch by @mbebenita) Switches AVM1Utils.addEventListenerProxy to a native implementation Optimize parsing of AVM1 ClipEvents And moved their application to avm1lib. Before, it was partly in FrameDelta#_initialize, partly in the late Sprite#_initAVM1Bindings. This also fixes the mapping of some of the ClipEvents to equivalent AVM2 events. Some aren't trivially mapped, so more work has to be done there. Those will show a warning at least when they're used. Add new test for mouse events on nested AVM1 objects and reactivate some existing tests The existing tests where disabled before the nat branch merge and then forgotten about. Give PromiseWrapper a `then` method Delay committing Loader updates until the right point in the event loop Support initialization from Uint8Array in source instead of special-casing BinarySymbol in ByteArray initializer Change how resolved symbols get stored on ASClasses Instead of having the Symbol ctor do that, the symbolResolver now does it. Not only is that cleaner, it's also required to make embedded images work: for those, the symbol is associated with a subclass of `Bitmap`, but we create a `BitmapSymbol` for the actual data. This was then stored on `flash.display.BitmapData`. Not ideal. Fix a few assert guards to let the assert execute in non-release mode instead of release mode Don't take 3 screenshots of an unchanging reftest Add parser tracing output for eagerly parsed images and fonts
e6674d9
to
4b42e06
Compare
/botio reftest |
From: Bot.io (Main)ReceivedCommand cmd_reftest from @tschneidereit received. Current queue size: 0 Live output at: http://areweflashyet.com:8081/8f1c2384518725d/output.txt |
From: Bot.io (Main)FailedFull output at http://areweflashyet.com:8081/8f1c2384518725d/output.txt Total script time: 5.71 mins
|
Bug 1035170 - Rewrite SWF parsing to a scan-first, parse tags on demand approach
No description provided.