Open
Bug 662348
Opened 14 years ago
Updated 1 year ago
Move off of using stdcall on windows
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
NEW
People
(Reporter: sicking, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
7.07 KB,
patch
|
Details | Diff | Splinter Review |
We currently mark all idl methods as using stdcall calling convention on windows. This has several downsides:
1. Slower
2. Forces us to use ugly macros when declaring and implementing idl methods
3. Makes it harder to migrate between .h and .idl interfaces
4. If you get the macro magic wrong, it'll likely only break on one platform
So we should stop doing this.
On win32 this seems very easy. All we need to do is remove this line:
http://mxr.mozilla.org/mozilla-central/source/xpcom/reflect/xptcall/src/md/win32/xptcinvoke.cpp#99
Technically, moving off of stdcall means that the caller now has to do the stack cleanup as I understand it. However for anything that goes through xptcall, no cleanup should be needed other than adjusting esp. However that already happens on this line:
http://mxr.mozilla.org/mozilla-central/source/xpcom/reflect/xptcall/src/md/win32/xptcinvoke.cpp#103
I'm trying to grokk the win64 code, but there's a number of things that are looking weird to me so I'm gonna grab someone on irc to get some help.
There will be code that interfaces with MS-COM that will need to be fixed here.
(In reply to comment #1)
> There will be code that interfaces with MS-COM that will need to be fixed
> here.
Or maybe not, looks like it all uses STDMETHOD and whatnot.
Reporter | ||
Comment 3•14 years ago
|
||
So it turns out that we have objects with implement both nsISupports and IUnknown in the tree. This makes it impossible to do this until we change that :(
At the very least this class does this:
http://mxr.mozilla.org/mozilla-central/source/accessible/src/msaa/nsAccessNodeWrap.h
Ah, a11y does it. I knew there was something.
I think you can do this, you just need to split the COM object into separate C++ objects. Implement the MS-COM ifaces on a tearoff and fwd to the main object.
Comment 5•14 years ago
|
||
__stdcall is noop on Win64 (both for IA64 and x64) because there's only one calling convention on those platforms.
http://msdn.microsoft.com/en-us/library/zxk0tw93.aspx
Reporter | ||
Comment 6•14 years ago
|
||
I need to additionally fix the mingw stubs I think. Will look at that once the a11y code is fixed.
Assignee: nobody → jonas
Updated•3 years ago
|
Severity: normal → S3
Comment 7•3 years ago
|
||
The bug assignee is inactive on Bugzilla, so the assignee is being reset.
Assignee: jonas → nobody
You need to log in
before you can comment on or make changes to this bug.
Description
•