1. 21 Jun, 2019 1 commit
    • 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
  2. 23 May, 2019 2 commits
  3. 22 May, 2019 1 commit
  4. 17 May, 2019 1 commit
  5. 16 May, 2019 2 commits
  6. 07 Jan, 2019 1 commit
  7. 20 Sep, 2018 1 commit
    • Ross McIlroy's avatar
      [Compile] Refactor CompilerDispatcher for inner function compilation jobs · 80195fc5
      Ross McIlroy authored
      Refactors the CompilerDispatcher to be able to enqueue eager inner functions
      for off-thread compilation during top-level compilation of a script.
      
      Unoptimized compile jobs are simplified to only have two phases - compile
      and finalization. Only finalization requires heap access (and therefore
      needs to be run on the main thread). The change also introduces a requirement
      to register a SFI with a given compile job after that job is posted, this
      is due to the fact that an SFI won't necessarily exist at the point the job
      is posted, but is created later when top-level compile is being finalized.
      Logic in the compile dispatcher is update to deal with the fact that a job
      may not be able to progress if it doesn't yet have an associated SFI
      registered with it.
      
      BUG=v8:8041
      
      Change-Id: I66cccd626136738304a7cab0e501fc65cf342514
      Reviewed-on: https://chromium-review.googlesource.com/1215782
      Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
      Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
      Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#56088}
      80195fc5
  8. 19 Jul, 2018 1 commit
    • Leszek Swirski's avatar
      [sfi] Remove SFI function identifier field · c941f11a
      Leszek Swirski authored
      Remove the function identifier field from SharedFunctionInfo. This field
      would store one of a) the function's inferred name, b) the "builtin
      function id", or c) debug info. We remove these in turn:
      
      a) The function's inferred name is available on the ScopeInfo, so like
         the start/end position we read it off either the ScopeInfo (for
         compiled functions) or the UncompiledData (for uncompiled functions).
      
         As a side-effect, now both UncompiledData and its subclass,
         UncompiledDataWithPreparsedScope, contain a pointer field. To keep
         BodyDescriptors manageable, we introduce a SubclassBodyDescriptor
         which effectively appends two BodyDescriptors together.
      
      b) The builtin function id is < 255, so we can steal a byte from
         expected no. of properies (also <255) and store these together.
         Eventually we want to get rid of this field and use the builtin ID,
         but this is pending JS builtin removal.
      
         As a side-effect, BuiltinFunctionId becomes an enum class (for better
         storage size guarantees).
      
      c) The debug info can hang off anything (since it stores the field it
         replaces), so we can attach it to the script field instead.
      
      This saves a word on compiled function (uncompiled functions
      unfortunately still have to store it in UncompiledData).
      
      Bug: chromium:818642
      Change-Id: I8b4b3a070f0fe328aafcaeac58842d144d12d996
      Reviewed-on: https://chromium-review.googlesource.com/1138328Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
      Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#54543}
      c941f11a
  9. 16 Jul, 2018 3 commits
    • Leszek Swirski's avatar
      [sfi] Remove SFI function literal id field (reland^2) · 5dee5ade
      Leszek Swirski authored
      SharedFunctionInfos store their original function literal's id. This is
      also their index in the Script's SFI list.
      
      The function literal id is only needed for lazy compilation and live edit,
      and access only has to be fast in the former. So, we can move the SFI
      function literal id field to UncompiledData, and if patching with live
      edit, or discarding compiled code, we can perform a slower linear search
      through the Script's SFI list.
      
      This is a reland of
       1) https://chromium-review.googlesource.com/1082480 and
       2) https://chromium-review.googlesource.com/1128854
      the differences being:
       1) caching the literal id on UncompiledData rather than always linearly
          searching the SFI list, and removing the unused runtime-liveedit.cc
          file instead of fixing it to support this change.
       2) clearing padding on UncompiledData now that it has 3 int32 fields,
          making its end unaligned on x64.
      
      TBR=yangguo@chromium.org,marja@chromium.org,ulan@chromium.org,cbruni@chromium.org
      
      Bug: chromium:818642
      Change-Id: I58dcb12a2a60a680f662568da428e01189c62638
      Reviewed-on: https://chromium-review.googlesource.com/1138325Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#54473}
      5dee5ade
    • Sigurd Schneider's avatar
      Revert "[sfi] Remove SFI function literal id field" · 58578584
      Sigurd Schneider authored
      This reverts commit 1d4a1172.
      
      Reason for revert: https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux%20-%20arm64%20-%20sim%20-%20MSAN/21989
      
      Original change's description:
      > [sfi] Remove SFI function literal id field
      > 
      > SharedFunctionInfos store their original function literal's id. This is
      > also their index in the Script's SFI list.
      > 
      > The function literal id is only needed for lazy compilation and live edit,
      > and access only has to be fast in the former. So, we can move the SFI
      > function literal id field to UncompiledData, and if patching with live
      > edit, or discarding compiled code, we can perform a slower linear search
      > through the Script's SFI list.
      > 
      > This is a reland of
      > https://chromium-review.googlesource.com/c/v8/v8/+/1082480
      > but caching the literal id on UncompiledData rather than always linearly
      > searching the SFI list. Also, removes the unused runtime-liveedit.cc file
      > instead of fixing it to support this change.
      > 
      > Bug: chromium:818642
      > Change-Id: I977bcca0dc72903ca476a7079d156cc8bbe88fde
      > Reviewed-on: https://chromium-review.googlesource.com/1128854
      > Reviewed-by: Yang Guo <yangguo@chromium.org>
      > Reviewed-by: Marja Hölttä <marja@chromium.org>
      > Reviewed-by: Camillo Bruni <cbruni@chromium.org>
      > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
      > Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#54464}
      
      TBR=ulan@chromium.org,marja@chromium.org,yangguo@chromium.org,kozyatinskiy@chromium.org,cbruni@chromium.org,leszeks@chromium.org,verwaest@chromium.org
      
      Change-Id: Icee5ee3ab7688b93e2963f91debed65a58164534
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: chromium:818642
      Reviewed-on: https://chromium-review.googlesource.com/1138276Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
      Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#54466}
      58578584
    • Leszek Swirski's avatar
      [sfi] Remove SFI function literal id field · 1d4a1172
      Leszek Swirski authored
      SharedFunctionInfos store their original function literal's id. This is
      also their index in the Script's SFI list.
      
      The function literal id is only needed for lazy compilation and live edit,
      and access only has to be fast in the former. So, we can move the SFI
      function literal id field to UncompiledData, and if patching with live
      edit, or discarding compiled code, we can perform a slower linear search
      through the Script's SFI list.
      
      This is a reland of
      https://chromium-review.googlesource.com/c/v8/v8/+/1082480
      but caching the literal id on UncompiledData rather than always linearly
      searching the SFI list. Also, removes the unused runtime-liveedit.cc file
      instead of fixing it to support this change.
      
      Bug: chromium:818642
      Change-Id: I977bcca0dc72903ca476a7079d156cc8bbe88fde
      Reviewed-on: https://chromium-review.googlesource.com/1128854Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
      Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#54464}
      1d4a1172
  10. 09 Jul, 2018 1 commit
  11. 07 Jun, 2018 1 commit
    • Leszek Swirski's avatar
      Revert "[sfi] Remove SFI function literal id field" · b6888b63
      Leszek Swirski authored
      This reverts commit ceb9c812.
      
      Reason for revert: Tanks compile time
      
      Original change's description:
      > [sfi] Remove SFI function literal id field
      > 
      > SharedFunctionInfos store their original function literal's id. This is
      > also their index in the Script's SFI list.
      > 
      > Since the function literal id is only needed for lazy compilation and live
      > edit, we can calculate it on-the-fly by linear search in the Script SFI list,
      > and save a field on the SFI.
      > 
      > If this regresses compile performance, we could alternatively store the
      > function literal id on the preparsed scope data as future work.
      > 
      > Bug: chromium:818642
      > Change-Id: I5468cea0e115921f1c864d94e567d749a4349882
      > Reviewed-on: https://chromium-review.googlesource.com/1082480
      > Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      > Reviewed-by: Hannes Payer <hpayer@chromium.org>
      > Reviewed-by: Toon Verwaest <verwaest@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#53523}
      
      TBR=hpayer@chromium.org,leszeks@chromium.org,verwaest@chromium.org
      
      # Not skipping CQ checks because original CL landed > 1 day ago.
      
      Bug: chromium:818642
      Bug: chromium:850417
      Change-Id: If2fd21331b7062532c04004a51e705f7e9d0a151
      Reviewed-on: https://chromium-review.googlesource.com/1090494Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#53573}
      b6888b63
  12. 05 Jun, 2018 1 commit
    • Leszek Swirski's avatar
      [sfi] Remove SFI function literal id field · ceb9c812
      Leszek Swirski authored
      SharedFunctionInfos store their original function literal's id. This is
      also their index in the Script's SFI list.
      
      Since the function literal id is only needed for lazy compilation and live
      edit, we can calculate it on-the-fly by linear search in the Script SFI list,
      and save a field on the SFI.
      
      If this regresses compile performance, we could alternatively store the
      function literal id on the preparsed scope data as future work.
      
      Bug: chromium:818642
      Change-Id: I5468cea0e115921f1c864d94e567d749a4349882
      Reviewed-on: https://chromium-review.googlesource.com/1082480
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
      Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#53523}
      ceb9c812
  13. 06 Apr, 2018 1 commit
  14. 26 Mar, 2018 1 commit
  15. 22 Mar, 2018 3 commits
  16. 20 Mar, 2018 2 commits
  17. 19 Mar, 2018 1 commit
  18. 16 Mar, 2018 1 commit
  19. 13 Mar, 2018 2 commits
  20. 13 Nov, 2017 1 commit
  21. 01 Aug, 2017 1 commit
    • jgruber's avatar
      Reland "[builtins] Remove Builtins::Name() accessors" · fcaa2c2e
      jgruber authored
      This is a reland of 2f79e035
      Original change's description:
      > [builtins] Remove Builtins::Name() accessors
      > 
      > Instead of auto-generating the Name() convenience accessor, use a macro to
      > avoid wasting code space.
      > 
      >   BUILTIN_CODE(isolate, Name)
      > 
      > expands to
      > 
      >   isolate->builtins()->builtin_handle(Builtins::kName);
      > 
      > This reduces the size of libv8.so by 134,752 bytes on a x64 release build.
      > 
      > Bug: v8:6624
      > Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
      > Change-Id: Idff7ee5c45e344e73412c0f47e92553c7c7ff75f
      > Reviewed-on: https://chromium-review.googlesource.com/593607
      > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
      > Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#47010}
      
      TBR=bmeurer@chromium.org,ahaas@chromium.org
      
      Bug: v8:6624
      Change-Id: I4733731e56dc8873ee06c2b36cac1918c0a658b2
      Reviewed-on: https://chromium-review.googlesource.com/594087
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#47037}
      fcaa2c2e
  22. 31 Jul, 2017 2 commits
    • Jakob Gruber's avatar
      Revert "[builtins] Remove Builtins::Name() accessors" · 17a26c0b
      Jakob Gruber authored
      This reverts commit 2f79e035.
      
      Reason for revert: Conflicts with successor CL.
      
      Original change's description:
      > [builtins] Remove Builtins::Name() accessors
      > 
      > Instead of auto-generating the Name() convenience accessor, use a macro to
      > avoid wasting code space.
      > 
      >   BUILTIN_CODE(isolate, Name)
      > 
      > expands to
      > 
      >   isolate->builtins()->builtin_handle(Builtins::kName);
      > 
      > This reduces the size of libv8.so by 134,752 bytes on a x64 release build.
      > 
      > Bug: v8:6624
      > Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
      > Change-Id: Idff7ee5c45e344e73412c0f47e92553c7c7ff75f
      > Reviewed-on: https://chromium-review.googlesource.com/593607
      > Reviewed-by: Andreas Haas <ahaas@chromium.org>
      > Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
      > Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#47010}
      
      TBR=yangguo@chromium.org,ahaas@chromium.org,jgruber@chromium.org,bmeurer@chromium.org
      
      Change-Id: Ia9ef5c755b26c3f4e143d87a7c51033614ea435e
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:6624
      Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
      Reviewed-on: https://chromium-review.googlesource.com/594048Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#47012}
      17a26c0b
    • jgruber's avatar
      [builtins] Remove Builtins::Name() accessors · 2f79e035
      jgruber authored
      Instead of auto-generating the Name() convenience accessor, use a macro to
      avoid wasting code space.
      
        BUILTIN_CODE(isolate, Name)
      
      expands to
      
        isolate->builtins()->builtin_handle(Builtins::kName);
      
      This reduces the size of libv8.so by 134,752 bytes on a x64 release build.
      
      Bug: v8:6624
      Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
      Change-Id: Idff7ee5c45e344e73412c0f47e92553c7c7ff75f
      Reviewed-on: https://chromium-review.googlesource.com/593607Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#47010}
      2f79e035
  23. 18 Apr, 2017 1 commit
  24. 11 Apr, 2017 1 commit
  25. 09 Jan, 2017 1 commit
  26. 12 Dec, 2016 1 commit