Closed Bug 1285890 Opened 8 years ago Closed 2 years ago

Remove locking on lazy linking

Categories

(Core :: JavaScript Engine: JIT, defect, P3)

defect

Tracking

()

RESOLVED FIXED
104 Branch
Tracking Status
firefox104 --- fixed

People

(Reporter: h4writer, Assigned: jandem)

Details

Attachments

(2 files)

I added the locking when trying to find the root cause of crashes during lazy linking. I eventually found the culprit, but never removed the locking. Lets remove it.
Attached patch PatchSplinter Review
Another reason the locking isn't needed anymore, is because the ionLazyLinkList doesn't need locking.

This patch removes this locking.

FinishOffThreadBuilder was hard to follow, since it has code that should only happend on the main thread and code that was shared. That is why I spit it into two functions: FinishBuilderOnThread and FinishBuilderOffThread. The OffThread version can only be used in very specific cases, which it guards for.
Assignee: nobody → hv1989
Attachment #8769616 - Flags: review?(jdemooij)
Comment on attachment 8769616 [details] [diff] [review]
Patch

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

Nice asserts.

::: js/src/jit/Ion.cpp
@@ +476,5 @@
> +void
> +jit::FinishBuilderOnThread(JSRuntime* runtime, IonBuilder* builder)
> +{
> +    MOZ_ASSERT(TlsPerThreadData.get()->runtimeFromMainThread(),
> +            "Should only be mutated by the main thread.");

Nit: fix indentation

@@ +485,5 @@
> +    {
> +        builder->script()->baselineScript()->removePendingIonBuilder(builder->script());
> +    }
> +
> +    // If the builder is still in one of the helper thread list, then remove it.

Nit: lists
Attachment #8769616 - Flags: review?(jdemooij) → review+
Priority: -- → P3
Hannes, this patch doesn't seem to apply any more.  Is it still needed?
Flags: needinfo?(hv1989)
This is still in my "I want to land this" list. Though jit-tests was upset and I do know why and it isn't an easy fix. I will come back to this hopefully.
Flags: needinfo?(hv1989)

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: hv1989 → nobody

A lot has changed, but part of this still applies: there's still an unnecessary AutoLockHelperThreadState in LinkIonScript. The second one is necessary today because of the off-thread IonFree task.

Flags: needinfo?(jdemooij)

Both the lazy link list and the pendingIonCompileTask are only used on the main thread.

Assignee: nobody → jdemooij
Status: NEW → ASSIGNED
Flags: needinfo?(jdemooij)
Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c8b6edbc1963
Remove unnecessary AutoLockHelperThreadState in LinkIonScript. r=jonco
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: