Changeset 267221 in webkit


Ignore:
Timestamp:
Sep 17, 2020, 7:06:41 PM (5 years ago)
Author:
mark.lam@apple.com
Message:

Use OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH) in speculationFromCell()'s isSanePointer().
https://bugs.webkit.org/show_bug.cgi?id=216638

Reviewed by Saam Barati.

We should be using OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH) instead of assuming the
width of the pointer address bits.

  • bytecode/SpeculatedType.cpp:

(JSC::isSanePointer):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r267219 r267221  
     12020-09-17  Mark Lam  <mark.lam@apple.com>
     2
     3        Use OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH) in speculationFromCell()'s isSanePointer().
     4        https://bugs.webkit.org/show_bug.cgi?id=216638
     5
     6        Reviewed by Saam Barati.
     7
     8        We should be using OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH) instead of assuming the
     9        width of the pointer address bits.
     10
     11        * bytecode/SpeculatedType.cpp:
     12        (JSC::isSanePointer):
     13
    1142020-09-17  Devin Rousso  <drousso@apple.com>
    215
  • trunk/Source/JavaScriptCore/bytecode/SpeculatedType.cpp

    r267192 r267221  
    554554#if CPU(ADDRESS64)
    555555    uintptr_t pointerAsInt = bitwise_cast<uintptr_t>(pointer);
    556     uintptr_t canonicalPointerBits = pointerAsInt << 16;
    557     uintptr_t nonCanonicalPointerBits = pointerAsInt >> 48;
     556    uintptr_t canonicalPointerBits = pointerAsInt << (64 - OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH));
     557    uintptr_t nonCanonicalPointerBits = pointerAsInt >> OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH);
    558558    return !nonCanonicalPointerBits && canonicalPointerBits;
    559559#else
Note: See TracChangeset for help on using the changeset viewer.