Closed Bug 1752212 Opened 4 years ago Closed 3 years ago

Standardize the ScriptPreloader/StartupCache cache key format

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(2 files)

Currently there are multiple cache key format:

where items marded with * are Stencil.

So, only nsMessageManagerScriptExecutor uses raw URI, while others uses path-like key.
If we add the compilation target into the cache key string in bug 1752209, it's better having consistent format, for example:

  • compilation target + "/" + loader type + "/" + URI path

(In reply to Tooru Fujisawa [:arai] from comment #0)

Currently there are multiple cache key format:

where items marded with * are Stencil.

this was not accurate.
the content of nsXULPrototypeCache can contain Stencil, but it's serialization of XUL tree, so it can contain multiple Stencils,
and it's not guaranteed to have single compilation target, if we support module in XUL.

So, the compilation target must be put into the key only for others that the cache corresponds to single .js file

(In reply to Tooru Fujisawa [:arai] from comment #1)

So, the compilation target must be put into the key only for others that the cache corresponds to single .js file

Or maybe the "compilation target" part can be extended to have "other", that can optionally be used by remaining consumers (not sure if it worth tho)

nsXULPrototypeScript::SerializeOutOfLine needs compilation target, because it's .js file referred from <script>
nsXULPrototypeCache::WritePrototype doesn't need it, because it's xul file

Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/e38fbd381ed3 Part 1: Pass loader type to PathifyURI. r=nbp https://hg.mozilla.org/integration/autoland/rev/557c428fb6bc Part 2: Add loader type to cache key used by nsFrameMessageManager. r=nbp
Flags: needinfo?(arai.unmht)
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/6340c6d93f10 Part 1: Pass loader type to PathifyURI. r=nbp https://hg.mozilla.org/integration/autoland/rev/7b7ac774209c Part 2: Add loader type to cache key used by nsFrameMessageManager. r=nbp
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: