Currently, the native-thunk generation code is written in Java and closely tied to the ASC/GlobalOptimizer codebase; this is inconvenient because updating the code requires tricky synchronization of submissions between Tamarin and ASC, in two completely different code control systems. There are several improvements from Tamarin-Tracing that we'd like to move to Tamarin-Redux/Tamarin-Central (eg direct access to native slots) that will require altering the native-thunk-gen code, so to make this easier, we should rewrite the thunk generation code in a form we can keep inside Tamarin/utils.
Created attachment 343127 [details] [diff] [review] patch Patch is vs. tamarin-redux. Basically a straightforward port of the existing code into Python. (Probably not the prettiest Python code in the world; critiques welcome...) Generated files are in a slightly different order (due to vagaries of hashmaps between java vs python) but should be otherwise equivalent, with two minor exceptions: -- private classname ids are now normalized to "private_" rather than having a weird prefix based on filename (see MethodClosure for an example) -- native-script ids now include the package as a prefix rather than just the method name. AVMTHUNK_VERSION was changed from 1 to 2 to allow for clients to check for these changes. updated builtin.py and shell_toplevel.py to call nativegen.py instead of asc.jar for the thunk-generation phase.
Attachment #343127 - Flags: review?(lhansen)
Comment on attachment 343127 [details] [diff] [review] patch I'm taking this mostly on faith, though I did look... (One wonders how many ABC parsers the world needs, really. This is at least the fourth I see. Presumably the answer is "at least one per language.")
Attachment #343127 - Flags: review?(lhansen) → review+
Re: how many parsers, sadly, yes... hopefuly someday we'll achieve Universal Interoperability. I considered writing it in AS3 but decided that having such a critical tool rely on itself for bootstrapping wasn't the direction to go at this point. As it it, the parser is basically lifted from abcdump.as -- it could probably be generalized and split into a standalone Python utility if that proves useful in the future, but didn't take the time to do that at this point.
pushed to redux as changeset: 1005:56691cf41db3
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Patch from yesterday had a few glitches, reopening
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Created attachment 343485 [details] [diff] [review] patch #2 utils/nativegen.py: Testing the new native-thunk generator in Flash revealed a few bugs that slipped into the first release: -- metadata was being parsed incorrectly and if there was any present the script would fail. -- ditto for AS3 interfaces. -- native methods with default values of type boolean were always getting "true" as the default value even if "false" was specified -- fixed minor incompatibility with how methods in custom namespaces were generated -- added a few to_cname() calls that were missing -- rewrote output to use a file object (rather than concatenating to a string and then dumping to a file) to greatly speed up generation.
are there any tests or classes we can add to the shell to cover these situations, to lessen our dependency on testing within the player?
yeah, good point. I'll leave this bug open until I can add such testcases.
Edwin, any chance you can review+ this for me since I think Lars is probably gone for the day? (I'll add the extra tests before pushing) If not, no worries, I'll get to it Monday
pushed to redux as changeset: 1006:0cb478f22f63
Status: REOPENED → RESOLVED
Last Resolved: 10 years ago → 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.