Closed Bug 1591515 Opened 5 years ago Closed 4 years ago

Avoid delazification in js::FunctionToString

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla73
Tracking Status
firefox73 --- fixed

People

(Reporter: tcampbell, Assigned: evilpie)

References

Details

Attachments

(1 file)

If js::FunctionToString we current delazify in [1], but it isn't necessary. Instead this whole method should be cleaned up in terms of JSFunction::baseScript(). Another minor detail is that [2] can be simplified since derived-class-constructors are no longer marked as builtin thanks to [3].

[1] https://searchfox.org/mozilla-central/rev/7536d7f480a7f18c941a590a2d4c5119d9f52770/js/src/vm/JSFunction.cpp#836
[2] https://searchfox.org/mozilla-central/rev/7536d7f480a7f18c941a590a2d4c5119d9f52770/js/src/vm/JSFunction.cpp#857
[3] https://searchfox.org/mozilla-central/rev/7536d7f480a7f18c941a590a2d4c5119d9f52770/js/src/vm/Interpreter.cpp#311

Note, one wrinkle is FunctionToStringCache, but I think changing it to store a BaseScript* is fine. The cache is wiped at any GC and is never traced so the fact that BaseScript is not really a complete type is fine.

Type: enhancement → task
Assignee: nobody → evilpies
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla73
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: