Closed Bug 1525505 Opened 2 years ago Closed 2 years ago

XDRScript should create JSScript with valid constructor arguments

Categories

(Core :: JavaScript Engine, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

Details

Attachments

(3 files)

In Bug 1451284 we have issues with coverage misbehaving that stem from XDR decoding.

We initialize the coverage data structures before the filename is properly set when something is OwnSource. We should code things in the appropriate order so that we can call JSScript::Create with legal values.

[1] https://searchfox.org/mozilla-central/rev/9eb30227b21e0aa40d51d9f9b08bb0b113c5fadb/js/src/vm/JSScript.cpp#520,566

Sanity check was reading out-of-range value. This caused more XDR decode
failures than expected, but non-cache load would recover anyways. With
fix, a few more cases will support XDR caching.

This ensures the script source is properly ininitialized before calling
JSScript::Create. This fixes issues with LCov when the script comes from
an XDR-based cache.

Depends on D18873

There is no existing bug, but passing correct values to constructor is
more predictable for future.

Depends on D18874

Blocks: 1525924
Status: NEW → ASSIGNED

(Changing reviewers based on workload/availability)

Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/41ba287d84da
Fix bug in XDRState::codeCString r=jandem,nbp
https://hg.mozilla.org/integration/autoland/rev/c4e1215ffff6
XDR ScriptSource before Script r=jandem
https://hg.mozilla.org/integration/autoland/rev/d6729b60b236
Pass source extents to JSScript constructor in XDRScript r=jandem
See Also: → 1528964
Blocks: 1528320
You need to log in before you can comment on or make changes to this bug.