• Ross McIlroy's avatar
    [SFI] Always store function_literal_id in SFI. · f92d7196
    Ross McIlroy authored
    Calling FindIndexInScript performs a linear search on the script functions and can
    take considerable time. With Bytecode flushing we will lose the function_literal_id
    and have to call FindIndexInScript if we ever recompile the flushed function. This
    can take a significant proportion of the recompilation time and has caused regressions
    in rendering times for some web applications (e.g, 395ms in FindIndexInScript for 132ms
    spent lazily re-compiling code).
    
    To avoid this, add function_literal_id back into the SFI and remove it from
    UnoptimizedCompileInfo. This will slightly regress memory usage (particularly
    in cases where many of the SFIs are compiled), however it means we can remove
    the FindIndexInScript function and avoid these long-tail regressions when
    bytecode is flushed.
    
    BUG=chromium:965833
    
    Change-Id: Ia31e82eb6c871a6d698a518326a8555822a7a1d8
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1669700Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
    Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#62319}
    f92d7196
factory.cc 166 KB