As discussed in the previous commit message, HashTableEntry wastes space
for common entry types. This commit reorganizes the internal storage to
store all the hashes packed together, followed by all the entries, which
eliminates the aforementioned waste.
HashTableEntry's data layout currently wastes a fair amount of space due
to ABI-mandated padding. For instance, HashTableEntry<T*> on a 64-bit
platform looks like:
class HashTableEntry {
HashNumber mKeyHash;
// Four bytes of wasted space here to pad mValueData to the correct place.
unsigned char mValueData[sizeof(T*)];
};
This wasted space means that sets of pointers backed by
mozilla::HashTable waste a quarter of their entry storage space. Maps
of pointers to pointers waste a sixth of their entry storage space.
We'd like to fix this by packing all the cached hashes together,
followed by all the hash table entries.
As a first step to laying out the hash table storage differently, we
have to make HashTable not access entries directly, but go through an
abstraction that represents the key and the entry. We call this
abstraction "slots". This commit is similar to the change done for
PLDHashTable previously.
Parts of HashTable still work in terms of Entry; the creation and
destruction of tables was not worth changing here. We'll address that
in the next commit.
We do this to make our lives easier in later patches; this check
guarantees that we don't need padding between the block of cached hash
values and the block of entries immediately after it.
This cleanup will help next refactorings.
Note that attachTestThread and attachTestTabAndResume are still using the callback style
as it is still being used by tests that aren't using threadClientTest helper.
MozReview-Commit-ID: 6FvoDtzEBmL
Depends on D13901
Differential Revision: https://phabricator.services.mozilla.com/D13902
--HG--
extra : moz-landing-system : lando
This isn't removing listTabs calls as these tests were using attachTestTab,
but all these tests are using testGlobal helper whereas they don't have to if they were using threadClientTest helper.
MozReview-Commit-ID: FPtYlDvYUeD
Depends on D13900
Differential Revision: https://phabricator.services.mozilla.com/D13901
--HG--
extra : moz-landing-system : lando
This isn't thread client test, but here we could share some more code with the memory tests
and use Target objects to retrieve the fronts.
MozReview-Commit-ID: C9S1VjTLrSF
Depends on D13899
Differential Revision: https://phabricator.services.mozilla.com/D13900
--HG--
extra : moz-landing-system : lando
All these tests are clearly copy pasting existing threadClientTest helper.
They might run as well against workers but today we don't run them there, so I used the doNotRunWorker flag.
MozReview-Commit-ID: 7k1lJ06WeGZ
Differential Revision: https://phabricator.services.mozilla.com/D13899
--HG--
extra : moz-landing-system : lando
For *incoming* wrappers this preserves behavior. We nuke *outgoing* wrappers
when all realms in the compartment have been nuked. To implement this I moved
the wasNuked flag from XPConnect to JS::Compartment as nukedOutgoingWrappers and
to JS::Realm as nukedIncomingWrappers.
The code to create a dead wrapper in the nuked compartment/realm case was also
moved into the JS engine. I added a shell test for it.
Differential Revision: https://phabricator.services.mozilla.com/D14149
--HG--
extra : moz-landing-system : lando
This patch shouldn't affect behavior; it's just making the existing control
flow clearer and more debuggable.
Differential Revision: https://phabricator.services.mozilla.com/D14216
--HG--
extra : moz-landing-system : lando
For *incoming* wrappers this preserves behavior. We nuke *outgoing* wrappers
when all realms in the compartment have been nuked. To implement this I moved
the wasNuked flag from XPConnect to JS::Compartment as nukedOutgoingWrappers and
to JS::Realm as nukedIncomingWrappers.
The code to create a dead wrapper in the nuked compartment/realm case was also
moved into the JS engine. I added a shell test for it.
Differential Revision: https://phabricator.services.mozilla.com/D14149
--HG--
extra : moz-landing-system : lando
This commit consolidates the `insertNewLocalItems` and
`updateExistingLocalItems` triggers into a single trigger that uses
an upsert, and removes the last vestiges of annotations from the
mirror.
Differential Revision: https://phabricator.services.mozilla.com/D14035
--HG--
extra : moz-landing-system : lando
skip on debug org.mozilla.geckoview.test.GeckoSessionTestRuleTest.waitForChromeJS
Differential Revision: https://phabricator.services.mozilla.com/D14190
--HG--
extra : moz-landing-system : lando