Replace mozilla::IsPod with <type_traits> alternatives
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
People
(Reporter: anba, Assigned: anba)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
Unless needed for the mozilla::Vector POD optimisation, we should replace mozilla::IsPod with appropriate <type_traits> alternatives.
| Assignee | ||
Comment 1•5 years ago
|
||
Replace mozilla::IsPod with std::is_trivial and std::is_trivially_destructible,
which should cover the requirements for LifoAlloc. (std::is_trivial implies
is_trivially_default_constructible and is_trivially_copyable.)
IsPod<OffsetAndDefIndex> can then be removed.
| Assignee | ||
Comment 2•5 years ago
|
||
Similar to part 1, use both std::is_trivial and std::is_trivially_destructible
instead of mozilla::IsPod to ensure the vector elements are POD values, so we
can skip constructor/destructor calls.
There's no mozilla::IsPod specialisation to remove for this part.
Depends on D69198
| Assignee | ||
Comment 3•5 years ago
|
||
We can't use std::is_trivial for the table entry type, because the entry value
isn't trivially default constructible. (Neither mozilla::HashMapEntry nor
RecyclableAtomMapValueWrapper are trivially default constructible.)
So instead of using std::is_trivial<EntryType> directly, we have to check
std::is_trivial<KeyType> and std::is_trivial<ValueType> separately, where
we potentially need to unwrap ValueType in case it's
IsRecyclableAtomMapValueWrapper.
This allows to remove the mozilla::IsPod specialisations for NameLocation,
DeclaredNameInfo, MaybeCheckTDZ, and RecyclableAtomMapValueWrapper.
Depends on D69199
| Assignee | ||
Comment 4•5 years ago
|
||
The mozilla::IsPod<HashMapEntry specialisation was only needed for the static
assertions in "js/src/frontend/NameCollections.h". Part 3 removed those, so we
can now also remove mozilla::IsPod<HashMapEntry.
Drive-by change:
- Remove no longer needed "mozilla/PodOperations.h" include in mfbt/HashTable.h.
- And then fix up previously transitively included files for RootingAPI.h,
jsfriendapi.h, and Bench.cpp.
Depends on D69200
Updated•5 years ago
|
Comment 6•5 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/d49eebe62ba3
https://hg.mozilla.org/mozilla-central/rev/1e75beb9d311
https://hg.mozilla.org/mozilla-central/rev/239b37c87f58
https://hg.mozilla.org/mozilla-central/rev/1e75de42137c
Updated•5 years ago
|
Description
•