Closed Bug 1605143 Opened 5 years ago Closed 5 years ago

Derived class constructors always marked as having unknown properties

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox73 --- wontfix
firefox74 --- wontfix
firefox75 --- fixed

People

(Reporter: anba, Assigned: anba)

References

Details

Attachments

(2 files)

Derived class constructors created via FunWithProtoOperation are always getting marked as having unknown properties, because CloneFunctionObjectIfNotSingleton calls the generic SetPrototype function:

js> dumpObject(class extends class {} { constructor() {} })
object 32844fd80f60
  global 32844fd7b060 [global]
  class 5559473467e8 Function
  group 32844fd78850
  flags: inDictionaryMode hasShapeTable
  proto <unnamed function (typein:1) at 32844fd80fb0>
  properties:
    [Latin 1]"prototype": <Object at c79a9000550> (shape 32844fd9d970 readonly permanent slot 0)

I wonder if it's possible to replace the SetPrototype call with JSObject::splicePrototype (change).

Try looks green with this change applied, but I'm not sure if there are any pitfalls lurking elsewhere: https://treeherder.mozilla.org/#/jobs?repo=try&revision=cf36196aee915762335915ef2e29465c88e8ecca

Priority: -- → P3
Assignee: nobody → andrebargull
Status: NEW → ASSIGNED
Blocks: 1557765
Attachment #9118858 - Attachment description: Bug 1605143 - Part 2: Fold JSOP_SUPERFUN to ensure we can inline `super()` calls. r=jandem! → Bug 1605143 - Part 2: Fold JSOp::SuperFun to ensure we can inline `super()` calls. r=jandem!
Attachment #9118858 - Attachment description: Bug 1605143 - Part 2: Fold JSOp::SuperFun to ensure we can inline `super()` calls. r=jandem! → Bug 1605143 - Part 2: Fold JSOp::SuperFun to ensure inlined class constructors use `MCreateThisWithProto`. r=jandem!
Pushed by nerli@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fa3ca6fd6f40 Part 1: Splice prototype to ensure we don't mark the object as having unknown properties. r=jandem https://hg.mozilla.org/integration/autoland/rev/ab8ec6eab00c Part 2: Fold JSOp::SuperFun to ensure inlined class constructors use `MCreateThisWithProto`. r=jandem
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75

Since the status are different for nightly and release, what's the status for beta?
For more information, please visit auto_nag documentation.

Regressions: 1628719
Regressions: 1624693
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: