Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Bug 1035170 - Rewrite SWF parsing to a scan-first, parse tags on demand approach #1856

Merged
merged 1 commit into from Nov 17, 2014

Conversation

tschneidereit
Copy link
Contributor

No description provided.

@tschneidereit
Copy link
Contributor Author

Obviously still very much a work in progress

@tschneidereit
Copy link
Contributor Author

/botio reftest

@shumway-bot
Copy link
Contributor

From: Bot.io (Main)


Received

Command cmd_reftest from @tschneidereit received. Current queue size: 0

Live output at: http://areweflashyet.com:8081/1546ab7f7f7b8fd/output.txt

@shumway-bot
Copy link
Contributor

From: Bot.io (Main)


Failed

Full output at http://areweflashyet.com:8081/1546ab7f7f7b8fd/output.txt

Total script time: 5.19 mins

@tschneidereit
Copy link
Contributor Author

grunt reftest

@tschneidereit
Copy link
Contributor Author

/botio reftest

@shumway-bot
Copy link
Contributor

From: Bot.io (Main)


Received

Command cmd_reftest from @tschneidereit received. Current queue size: 0

Live output at: http://areweflashyet.com:8081/4e871ab0e5a569b/output.txt

@shumway-bot
Copy link
Contributor

From: Bot.io (Main)


Failed

Full output at http://areweflashyet.com:8081/4e871ab0e5a569b/output.txt

Total script time: 5.01 mins

@tschneidereit
Copy link
Contributor Author

/botio reftest

@shumway-bot
Copy link
Contributor

From: Bot.io (Main)


Received

Command cmd_reftest from @tschneidereit received. Current queue size: 0

Live output at: http://areweflashyet.com:8081/5078b264d0d5ccf/output.txt

@shumway-bot
Copy link
Contributor

From: Bot.io (Main)


Failed

Full 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;
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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.

@yurydelendik
Copy link
Contributor

Changes in the AVM1 library looks good

@tschneidereit
Copy link
Contributor Author

/botio reftest

@shumway-bot
Copy link
Contributor

From: Bot.io (Main)


Received

Command cmd_reftest from @tschneidereit received. Current queue size: 0

Live output at: http://areweflashyet.com:8081/603e49376ef38a8/output.txt

@shumway-bot
Copy link
Contributor

From: Bot.io (Main)


Failed

Full output at http://areweflashyet.com:8081/603e49376ef38a8/output.txt

Total script time: 5.65 mins

@tschneidereit
Copy link
Contributor Author

/botio reftest

@shumway-bot
Copy link
Contributor

From: Bot.io (Main)


Received

Command cmd_reftest from @tschneidereit received. Current queue size: 0

Live output at: http://areweflashyet.com:8081/8eb77ef48b7b276/output.txt

@shumway-bot
Copy link
Contributor

From: Bot.io (Main)


Failed

Full output at http://areweflashyet.com:8081/8eb77ef48b7b276/output.txt

Total script time: 5.66 mins

@tschneidereit
Copy link
Contributor Author

/botio reftest

@shumway-bot
Copy link
Contributor

From: Bot.io (Main)


Received

Command cmd_reftest from @tschneidereit received. Current queue size: 0

Live output at: http://areweflashyet.com:8081/f0efa10d5a08021/output.txt

@shumway-bot
Copy link
Contributor

From: Bot.io (Main)


Failed

Full output at http://areweflashyet.com:8081/f0efa10d5a08021/output.txt

Total script time: 5.71 mins

@tschneidereit
Copy link
Contributor Author

/botio reftest

@shumway-bot
Copy link
Contributor

From: Bot.io (Main)


Received

Command cmd_reftest from @tschneidereit received. Current queue size: 0

Live output at: http://areweflashyet.com:8081/e4233913650237b/output.txt

@shumway-bot
Copy link
Contributor

From: Bot.io (Main)


Failed

Full output at http://areweflashyet.com:8081/e4233913650237b/output.txt

Total script time: 5.64 mins

@tschneidereit
Copy link
Contributor Author

/botio test

@shumway-bot
Copy link
Contributor

From: Bot.io (Main)


Received

Command cmd_test from @tschneidereit received. Current queue size: 0

Live output at: http://areweflashyet.com:8081/cfb4605c1e590ad/output.txt

@shumway-bot
Copy link
Contributor

From: Bot.io (Main)


Failed

Full output at http://areweflashyet.com:8081/cfb4605c1e590ad/output.txt

Total script time: 8.92 mins

@tschneidereit
Copy link
Contributor Author

/botio reftest

@shumway-bot
Copy link
Contributor

From: Bot.io (Main)


Received

Command cmd_reftest from @tschneidereit received. Current queue size: 0

Live output at: http://areweflashyet.com:8081/56c7aab621eca65/output.txt

@shumway-bot
Copy link
Contributor

From: Bot.io (Main)


Failed

Full 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
@tschneidereit
Copy link
Contributor Author

/botio reftest

@shumway-bot
Copy link
Contributor

From: Bot.io (Main)


Received

Command cmd_reftest from @tschneidereit received. Current queue size: 0

Live output at: http://areweflashyet.com:8081/8f1c2384518725d/output.txt

@shumway-bot
Copy link
Contributor

From: Bot.io (Main)


Failed

Full output at http://areweflashyet.com:8081/8f1c2384518725d/output.txt

Total script time: 5.71 mins

tschneidereit added a commit that referenced this pull request Nov 17, 2014
Bug 1035170 - Rewrite SWF parsing to a scan-first, parse tags on demand approach
@tschneidereit tschneidereit merged commit 0cdc3d9 into mozilla:master Nov 17, 2014
@tschneidereit tschneidereit deleted the parser branch April 24, 2015 11:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants