Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 640f12012b649fa3d73f80b4d1f35ce53a96e484
      
https://github.com/WebKit/WebKit/commit/640f12012b649fa3d73f80b4d1f35ce53a96e484
  Author: Mark Lam <[email protected]>
  Date:   2025-10-13 (Mon, 13 Oct 2025)

  Changed paths:
    M Source/JavaScriptCore/runtime/StructureID.h
    M Source/WTF/wtf/CompactPtr.h
    M Source/WTF/wtf/FastMalloc.h
    M Source/WTF/wtf/Mmap.h
    M Source/WTF/wtf/PlatformHave.h
    M Source/WTF/wtf/SequesteredImmortalHeap.h
    M Source/WTF/wtf/WTFConfig.cpp
    M Source/bmalloc/bmalloc/BAssert.h
    M Source/bmalloc/bmalloc/BPlatform.h
    M Source/bmalloc/bmalloc/Gigacage.h
    M Source/bmalloc/bmalloc/VMAllocate.cpp
    M Source/bmalloc/bmalloc/VMAllocate.h
    M Source/bmalloc/bmalloc/bmalloc.cpp
    M Source/bmalloc/libpas/src/libpas/pas_page_malloc.c
    M Source/bmalloc/libpas/src/libpas/pas_platform.h
    M Source/bmalloc/libpas/src/libpas/pas_root.c
    M Source/bmalloc/libpas/src/libpas/pas_utils.h

  Log Message:
  -----------
  Make HAVE(36BIT_ADDRESS) a top level compile time flag.
https://bugs.webkit.org/show_bug.cgi?id=300611
rdar://162307680

Reviewed by Yusuke Suzuki.

It was previously only defined in CompactPtr.h.  This way, we can use this flag 
(and its libpas
and bmalloc equivalents) to uniformly control all code that are conditional on 
the platform
having 36-bit data addresses instead of inferring it from 
MACH_VM_MAX_ADDRESS_RAW.  This also
makes it easier to later grep for all these places that rely on having 36-bit 
data addresses.

Also made the following changes:

1. Added RELEASE_ASSERTs after mmap() calls to ensure that data addresses 
returned by the
   kernel are indeed 36-bit data addresses.

2. When HAVE(36BIT_ADDRESS), override WTF_OS_CONSTANT_EFFECTIVE_ADDRESS_WIDTH 
(and peers)
   to be 36.  Don't need to be clever and try to infer it from 
MACH_VM_MAX_ADDRESS, which
   may or may not yield the correct WTF_OS_CONSTANT_EFFECTIVE_ADDRESS_WIDTH in 
practice.

3. Added the BHAVE() macro to BPlatform.h, and fix up the other macros there to 
use the
   _FEATURE macro argument consistently.  Some were using WTF_FEATURE, which is 
a copy paste
   artifact.  While it's innocuous, let's make the code consistent and not 
reference WTF
   (which is a higher layer).

4. Added some sanity #if checks in bmalloc.cpp and WTFConfig.cpp to ensure that
   HAVE(36BIT_ADDRESS), BHAVE(36BIT_ADDRESS), and PAS_HAVE(36BIT_ADDRESS) all 
match each
   other.

This change is mainly code re-factoring with some extra RELEASE_ASSERTs as 
sanity checks.
Existing tests provide sufficient coverage for this change.

* Source/JavaScriptCore/runtime/StructureID.h:
* Source/WTF/wtf/CompactPtr.h:
* Source/WTF/wtf/FastMalloc.h:
* Source/WTF/wtf/Mmap.h:
(WTF::Mmap::mmap):
* Source/WTF/wtf/PlatformHave.h:
* Source/WTF/wtf/SequesteredImmortalHeap.h:
* Source/WTF/wtf/WTFConfig.cpp:
* Source/bmalloc/bmalloc/BAssert.h:
* Source/bmalloc/bmalloc/BPlatform.h:
* Source/bmalloc/bmalloc/Gigacage.h:
* Source/bmalloc/bmalloc/VMAllocate.cpp:
(bmalloc::zeroFillLatchIfMadvZeroIsSupported):
* Source/bmalloc/bmalloc/VMAllocate.h:
(bmalloc::tryVMAllocate):
(bmalloc::vmZeroAndPurge):
* Source/bmalloc/bmalloc/bmalloc.cpp:
(bmalloc::api::mallocOutOfLine):
* Source/bmalloc/libpas/src/libpas/pas_page_malloc.c:
(pas_page_malloc_try_map_pages):
(pas_page_malloc_zero_fill_latch_if_madv_zero_is_supported):
(pas_page_malloc_zero_fill):
* Source/bmalloc/libpas/src/libpas/pas_platform.h:
* Source/bmalloc/libpas/src/libpas/pas_root.c:
(pas_root_visit_conservative_candidate_pointers_in_address_range):
* Source/bmalloc/libpas/src/libpas/pas_utils.h:

Canonical link: https://commits.webkit.org/301407@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to