Closed Bug 1559275 Opened 5 years ago Closed 5 years ago

Minor cleanups in CompileOptions handling

Categories

(Core :: JavaScript Engine, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

Details

Attachments

(7 files)

Track discardSources on the CompileOptions (but initialize it from the realm behaviour). This simplifies things when trying to pre-compile exotic scripts like the self-hosting script.

Check realm flags at when creating CompileOptions rather than during
compilation. This is helpful for pre-compiling self-hosting code.

While here, I also removed isProbablySystemCode since it is unused in compiler.

I tried to also cleanup the parser's check for Realm::disableLazyParser but it didn't seem like a good idea to store it in the lazyParse option just yet.

One issue that comes up is that the AsyncScriptLoader component as affected by Bug 1409782. We don't currently use async loading or discard sources outside of tests. This should probably be cleaned up in follow-ups.

Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/248e294630c1
Add CompileOptions::discardSource. r=jandem
https://hg.mozilla.org/integration/autoland/rev/41762079fd4c
Remove unused CompileOptions::isProbablySystemCode. r=jandem
Keywords: leave-open
Summary: Add CompileOptions::discardSource → Minor cleanups in CompileOptions handling

The OwningCompileOptions constructor doesn't perform completion default
initialization so use normal CompileOptions to set up options and then
clone into the OwningCompileOptions. This AsyncScriptLoader module
doesn't seem to have any uses right now anyways.

All uses of OwningCompileOptions now are initialized from copy() so
remove the now unused setters.

Looks like the order I land these patches is more important than I realized. I'll do further testing, but it looks like the 'fix' is make sure the OwningCompileOptions changes (two patches) should come first.

Flags: needinfo?(tcampbell)
Attachment #9072252 - Attachment description: Bug 1559275 - Fixup CompileOptions in AsyncScriptLoader. r?kmag → Bug 1559275 - Use JS::CompileOptions in AsyncScriptCompiler. r?kmag
Attachment #9072065 - Attachment description: Bug 1559275 - Add CompileOptions::discardSource. r?jandem → Bug 1559275 - Add TransistiveCompileOptions::discardSource. r?jandem

Check VM and Realm options that may disable syntax parsing up front in
the CompileOptions constructor. This is needed to make the frontend
closer to a pure-function.

Depends on D34976

Sorry for all the churn. I think this is all passing tests for me. After final reviews, I'll land it.

Keywords: leave-open
Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3c83d9936c2c
Use JS::CompileOptions in AsyncScriptCompiler. r=kmag
https://hg.mozilla.org/integration/autoland/rev/cd6b4126a1b6
Avoid OwningCompileOptions accessors in js-rust glue. r=jandem
https://hg.mozilla.org/integration/autoland/rev/96acb8c9df07
Only initialize JS::OwningCompileOptions by copying. r=jandem
https://hg.mozilla.org/integration/autoland/rev/ef106f22e7e5
Remove unused CompileOptions::isProbablySystemCode. r=jandem
https://hg.mozilla.org/integration/autoland/rev/901f51251ea9
Remove unused CompileOptions::allowSyntaxParser. r=jandem
https://hg.mozilla.org/integration/autoland/rev/28a43f9cc6b1
Add TransistiveCompileOptions::discardSource. r=jandem
https://hg.mozilla.org/integration/autoland/rev/960c9f0926e9
Add TransistiveCompileOptions::forceFullParse. r=jandem
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: