[code cache] Refactor GeneratedCodeCache to split reads and writes
- Splits Write into two parts, response time and data. Uses stream 0 for response time, stream 1 for data, to avoid a slowdown. - Splits Read similarly. - Eliminates the extra data copy when writing caused by passing a span from CodeCacheHostImpl rather than the Mojo BigBuffer received from the renderer. - Changes the keyed PendingOperation queues to keep the active op at the head. This simplifies the helper method and callback signatures. - PendingOperations now own the IOBuffers for Write and Fetch. - Using stream 0 now will make deduplication of the code caches (not storing a copy of the code for each origin) easier in the future. Behavior changes: - IssuePendingOperations now runs PendingOperations through the queues rather than all at once. This was probably didn't happen in the real world but seems incorrect. - Reads where one or more parts fail now doom the entry. We should help the cache eliminate inaccessible data. - Response time is now stored in stream 0. This means any data in the cache from previous Chromes where response time was a prefix on stream 1 will cause a cache miss, since the time stamp read will fail. This CL then makes the data read fail, since returning data prefixed with a timestamp could be confusing now. Invalidating the caches shouldn't be a problem, since we expect a new version of Chrome/V8 to cause the code caches to become invalid since their version/feature header won't match, see: https://cs.chromium.org/chromium/src/v8/src/snapshot/code-serializer.cc?rcl=6c89d2ffb531b3c79181532b5de04adaf7206049&l=387 Bug: chromium:992991 Change-Id: If3c5e8a83bca811fcb809a8a89c6d22942456f13 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1814685 Commit-Queue: Bill Budge <bbudge@chromium.org> Reviewed-by:Maks Orlovich <morlovich@chromium.org> Reviewed-by:
Kinuko Yasuda <kinuko@chromium.org> Reviewed-by:
Mythri Alle <mythria@chromium.org> Cr-Commit-Position: refs/heads/master@{#700307}
Showing
Please register or sign in to comment