gecko-dev/xpcom
Nika Layzell 3a56bcbaeb Bug 1709227 - Include offset information in rust-xpcom vtables, r=mccr8
In the Itanium C++ ABI VTables contain extra fields before the virtual function
pointer list for RTTI information, and these fields are not eliminated even
when RTTI is disabled using -fno-rtti. The two relevant fields for rust-xpcom's
vtables are the "offset to top" field, which contains the displacement to the
top of the object from the corresponding vtable pointer as a `ptrdiff_t`
(`isize`), and the "typeinfo pointer" field which points to the typeinfo object
and is null when building with -fno-rtti. The VTable pointer points after these
fields to the beginning of the virtual function pointer list.

While these extra fields would generally not be accessed in -fno-rtti
situations, gcc and clang still support `dynamic_cast<void*>` even when
-fno-rtti is passed, meaning that the "offset to top" field should be present.

Although I was unable to find documentation for the C++ ABI used on Darwin, it
appears to behave the same as the Itanium C++ ABI when it comes to VTable
layout.

In order to include these fields in the manual vtables built by the rust-xpcom
macros, a `&'static VTableExtra<VTableType>` is used instead of directly using
the vtable type, and the vtable reference stored in the struct is offset into
the allocation.

As the only platform I know of to not include these extra fields is Windows,
they are generated on all non-Windows platforms.

Differential Revision: https://phabricator.services.mozilla.com/D115085
2021-05-18 20:56:40 +00:00
..
base Bug 1710845 - Get rid of NS_ERROR_DOM_INVALID_EXPRESSION_ERR; r=smaug; 2021-05-12 23:32:38 +00:00
build Bug 1698045 part 1 - Add xpc::SelfHostedShmem to hold shared memory for JS initialization. r=smaug,tcampbell,ipc-reviewers,jld 2021-05-12 13:57:55 +00:00
components Update configs. IGNORE BROKEN CHANGESETS CLOSED TREE NO BUG a=release ba=release 2021-04-19 19:09:05 +00:00
docs Bug 1702245 - Expand XPCOM's in-tree documentation, r=xpcom-reviewers,kmag 2021-04-05 15:56:18 +00:00
ds Bug 1711100 - Remove XPCOM leak logging from nsTArray_base, r=mccr8 2021-05-13 23:20:31 +00:00
glue Bug 1704683 - Avoid loop for closing fd r=jld 2021-05-11 07:45:16 +00:00
idl-parser Bug 1647259 - Replace unsubscriptable value 'list' with 'attlist' r=nika 2021-02-01 15:57:44 +00:00
io Bug 1709887: Add missing #define in mingw builds. r=xpcom-reviewers,nika 2021-05-07 14:02:26 +00:00
libxpt/xptcall
reflect Bug 1690152 - on ppc64 properly skip parameter slots if we overflow GPRs while still having FPRs to burn. r=tcampbell 2021-02-02 02:04:20 +00:00
rust Bug 1709227 - Include offset information in rust-xpcom vtables, r=mccr8 2021-05-18 20:56:40 +00:00
string Bug 1683062 - disable 1113005.html on linux-qr r=intermittent-reviewers,ahal DONTBUILD 2021-05-10 13:41:14 +00:00
system Bug 1682030 - Remove NPAPI plugin process from GeckoChildProcess r=jld,gsvelto 2021-04-06 19:28:20 +00:00
tests Bug 1711090 - Part 2: Allow creating a nsITimer with a std::function callback, r=KrisWright 2021-05-18 20:45:16 +00:00
threads Bug 1711090 - Part 4: Remove non-string func timer names, r=KrisWright 2021-05-18 20:45:17 +00:00
windbgdlg Bug 1654103: Standardize on Black for Python code in `mozilla-central`. 2020-10-26 18:34:53 +00:00
xpidl Bug 1670357 - Remove `make` targets for cleaning: `clean`, `realclean`, `clobber`, `distclean`, `clobber_all`, `everything` r=firefox-build-system-reviewers,mhentges 2020-10-15 20:37:18 +00:00
moz.build Bug 1695954: Move Gecko Logging MDN Page In-tree r=nika 2021-03-09 16:27:29 +00:00
xpcom-config.h.in