Skip to content

build: tracking issue for V8 code cache intergration #21563

Closed
@joyeecheung

Description

Following up on #21405

  • Better integrity check when using the code cache in NativeModule.prototype.compile (right now SerializedCodeData::SourceHash returns source->length()) e.g. calculating the checksums of the source code in both js2c and the code cache generator and compare them before using the cache. See build: speed up startup with V8 code cache #21405 (comment) simply relying on V8 to do the checks is fine
  • build: create V8 code cache after script is run #21567: Use script.createCachedData to generate the code cache after the builtin modules have runInThisContext(), so that the cache of the lazily compiled inner functions are also included (right now only the top level function is included in the cache),see build: speed up startup with V8 code cache #21405 (comment) . We may need to include the code cache generator in core or expose the scripts to user land.
  • Cache internal/bootstrap/loaders.js and internal/bootstrap/node.js (these two are compiled in C++): src: use NativeModuleLoader to compile all the bootstrappers #24775
  • (might be related if we still use JS to generate the cache) Add support for the full range of CompileOptions (and possibly NoCacheReason) to ContextifyScript/vm.Script it's not using the JS land function anymore

Long-term action items

Metadata

Assignees

No one assigned

    Labels

    buildIssues and PRs related to build files or the CI.moduleIssues and PRs related to the module subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions