Changeset 242912 in webkit


Ignore:
Timestamp:
Mar 13, 2019 3:05:19 PM (5 years ago)
Author:
mark.lam@apple.com
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:
Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r242910 r242912  
     12019-03-13  Mark Lam  <mark.lam@apple.com>
     2
     3        Remove unneeded --tradeDestructorBlocks option.
     4        https://bugs.webkit.org/show_bug.cgi?id=195698
     5        <rdar://problem/39681388>
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        There's no reason why we would ever want --tradeDestructorBlocks to be false.
     10
     11        Also, there was an assertion in BlockDirectory::endMarking() for when
     12        (!Options::tradeDestructorBlocks() && needsDestruction()).  This assertion is
     13        outdated because the BlockDirectory's m_empty set used to mean the set of all
     14        blocks that have no live (as in not reachable by GC) objects and dead objects
     15        also do not require destructors to be called on them.  The current meaning of
     16        m_empty is that it is the set of all blocks that have no live objects,
     17        independent of whether they needs destructors to be called on them or not.
     18        The assertion is no longer valid for the new meaning of m_empty as m_empty may
     19        now contain destructible blocks.  This assertion is now removed as part of this
     20        patch.
     21
     22        * heap/BlockDirectory.cpp:
     23        (JSC::BlockDirectory::endMarking):
     24        * heap/LocalAllocator.cpp:
     25        (JSC::LocalAllocator::tryAllocateWithoutCollecting):
     26        * runtime/Options.h:
     27
    1282019-03-13  Dominik Infuehr  <dinfuehr@igalia.com>
    229
  • trunk/Source/JavaScriptCore/heap/BlockDirectory.cpp

    r240216 r242912  
    11/*
    2  * Copyright (C) 2012-2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2012-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    250250    // vectors.
    251251   
    252     if (!Options::tradeDestructorBlocks() && needsDestruction()) {
    253         ASSERT(m_empty.isEmpty());
    254         m_canAllocateButNotEmpty = m_live & ~m_markingRetired;
    255     } else {
    256         m_empty = m_live & ~m_markingNotEmpty;
    257         m_canAllocateButNotEmpty = m_live & m_markingNotEmpty & ~m_markingRetired;
    258     }
    259    
     252    m_empty = m_live & ~m_markingNotEmpty;
     253    m_canAllocateButNotEmpty = m_live & m_markingNotEmpty & ~m_markingRetired;
     254
    260255    if (needsDestruction()) {
    261256        // There are some blocks that we didn't allocate out of in the last cycle, but we swept them. This
  • trunk/Source/JavaScriptCore/heap/LocalAllocator.cpp

    r240216 r242912  
    11/*
    2  * Copyright (C) 2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    185185    }
    186186   
    187     if (Options::stealEmptyBlocksFromOtherAllocators()
    188         && (Options::tradeDestructorBlocks() || !m_directory->needsDestruction())) {
     187    if (Options::stealEmptyBlocksFromOtherAllocators()) {
    189188        if (MarkedBlock::Handle* block = m_directory->m_subspace->findEmptyBlockToSteal()) {
    190189            RELEASE_ASSERT(block->alignedMemoryAllocator() == m_directory->m_subspace->alignedMemoryAllocator());
  • trunk/Source/JavaScriptCore/runtime/Options.h

    r242123 r242912  
    11/*
    2  * Copyright (C) 2011-2018 Apple Inc. All rights reserved.
     2 * Copyright (C) 2011-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    253253    v(bool, useBumpAllocator, true, Normal, nullptr) \
    254254    v(bool, stealEmptyBlocksFromOtherAllocators, true, Normal, nullptr) \
    255     v(bool, tradeDestructorBlocks, true, Normal, nullptr) \
    256255    v(bool, eagerlyUpdateTopCallFrame, false, Normal, nullptr) \
    257256    \
Note: See TracChangeset for help on using the changeset viewer.