Title: [251372] trunk/Source
Revision
251372
Author
[email protected]
Date
2019-10-21 12:15:26 -0700 (Mon, 21 Oct 2019)

Log 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/_javascript_Core:

* 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):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (251371 => 251372)


--- trunk/Source/_javascript_Core/ChangeLog	2019-10-21 19:06:48 UTC (rev 251371)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-10-21 19:15:26 UTC (rev 251372)
@@ -1,3 +1,14 @@
+2019-10-21  Mark Lam  <[email protected]>
+
+        Remove all uses of untagCodePtr in debugging code.
+        https://bugs.webkit.org/show_bug.cgi?id=203188
+        <rdar://problem/56453043> 
+
+        Reviewed by Yusuke Suzuki.
+
+        * runtime/JSCPtrTag.cpp:
+        (JSC::tagForPtr):
+
 2019-10-21  Robin Morisset  <[email protected]>
 
         Post increment/decrement should only call ToNumber once

Modified: trunk/Source/_javascript_Core/runtime/JSCPtrTag.cpp (251371 => 251372)


--- trunk/Source/_javascript_Core/runtime/JSCPtrTag.cpp	2019-10-21 19:06:48 UTC (rev 251371)
+++ trunk/Source/_javascript_Core/runtime/JSCPtrTag.cpp	2019-10-21 19:15:26 UTC (rev 251372)
@@ -33,7 +33,7 @@
 static const char* tagForPtr(const void* ptr)
 {
 #define RETURN_NAME_IF_TAG_MATCHES(tag) \
-    if (WTF::untagCodePtrImpl<WTF::PtrTagAction::NoAssert>(ptr, JSC::tag) == removeCodePtrTag(ptr)) \
+    if (ptr == WTF::tagCodePtrImpl<WTF::PtrTagAction::NoAssert>(removeCodePtrTag(ptr), JSC::tag)) \
         return #tag;
     FOR_EACH_JSC_PTRTAG(RETURN_NAME_IF_TAG_MATCHES)
 #undef RETURN_NAME_IF_TAG_MATCHES

Modified: trunk/Source/WTF/ChangeLog (251371 => 251372)


--- trunk/Source/WTF/ChangeLog	2019-10-21 19:06:48 UTC (rev 251371)
+++ trunk/Source/WTF/ChangeLog	2019-10-21 19:15:26 UTC (rev 251372)
@@ -1,3 +1,23 @@
+2019-10-20  Mark Lam  <[email protected]>
+
+        Remove all uses of untagCodePtr in debugging code.
+        https://bugs.webkit.org/show_bug.cgi?id=203188
+        <rdar://problem/56453043> 
+
+        Reviewed by Yusuke Suzuki.
+
+        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):
+
 2019-10-19  Simon Fraser  <[email protected]>
 
         Add support to TextStream for dumping HashMap<> and HashSet<>

Modified: trunk/Source/WTF/wtf/PtrTag.cpp (251371 => 251372)


--- trunk/Source/WTF/wtf/PtrTag.cpp	2019-10-21 19:06:48 UTC (rev 251371)
+++ trunk/Source/WTF/wtf/PtrTag.cpp	2019-10-21 19:15:26 UTC (rev 251372)
@@ -46,7 +46,7 @@
         return "NoPtrTag";
 
 #define RETURN_NAME_IF_TAG_MATCHES(tag) \
-    if (untagCodePtrImpl<PtrTagAction::NoAssert>(ptr, tag) == removeCodePtrTag(ptr)) \
+    if (ptr == tagCodePtrImpl<PtrTagAction::NoAssert>(removeCodePtrTag(ptr), tag)) \
         return #tag;
     FOR_EACH_WTF_PTRTAG(RETURN_NAME_IF_TAG_MATCHES)
 #undef RETURN_NAME_IF_TAG_MATCHES

Modified: trunk/Source/WTF/wtf/PtrTag.h (251371 => 251372)


--- trunk/Source/WTF/wtf/PtrTag.h	2019-10-21 19:06:48 UTC (rev 251371)
+++ trunk/Source/WTF/wtf/PtrTag.h	2019-10-21 19:15:26 UTC (rev 251372)
@@ -263,7 +263,7 @@
     if (!ptr)
         return nullptr;
     PtrTagAction untagAction = (tagAction == PtrTagAction::NoAssert) ? PtrTagAction::NoAssert : PtrTagAction::ReleaseAssert;
-    WTF_PTRTAG_ASSERT(untagAction, ptr, oldTag, removeCodePtrTag(ptr) == untagCodePtrImpl<PtrTagAction::NoAssert>(ptr, oldTag));
+    WTF_PTRTAG_ASSERT(untagAction, ptr, oldTag, ptr == tagCodePtrImpl<PtrTagAction::NoAssert>(removeCodePtrTag(ptr), oldTag));
     PtrType result = retagCodePtrImplHelper<tagAction>(ptr, oldTag, newTag);
     WTF_PTRTAG_ASSERT(tagAction, ptr, newTag, result == tagCodePtrImpl<PtrTagAction::NoAssert>(removeCodePtrTag(ptr), newTag));
     return result;
@@ -295,7 +295,7 @@
 {
     if (!ptr)
         return nullptr;
-    WTF_PTRTAG_ASSERT(tagAction, ptr, CFunctionPtrTag, removeCodePtrTag(ptr) == untagCodePtrImpl<PtrTagAction::NoAssert>(ptr, CFunctionPtrTag));
+    WTF_PTRTAG_ASSERT(tagAction, ptr, CFunctionPtrTag, ptr == tagCodePtrImpl<PtrTagAction::NoAssert>(removeCodePtrTag(ptr), CFunctionPtrTag));
     return retagCodePtrImpl<tagAction>(ptr, CFunctionPtrTag, tag);
 }
 
@@ -325,7 +325,7 @@
 {
     if (!ptr)
         return nullptr;
-    WTF_PTRTAG_ASSERT(tagAction, ptr, tag, removeCodePtrTag(ptr) == untagCodePtrImpl<PtrTagAction::NoAssert>(ptr, tag));
+    WTF_PTRTAG_ASSERT(tagAction, ptr, tag, ptr == tagCodePtrImpl<PtrTagAction::NoAssert>(removeCodePtrTag(ptr), tag));
     return retagCodePtrImpl<tagAction>(ptr, tag, CFunctionPtrTag);
 }
 
@@ -367,7 +367,7 @@
 void assertIsCFunctionPtr(PtrType value)
 {
     void* ptr = bitwise_cast<void*>(value);
-    WTF_PTRTAG_ASSERT(PtrTagAction::ReleaseAssert, ptr, CFunctionPtrTag, untagCodePtrImpl<PtrTagAction::NoAssert>(ptr, CFunctionPtrTag) == removeCodePtrTag(ptr));
+    WTF_PTRTAG_ASSERT(PtrTagAction::ReleaseAssert, ptr, CFunctionPtrTag, ptr == tagCodePtrImpl<PtrTagAction::NoAssert>(removeCodePtrTag(ptr), CFunctionPtrTag));
 }
 
 template<typename PtrType>
@@ -404,7 +404,7 @@
     void* ptr = bitwise_cast<void*>(value);
     if (tag == NoPtrTag)
         return ptr == removeCodePtrTag(ptr);
-    return untagCodePtrImpl<PtrTagAction::NoAssert>(ptr, tag) == removeCodePtrTag(ptr);
+    return ptr == tagCodePtrImpl<PtrTagAction::NoAssert>(removeCodePtrTag(ptr), tag);
 }
 
 template<typename PtrType>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to