Closed Bug 450126 Opened 17 years ago Closed 17 years ago

Update Tamarin-Central to not require MIR for native method thunks

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: stejohns, Assigned: stejohns)

Details

Attachments

(3 files)

Currently, Tamarin-Central can't disable MIR entirely, even for interpreter-only mode, because it uses MIR to generate thunks for native methods. This is undesirable as some target platforms can't implement MIR due to executable-code restrictions.
Attached patch PatchSplinter Review
Enclosed patch revises Tamarin-Central to allow statically-generated (C++) thunks for native methods. This allows you to disable AVMPLUS_MIR and run in interp-only mode (though AVMPLUS_MIR is still defined by default). (There was a lot of churn in Verifier as a result of this.) Syntax for existing native methods is unchanged (you won't have to change your source), with one exception: NATIVE_METHODV is now gone. (It's been marked as deprecated for a long while and can still be simulated easily via rest args, which are still supported). Also note that some of the weirdly redudant NATIVE_METHOD2 stuff was simplified and removed; AFAIK this only made a difference on Metrowerks (no longer supported anyway) and SunPro (which I have no way to test -- if someone from Sun could test this patch I'd appreciate it). There is a bit of code bloat because the statically-generated code uses vanilla C++ pointer-to-member functions, and GCC seems to generate more code than I would have thought (avmshell is ~80k larger in Release builds on GCC4). There's definitely room for improvement here, but the initial version was intended to get something working reliably on all platforms. (Performance doesn't seem to be affected on the typical benchmarks, though tight loops of native calls might be.) Please note, you'll need to update asc.jar to revision 2802 or later ( see http://opensource.adobe.com/svn/opensource/flex/sdk/trunk/modules/asc ) to take advantage of this (though the code will still work with older versions of asc.jar if you edit builtin.py and toplevel.py to omit the calls to AbcThunkGen). Also brought over the C99 int types emulation for MSVC from Tamarin-Tracing, so we should probably start migrating new TC code to using those in preference to the older avmplus-specific int types.
Assignee: nobody → stejohns
Status: NEW → ASSIGNED
Attachment #333254 - Flags: review?(edwsmith)
Attachment #333254 - Flags: review?(edwsmith) → review+
pushed as changeset: 605:0292474bdc00
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Doh -- the thunking code that the revised asc.jar is generating isn't 64-bit happy. Sorry about that. I'll get a fix in place tomorrow.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached patch Patch #2Splinter Review
Previous revision to native-thunk-generation wasn't 64-bit safe. AbcThunkGen (in asc.jar) was revised to output thunks that should now work for 64-bit builds ( note, you need rev 2826 or later of asc.jar, please visit http://opensource.adobe.com/svn/opensource/flex/sdk/trunk/modules/asc for source ). While I was at it I resurrected the 64-bit XCode build for Mac; we now (mostly) run properly in non-MIR mode on 64-bit Mac. As a result, fixed a few minor 32/64 related warnings.
Attachment #333452 - Flags: review?(edwsmith)
Attachment #333452 - Flags: review?(edwsmith) → review?(wsharp)
Attachment #333452 - Flags: review?(wsharp) → review+
pushed as changeset: 609:90c210c96157
Status: REOPENED → RESOLVED
Closed: 17 years ago17 years ago
Resolution: --- → FIXED
Reopening yet again -- failing on Win64 builds. My bad: I didn't test there because I don't currently have such a machine set up. I'll get one set up and try to get a fix out within a day or two.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached patch Patch #3Splinter Review
Further correction to pre-generated native thunks; handling of bool arguments needed a little massaging to be correct on 64-bit Windows builds. (Note this will require asc.jar build 2859 or later.)
Attachment #334009 - Flags: review?(rreitmai)
Attachment #334009 - Flags: review?(rreitmai) → review+
pushed as changeset: 613:ccd2248d64af
Status: REOPENED → RESOLVED
Closed: 17 years ago17 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: