Ignore:
Timestamp:
Jun 9, 2011, 12:44:37 PM (14 years ago)
Author:
[email protected]
Message:

2011-06-08 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.

Factored a bunch of Heap functionality into stand-alone functors
https://bugs.webkit.org/show_bug.cgi?id=62337


This is in preparation for making these functors operate on arbitrary
sets of MarkedBlocks.

  • debugger/Debugger.cpp: (JSC::Debugger::recompileAllJSFunctions): Updated for type change and rename.
  • heap/HandleHeap.h: (JSC::HandleHeap::forEachStrongHandle): New function for iterating all strong handles, so we can play along in the functor game.
  • heap/Heap.cpp: (JSC::CountFunctor::CountFunctor::CountFunctor): (JSC::CountFunctor::CountFunctor::count): (JSC::CountFunctor::CountFunctor::returnValue): (JSC::CountFunctor::ClearMarks::operator()): (JSC::CountFunctor::ResetAllocator::operator()): (JSC::CountFunctor::Sweep::operator()): (JSC::CountFunctor::MarkCount::operator()): (JSC::CountFunctor::Size::operator()): (JSC::CountFunctor::Capacity::operator()): (JSC::CountFunctor::Count::operator()): (JSC::CountFunctor::CountIfGlobalObject::operator()): (JSC::CountFunctor::TakeIfEmpty::TakeIfEmpty): (JSC::CountFunctor::TakeIfEmpty::operator()): (JSC::CountFunctor::TakeIfEmpty::returnValue): (JSC::CountFunctor::RecordType::RecordType): (JSC::CountFunctor::RecordType::typeName): (JSC::CountFunctor::RecordType::operator()): (JSC::CountFunctor::RecordType::returnValue): These functors factor out behavior that used to be in the functions below.

(JSC::Heap::clearMarks):
(JSC::Heap::sweep):
(JSC::Heap::objectCount):
(JSC::Heap::size):
(JSC::Heap::capacity):
(JSC::Heap::protectedGlobalObjectCount):
(JSC::Heap::protectedObjectCount):
(JSC::Heap::protectedObjectTypeCounts):
(JSC::Heap::objectTypeCounts):
(JSC::Heap::resetAllocator):
(JSC::Heap::freeBlocks):
(JSC::Heap::shrink): Factored out behavior into the functors above.

  • heap/Heap.h: (JSC::Heap::forEachProtectedCell): (JSC::Heap::forEachCell): (JSC::Heap::forEachBlock): Added forEach* iteration templates. I chose functor-based templates instead of plain iterators because they're simpler to implement in this case and they require a lot less code at the call site.
  • heap/MarkedBlock.h: (JSC::MarkedBlock::VoidFunctor::returnValue): Default parent class for trivial functors.

(JSC::MarkedBlock::forEachCell): Renamed forEach to forEachCell because
we have a few different kind of "for each" now.

  • runtime/JSGlobalData.cpp: (WTF::Recompile::operator()): (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::recompileAllJSFunctions): Updated for type change and rename.
  • runtime/JSGlobalData.h: Removed globalObjectCount because it was unused.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/JavaScriptCore.exp

    r88444 r88473  
    222222__ZN3JSC3NaNE
    223223__ZN3JSC41constructFunctionSkippingEvalEnabledCheckEPNS_9ExecStateEPNS_14JSGlobalObjectERKNS_7ArgListERKNS_10IdentifierERKNS_7UStringEi
     224__ZN3JSC4Heap11objectCountEv
    224225__ZN3JSC4Heap16activityCallbackEv
    225226__ZN3JSC4Heap16objectTypeCountsEv
     
    232233__ZN3JSC4Heap26protectedGlobalObjectCountEv
    233234__ZN3JSC4Heap29reportExtraMemoryCostSlowCaseEm
     235__ZN3JSC4Heap4sizeEv
    234236__ZN3JSC4Heap7destroyEv
    235237__ZN3JSC4Heap7protectENS_7JSValueE
    236238__ZN3JSC4Heap8allocateERNS_8NewSpace9SizeClassE
     239__ZN3JSC4Heap8capacityEv
    237240__ZN3JSC4Heap9unprotectENS_7JSValueE
    238241__ZN3JSC4Yarr11YarrPatternC1ERKNS_7UStringEbbPPKc
     
    536539__ZNK3JSC18PropertyDescriptor8writableEv
    537540__ZNK3JSC19SourceProviderCache8byteSizeEv
    538 __ZNK3JSC4Heap11objectCountEv
    539 __ZNK3JSC4Heap4sizeEv
    540 __ZNK3JSC4Heap8capacityEv
    541541__ZNK3JSC6JSCell11toPrimitiveEPNS_9ExecStateENS_22PreferredPrimitiveTypeE
    542542__ZNK3JSC6JSCell12toThisObjectEPNS_9ExecStateE
Note: See TracChangeset for help on using the changeset viewer.