Closed Bug 1763103 Opened 4 years ago Closed 3 years ago

Don't require extended functions when methods don't use [[HomeObject]]

Categories

(Core :: JavaScript Engine, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

(Keywords: perf-alert)

Attachments

(5 files)

Currently all methods are allocated as extended functions, even when they don't use METHOD_HOMEOBJECT_SLOT. Thanks to Stencil, we no longer allocate functions in the parser, which enables us to only require extended functions when the home object is actually needed.

The FunctionBox is created with the exact same FunctionFlags, so we don't have
to pass the flags as a separate parameter, but instead can read them from the
FunctionBox::flags_ member.

Depends on D142929

Change emitPrivateMethodInitializer() to accept a ClassMethod* instead of
receiving the separate child parse nodes of ClassMethod.

Drive-by change:

  • Use less casts.
  • Remove unreachable PrivateNameKind::Method case from switch.

Depends on D142930

Private instance accessors were always initialising the home object, even when
needsHomeObject() was false.

Depends on D142931

Methods only need to be created as extended functions when they need to store
their home-object. So any method which doesn't use super can actually be
created as a normal, non-extended function.

Depends on D142932

Severity: -- → S3
Priority: -- → P1
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/9a662b26eb81 Part 1: Update a comment to no longer mention object groups. r=arai https://hg.mozilla.org/integration/autoland/rev/fddaa6af17d6 Part 2: Stop passing redundant FunctionFlags when initialising a FunctionBox. r=arai https://hg.mozilla.org/integration/autoland/rev/d3a0f6499f71 Part 3: Clean-up emitPrivateMethodInitializer. r=arai https://hg.mozilla.org/integration/autoland/rev/dc55792f6bcc Part 4: Only initialise home object for private instance accessors when neeeded. r=arai https://hg.mozilla.org/integration/autoland/rev/4e0f719f9498 Part 5: Don't require extended functions when |super| isn't used. r=arai

== Change summary for alert #33809 (as of Tue, 12 Apr 2022 18:42:06 GMT) ==

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
1% Base Content JS windows10-64-2004-shippable-qr 1,813,717.33 -> 1,801,448.00
1% Base Content JS linux1804-64-shippable-qr 1,811,600.00 -> 1,799,633.33
0.44% Base Content JS macosx1015-64-shippable-qr 1,841,482.67 -> 1,833,458.67

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=33809

Keywords: perf-alert
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: