Remove some global constructors
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox133 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
References
(Blocks 2 open bugs)
Details
Attachments
(4 files, 2 obsolete files)
Remove some global constructors according to -Wglobal-constructors
. Not necessarily still global constructors after compiler optimisations, see bug 74803, comment #99. But no harm also removing global constructors from -Wglobal-constructors
, too. The proposed patches do remove the effective number of global constructors per nm libmozjs-132a1.so | grep -c _GLOBAL__sub_
, but I haven't spent time investigating which patch removed which constructor.
Assignee | ||
Comment 1•11 months ago
|
||
Add more constexpr
in preparation for part 2.
Part 2 only requires constexpr operator+
, but there shouldn't be harm
adding constexpr
to the other methods, too.
Assignee | ||
Comment 2•11 months ago
|
||
Requires the previous part.
Assignee | ||
Comment 3•11 months ago
|
||
Assignee | ||
Comment 4•11 months ago
|
||
Required for the next part.
PackedTypeCode:
- Add separate
PackedTypeCode::pack()
for non-ref type case, because
reinterpret_cast
isn't allowed inconstexpr
functions. (There's an
implicitreinterpret_cast
in(uint64_t)(uintptr_t)typeDef
.) - Add private constructors to
PackedTypeCode
to fully initialise all parts of
the union.constexpr
functions can't change the active member of an union
and the initialisation throughPackedTypeCode ptc = {};
activates the
PackedTypeCode::bits_
member. - The default constructor is needed for the
std::is_pod_v<LitValPOD>
static
assertion in "js/src/wasm/AsmJS.cpp".
Assignee | ||
Comment 5•11 months ago
|
||
The preprocessor generated SymbolicAddressSignature SASig##sa_name
globals needed
global constructors, because when calling ValType::toMIRType()
, cf. specTypeToMIRType
in "GenerateBuiltinModules.py".
The previous part made ValType::toMIRType()
constexpr
, also add constexpr
here to
avoid regressions. Also add constexpr
to all other SymbolicAddressSignature
globals
for consistency.
Assignee | ||
Comment 6•11 months ago
|
||
TypedArrayObject::{fixedLength,resizable}Classes
were defined out-of-line,
which caused protoTable
to generate a global constructor. Change the
definition to be inline and then make protoTable
constexpr
to ensure we
don't regress this.
Updated•11 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Assignee | ||
Updated•10 months ago
|
Comment 8•10 months ago
|
||
bugherder |
Assignee | ||
Updated•10 months ago
|
Comment 10•10 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/378c7b45cb5d
https://hg.mozilla.org/mozilla-central/rev/75900af5f9c7
Description
•