• jgruber's avatar
    [api] Add option to consume code cache on module compilation · 70b5fd3b
    jgruber authored
    This extends the ScriptCompiler::CompileModule function with a
    CompileOptions argument. Accepted values are kNoCompileOptions (in
    which case, behavior remains unmodified) and kConsumeCodeCache. If the
    latter is passed, we try to fetch the given module from the code
    cache.
    
    Since it is possible to compile the same source code as both a script
    and a module (and different code is generated for the two cases), a
    new is_module bit is added to the SerializedCodeData header to
    disambiguate between the two cases.
    
    Bug: v8:7685
    Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
    Change-Id: I34b3642505577ed9ed0caedbee5876308c5a53ea
    Reviewed-on: https://chromium-review.googlesource.com/1073327
    Commit-Queue: Jakob Gruber <jgruber@chromium.org>
    Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
    Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#53432}
    70b5fd3b
code-serializer.cc 19.2 KB