Ignore:
Timestamp:
Aug 5, 2013, 12:52:43 PM (12 years ago)
Author:
[email protected]
Message:

Copied space should be able to handle more than one copied backing store per JSCell
https://bugs.webkit.org/show_bug.cgi?id=119471

Reviewed by Mark Hahnenberg.

This allows a cell to call copyLater() multiple times for multiple different
backing stores, and then have copyBackingStore() called exactly once for each
of those. A token tells it which backing store to copy. All backing stores
must be named using the CopyToken, an enumeration which currently cannot
exceed eight entries.

When copyBackingStore() is called, it's up to the callee to (a) use the token
to decide what to copy and (b) call its base class's copyBackingStore() in
case the base class had something that needed copying. The only exception is
that JSCell never asks anything to be copied, and so if your base is JSCell
then you don't have to do anything.

  • GNUmakefile.list.am:
  • JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • heap/CopiedBlock.h:
  • heap/CopiedBlockInlines.h:

(JSC::CopiedBlock::reportLiveBytes):

  • heap/CopyToken.h: Added.
  • heap/CopyVisitor.cpp:

(JSC::CopyVisitor::copyFromShared):

  • heap/CopyVisitor.h:
  • heap/CopyVisitorInlines.h:

(JSC::CopyVisitor::visitItem):

  • heap/CopyWorkList.h:

(JSC::CopyWorklistItem::CopyWorklistItem):
(JSC::CopyWorklistItem::cell):
(JSC::CopyWorklistItem::token):
(JSC::CopyWorkListSegment::get):
(JSC::CopyWorkListSegment::append):
(JSC::CopyWorkListSegment::data):
(JSC::CopyWorkListIterator::get):
(JSC::CopyWorkListIterator::operator*):
(JSC::CopyWorkListIterator::operator->):
(JSC::CopyWorkList::append):

  • heap/SlotVisitor.h:
  • heap/SlotVisitorInlines.h:

(JSC::SlotVisitor::copyLater):

  • runtime/ClassInfo.h:
  • runtime/JSCell.cpp:

(JSC::JSCell::copyBackingStore):

  • runtime/JSCell.h:
  • runtime/JSObject.cpp:

(JSC::JSObject::visitButterfly):
(JSC::JSObject::copyBackingStore):

  • runtime/JSObject.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r153691 r153720  
    186186    // Mark the properties.
    187187    visitor.appendValues(butterfly->propertyStorage() - storageSize, storageSize);
    188     visitor.copyLater(this, butterfly->base(preCapacity, propertyCapacity), capacityInBytes);
     188    visitor.copyLater(
     189        this, ButterflyCopyToken,
     190        butterfly->base(preCapacity, propertyCapacity), capacityInBytes);
    189191   
    190192    // Mark the array if appropriate.
     
    223225}
    224226
    225 void JSObject::copyBackingStore(JSCell* cell, CopyVisitor& visitor)
     227void JSObject::copyBackingStore(JSCell* cell, CopyVisitor& visitor, CopyToken token)
    226228{
    227229    JSObject* thisObject = jsCast<JSObject*>(cell);
    228230    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     231   
     232    if (token != ButterflyCopyToken)
     233        return;
    229234   
    230235    Butterfly* butterfly = thisObject->butterfly();
Note: See TracChangeset for help on using the changeset viewer.