mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 13:25:37 +00:00
821b59184e
This adds a heap allocation in XPCNativeScriptableSharedMap::GetNewOrUsed() on the fast path. Hopefully that code is not hot enough for it to matter. I could work around this if needed, but it would be ugly. mNativeScriptableSharedMap has a weak pointer to XPCNativeScriptableShared. I moved this removal from XPCJSRuntime::FinalizeCallback() to the dtor. There are two types of scriptable: one is a dummy one created in GetNewOrUsed() to do a lookup, and the other is a fully filled out one. The dummy one is not added to the hashtable, and may have had its name stolen if we created a new scriptable. The latter makes it so that you crash if you try to look it up in the hashtable anyways, so this patch only looks up fully filled out scriptables. This patch also removes MOZ_COUNT_CTOR/DTOR because they are not needed for refcounted classes. Stop destroying mScriptableInfo in XPCWrappedNative's SystemIsBeingShutDown(), because that will end up destroying XPCNativeScriptableShared, while their js::ClassOps are still in use by JS objects. This matches the existing behavior, which does not sweep these ScriptableShared during shutdown. (This came up in opt xpcshell tests.) MozReview-Commit-ID: GeG0pAYqXpR |
||
---|---|---|
.. | ||
crashtests | ||
idl | ||
loader | ||
public | ||
shell | ||
src | ||
tests | ||
wrappers | ||
moz.build |