[JSC] Remove distancing for LargeAllocation
authorysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Mar 2019 23:33:31 +0000 (23:33 +0000)
committerysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Mar 2019 23:33:31 +0000 (23:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196335

Reviewed by Saam Barati.

In r230226, we removed distancing feature from our GC. This patch removes remaining distancing thing in LargeAllocation.

* heap/HeapCell.h:
* heap/LargeAllocation.cpp:
(JSC::LargeAllocation::tryCreate):
* heap/MarkedBlock.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243667 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/heap/HeapCell.h
Source/JavaScriptCore/heap/LargeAllocation.cpp
Source/JavaScriptCore/heap/MarkedBlock.h

index 85a1673..9bb447c 100644 (file)
@@ -1,3 +1,17 @@
+2019-03-29  Yusuke Suzuki  <ysuzuki@apple.com>
+
+        [JSC] Remove distancing for LargeAllocation
+        https://bugs.webkit.org/show_bug.cgi?id=196335
+
+        Reviewed by Saam Barati.
+
+        In r230226, we removed distancing feature from our GC. This patch removes remaining distancing thing in LargeAllocation.
+
+        * heap/HeapCell.h:
+        * heap/LargeAllocation.cpp:
+        (JSC::LargeAllocation::tryCreate):
+        * heap/MarkedBlock.h:
+
 2019-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
 
         Delete WebMetal implementation in favor of WebGPU
index 09ca433..a9fef3f 100644 (file)
@@ -37,8 +37,6 @@ class Subspace;
 class VM;
 struct CellAttributes;
 
-static constexpr unsigned minimumDistanceBetweenCellsFromDifferentOrigins = sizeof(void*) == 8 ? 304 : 288;
-
 class HeapCell {
 public:
     enum Kind : int8_t {
index 255e931..8cf62a4 100644 (file)
@@ -39,18 +39,12 @@ LargeAllocation* LargeAllocation::tryCreate(Heap& heap, size_t size, Subspace* s
     if (validateDFGDoesGC)
         RELEASE_ASSERT(heap.expectDoesGC());
 
-    // This includes padding at the end of the allocation to maintain the distancing constraint.
-    constexpr size_t distancing = minimumDistanceBetweenCellsFromDifferentOrigins;
-    size_t sizeBeforeDistancing = headerSize() + size;
-    size_t sizeIncludingDistancing = sizeBeforeDistancing + distancing;
+    size_t allocationSize = headerSize() + size;
     
-    void* space = subspace->alignedMemoryAllocator()->tryAllocateAlignedMemory(alignment, sizeIncludingDistancing);
+    void* space = subspace->alignedMemoryAllocator()->tryAllocateAlignedMemory(alignment, allocationSize);
     if (!space)
         return nullptr;
     
-    // Make sure that the padding does not contain useful things.
-    memset(static_cast<char*>(space) + sizeBeforeDistancing, 0, distancing);
-    
     if (scribbleFreeCells())
         scribble(space, size);
     return new (NotNull, space) LargeAllocation(heap, size, subspace);
index e240f0a..a35660b 100644 (file)
@@ -304,7 +304,6 @@ public:
     static constexpr size_t footerSize = blockSize - payloadSize;
 
     static_assert(payloadSize == ((blockSize - sizeof(MarkedBlock::Footer)) & ~(atomSize - 1)), "Payload size computed the alternate way should give the same result");
-    static_assert(footerSize >= minimumDistanceBetweenCellsFromDifferentOrigins, "Footer is not big enough to create the necessary distance between objects from different origins");
     
     static MarkedBlock::Handle* tryCreate(Heap&, AlignedMemoryAllocator*);