IonMonkey: (ARM) ensure that there is an IonContext when discarding Ion code

RESOLVED FIXED

Status

()

defect
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: mjrosenb, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

currently there is a failure on tbpl for android builds because we attempt to discard JIT code while there are no IonContexts in existence, which are used to coalesce cache flushes.  This patch ensures that there is an IonContext in existence.
Attachment #655708 - Flags: review?(sstangl)
Comment on attachment 655708 [details] [diff] [review]
/home/mrosenberg/patches/debug_crash-r0.patch

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

From IRC discussion: let's solve this by threading the IonCompartment into purgeCaches(), then using the explicit 2nd argument on AutoFlushCaches' constructor.
Attachment #655708 - Flags: review?(sstangl)
Comment on attachment 655708 [details] [diff] [review]
/home/mrosenberg/patches/debug_crash-r0.patch

After looking into it a bit more, that plan won't work, since there are two places that an IonCompartment is needed, once when we create the AutoCacheFlusher, then later, when we register a section of code to be flushed.  The proposed fix only works for the first use case, not the second.
Attachment #655708 - Flags: review?(dvander)
Comment on attachment 655708 [details] [diff] [review]
/home/mrosenberg/patches/debug_crash-r0.patch

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

::: js/src/jsgc.cpp
@@ +5708,5 @@
>          /* Discard Ion caches. */ 
> +        if (script->hasIonScript()) {
> +            // I thought this line was necessary, but evidently, not?
> +            // JSContext jcx(c->rt);
> +            js::ion::IonContext ictx(NULL, c, NULL);

Instead, give purgeCaches a JSCompartment, and create the IonContext inside purgeCaches, to avoid entraining IonMonkey gunk in jsgc.cpp

r=me with that
Attachment #655708 - Flags: review?(dvander) → review+
Landed, with nets addressed: http://hg.mozilla.org/projects/ionmonkey/rev/b63bb39ed1c0
I'll close this when it is done running on tbpl.
Looks clean!
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Duplicate of this bug: 785625
You need to log in before you can comment on or make changes to this bug.