Closed
Bug 910829
Opened 10 years ago
Closed 10 years ago
Various cleanups
Categories
(Core :: JavaScript Engine, enhancement)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: sunfish, Assigned: sunfish)
References
Details
Attachments
(5 files)
13.94 KB,
patch
|
jandem
:
review+
|
Details | Diff | Splinter Review |
43.59 KB,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
5.21 KB,
patch
|
bhackett1024
:
review+
|
Details | Diff | Splinter Review |
11.27 KB,
patch
|
bhackett1024
:
review+
|
Details | Diff | Splinter Review |
1.57 KB,
patch
|
bhackett1024
:
review+
|
Details | Diff | Splinter Review |
The following is a series of miscellaneous cleanups.
Attachment #797396 -
Flags: review?(jdemooij)
Assignee | ||
Comment 1•10 years ago
|
||
Attachment #797397 -
Flags: review?(jwalden+bmo)
Assignee | ||
Comment 2•10 years ago
|
||
Attachment #797398 -
Flags: review?(bhackett1024)
Assignee | ||
Comment 3•10 years ago
|
||
Attachment #797400 -
Flags: review?(bhackett1024)
Assignee | ||
Comment 4•10 years ago
|
||
Attachment #797401 -
Flags: review?(bhackett1024)
Updated•10 years ago
|
Attachment #797397 -
Flags: review?(jwalden+bmo) → review+
Updated•10 years ago
|
Attachment #797396 -
Flags: review?(jdemooij) → review+
Assignee | ||
Comment 5•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/ef553af7c130 https://hg.mozilla.org/integration/mozilla-inbound/rev/c0104d0c88a1
Whiteboard: [leave open]
Comment 6•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/ef553af7c130 https://hg.mozilla.org/mozilla-central/rev/c0104d0c88a1
![]() |
||
Comment 7•10 years ago
|
||
> anonymous-namespaces.patch
What's the benefit of this?
Assignee | ||
Comment 8•10 years ago
|
||
(In reply to Nicholas Nethercote [:njn] from comment #7) > > anonymous-namespaces.patch > > What's the benefit of this? Just general code cleanliness. The main measurable effect of this patch is it reduces the number of global symbols among the .o files of the js engine by 3.8% (the number of global symbols in libmozjs-* is unchanged, due to the use of symbol visibilities). It's not important, so I don't mind if such patches aren't accepted.
Comment 9•10 years ago
|
||
(In reply to Dan Gohman [:sunfish] from comment #8) > (In reply to Nicholas Nethercote [:njn] from comment #7) > > > anonymous-namespaces.patch > > > > What's the benefit of this? > > Just general code cleanliness. The main measurable effect of this patch is > it reduces the number of global symbols among the .o files of the js engine > by 3.8% (the number of global symbols in libmozjs-* is unchanged, due to the > use of symbol visibilities). It's not important, so I don't mind if such > patches aren't accepted. I think it would be good to use an empty macro as the name of the anonymous namespaces, such as people who complained about the ability to debug these functions can still set the macro to get a name in their debuggers.
Comment 10•10 years ago
|
||
Interesting idea. But (assuming I understand it) wouldn't it founder when code outside the "anonymous" namespace needs to call a method defined inside it? namespace ANONYMOUS { static bool InitFoo() { return true; } } namespace other_thing { bool Exported() { return InitFoo(); // doesn't work if ANONYMOUS expands to anything } } I'm not sure how common this is, but there's some Mozilla code fitting this pattern now.
Comment 11•10 years ago
|
||
(In reply to Jeff Walden [:Waldo] (remove +bmo to email) from comment #10) > bool > Exported() > { > return InitFoo(); // doesn't work if ANONYMOUS expands to anything > } #define USING_NS_ANONYMOUS using namespace anonymous
![]() |
||
Comment 12•10 years ago
|
||
> #define USING_NS_ANONYMOUS using namespace anonymous
Please, please, no.
Comment 13•10 years ago
|
||
Another option would be: #define ANONYMOUS \ anonymous {} \ using namespace anonymous; \ namespace anonymous in which case one can transparently use the named-anonymous namespace as if it was a real anonymous namespace. (In reply to Jeff Walden [:Waldo] (remove +bmo to email) from comment #10) > namespace ANONYMOUS { > > static bool > InitFoo() > { > return true; > } > > }
Comment 14•10 years ago
|
||
Comment on attachment 797398 [details] [diff] [review] ra-cleanup.patch Review of attachment 797398 [details] [diff] [review]: ----------------------------------------------------------------- Sorry for the delay.
Attachment #797398 -
Flags: review?(bhackett1024) → review+
Updated•10 years ago
|
Attachment #797400 -
Flags: review?(bhackett1024) → review+
Updated•10 years ago
|
Attachment #797401 -
Flags: review?(bhackett1024) → review+
Assignee | ||
Comment 15•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/f2d3df7c6056 https://hg.mozilla.org/integration/mozilla-inbound/rev/81be63a2e9b1 https://hg.mozilla.org/integration/mozilla-inbound/rev/f33f92d540df
Whiteboard: [leave open]
Comment 16•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/f2d3df7c6056 https://hg.mozilla.org/mozilla-central/rev/81be63a2e9b1 https://hg.mozilla.org/mozilla-central/rev/f33f92d540df
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in
before you can comment on or make changes to this bug.
Description
•