Closed
Bug 1442599
Opened 6 years ago
Closed 6 years ago
Remove or replace macros/definitions in jsutil.h and jstypes.h with modern replacements
Categories
(Core :: JavaScript Engine, enhancement, P3)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla61
People
(Reporter: anba, Assigned: anba)
Details
Attachments
(7 files, 3 obsolete files)
4.10 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
5.00 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
5.89 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
6.79 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
2.68 KB,
patch
|
anba
:
review+
|
Details | Diff | Splinter Review |
21.51 KB,
patch
|
anba
:
review+
|
Details | Diff | Splinter Review |
19.29 KB,
patch
|
anba
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•6 years ago
|
||
AutoScopedAssign was only used in jsexn.cpp, replace it with MakeScopeExit and then remove AutoScopedAssign from jsutil.
Attachment #8955480 -
Flags: review?(jorendorff)
Assignee | ||
Comment 2•6 years ago
|
||
The bitmap macros are only used in BytecodeEmitter.cpp, we can replace them with the bit-array-element functions (also defined in jsutil.h) and then remove the bitmap macros completely. The bit-array-element functions are internally asserting that no out-of-bounds access happens, so it's not less safe even though we're now passing the pointer returned by |Vector::begin()| to the bit-array-element functions.
Attachment #8955483 -
Flags: review?(jorendorff)
Assignee | ||
Comment 3•6 years ago
|
||
The JS_SILENCE_UNUSED_VALUE_IN_EXPR macro is only used in builtin/Profilers.cpp, move it to that file so it's not accidentally used instead of mozilla::Unused.
Attachment #8955484 -
Flags: review?(jorendorff)
Assignee | ||
Comment 4•6 years ago
|
||
Replace the few remaining uses of JS_ALWAYS_{TRUE,FALSE} with MOZ_ALWAYS_{TRUE,FALSE}.
Attachment #8955485 -
Flags: review?(jorendorff)
Assignee | ||
Comment 5•6 years ago
|
||
Remove JSBasicStats from jsutil because it appears to be unused.
Attachment #8955486 -
Flags: review?(jorendorff)
Assignee | ||
Comment 6•6 years ago
|
||
- JS_EXPORT_API was only used in js/src/shell/js.cpp and js/xpconnect/src/nsXPConnect.cpp, replace it with MOZ_EXPORT. - And then we can remove all JS_{EXTERN,EXPORT,IMPORT} macros from jstypes.h, because they are no longer used. - JS_BITS_PER_BYTE was only used twice, replace it CHAR_BIT, which is already used elsewhere. - Remove the unused JS_BITS_PER_BYTE_LOG2 macro. - And also remove the unused JS_EXTENSION macros.
Attachment #8955487 -
Flags: review?(jorendorff)
Updated•6 years ago
|
Attachment #8955480 -
Flags: review?(jorendorff) → review+
Updated•6 years ago
|
Attachment #8955483 -
Flags: review?(jorendorff) → review+
Updated•6 years ago
|
Attachment #8955484 -
Flags: review?(jorendorff) → review+
Updated•6 years ago
|
Attachment #8955485 -
Flags: review?(jorendorff) → review+
Updated•6 years ago
|
Attachment #8955486 -
Flags: review?(jorendorff) → review+
Comment 7•6 years ago
|
||
Comment on attachment 8955487 [details] [diff] [review] bug1442599-part6-jstypes-macros.patch Review of attachment 8955487 [details] [diff] [review]: ----------------------------------------------------------------- Thanks!
Attachment #8955487 -
Flags: review?(jorendorff) → review+
Assignee | ||
Comment 8•6 years ago
|
||
I've forgot to remove no longer used #includes and |using| declarations in part 5. While removing them I've noticed that |mozilla::Maybe| is used unqualified in jsutil.cpp. This currently works because jsutil.cpp includes vm/HelperThreads.h which in turn includes vm/JSContext.h which in turn includes vm/Runtime.h which in turn includes gc/ZoneGroup.h which in turn includes gc/Statistics.h and gc/Statistics.h has |using mozilla::Maybe|. And because vm/JSContext.h is part of this include chain, more or less any file in js/src can currently use |mozilla::Maybe| unqualified. Let's fix that and remove |using mozilla::Maybe| from gc/Statistics.h and then handle the fallout in various files.
Attachment #8955701 -
Flags: review?(jorendorff)
Comment 9•6 years ago
|
||
Comment on attachment 8955701 [details] [diff] [review] bug1442599-part7-using-and-includes.patch Review of attachment 8955701 [details] [diff] [review]: ----------------------------------------------------------------- *sustained, thunderous applause*
Attachment #8955701 -
Flags: review?(jorendorff) → review+
Assignee | ||
Comment 10•6 years ago
|
||
Update part 1 to apply cleanly on inbound, carrying r+.
Attachment #8955480 -
Attachment is obsolete: true
Attachment #8959146 -
Flags: review+
Assignee | ||
Comment 11•6 years ago
|
||
Update part 4 to apply cleanly on inbound, carrying r+.
Attachment #8955485 -
Attachment is obsolete: true
Attachment #8959147 -
Flags: review+
Assignee | ||
Comment 12•6 years ago
|
||
Update part 7 to apply cleanly on inbound and to fix new files which don't properly include "mozilla/Maybe.h", carrying r+.
Attachment #8955701 -
Attachment is obsolete: true
Attachment #8959149 -
Flags: review+
Assignee | ||
Comment 13•6 years ago
|
||
Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f37ce3df5fbced00cd323f7d28a7f51804d3d44b
Keywords: checkin-needed
Comment 14•6 years ago
|
||
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/61ecd1a2547c Part 1: Replace AutoScopedAssign with MakeScopeExit. r=jorendorff https://hg.mozilla.org/integration/mozilla-inbound/rev/593825fbb674 Part 2: Replace bitmap macros with BitArrayElement functions. r=jorendorff https://hg.mozilla.org/integration/mozilla-inbound/rev/12150eddce35 Part 3: Move JS_SILENCE_UNUSED_VALUE_IN_EXPR macro to last remaining call site. r=jorendorff https://hg.mozilla.org/integration/mozilla-inbound/rev/2269c7ed37ff Part 4: Replace JS_ALWAYS_TRUE/FALSE with MOZ_ALWAYS_TRUE/FALSE. r=jorendorff https://hg.mozilla.org/integration/mozilla-inbound/rev/43b8be56fa06 Part 5: Remove "Basic stats" from jsutil. r=jorendorff https://hg.mozilla.org/integration/mozilla-inbound/rev/1ff23ca2f9fd Part 6: Remove macros from jstypes.h when unused or replacements exist. r=jorendorff https://hg.mozilla.org/integration/mozilla-inbound/rev/2c450d858f01 Part 7: Clean up using and includes in jsutil. r=jorendorff
Keywords: checkin-needed
Comment 15•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/61ecd1a2547c https://hg.mozilla.org/mozilla-central/rev/593825fbb674 https://hg.mozilla.org/mozilla-central/rev/12150eddce35 https://hg.mozilla.org/mozilla-central/rev/2269c7ed37ff https://hg.mozilla.org/mozilla-central/rev/43b8be56fa06 https://hg.mozilla.org/mozilla-central/rev/1ff23ca2f9fd https://hg.mozilla.org/mozilla-central/rev/2c450d858f01
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox61:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Updated•6 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•