Changeset 251372 in webkit


Ignore:
Timestamp:
Oct 21, 2019 12:15:26 PM (5 years ago)
Author:
mark.lam@apple.com
Message:

Remove all uses of untagCodePtr in debugging code.
https://bugs.webkit.org/show_bug.cgi?id=203188
<rdar://problem/56453043>

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

  • runtime/JSCPtrTag.cpp:

(JSC::tagForPtr):

Source/WTF:

We want the ability to always assert on failure to authenticate in untagCodePtr
(though we don't currently do that yet).

  • wtf/PtrTag.cpp:

(WTF::tagForPtr):

  • wtf/PtrTag.h:

(WTF::retagCodePtrImpl):
(WTF::tagCFunctionPtrImpl):
(WTF::untagCFunctionPtrImpl):
(WTF::assertIsCFunctionPtr):
(WTF::isTaggedWith):

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r251371 r251372  
     12019-10-21  Mark Lam  <mark.lam@apple.com>
     2
     3        Remove all uses of untagCodePtr in debugging code.
     4        https://bugs.webkit.org/show_bug.cgi?id=203188
     5        <rdar://problem/56453043>
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        * runtime/JSCPtrTag.cpp:
     10        (JSC::tagForPtr):
     11
    1122019-10-21  Robin Morisset  <rmorisset@apple.com>
    213
  • trunk/Source/JavaScriptCore/runtime/JSCPtrTag.cpp

    r243254 r251372  
    3434{
    3535#define RETURN_NAME_IF_TAG_MATCHES(tag) \
    36     if (WTF::untagCodePtrImpl<WTF::PtrTagAction::NoAssert>(ptr, JSC::tag) == removeCodePtrTag(ptr)) \
     36    if (ptr == WTF::tagCodePtrImpl<WTF::PtrTagAction::NoAssert>(removeCodePtrTag(ptr), JSC::tag)) \
    3737        return #tag;
    3838    FOR_EACH_JSC_PTRTAG(RETURN_NAME_IF_TAG_MATCHES)
  • trunk/Source/WTF/ChangeLog

    r251325 r251372  
     12019-10-20  Mark Lam  <mark.lam@apple.com>
     2
     3        Remove all uses of untagCodePtr in debugging code.
     4        https://bugs.webkit.org/show_bug.cgi?id=203188
     5        <rdar://problem/56453043>
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        We want the ability to always assert on failure to authenticate in untagCodePtr
     10        (though we don't currently do that yet).
     11
     12        * wtf/PtrTag.cpp:
     13        (WTF::tagForPtr):
     14        * wtf/PtrTag.h:
     15        (WTF::retagCodePtrImpl):
     16        (WTF::tagCFunctionPtrImpl):
     17        (WTF::untagCFunctionPtrImpl):
     18        (WTF::assertIsCFunctionPtr):
     19        (WTF::isTaggedWith):
     20
    1212019-10-19  Simon Fraser  <simon.fraser@apple.com>
    222
  • trunk/Source/WTF/wtf/PtrTag.cpp

    r243254 r251372  
    4747
    4848#define RETURN_NAME_IF_TAG_MATCHES(tag) \
    49     if (untagCodePtrImpl<PtrTagAction::NoAssert>(ptr, tag) == removeCodePtrTag(ptr)) \
     49    if (ptr == tagCodePtrImpl<PtrTagAction::NoAssert>(removeCodePtrTag(ptr), tag)) \
    5050        return #tag;
    5151    FOR_EACH_WTF_PTRTAG(RETURN_NAME_IF_TAG_MATCHES)
  • trunk/Source/WTF/wtf/PtrTag.h

    r248192 r251372  
    264264        return nullptr;
    265265    PtrTagAction untagAction = (tagAction == PtrTagAction::NoAssert) ? PtrTagAction::NoAssert : PtrTagAction::ReleaseAssert;
    266     WTF_PTRTAG_ASSERT(untagAction, ptr, oldTag, removeCodePtrTag(ptr) == untagCodePtrImpl<PtrTagAction::NoAssert>(ptr, oldTag));
     266    WTF_PTRTAG_ASSERT(untagAction, ptr, oldTag, ptr == tagCodePtrImpl<PtrTagAction::NoAssert>(removeCodePtrTag(ptr), oldTag));
    267267    PtrType result = retagCodePtrImplHelper<tagAction>(ptr, oldTag, newTag);
    268268    WTF_PTRTAG_ASSERT(tagAction, ptr, newTag, result == tagCodePtrImpl<PtrTagAction::NoAssert>(removeCodePtrTag(ptr), newTag));
     
    296296    if (!ptr)
    297297        return nullptr;
    298     WTF_PTRTAG_ASSERT(tagAction, ptr, CFunctionPtrTag, removeCodePtrTag(ptr) == untagCodePtrImpl<PtrTagAction::NoAssert>(ptr, CFunctionPtrTag));
     298    WTF_PTRTAG_ASSERT(tagAction, ptr, CFunctionPtrTag, ptr == tagCodePtrImpl<PtrTagAction::NoAssert>(removeCodePtrTag(ptr), CFunctionPtrTag));
    299299    return retagCodePtrImpl<tagAction>(ptr, CFunctionPtrTag, tag);
    300300}
     
    326326    if (!ptr)
    327327        return nullptr;
    328     WTF_PTRTAG_ASSERT(tagAction, ptr, tag, removeCodePtrTag(ptr) == untagCodePtrImpl<PtrTagAction::NoAssert>(ptr, tag));
     328    WTF_PTRTAG_ASSERT(tagAction, ptr, tag, ptr == tagCodePtrImpl<PtrTagAction::NoAssert>(removeCodePtrTag(ptr), tag));
    329329    return retagCodePtrImpl<tagAction>(ptr, tag, CFunctionPtrTag);
    330330}
     
    368368{
    369369    void* ptr = bitwise_cast<void*>(value);
    370     WTF_PTRTAG_ASSERT(PtrTagAction::ReleaseAssert, ptr, CFunctionPtrTag, untagCodePtrImpl<PtrTagAction::NoAssert>(ptr, CFunctionPtrTag) == removeCodePtrTag(ptr));
     370    WTF_PTRTAG_ASSERT(PtrTagAction::ReleaseAssert, ptr, CFunctionPtrTag, ptr == tagCodePtrImpl<PtrTagAction::NoAssert>(removeCodePtrTag(ptr), CFunctionPtrTag));
    371371}
    372372
     
    405405    if (tag == NoPtrTag)
    406406        return ptr == removeCodePtrTag(ptr);
    407     return untagCodePtrImpl<PtrTagAction::NoAssert>(ptr, tag) == removeCodePtrTag(ptr);
     407    return ptr == tagCodePtrImpl<PtrTagAction::NoAssert>(removeCodePtrTag(ptr), tag);
    408408}
    409409
Note: See TracChangeset for help on using the changeset viewer.