Bug 215030

Summary: Use OS defined value for size of address space on Darwin
Product: WebKit Reporter: Keith Miller <keith_miller>
Component: New BugsAssignee: Keith Miller <keith_miller>
Status: RESOLVED WONTFIX    
Severity: Normal CC: benjamin, cdumez, cmarcelo, ews-watchlist, ysuzuki
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Keith Miller 2020-07-31 13:04:10 PDT
Use OS defined value for size of address space on Darwin
Comment 1 Keith Miller 2020-07-31 13:14:08 PDT
Created attachment 405730 [details]
Patch
Comment 2 Keith Miller 2020-07-31 13:17:07 PDT
Created attachment 405731 [details]
Patch
Comment 3 Yusuke Suzuki 2020-07-31 13:25:50 PDT
Comment on attachment 405731 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=405731&action=review

> Source/WTF/wtf/PlatformOS.h:39
> +#include <mach/vm_param.h>

I guess it does not work IIRC: Platform.h can be included when processing sandbox definitions IIRC. So we cannot include any C / C++ things in Platform.h and dependent headers.

> Source/WTF/wtf/PlatformOS.h:143
> +#define WTF_OS_CONSTANT_EFFECTIVE_ADDRESS_WIDTH (64 - WTF::clzConstexpr(MACH_VM_MAX_ADDRESS))

Unfortunately, MACH_VM_MAX_ADDRESS is broken: MACH_VM_MAX_ADDRESS is beyond 32bit even in ARM64_32.
In this case, this is OK since it is inside `CPU(ADDRESS64)`, but it would be possible that this macro returns broken value...
Comment 4 Keith Miller 2020-07-31 14:00:44 PDT
Oh, that's gross... nvm then.