Closed Bug 1371261 Opened 3 years ago Closed 3 years ago

Bytecode Cache Heuristics are based on Epoch

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: nbp, Assigned: nbp)

References

Details

Attachments

(1 file)

Currently the lastFetched information taken out of the cacheEntry is based on Epoch.  Unfortunately Epoch cannot be guaranteed to exists in our TimeStamp representation, thus we have to fallback on using PR_Now() for the moment.
This patch remove the use of TimeStamp(), which asserts on Debug builds.

I mistakenly thought that TimeStamp() would produce the equivalent of Epoch
after reading that isNull was equivalent as testing for Epoch in one of the
comments, and assumed that we can use it, but apprently TimeStamp use a non
monotonic clock which is not necessary based on Epoch.

So this patch uses PR_Now, as this is the way used to compute the lastFetch
value in the CacheEntry, but still uses the TimeDuration for comparisons.
Attachment #8875726 - Flags: review?(mrbkap)
Comment on attachment 8875726 [details] [diff] [review]
ScriptLoader: Work-around the lack of Epoch from TimeStamp class.

Review of attachment 8875726 [details] [diff] [review]:
-----------------------------------------------------------------

Is there a bug tracking adding Epoch to TimeStamp? If not, let's file one.
Attachment #8875726 - Flags: review?(mrbkap) → review+
(In reply to Blake Kaplan (:mrbkap) from comment #2)
> Is there a bug tracking adding Epoch to TimeStamp? If not, let's file one.

I opened Bug 1371585 as a follow-up.
Pushed by npierron@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/eb644e17a1a4
ScriptLoader: Work-around the lack of Epoch from TimeStamp class. r=mrbkap
https://hg.mozilla.org/mozilla-central/rev/eb644e17a1a4
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.