As Ben says: The code cache is specific the exact source string, the CPU (cpu family & cpu flags, e.g. whether certain features are supported), the exact V8 version (since there is no mechanism to guarantee correctness across versions), and the compile options (debug, release, certain features that affect code generation).
Additional info: The API contract is meant to be that the embedder checks all these things, and it's the embedders duty to never hand us a cache w/ kConsumeCodeCache if there's a a source/v8 version/cpu mismatch. When trying to launch the feature (& shortly after), we had a bunch of weird crashes apparently related to code caching (likely from disk or RAM failures on cheap-ish machines, which happens at a noticeable rate with ~1e9 users), and so we added a number of checksums and sanity checks to the code caching. These are the primary reason why stuff gets rejected. But those where really meant as a last resort & sanity check, and it really means that the embedder shouldn't have given us that data in the first place. The sanity checks are mostly hash-sums. Hash collisions are possible, and then there'll be false positives. Looking back, I'm not sure that particular API was the best way of doing this. I hope it works well; I'll be happy to hear any feedback if it doesn't. On Fri, Apr 21, 2017 at 9:59 AM, Ben Noordhuis <[email protected]> wrote: > On Fri, Apr 21, 2017 at 9:51 AM, Johannes Rieken > <[email protected]> wrote: > > Does the data depend on things like endian-ness, CPU etc or only > > on v8-locals like v8-version and v8-flags? > > All of the above; it's machine-, version- and invocation-specific. > > -- > -- > v8-users mailing list > [email protected] > http://groups.google.com/group/v8-users > --- > You received this message because you are subscribed to the Google Groups > "v8-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
