1. 09 Mar, 2020 1 commit
    • Dan Elphick's avatar
      [api] Create v8::String::NewFromLiteral that returns Local<String> · b097a8e5
      Dan Elphick authored
      String::NewFromLiteral is a templated function that takes a char[N]
      argument that can be used as an alternative to String::NewFromUtf8 and
      returns a Local<String> rather than a MaybeLocal<String> reducing the
      number of ToLocalChecked() or other checks.
      
      Since the string length is known at compile time, it can statically
      assert that the length is less than String::kMaxLength, which means that
      it can never fail at runtime.
      
      This also converts all found uses of NewFromUtf8 taking a string literal
      or a variable initialized from a string literal to use the new API. In
      some cases the types of stored string literals are changed from const
      char* to const char[] to ensure the size is retained.
      
      This API does introduce a small difference compared to NewFromUtf8. For
      a case like "abc\0def", NewFromUtf8 (using length -1 to infer length)
      would treat this as a 3 character string, whereas the new API will treat
      it as a 7 character string.
      
      As a drive-by fix, this also fixes all redundant uses of
      v8::NewStringType::kNormal when passed to any of the String::New*
      functions.
      
      Change-Id: Id96a44bc068d9c4eaa634aea688e024675a0e5b3
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2089935
      Commit-Queue: Dan Elphick <delphick@chromium.org>
      Reviewed-by: 's avatarMathias Bynens <mathias@chromium.org>
      Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
      Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#66622}
      b097a8e5
  2. 03 Mar, 2020 1 commit
  3. 17 Jan, 2020 1 commit
  4. 22 Aug, 2019 1 commit
  5. 20 Aug, 2019 1 commit
  6. 19 Aug, 2019 2 commits
    • Dominik Inführ's avatar
      Revert "Use list of invalidated objects for old-to-new refs" · 9a9ba762
      Dominik Inführ authored
      This reverts commit 60843b42.
      
      Reason for revert: TSAN detected issue between Scavenge workers.
      One task could invoke RefillFreeList(), while the other task iterates the remembered set of a swept page.
      
      Original change's description:
      > Use list of invalidated objects for old-to-new refs
      > 
      > Instead of inserting "deletion" entries into the store buffer, keep a
      > list of invalidated objects to filter out invalid old-to-new slots.
      > 
      > The first CL https://crrev.com/c/1704109 got reverted because both the
      > sweeper and the main task were modifying the invalidated slots data
      > structure concurrently. This CL changes this, such that the sweeper
      > only modifies the invalidated slots during the final atomic pause when
      > the main thread is not running. The sweeper does not need to clean this
      > data structure after the pause, since the "update pointers" phase
      > already removed all invalidated slots.
      > 
      > The second CL https://crrev.com/c/1733081 got reverted because the
      > sweeper might find more free space than the full GC before it. If an
      > object shrinks after the pause but before the sweep, the invalidated
      > object might span free memory and potentially new allocated objects.
      > Therefore shrink invalidated objects when processing swept pages on
      > the main thread. Also clean recorded slots in the gap.
      > 
      > TBR=petermarshall@chromium.org
      > 
      > Bug: v8:9454
      > Change-Id: I80d1fa3bbc24e97f7c97a373aaad66f105456f12
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1751795
      > Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#63239}
      
      TBR=ulan@chromium.org,hpayer@chromium.org,dinfuehr@chromium.org
      
      Change-Id: I9c6a371ebe36a1873acbe0d6c6a75dd2f5a55f4e
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:9454
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1760817Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#63253}
      9a9ba762
    • Dominik Inführ's avatar
      Use list of invalidated objects for old-to-new refs · 60843b42
      Dominik Inführ authored
      Instead of inserting "deletion" entries into the store buffer, keep a
      list of invalidated objects to filter out invalid old-to-new slots.
      
      The first CL https://crrev.com/c/1704109 got reverted because both the
      sweeper and the main task were modifying the invalidated slots data
      structure concurrently. This CL changes this, such that the sweeper
      only modifies the invalidated slots during the final atomic pause when
      the main thread is not running. The sweeper does not need to clean this
      data structure after the pause, since the "update pointers" phase
      already removed all invalidated slots.
      
      The second CL https://crrev.com/c/1733081 got reverted because the
      sweeper might find more free space than the full GC before it. If an
      object shrinks after the pause but before the sweep, the invalidated
      object might span free memory and potentially new allocated objects.
      Therefore shrink invalidated objects when processing swept pages on
      the main thread. Also clean recorded slots in the gap.
      
      TBR=petermarshall@chromium.org
      
      Bug: v8:9454
      Change-Id: I80d1fa3bbc24e97f7c97a373aaad66f105456f12
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1751795
      Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#63239}
      60843b42
  7. 08 Aug, 2019 1 commit
    • Dominik Inführ's avatar
      Revert "Use list of invalidated objects for old-to-new refs" · c9f9d1b0
      Dominik Inführ authored
      This reverts commit e2f98ec2.
      
      Reason for revert: Caused performance regression in ArrayLiteralInitialSpreadSmallHoley.
      
      Original change's description:
      > Use list of invalidated objects for old-to-new refs
      >
      > Instead of inserting "deletion" entries into the store buffer, keep
      > a list of invalidated objects to filter out invalid old-to-new slots.
      >
      > The first CL https://crrev.com/c/1704109 got reverted because both the sweeper and the main task were modifying the invalidated slots data structure concurrently. This CL changes this, such that the sweeper only modifies the invalidated slots during the final atomic pause when the main thread is not running. The sweeper does not need to clean this data structure after the pause, since the "update pointers" phase already removed all invalidated slots.
      >
      > Bug: v8:9454
      > Change-Id: Iffb5bf96de2c89eee1ee1231a3414a0f2a155cbc
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1733081
      > Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
      > Reviewed-by: Peter Marshall <petermarshall@chromium.org>
      > Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#63087}
      
      TBR=ulan@chromium.org,petermarshall@chromium.org,dinfuehr@chromium.org
      
      # Not skipping CQ checks because original CL landed > 1 day ago.
      
      Bug: v8:9454
      Change-Id: I328b9f72df45fc9570d4a4d1b5389eac010638c7
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1743970
      Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
      Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#63131}
      c9f9d1b0
  8. 06 Aug, 2019 1 commit
  9. 16 Jul, 2019 2 commits
  10. 24 May, 2019 1 commit
  11. 23 May, 2019 2 commits
  12. 22 May, 2019 1 commit
  13. 20 May, 2019 1 commit
  14. 17 May, 2019 1 commit
  15. 16 May, 2019 2 commits
  16. 05 Mar, 2019 1 commit
  17. 15 Feb, 2019 1 commit
  18. 20 Dec, 2018 1 commit
  19. 29 Nov, 2018 1 commit
  20. 24 Sep, 2018 1 commit
    • Dan Elphick's avatar
      [deprecation] Deprecate ToBoolean(Local<Context>) · d235f550
      Dan Elphick authored
      ToBoolean and BooleanValue cannot throw exceptions so the Maybe versions
      of the functions don't make sense. As such this deprecates the Maybe
      versions and undeprecates ToBoolean(Isolate*). It also adds
      BooleanValue(Isolate*).
      
      Fix up all of the v8 code to not use the deprecated functions.
      
      Bug: v8:7279, v8:8015
      Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
      Change-Id: I50e7474d205c75baa153f0dea7f02dcf60232d1d
      Reviewed-on: https://chromium-review.googlesource.com/1238476
      Commit-Queue: Dan Elphick <delphick@chromium.org>
      Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#56163}
      d235f550
  21. 15 Sep, 2018 1 commit
  22. 12 Sep, 2018 1 commit
  23. 10 Sep, 2018 1 commit
  24. 07 Sep, 2018 1 commit
  25. 23 Jul, 2018 1 commit
  26. 23 Jun, 2018 1 commit
  27. 19 Jun, 2018 1 commit
  28. 11 Jun, 2018 1 commit
  29. 02 May, 2018 1 commit
  30. 14 Apr, 2018 1 commit
    • Jakob Kummerow's avatar
      [ubsan] Change Address typedef to uintptr_t · 2459046c
      Jakob Kummerow authored
      The "Address" type is V8's general-purpose type for manipulating memory
      addresses. Per the C++ spec, pointer arithmetic and pointer comparisons
      are undefined behavior except within the same array; since we generally
      don't operate within a C++ array, our general-purpose type shouldn't be
      a pointer type.
      
      Bug: v8:3770
      Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel
      Change-Id: Ib96016c24a0f18bcdba916dabd83e3f24a1b5779
      Reviewed-on: https://chromium-review.googlesource.com/988657
      Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
      Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52601}
      2459046c
  31. 09 Apr, 2018 1 commit
  32. 06 Apr, 2018 2 commits
    • Michael Achenbach's avatar
      Revert "[cleanup] Refactor the Factory" · 503e07c3
      Michael Achenbach authored
      This reverts commit f9a2e24b.
      
      Reason for revert: gc stress failures not all fixed by follow up.
      
      Original change's description:
      > [cleanup] Refactor the Factory
      > 
      > There is no good reason to have the meat of most objects' initialization
      > logic in heap.cc, all wrapped by the CALL_HEAP_FUNCTION macro. Instead,
      > this CL changes the protocol between Heap and Factory to be AllocateRaw,
      > and all object initialization work after (possibly retried) successful
      > raw allocation happens in the Factory.
      > 
      > This saves about 20KB of binary size on x64.
      > 
      > Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
      > Change-Id: Icbfdc4266d7be8b48d2fe085f03411743dc6a0ca
      > Reviewed-on: https://chromium-review.googlesource.com/959533
      > Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
      > Reviewed-by: Hannes Payer <hpayer@chromium.org>
      > Reviewed-by: Yang Guo <yangguo@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#52416}
      
      TBR=jkummerow@chromium.org,yangguo@chromium.org,mstarzinger@chromium.org,hpayer@chromium.org
      
      Change-Id: Idbbc53478742f3e9525eee83342afc6aedae122f
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
      Reviewed-on: https://chromium-review.googlesource.com/999414Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
      Commit-Queue: Michael Achenbach <machenbach@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52420}
      503e07c3
    • Jakob Kummerow's avatar
      [cleanup] Refactor the Factory · f9a2e24b
      Jakob Kummerow authored
      There is no good reason to have the meat of most objects' initialization
      logic in heap.cc, all wrapped by the CALL_HEAP_FUNCTION macro. Instead,
      this CL changes the protocol between Heap and Factory to be AllocateRaw,
      and all object initialization work after (possibly retried) successful
      raw allocation happens in the Factory.
      
      This saves about 20KB of binary size on x64.
      
      Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
      Change-Id: Icbfdc4266d7be8b48d2fe085f03411743dc6a0ca
      Reviewed-on: https://chromium-review.googlesource.com/959533
      Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
      Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
      Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52416}
      f9a2e24b
  33. 05 Apr, 2018 1 commit
    • Peter Marshall's avatar
      Reland "[runtime] Remove the construct_stub field of the SFI" · b158bfdc
      Peter Marshall authored
      This is a reland of 63ecddc8
      
      Original change's description:
      > [runtime] Remove the construct_stub field of the SFI
      >
      > Don't dispatch based on the construct_stub field anymore. Rather than
      > read it out and jump to the construct stub, we can switch on the
      > builtin_id.
      >
      > Builtins will always have builtin_id as a Smi, so this signals we need
      > to jump to JSBuiltinsConstructStub. The only exception is for uncompiled
      > functions, which will have kCompileLazy as the builtin_id, but need to
      > jump to the generic stub instead.
      >
      > API function calls will have a FunctionTemplateInfo in the SFI
      > function_data field, and need to go to the builtins stub as well.
      >
      > The final case is everything else, which should go to the generic stub.
      >
      > Bug: v8:7503
      > Change-Id: I14790a5f9784dc0d940bf10a05f5310026e1d482
      > Reviewed-on: https://chromium-review.googlesource.com/980941
      > Reviewed-by: Leszek Swirski <leszeks@chromium.org>
      > Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
      > Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#52345}
      
      TBR=bmeurer@chromium.org
      
      Bug: v8:7503
      Change-Id: Ie46bfb0af173ad7ac8cbdfeed1865e60f3f413f7
      Reviewed-on: https://chromium-review.googlesource.com/997712Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
      Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52389}
      b158bfdc
  34. 04 Apr, 2018 2 commits
    • Michael Achenbach's avatar
      Revert "[runtime] Remove the construct_stub field of the SFI" · f49a1a67
      Michael Achenbach authored
      This reverts commit 63ecddc8.
      
      Reason for revert:
      https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20-%20internal%20snapshot/builds/14773
      
      Original change's description:
      > [runtime] Remove the construct_stub field of the SFI
      > 
      > Don't dispatch based on the construct_stub field anymore. Rather than
      > read it out and jump to the construct stub, we can switch on the
      > builtin_id.
      > 
      > Builtins will always have builtin_id as a Smi, so this signals we need
      > to jump to JSBuiltinsConstructStub. The only exception is for uncompiled
      > functions, which will have kCompileLazy as the builtin_id, but need to
      > jump to the generic stub instead.
      > 
      > API function calls will have a FunctionTemplateInfo in the SFI
      > function_data field, and need to go to the builtins stub as well.
      > 
      > The final case is everything else, which should go to the generic stub.
      > 
      > Bug: v8:7503
      > Change-Id: I14790a5f9784dc0d940bf10a05f5310026e1d482
      > Reviewed-on: https://chromium-review.googlesource.com/980941
      > Reviewed-by: Leszek Swirski <leszeks@chromium.org>
      > Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
      > Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#52345}
      
      TBR=petermarshall@chromium.org,leszeks@chromium.org,bmeurer@chromium.org
      
      Change-Id: I2031913ab5a12018ad932f920792aa1f6faa5e22
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:7503
      Reviewed-on: https://chromium-review.googlesource.com/995293Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
      Commit-Queue: Michael Achenbach <machenbach@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52346}
      f49a1a67
    • Peter Marshall's avatar
      [runtime] Remove the construct_stub field of the SFI · 63ecddc8
      Peter Marshall authored
      Don't dispatch based on the construct_stub field anymore. Rather than
      read it out and jump to the construct stub, we can switch on the
      builtin_id.
      
      Builtins will always have builtin_id as a Smi, so this signals we need
      to jump to JSBuiltinsConstructStub. The only exception is for uncompiled
      functions, which will have kCompileLazy as the builtin_id, but need to
      jump to the generic stub instead.
      
      API function calls will have a FunctionTemplateInfo in the SFI
      function_data field, and need to go to the builtins stub as well.
      
      The final case is everything else, which should go to the generic stub.
      
      Bug: v8:7503
      Change-Id: I14790a5f9784dc0d940bf10a05f5310026e1d482
      Reviewed-on: https://chromium-review.googlesource.com/980941Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
      Commit-Queue: Peter Marshall <petermarshall@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52345}
      63ecddc8