Title: [252341] trunk/Source/_javascript_Core
Revision
252341
Author
[email protected]
Date
2019-11-11 15:57:40 -0800 (Mon, 11 Nov 2019)

Log Message

Unreviewed, fix alignment adjustment when reusing PreciseAllocation
https://bugs.webkit.org/show_bug.cgi?id=201908

* heap/PreciseAllocation.cpp:
(JSC::PreciseAllocation::reuseForLowerTier):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (252340 => 252341)


--- trunk/Source/_javascript_Core/ChangeLog	2019-11-11 23:26:18 UTC (rev 252340)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-11-11 23:57:40 UTC (rev 252341)
@@ -1,3 +1,11 @@
+2019-11-11  Yusuke Suzuki  <[email protected]>
+
+        Unreviewed, fix alignment adjustment when reusing PreciseAllocation
+        https://bugs.webkit.org/show_bug.cgi?id=201908
+
+        * heap/PreciseAllocation.cpp:
+        (JSC::PreciseAllocation::reuseForLowerTier):
+
 2019-11-11  Tuomas Karkkainen  <[email protected]>
 
         Typo in assertion in validateCPS in DFGValidate.cpp ("Unexecpted")

Modified: trunk/Source/_javascript_Core/heap/PreciseAllocation.cpp (252340 => 252341)


--- trunk/Source/_javascript_Core/heap/PreciseAllocation.cpp	2019-11-11 23:26:18 UTC (rev 252340)
+++ trunk/Source/_javascript_Core/heap/PreciseAllocation.cpp	2019-11-11 23:57:40 UTC (rev 252341)
@@ -152,10 +152,15 @@
     Subspace* subspace = m_subspace;
     bool adjustedAlignment = m_adjustedAlignment;
     uint8_t lowerTierIndex = m_lowerTierIndex;
+    void* basePointer = this->basePointer();
 
-    void* space = this->basePointer();
     this->~PreciseAllocation();
 
+    void* space = basePointer;
+    ASSERT(isAlignedForPreciseAllocation(basePointer) == adjustedAlignment);
+    if (adjustedAlignment)
+        space = bitwise_cast<void*>(bitwise_cast<uintptr_t>(basePointer) + halfAlignment);
+
     PreciseAllocation* preciseAllocation = new (NotNull, space) PreciseAllocation(heap, size, subspace, 0, adjustedAlignment);
     preciseAllocation->m_lowerTierIndex = lowerTierIndex;
     preciseAllocation->m_hasValidCell = false;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to