Ignore:
Timestamp:
Feb 11, 2011, 3:31:04 PM (15 years ago)
Author:
[email protected]
Message:

2011-02-11 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.

A little more encapsulation for the heap: Removed CollectorHeapIterator
https://bugs.webkit.org/show_bug.cgi?id=54298


CollectorHeapIterator is a God object that knows the internals of each
of the pieces of the heap. This undermines the encapsulation I'm trying
to achieve by splitting concepts into different classes.


As an alternative, I've given each class a forEach iteration function,
which takes a functor as an argument. Now, each class just needs to
know how to iterate the things it knows about.

  • debugger/Debugger.cpp: (JSC::Recompiler::Recompiler): (JSC::Recompiler::~Recompiler): (JSC::Recompiler::operator()): (JSC::Debugger::recompileAllJSFunctions): Updated to use forEach interface instead of an iterator.
  • runtime/CollectorHeapIterator.h: Removed.
  • runtime/Heap.cpp: (JSC::TypeCounter::TypeCounter): (JSC::TypeCounter::typeName): (JSC::TypeCounter::operator()): (JSC::TypeCounter::take): (JSC::Heap::protectedObjectTypeCounts): (JSC::Heap::objectTypeCounts): Added forEach and removed iterator.
  • runtime/Heap.h: (JSC::Heap::forEach):
  • runtime/JSGlobalData.cpp: (JSC::Recompiler::operator()): (JSC::JSGlobalData::recompileAllJSFunctions):
  • runtime/MarkedBlock.h: (JSC::MarkedBlock::forEach): Added forEach. Removed friend declaration for CollectorHeapIterator. Now, we can make all our data private and change it without breaking any other classes.
  • runtime/MarkedSpace.cpp:
  • runtime/MarkedSpace.h: (JSC::MarkedSpace::forEach): Added forEach and removed iterator.

2011-02-11 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.

A little more encapsulation for the heap: Removed CollectorHeapIterator
https://bugs.webkit.org/show_bug.cgi?id=54298

  • WebCoreStatistics.cpp: (WebCoreStatistics::javaScriptProtectedObjectTypeCounts):

2011-02-11 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.

A little more encapsulation for the heap: Removed CollectorHeapIterator
https://bugs.webkit.org/show_bug.cgi?id=54298

  • Misc/WebCoreStatistics.mm: (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]): (+[WebCoreStatistics javaScriptObjectTypeCounts]): Updated for new typedef.
File:
1 edited

Legend:

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

    r78321 r78382  
    207207__ZN3JSC35createInterruptedExecutionExceptionEPNS_12JSGlobalDataE
    208208__ZN3JSC3NaNE
    209 __ZN3JSC4Heap14primaryHeapEndEv
    210209__ZN3JSC4Heap15addWeakGCHandleEPNS_6JSCellE
    211210__ZN3JSC4Heap16objectTypeCountsEv
    212 __ZN3JSC4Heap16primaryHeapBeginEv
    213211__ZN3JSC4Heap17collectAllGarbageEv
    214212__ZN3JSC4Heap17globalObjectCountEv
Note: See TracChangeset for help on using the changeset viewer.