Title: [242912] trunk/Source/_javascript_Core
Revision
242912
Author
[email protected]
Date
2019-03-13 15:05:19 -0700 (Wed, 13 Mar 2019)

Log Message

Remove unneeded --tradeDestructorBlocks option.
https://bugs.webkit.org/show_bug.cgi?id=195698
<rdar://problem/39681388>

Reviewed by Yusuke Suzuki.

There's no reason why we would ever want --tradeDestructorBlocks to be false.

Also, there was an assertion in BlockDirectory::endMarking() for when
(!Options::tradeDestructorBlocks() && needsDestruction()).  This assertion is
outdated because the BlockDirectory's m_empty set used to mean the set of all
blocks that have no live (as in not reachable by GC) objects and dead objects
also do not require destructors to be called on them.  The current meaning of
m_empty is that it is the set of all blocks that have no live objects,
independent of whether they needs destructors to be called on them or not.
The assertion is no longer valid for the new meaning of m_empty as m_empty may
now contain destructible blocks.  This assertion is now removed as part of this
patch.

* heap/BlockDirectory.cpp:
(JSC::BlockDirectory::endMarking):
* heap/LocalAllocator.cpp:
(JSC::LocalAllocator::tryAllocateWithoutCollecting):
* runtime/Options.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (242911 => 242912)


--- trunk/Source/_javascript_Core/ChangeLog	2019-03-13 21:47:13 UTC (rev 242911)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-03-13 22:05:19 UTC (rev 242912)
@@ -1,3 +1,30 @@
+2019-03-13  Mark Lam  <[email protected]>
+
+        Remove unneeded --tradeDestructorBlocks option.
+        https://bugs.webkit.org/show_bug.cgi?id=195698
+        <rdar://problem/39681388>
+
+        Reviewed by Yusuke Suzuki.
+
+        There's no reason why we would ever want --tradeDestructorBlocks to be false.
+
+        Also, there was an assertion in BlockDirectory::endMarking() for when
+        (!Options::tradeDestructorBlocks() && needsDestruction()).  This assertion is
+        outdated because the BlockDirectory's m_empty set used to mean the set of all
+        blocks that have no live (as in not reachable by GC) objects and dead objects
+        also do not require destructors to be called on them.  The current meaning of
+        m_empty is that it is the set of all blocks that have no live objects,
+        independent of whether they needs destructors to be called on them or not.
+        The assertion is no longer valid for the new meaning of m_empty as m_empty may
+        now contain destructible blocks.  This assertion is now removed as part of this
+        patch.
+
+        * heap/BlockDirectory.cpp:
+        (JSC::BlockDirectory::endMarking):
+        * heap/LocalAllocator.cpp:
+        (JSC::LocalAllocator::tryAllocateWithoutCollecting):
+        * runtime/Options.h:
+
 2019-03-13  Dominik Infuehr  <[email protected]>
 
         String overflow when using StringBuilder in JSC::createError

Modified: trunk/Source/_javascript_Core/heap/BlockDirectory.cpp (242911 => 242912)


--- trunk/Source/_javascript_Core/heap/BlockDirectory.cpp	2019-03-13 21:47:13 UTC (rev 242911)
+++ trunk/Source/_javascript_Core/heap/BlockDirectory.cpp	2019-03-13 22:05:19 UTC (rev 242912)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -249,14 +249,9 @@
     // know what kind of collection it is. That knowledge is already encoded in the m_markingXYZ
     // vectors.
     
-    if (!Options::tradeDestructorBlocks() && needsDestruction()) {
-        ASSERT(m_empty.isEmpty());
-        m_canAllocateButNotEmpty = m_live & ~m_markingRetired;
-    } else {
-        m_empty = m_live & ~m_markingNotEmpty;
-        m_canAllocateButNotEmpty = m_live & m_markingNotEmpty & ~m_markingRetired;
-    }
-    
+    m_empty = m_live & ~m_markingNotEmpty;
+    m_canAllocateButNotEmpty = m_live & m_markingNotEmpty & ~m_markingRetired;
+
     if (needsDestruction()) {
         // There are some blocks that we didn't allocate out of in the last cycle, but we swept them. This
         // will forget that we did that and we will end up sweeping them again and attempting to call their

Modified: trunk/Source/_javascript_Core/heap/LocalAllocator.cpp (242911 => 242912)


--- trunk/Source/_javascript_Core/heap/LocalAllocator.cpp	2019-03-13 21:47:13 UTC (rev 242911)
+++ trunk/Source/_javascript_Core/heap/LocalAllocator.cpp	2019-03-13 22:05:19 UTC (rev 242912)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -184,8 +184,7 @@
             return result;
     }
     
-    if (Options::stealEmptyBlocksFromOtherAllocators()
-        && (Options::tradeDestructorBlocks() || !m_directory->needsDestruction())) {
+    if (Options::stealEmptyBlocksFromOtherAllocators()) {
         if (MarkedBlock::Handle* block = m_directory->m_subspace->findEmptyBlockToSteal()) {
             RELEASE_ASSERT(block->alignedMemoryAllocator() == m_directory->m_subspace->alignedMemoryAllocator());
             

Modified: trunk/Source/_javascript_Core/runtime/Options.h (242911 => 242912)


--- trunk/Source/_javascript_Core/runtime/Options.h	2019-03-13 21:47:13 UTC (rev 242911)
+++ trunk/Source/_javascript_Core/runtime/Options.h	2019-03-13 22:05:19 UTC (rev 242912)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -252,7 +252,6 @@
     v(bool, dumpSizeClasses, false, Normal, nullptr) \
     v(bool, useBumpAllocator, true, Normal, nullptr) \
     v(bool, stealEmptyBlocksFromOtherAllocators, true, Normal, nullptr) \
-    v(bool, tradeDestructorBlocks, true, Normal, nullptr) \
     v(bool, eagerlyUpdateTopCallFrame, false, Normal, nullptr) \
     \
     v(bool, useOSREntryToDFG, true, Normal, nullptr) \
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to