1. 20 Oct, 2020 1 commit
  2. 16 Oct, 2020 1 commit
    • Pierre Langlois's avatar
      [heap] Make maximum regular code object size a runtime value. · f4376ec8
      Pierre Langlois authored
      Executable V8 pages include 3 reserved OS pages: one for the writable
      header and two as guards. On systems with 64k OS pages, the amount of
      allocatable space left for objects can then be quite smaller than the
      page size, only 64k for each 256k page.
      
      This means regular code objects cannot be larger than 64k, while the
      maximum regular object size is fixed to 128k, half of the page size. As
      a result code object never reach this limit and we can end up filling
      regular pages with few large code objects.
      
      To fix this, we change the maximum code object size to be runtime value,
      set to half of the allocatable space per page. On systems with 64k OS
      pages, the limit will be 32k.
      
      Alternatively, we could increase the V8 page size to 512k on Arm64 linux
      so we wouldn't waste code space. However, systems with 4k OS pages are
      more common, and those with 64k pages tend to have more memory available
      so we should be able to live with it.
      
      Bug: v8:10808
      Change-Id: I5d807e7a3df89f1e9c648899e9ba2f8e2648264c
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2460809Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
      Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
      Cr-Commit-Position: refs/heads/master@{#70569}
      f4376ec8
  3. 12 Oct, 2020 1 commit
  4. 07 Oct, 2020 1 commit
  5. 22 Sep, 2020 2 commits
  6. 09 Sep, 2020 4 commits
  7. 07 Sep, 2020 2 commits
    • Camillo Bruni's avatar
      Revert "[test][d8] Add d8.log.getAndStop helper" · 8bf237dd
      Camillo Bruni authored
      This reverts commit 95aa697b.
      
      Reason for revert: breaks under tsan
      
      Original change's description:
      > [test][d8] Add d8.log.getAndStop helper
      > 
      > The new helper function allows us to write tests for log parsing
      > without the need to first generating a log file. This makes it easier
      > to spot errors when the log format changes.
      > 
      > - Add d8 global variable
      > - Add file_name accessor to Logger and Log classes
      > - Change OS::LogFileOpenMode to w+ / wb+
      > - Use separate Log::WriteLogHeader method
      > - Remove unused logger_ instance variable from Log
      > 
      > Bug: v8:10644
      > Change-Id: Ifc7e35aa4e91b3f01f0847843263946e085944c3
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2387563
      > Commit-Queue: Camillo Bruni <cbruni@chromium.org>
      > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
      > Reviewed-by: Toon Verwaest <verwaest@chromium.org>
      > Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#69715}
      
      TBR=mlippautz@chromium.org,cbruni@chromium.org,gsathya@chromium.org,verwaest@chromium.org
      
      Change-Id: Iad47d2f1e3391cae3c2f8c9e6c904c43925e1671
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:10644
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2396080Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
      Commit-Queue: Camillo Bruni <cbruni@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69717}
      8bf237dd
    • Camillo Bruni's avatar
      [test][d8] Add d8.log.getAndStop helper · 95aa697b
      Camillo Bruni authored
      The new helper function allows us to write tests for log parsing
      without the need to first generating a log file. This makes it easier
      to spot errors when the log format changes.
      
      - Add d8 global variable
      - Add file_name accessor to Logger and Log classes
      - Change OS::LogFileOpenMode to w+ / wb+
      - Use separate Log::WriteLogHeader method
      - Remove unused logger_ instance variable from Log
      
      Bug: v8:10644
      Change-Id: Ifc7e35aa4e91b3f01f0847843263946e085944c3
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2387563
      Commit-Queue: Camillo Bruni <cbruni@chromium.org>
      Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Reviewed-by: 's avatarSathya Gunasekaran  <gsathya@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69715}
      95aa697b
  8. 02 Sep, 2020 1 commit
  9. 31 Aug, 2020 1 commit
    • Brendan Shanks's avatar
      Use NtCurrentTeb() in GetStackStart() to fix 64-bit Wine on macOS · c40c8f7d
      Brendan Shanks authored
      When running 64-bit Windows binaries on macOS using Wine, there is a
      conflict between macOS's use of GS to point to pthread thread-specific
      data, and Windows' use of GS to point to the TEB.
      
      Apple has reserved some TSD slots for use by Wine to store commonly-used
      TEB members (such as 0x30, the 'Self' pointer to the TEB).
      But, other direct GS accesses by Windows programs (such as to
      'StackBase') will return macOS pthread data rather than the TEB member.
      This was causing a V8 unit test to crash on macOS under Wine.
      
      Using NtCurrentTeb() gets the 'Self' pointer first, then dereferences
      it to access the correct 'StackBase', fixing the crash.
      This turns GetStackStart() from one instruction into two.
      
      Chrome (http://crrev.com/c/2380425) and Crashpad also use
      NtCurrentTeb().
      
      The 32-bit change isn't needed, but is just for consistency.
      
      Bug: chromium:1121842
      Change-Id: I824f893aa451d8570142226be91840c964426f38
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2381941Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69627}
      c40c8f7d
  10. 25 Aug, 2020 1 commit
  11. 24 Aug, 2020 1 commit
  12. 19 Aug, 2020 3 commits
  13. 17 Aug, 2020 1 commit
  14. 11 Aug, 2020 1 commit
  15. 03 Aug, 2020 1 commit
    • Clemens Backes's avatar
      [wasm] Check that all initial reservations succeed · c049a3bc
      Clemens Backes authored
      After allocating a new code space, we do some initial allocations in the
      new space (e.g. for the jump table). These allocations are not allowed
      to fail.
      If this in indeed what's happening in the linked bug, this CHECK will
      give fuzzers a chance to find us a reproducer.
      
      Drive-by: Introduce {WasmCodeAllocator::kUnrestrictedRegion} to remove
      magic constants.
      
      R=ahaas@chromium.org
      
      Bug: v8:1111266
      Change-Id: Ia76721653226bd4aa346b89ffab0c80f67892794
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2333250
      Commit-Queue: Clemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69204}
      c049a3bc
  16. 31 Jul, 2020 3 commits
    • Avi Drissman's avatar
      Fix OS_MACOSX usages · 065dde95
      Avi Drissman authored
      Two of them were in comments; updated them to V8_OS_MACOSX.
      
      Two of them were incorrectly in #if statements. Updated them to
      V8_OS_MACOSX.
      
      Bug: chromium:823915, chromium:1105907
      Change-Id: Ibfc0f8936dbc8cbf3b05a674e882bbc480d0b4c4
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2331736Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
      Commit-Queue: Avi Drissman <avi@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69178}
      065dde95
    • Dan Elphick's avatar
      [heap] Share RO_SPACE pages with pointer compression · c7d22c49
      Dan Elphick authored
      This allows the configuration v8_enable_shared_ro_heap and
      v8_enable_pointer_compression on Linux and Android, although it still
      defaults to off.
      
      When pointer compression and read-only heap sharing are enabled, sharing
      is achieved by allocating ReadOnlyPages in shared memory that are
      retained in the shared ReadOnlyArtifacts object. These ReadOnlyPages are
      then remapped into the address space of the Isolate ultimately using
      mremap.
      
      To simplify the creation process the ReadOnlySpace memory for the first
      Isolate is created as before without any sharing. It is only when the
      ReadOnlySpace memory has been finalized that the shared memory is
      allocated and has its contents copied into it. The original memory is
      then released (with PC this means it's just released back to the
      BoundedPageAllocator) and immediately re-allocated as a shared mapping.
      
      Because we would like to make v8_enable_shared_ro_heap default to true
      at some point but can't make this conditional on the value returned by
      a method in the code we are yet to compile, the code required for
      sharing has been mostly changed to use ifs with
      ReadOnlyHeap::IsReadOnlySpaceShared() instead of #ifdefs except where
      a compile error would result due to the absence of a class members
      without sharing. IsReadOnlySpaceShared() will evaluate
      CanAllocateSharedPages in the platform PageAllocator (with pointer
      compression and sharing enabled) once and cache that value so sharing
      cannot be toggled during the lifetime of the process.
      
      Bug: v8:10454
      Change-Id: I0236d752047ecce71bd64c159430517a712bc1e2
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2267300
      Commit-Queue: Dan Elphick <delphick@chromium.org>
      Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69174}
      c7d22c49
    • Dan Elphick's avatar
      [base] Don't allow excluded regions to be freed · 8130e54d
      Dan Elphick authored
      Excluded regions are no longer available to the RegionAllocator, so
      should not be freeable so actually enforce that and aAdd a test.
      
      Bug: v8:10454
      Change-Id: I51c41cf0bf3d2eeb699b10b1fa02f5465d93b6aa
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2330026Reviewed-by: 's avatarIgor Sheludko (OOO Aug 3-17) <ishell@chromium.org>
      Commit-Queue: Dan Elphick <delphick@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69163}
      8130e54d
  17. 30 Jul, 2020 1 commit
    • Dan Elphick's avatar
      [platform] Add SharedMemory allocation and mapping · c1c38e19
      Dan Elphick authored
      This adds new methods AllocateSharedPages, ReserveForSharedMemoryMapping
      and CanAllocateSharedPages to v8::PageAllocator, which if overridden
      allows the platform to declare that it supports allocation and remapping
      of shared memory.
      
      This interface is currently a work in progress so the new methods are
      marked "INTERNAL ONLY" and they may change without being first
      deprecated.
      
      An implementation of PageAllocator is provided that can allocate and map
      shared memory on Linux and Android, but no other platforms are yet
      supported. While Windows is not supported the interface has been
      designed to make this possible as AllocateSharedPages returns a
      SharedMemory object that wraps the shared memory and provides its own
      remap function. This should allow the SharedMemory object on windows to
      contain a mapping a to hFileMappingObject as required by
      MapViewOfFileEx.
      
      Bug: v8:10454
      Change-Id: I2e601d49ea14da44867a102c823fa4e341cf0dab
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2306789Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Commit-Queue: Dan Elphick <delphick@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69154}
      c1c38e19
  18. 24 Jul, 2020 2 commits
  19. 22 Jul, 2020 1 commit
  20. 20 Jul, 2020 2 commits
  21. 16 Jul, 2020 2 commits
  22. 15 Jul, 2020 2 commits
  23. 14 Jul, 2020 1 commit
    • Ng Zhi An's avatar
      [wasm-simd][arm64][arm] Fix v128.const · 7c10560d
      Ng Zhi An authored
      There is a sign-extension bug happening when packing 2 32-bit ints into
      a 64-bit int. We are OR-ing int32_t with a uint64_t, so an integral
      conversion converts int32_t to uint64_t, which is a sign extension, and
      this gives unexpected results for a negative value:
      
          0x80000000 | uint64_t{0} -> 0xffffffff80000000
      
      What we want is 0x0000000080000000.
      
      Created a helper function to do this work of combining two uint32_t
      into one uint64_t. The use of this function will also ensure that
      if callers passed a int32_t, it would first be converted to a
      uint32_t, and will not have this sign extension bug.
      
      Sneaked a small regression test into the existing v128.const cctest,
      and also cleanup the loop to reset `expected` array to 0.
      
      Bug: chromium:1104033
      Change-Id: Icaca4c5ba42077dd4463697b9220cdbca9974b5e
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2293044
      Commit-Queue: Zhi An Ng <zhin@chromium.org>
      Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#68850}
      7c10560d
  24. 08 Jul, 2020 1 commit
    • Clemens Backes's avatar
      [wasm] Split decoder functions · d696c37d
      Clemens Backes authored
      Instead of having one method with a big switch, and specializing that
      method for each single opcode, we now have one proper method per opcode.
      This makes the code way more readable, and also reduces the compile time
      of liftoff-compiler.cc significantly.
      
      Unfortunately, we cannot use template specializations for this, since
      GCC does not support specializing the methods within an unspecialized
      templated class.
      Hence, we need to have another dispatch per opcode when generating the
      opcode handler table. I left a comment explaining why we do it this way.
      The upside of this is that we get nicer method names.
      
      R=thibaudm@chromium.org
      
      Bug: v8:10576
      Change-Id: I8c7026177490893711c999217eeb1e4f2fbb5e36
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2282533
      Commit-Queue: Clemens Backes <clemensb@chromium.org>
      Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#68732}
      d696c37d
  25. 30 Jun, 2020 2 commits
  26. 29 Jun, 2020 1 commit