You can key your cache on v8::ScriptCompiler::CachedDataVersionTag
<https://v8.github.io/api/head/classv8_1_1ScriptCompiler.html#aea78877b0dccde1e587ee1ddeda1c155>
.

On Fri, Jan 19, 2024 at 5:54 AM 'Ronald Fenner' via v8-dev <
[email protected]> wrote:

> Not sure there is but it's probably safer when your app updates with a
> different version of v8 to just flush the whole cache.
>
> On Wednesday, January 17, 2024 at 9:40:19 AM UTC+8 Tekman wrote:
>
>> Hi,
>>
>> We use a code cache to speed up load times for large JavaScript bundles.
>> We reload the cache by passing kConsumeCodeCache and a CachedData into
>> ScriptCompiler::Compile.
>>
>> This generally works fine except when moving between some versions of V8
>> (which I presume alters the layout of some of the serialized structures).
>>
>> The problem is the failure presents as a crash (V8_Fatal called a few
>> layers into a v8::internal::Deserializer). Is there a way to validate the
>> cache or otherwise treat this as an exception we can handle instead? (if we
>> fail to load the cache, we'd just load the bundle from source and preserve
>> the new cache, no big deal, but the crash just brings down the whole
>> program).
>>
>> Thanks!
>>
> --
> --
> v8-dev mailing list
> [email protected]
> http://groups.google.com/group/v8-dev
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/v8-dev/77197a60-0411-42bf-abfd-b615d5147501n%40googlegroups.com
> <https://groups.google.com/d/msgid/v8-dev/77197a60-0411-42bf-abfd-b615d5147501n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-dev/CAOR4dTovBwzNnVLK6xzjunJCBjJ%3DPYPi0b_8ivUvByCzWQSKwQ%40mail.gmail.com.

Reply via email to