Ignore:
Timestamp:
May 22, 2012, 6:28:03 PM (13 years ago)
Author:
[email protected]
Message:

CopiedSpace::contains doesn't check for oversize blocks
https://bugs.webkit.org/show_bug.cgi?id=87180

Reviewed by Geoffrey Garen.

When doing a conservative scan we use CopiedSpace::contains to determine if a particular
address points into the CopiedSpace. Currently contains() only checks if the address
points to a block in to-space, which means that pointers to oversize blocks may not get scanned.

  • heap/CopiedSpace.cpp:

(JSC::CopiedSpace::tryAllocateOversize):
(JSC::CopiedSpace::tryReallocateOversize):
(JSC::CopiedSpace::doneFillingBlock):
(JSC::CopiedSpace::doneCopying):

  • heap/CopiedSpace.h: Refactored CopiedSpace so that all blocks (oversize and to-space) are

in a single hash set and bloom filter for membership testing.
(CopiedSpace):

  • heap/CopiedSpaceInlineMethods.h:

(JSC::CopiedSpace::contains): We check for the normal block first. Since the oversize blocks are
only page aligned, rather than block aligned, we have to re-mask the ptr to check if it's in
CopiedSpace. Also added a helper function of the same name that takes a CopiedBlock* and checks
if it's in CopiedSpace so that check isn't typed out twice.
(JSC):
(JSC::CopiedSpace::startedCopying):
(JSC::CopiedSpace::addNewBlock):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/CopiedSpace.h

    r115915 r118093  
    6565    bool isPinned(void*);
    6666
     67    bool contains(CopiedBlock*);
    6768    bool contains(void*, CopiedBlock*&);
    6869
     
    9798    CopiedAllocator m_allocator;
    9899
    99     TinyBloomFilter m_toSpaceFilter;
    100     TinyBloomFilter m_oversizeFilter;
    101     HashSet<CopiedBlock*> m_toSpaceSet;
     100    TinyBloomFilter m_blockFilter;
     101    HashSet<CopiedBlock*> m_blockSet;
    102102
    103103    Mutex m_toSpaceLock;
Note: See TracChangeset for help on using the changeset viewer.