Make use of MOZ_RAII and ScopeExit to simplify some Auto guards in the GC

RESOLVED FIXED in Firefox 43

Status

()

Core
JavaScript: GC
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: terrence, Assigned: terrence)

Tracking

Trunk
mozilla43
Points:
---

Firefox Tracking Flags

(firefox43 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
Created attachment 8660853 [details] [diff] [review]
use_MOZ_RAII-v0.diff

8 files changed, 33 insertions(+), 80 deletions(-)
Attachment #8660853 - Flags: review?(sphink)
Comment on attachment 8660853 [details] [diff] [review]
use_MOZ_RAII-v0.diff

Review of attachment 8660853 [details] [diff] [review]:
-----------------------------------------------------------------

\o/ I hated that ugly thing.

We don't need to include anything to get the definition, though?

::: js/src/gc/Marking.cpp
@@ -1249,5 @@
>  {
>  #ifdef DEBUG
> -    struct AutoCheckCompartment {
> -        bool& flag;
> -        explicit AutoCheckCompartment(bool& comparmentCheckFlag) : flag(comparmentCheckFlag) {

-1 typo here too
Attachment #8660853 - Flags: review?(sphink) → review+
(In reply to Steve Fink [:sfink, :s:] from comment #2)
> Comment on attachment 8660853 [details] [diff] [review]
> use_MOZ_RAII-v0.diff
> 
> Review of attachment 8660853 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> \o/ I hated that ugly thing.
> 
> We don't need to include anything to get the definition, though?

As in, shouldn't this patch have some #include <mfbt/Attributes.h> lines?
Er... that would be mozilla/Attributes.h, I think.
(Assignee)

Comment 6

3 years ago
(In reply to Steve Fink [:sfink, :s:] from comment #4)
> Er... that would be mozilla/Attributes.h, I think.

Apparently not? I think that js/HeapAPI.h has it, which means we get it "for free" everywhere. We /should/ stop smuggling it, but that's a bit of a fool's errand at this point.
https://hg.mozilla.org/mozilla-central/rev/60fdd3ce9836
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox43: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
You need to log in before you can comment on or make changes to this bug.