1 Solaris x86_64 allocates some user space memory in the canonical
2 'higher half' of the address space. Consequently, on Solaris x86_64,
3 a pointer may reference either the lower half or higher half.
5 As the MemoryTracker persists only the low order 56 bits, we must
6 reconstitute the high order bits in this case, as they may well not
9 We can recover the bits easily, though, as the x86_64 specification
10 requires the most significant 16 bits of any virtual address, bits 48
11 through 63, be copies of bit 47, in a manner akin to sign extension.
13 Suitable for upstream, though not a likely candidate, as Solaris seems
14 to be the only operating system that allocates user space memory in
18 --- a/js/src/gc/Scheduling.cpp 2021-08-16 19:14:35.000000000 +0000
19 +++ b/js/src/gc/Scheduling.cpp 2021-09-06 17:12:00.451552042 +0000
22 template <typename Ptr>
23 inline Ptr* MemoryTracker::Key<Ptr>::ptr() const {
25 + return reinterpret_cast<Ptr*>((static_cast<intptr_t>(ptr_) << 16) >> 16);
27 return reinterpret_cast<Ptr*>(ptr_);
30 template <typename Ptr>
31 inline MemoryUse MemoryTracker::Key<Ptr>::use() const {