Closed Bug 1643902 Opened 5 years ago Closed 5 years ago

Functions created through CreateDynamicFunction no longer inlinable

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox-esr68 --- unaffected
firefox76 --- unaffected
firefox77 --- unaffected
firefox78 --- unaffected
firefox79 --- fixed

People

(Reporter: anba, Assigned: tcampbell)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Bug 1599634 regressed bug 958797 by removing the call to JSFunction::setTypeForScriptedFunction. Calling JSFunction::setTypeForScriptedFunction is required to ensure the function can be inlined.

Test case:

var F = Function("return 1");

function f() {
    var r = 0;
    var t = dateNow();
    for (var i = 0; i < 100_000_000; ++i) {
        r += F();
    }
    return [dateNow() - t, r];
}

for (var i = 0; i < 10; ++i) print(f());

Expected:

Actual:

  • Slower performance.
Assignee: nobody → tcampbell
Severity: -- → S3
Priority: -- → P1

Fix recent regression when standalone functions started being allocated by
instantiateStencils. This adds an isStandalone flag to the function box
that we can check in addition to wasEmitted (which is not set for these
standalone functions).

Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8a1c8747a43b Call setTypeForScriptFunction for standalone functions. r=anba
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: