Title: [293799] trunk/Source/_javascript_Core
Revision
293799
Author
ysuz...@apple.com
Date
2022-05-04 16:17:13 -0700 (Wed, 04 May 2022)

Log Message

[JSC] Use decontaminate in StructureID::decode
https://bugs.webkit.org/show_bug.cgi?id=240088

Reviewed by Saam Barati and Mark Lam.

We have a bug that ENABLE(STRUCTURE_ID_WITH_SHIFT) and CPU(ADDRESS32) version of StructureID::decode
does not have decontaminate() call. It is wrong since these ID can be decoded concurrently. This patch fixes it.

* Source/_javascript_Core/runtime/StructureID.h:
(JSC::StructureID::decode const):

Canonical link: https://commits.webkit.org/250273@main

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (293798 => 293799)


--- trunk/Source/_javascript_Core/ChangeLog	2022-05-04 23:14:45 UTC (rev 293798)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-05-04 23:17:13 UTC (rev 293799)
@@ -1,3 +1,16 @@
+2022-05-04  Yusuke Suzuki  <ysuz...@apple.com>
+
+        [JSC] Use decontaminate in StructureID::decode
+        https://bugs.webkit.org/show_bug.cgi?id=240088
+
+        Reviewed by Saam Barati and Mark Lam.
+
+        We have a bug that ENABLE(STRUCTURE_ID_WITH_SHIFT) and CPU(ADDRESS32) version of StructureID::decode
+        does not have decontaminate() call. It is wrong since these ID can be decoded concurrently. This patch fixes it.
+
+        * runtime/StructureID.h:
+        (JSC::StructureID::decode const):
+
 2022-05-04  Mark Lam  <mark....@apple.com>
 
         Use IterationStatus in more places.

Modified: trunk/Source/_javascript_Core/runtime/StructureID.h (293798 => 293799)


--- trunk/Source/_javascript_Core/runtime/StructureID.h	2022-05-04 23:14:45 UTC (rev 293798)
+++ trunk/Source/_javascript_Core/runtime/StructureID.h	2022-05-04 23:17:13 UTC (rev 293799)
@@ -88,7 +88,7 @@
 ALWAYS_INLINE Structure* StructureID::decode() const
 {
     ASSERT(decontaminate());
-    return reinterpret_cast<Structure*>(static_cast<uintptr_t>(m_bits) << encodeShiftAmount);
+    return reinterpret_cast<Structure*>(static_cast<uintptr_t>(decontaminate().m_bits) << encodeShiftAmount);
 }
 
 ALWAYS_INLINE Structure* StructureID::tryDecode() const
@@ -140,7 +140,7 @@
 ALWAYS_INLINE Structure* StructureID::decode() const
 {
     ASSERT(decontaminate());
-    return reinterpret_cast<Structure*>(m_bits);
+    return reinterpret_cast<Structure*>(decontaminate().m_bits);
 }
 
 ALWAYS_INLINE Structure* StructureID::tryDecode() const
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to