Closed
Bug 935800
Opened 11 years ago
Closed 11 years ago
Fix an exact rooting false positive in ForkJoinSlice
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla28
People
(Reporter: terrence, Assigned: terrence)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
shu
:
review+
|
Details | Diff | Splinter Review |
As discussed on IRC, the control flow here is monumentally complicated, but cannot actually trigger GC in practice.
Unfortunately, because of the field call when we dispatch to the sub-threads, the analysis recognize will not recognize that the AutoAssertNoGC covers the parallel section. Instead we have to make the assertion in parallel. This means that getting the runtime out of TLS will not work, so I have added a JSRuntime* variant of AutoAssertNoGC.
When we have a JSRuntime, it is generally safe to access it, except through the pointer in ForkJoinShared: i.e. the one we are using here. Fortunately, we know for other reasons that this usage is safe since the main thread is blocked or doing other things that cannot GC. At the very least, we want to over-assert here rather than under asserting, so I think the new constructor is preferable to ignoring the assertions in this case.
Flagging Steve for review of the AutoAssertNoGC changes and Shu for the changes to ForkJoin.
Attachment #828379 -
Flags: review?(sphink)
Attachment #828379 -
Flags: review?(shu)
Comment 1•11 years ago
|
||
Comment on attachment 828379 [details] [diff] [review]
hazard_forkjoin-v0.diff
Review of attachment 828379 [details] [diff] [review]:
-----------------------------------------------------------------
The patch doesn't contain any AutoAssertNoGC changes. r-, it'll never work, rejecting with prejudice. ;-)
(I'm guessing you're missing a qref.)
Attachment #828379 -
Flags: review?(sphink) → review-
Assignee | ||
Comment 2•11 years ago
|
||
Yes indeed, I forgot to qref. Luckily, my changes lined up with just the right split, so I qnewd instead of qrefing.
Attachment #828676 -
Flags: review?(sphink)
Updated•11 years ago
|
Attachment #828379 -
Flags: review-
Comment 3•11 years ago
|
||
Comment on attachment 828676 [details] [diff] [review]
hazard_forkjoin_autoassert_changes-v0.diff
Review of attachment 828676 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/jsgc.cpp
@@ +5306,5 @@
> }
>
> JS::AutoAssertNoGC::~AutoAssertNoGC()
> {
> + MOZ_ASSERT(gcNumber == runtime->gcNumber);
You no like my MOZ_ASSERT explanation text?
Attachment #828676 -
Flags: review?(sphink) → review+
Comment 4•11 years ago
|
||
(In reply to Terrence Cole [:terrence] from comment #2)
> Created attachment 828676 [details] [diff] [review]
> hazard_forkjoin_autoassert_changes-v0.diff
>
> Yes indeed, I forgot to qref. Luckily, my changes lined up with just the
> right split, so I qnewd instead of qrefing.
Well, mostly. There's a chunk in ForkJoinSlice.cpp in the 2nd patch, so you'll need to merge these before landing.
Assignee | ||
Comment 5•11 years ago
|
||
(In reply to Steve Fink [:sfink] from comment #3)
> ::: js/src/jsgc.cpp
> @@ +5306,5 @@
> > }
> >
> > JS::AutoAssertNoGC::~AutoAssertNoGC()
> > {
> > + MOZ_ASSERT(gcNumber == runtime->gcNumber);
>
> You no like my MOZ_ASSERT explanation text?
Whoops! Did not mean to drop that.
(In reply to Steve Fink [:sfink] from comment #4)
> (In reply to Terrence Cole [:terrence] from comment #2)
> > Created attachment 828676 [details] [diff] [review]
> > hazard_forkjoin_autoassert_changes-v0.diff
> >
> > Yes indeed, I forgot to qref. Luckily, my changes lined up with just the
> > right split, so I qnewd instead of qrefing.
>
> Well, mostly. There's a chunk in ForkJoinSlice.cpp in the 2nd patch, so
> you'll need to merge these before landing.
And yes, I appear to be totally incompetent after 5PM when I wake up at 7AM.
Assignee | ||
Comment 6•11 years ago
|
||
Lets just fold this all together now.
Attachment #828379 -
Attachment is obsolete: true
Attachment #828676 -
Attachment is obsolete: true
Attachment #828379 -
Flags: review?(shu)
Attachment #828849 -
Flags: review?(shu)
Comment 7•11 years ago
|
||
Comment on attachment 828849 [details] [diff] [review]
hazard_forkjoin-v1.diff
Review of attachment 828849 [details] [diff] [review]:
-----------------------------------------------------------------
Sorry this took so long. Looks fine to me. I assume all PJS tests pass?
::: js/src/jsgc.cpp
@@ +5312,1 @@
> }
These changes look for PJS. What about Brian's off-thread stuff? Does requiring the runtime field to be always present break anything there?
Attachment #828849 -
Flags: review?(shu) → review+
Comment 8•11 years ago
|
||
These changes look fine for PJS*.
Assignee | ||
Comment 9•11 years ago
|
||
(In reply to Shu-yu Guo [:shu] from comment #7)
>
> Sorry this took so long. Looks fine to me. I assume all PJS tests pass?
I ran jit-tests --tbpl with tests matching "arallel", which I think catches everything relevant. I'll do a full run before landing though.
> These changes look for PJS. What about Brian's off-thread stuff? Does
> requiring the runtime field to be always present break anything there?
Good thought! I'll add an --ion-parallel-compile=on pass as well.
Assignee | ||
Comment 10•11 years ago
|
||
Comment 11•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
You need to log in
before you can comment on or make changes to this bug.
Description
•