Changeset 183124 in webkit


Ignore:
Timestamp:
Apr 22, 2015 1:05:06 PM (9 years ago)
Author:
mark.lam@apple.com
Message:

Give the heap object iterators the ability to return early.
https://bugs.webkit.org/show_bug.cgi?id=144011

Reviewed by Michael Saboff.

JSDollarVMPrototype::isValidCell() uses a heap object iterator to validate
candidate cell pointers, and, when in use, is called a lot more often than
the normal way those iterators are used. As a result, I see my instrumented
VM killed with a SIGXCPU (CPU time limit exceeded). This patch gives the
callback functor the ability to tell the iterators to return early when the
functor no longer needs to continue iterating. With this, my instrumented
VM is useful again for debugging.

Since heap iteration is not something that we do in a typical fast path,
I don't expect this to have any noticeable impact on performance.

I also renamed ObjectAddressCheckFunctor to CellAddressCheckFunctor since
it checks JSCell addresses, not just JSObjects.

(JSC::LoggingFunctor::operator()):

  • heap/Heap.cpp:

(JSC::Zombify::visit):
(JSC::Zombify::operator()):

  • heap/HeapStatistics.cpp:

(JSC::StorageStatistics::visit):
(JSC::StorageStatistics::operator()):

  • heap/HeapVerifier.cpp:

(JSC::GatherLiveObjFunctor::visit):
(JSC::GatherLiveObjFunctor::operator()):

  • heap/MarkedBlock.cpp:

(JSC::SetNewlyAllocatedFunctor::operator()):

  • heap/MarkedBlock.h:

(JSC::MarkedBlock::forEachCell):
(JSC::MarkedBlock::forEachLiveCell):
(JSC::MarkedBlock::forEachDeadCell):

  • heap/MarkedSpace.h:

(JSC::MarkedSpace::forEachLiveCell):
(JSC::MarkedSpace::forEachDeadCell):

  • inspector/agents/InspectorRuntimeAgent.cpp:

(Inspector::TypeRecompiler::visit):
(Inspector::TypeRecompiler::operator()):

  • runtime/IterationStatus.h: Added.
  • runtime/JSGlobalObject.cpp:
  • runtime/VM.cpp:

(JSC::StackPreservingRecompiler::visit):
(JSC::StackPreservingRecompiler::operator()):

  • tools/JSDollarVMPrototype.cpp:

(JSC::CellAddressCheckFunctor::CellAddressCheckFunctor):
(JSC::CellAddressCheckFunctor::operator()):
(JSC::JSDollarVMPrototype::isValidCell):
(JSC::ObjectAddressCheckFunctor::ObjectAddressCheckFunctor): Deleted.
(JSC::ObjectAddressCheckFunctor::operator()): Deleted.

Location:
trunk/Source/JavaScriptCore
Files:
1 added
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r183117 r183124  
     12015-04-22  Mark Lam  <mark.lam@apple.com>
     2
     3        Give the heap object iterators the ability to return early.
     4        https://bugs.webkit.org/show_bug.cgi?id=144011
     5
     6        Reviewed by Michael Saboff.
     7
     8        JSDollarVMPrototype::isValidCell() uses a heap object iterator to validate
     9        candidate cell pointers, and, when in use, is called a lot more often than
     10        the normal way those iterators are used.  As a result, I see my instrumented
     11        VM killed with a SIGXCPU (CPU time limit exceeded).  This patch gives the
     12        callback functor the ability to tell the iterators to return early when the
     13        functor no longer needs to continue iterating.  With this, my instrumented
     14        VM is useful again for debugging.
     15
     16        Since heap iteration is not something that we do in a typical fast path,
     17        I don't expect this to have any noticeable impact on performance.
     18
     19        I also renamed ObjectAddressCheckFunctor to CellAddressCheckFunctor since
     20        it checks JSCell addresses, not just JSObjects.
     21
     22        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
     23        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
     24        * JavaScriptCore.xcodeproj/project.pbxproj:
     25        * debugger/Debugger.cpp:
     26        * heap/GCLogging.cpp:
     27        (JSC::LoggingFunctor::operator()):
     28        * heap/Heap.cpp:
     29        (JSC::Zombify::visit):
     30        (JSC::Zombify::operator()):
     31        * heap/HeapStatistics.cpp:
     32        (JSC::StorageStatistics::visit):
     33        (JSC::StorageStatistics::operator()):
     34        * heap/HeapVerifier.cpp:
     35        (JSC::GatherLiveObjFunctor::visit):
     36        (JSC::GatherLiveObjFunctor::operator()):
     37        * heap/MarkedBlock.cpp:
     38        (JSC::SetNewlyAllocatedFunctor::operator()):
     39        * heap/MarkedBlock.h:
     40        (JSC::MarkedBlock::forEachCell):
     41        (JSC::MarkedBlock::forEachLiveCell):
     42        (JSC::MarkedBlock::forEachDeadCell):
     43        * heap/MarkedSpace.h:
     44        (JSC::MarkedSpace::forEachLiveCell):
     45        (JSC::MarkedSpace::forEachDeadCell):
     46        * inspector/agents/InspectorRuntimeAgent.cpp:
     47        (Inspector::TypeRecompiler::visit):
     48        (Inspector::TypeRecompiler::operator()):
     49        * runtime/IterationStatus.h: Added.
     50        * runtime/JSGlobalObject.cpp:
     51        * runtime/VM.cpp:
     52        (JSC::StackPreservingRecompiler::visit):
     53        (JSC::StackPreservingRecompiler::operator()):
     54        * tools/JSDollarVMPrototype.cpp:
     55        (JSC::CellAddressCheckFunctor::CellAddressCheckFunctor):
     56        (JSC::CellAddressCheckFunctor::operator()):
     57        (JSC::JSDollarVMPrototype::isValidCell):
     58        (JSC::ObjectAddressCheckFunctor::ObjectAddressCheckFunctor): Deleted.
     59        (JSC::ObjectAddressCheckFunctor::operator()): Deleted.
     60
    1612015-04-22  Yusuke Suzuki  <utatane.tea@gmail.com>
    262
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj

    r183072 r183124  
    15261526    <ClInclude Include="..\runtime\InternalFunction.h" />
    15271527    <ClInclude Include="..\runtime\Intrinsic.h" />
     1528    <ClInclude Include="..\runtime\IterationStatus.h" />
    15281529    <ClInclude Include="..\runtime\IteratorOperations.h" />
    15291530    <ClInclude Include="..\runtime\JSAPIValueWrapper.h" />
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters

    r182997 r183124  
    26792679      <Filter>runtime</Filter>
    26802680    </ClInclude>
     2681    <ClInclude Include="..\runtime\IterationStatus.h">
     2682      <Filter>runtime</Filter>
     2683    </ClInclude>
    26812684    <ClInclude Include="..\runtime\IteratorOperations.h">
    26822685      <Filter>runtime</Filter>
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r183072 r183124  
    16551655                FE20CE9D15F04A9500DF3430 /* LLIntCLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE20CE9B15F04A9500DF3430 /* LLIntCLoop.cpp */; };
    16561656                FE20CE9E15F04A9500DF3430 /* LLIntCLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = FE20CE9C15F04A9500DF3430 /* LLIntCLoop.h */; settings = {ATTRIBUTES = (Private, ); }; };
    1657                 FE4BFF2B1AD476E700088F87 /* FunctionOverrides.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE4BFF291AD476E700088F87 /* FunctionOverrides.cpp */; };
    1658                 FE4BFF2C1AD476E700088F87 /* FunctionOverrides.h in Headers */ = {isa = PBXBuildFile; fileRef = FE4BFF2A1AD476E700088F87 /* FunctionOverrides.h */; };
    16591657                FE384EE51ADDB7AD0055DE2C /* JSDollarVM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE384EE11ADDB7AD0055DE2C /* JSDollarVM.cpp */; };
    16601658                FE384EE61ADDB7AD0055DE2C /* JSDollarVM.h in Headers */ = {isa = PBXBuildFile; fileRef = FE384EE21ADDB7AD0055DE2C /* JSDollarVM.h */; settings = {ATTRIBUTES = (Private, ); }; };
    16611659                FE384EE71ADDB7AD0055DE2C /* JSDollarVMPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE384EE31ADDB7AD0055DE2C /* JSDollarVMPrototype.cpp */; };
    16621660                FE384EE81ADDB7AD0055DE2C /* JSDollarVMPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = FE384EE41ADDB7AD0055DE2C /* JSDollarVMPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1661                FE4BFF2B1AD476E700088F87 /* FunctionOverrides.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE4BFF291AD476E700088F87 /* FunctionOverrides.cpp */; };
     1662                FE4BFF2C1AD476E700088F87 /* FunctionOverrides.h in Headers */ = {isa = PBXBuildFile; fileRef = FE4BFF2A1AD476E700088F87 /* FunctionOverrides.h */; };
     1663                FE4D55B81AE716CA0052E459 /* IterationStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = FE4D55B71AE716CA0052E459 /* IterationStatus.h */; settings = {ATTRIBUTES = (Private, ); }; };
    16631664                FE5932A7183C5A2600A1ECCC /* VMEntryScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE5932A5183C5A2600A1ECCC /* VMEntryScope.cpp */; };
    16641665                FE5932A8183C5A2600A1ECCC /* VMEntryScope.h in Headers */ = {isa = PBXBuildFile; fileRef = FE5932A6183C5A2600A1ECCC /* VMEntryScope.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    34473448                FE20CE9B15F04A9500DF3430 /* LLIntCLoop.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LLIntCLoop.cpp; path = llint/LLIntCLoop.cpp; sourceTree = "<group>"; };
    34483449                FE20CE9C15F04A9500DF3430 /* LLIntCLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LLIntCLoop.h; path = llint/LLIntCLoop.h; sourceTree = "<group>"; };
    3449                 FE4BFF291AD476E700088F87 /* FunctionOverrides.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FunctionOverrides.cpp; sourceTree = "<group>"; };
    3450                 FE4BFF2A1AD476E700088F87 /* FunctionOverrides.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FunctionOverrides.h; sourceTree = "<group>"; };
    34513450                FE384EE11ADDB7AD0055DE2C /* JSDollarVM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDollarVM.cpp; sourceTree = "<group>"; };
    34523451                FE384EE21ADDB7AD0055DE2C /* JSDollarVM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDollarVM.h; sourceTree = "<group>"; };
    34533452                FE384EE31ADDB7AD0055DE2C /* JSDollarVMPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDollarVMPrototype.cpp; sourceTree = "<group>"; };
    34543453                FE384EE41ADDB7AD0055DE2C /* JSDollarVMPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDollarVMPrototype.h; sourceTree = "<group>"; };
     3454                FE4BFF291AD476E700088F87 /* FunctionOverrides.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FunctionOverrides.cpp; sourceTree = "<group>"; };
     3455                FE4BFF2A1AD476E700088F87 /* FunctionOverrides.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FunctionOverrides.h; sourceTree = "<group>"; };
     3456                FE4D55B71AE716CA0052E459 /* IterationStatus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IterationStatus.h; sourceTree = "<group>"; };
    34553457                FE5932A5183C5A2600A1ECCC /* VMEntryScope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VMEntryScope.cpp; sourceTree = "<group>"; };
    34563458                FE5932A6183C5A2600A1ECCC /* VMEntryScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMEntryScope.h; sourceTree = "<group>"; };
     
    44524454                                70113D491A8DB093003848C4 /* IteratorOperations.cpp */,
    44534455                                70113D4A1A8DB093003848C4 /* IteratorOperations.h */,
     4456                                FE4D55B71AE716CA0052E459 /* IterationStatus.h */,
    44544457                                93ADFCE60CCBD7AC00D30B08 /* JSArray.cpp */,
    44554458                                938772E5038BFE19008635CE /* JSArray.h */,
     
    55895592                                0FE050281AA9095600D33B33 /* ScopedArguments.h in Headers */,
    55905593                                52C0611F1AA51E1C00B4ADBA /* RuntimeType.h in Headers */,
     5594                                FE4D55B81AE716CA0052E459 /* IterationStatus.h in Headers */,
    55915595                                C442CB251A6CDB8C005D3D7C /* JSInputs.json in Headers */,
    55925596                                52678F911A04177C006A306D /* ControlFlowProfiler.h in Headers */,
  • trunk/Source/JavaScriptCore/debugger/Debugger.cpp

    r182038 r183124  
    4545    Recompiler(JSC::Debugger*);
    4646    ~Recompiler();
    47     void operator()(JSCell*);
     47    IterationStatus operator()(JSCell*);
    4848
    4949private:
    5050    typedef HashSet<FunctionExecutable*> FunctionExecutableSet;
    5151    typedef HashMap<SourceProvider*, ExecState*> SourceProviderMap;
     52   
     53    void visit(JSCell*);
    5254   
    5355    JSC::Debugger* m_debugger;
     
    7072}
    7173
    72 inline void Recompiler::operator()(JSCell* cell)
     74inline void Recompiler::visit(JSCell* cell)
    7375{
    7476    if (!cell->inherits(JSFunction::info()))
     
    9193    if (m_debugger == function->scope()->globalObject()->debugger())
    9294        m_sourceProviders.add(executable->source().provider(), exec);
     95}
     96
     97inline IterationStatus Recompiler::operator()(JSCell* cell)
     98{
     99    visit(cell);
     100    return IterationStatus::Continue;
    93101}
    94102
  • trunk/Source/JavaScriptCore/heap/GCLogging.cpp

    r166838 r183124  
    6464    }
    6565
    66     void operator()(JSCell* cell)
     66    IterationStatus operator()(JSCell* cell)
    6767    {
    6868        m_liveCells.append(cell);
    6969        MarkedBlock::blockFor(cell)->clearMarked(cell);
     70        return IterationStatus::Continue;
    7071    }
    7172
  • trunk/Source/JavaScriptCore/heap/Heap.cpp

    r182927 r183124  
    241241
    242242struct MarkObject : public MarkedBlock::VoidFunctor {
    243     void operator()(JSCell* cell)
     243    inline void visit(JSCell* cell)
    244244    {
    245245        if (cell->isZapped())
     
    247247        Heap::heap(cell)->setMarked(cell);
    248248    }
     249    IterationStatus operator()(JSCell* cell)
     250    {
     251        visit(cell);
     252        return IterationStatus::Continue;
     253    }
    249254};
    250255
     
    254259
    255260struct CountIfGlobalObject : MarkedBlock::CountFunctor {
    256     void operator()(JSCell* cell) {
     261    inline void visit(JSCell* cell)
     262    {
    257263        if (!cell->isObject())
    258264            return;
     
    261267        count(1);
    262268    }
     269    IterationStatus operator()(JSCell* cell)
     270    {
     271        visit(cell);
     272        return IterationStatus::Continue;
     273    }
    263274};
    264275
     
    268279
    269280    RecordType();
    270     void operator()(JSCell*);
     281    IterationStatus operator()(JSCell*);
    271282    ReturnType returnValue();
    272283
     
    289300}
    290301
    291 inline void RecordType::operator()(JSCell* cell)
     302inline IterationStatus RecordType::operator()(JSCell* cell)
    292303{
    293304    m_typeCountSet->add(typeName(cell));
     305    return IterationStatus::Continue;
    294306}
    295307
     
    14231435class Zombify : public MarkedBlock::VoidFunctor {
    14241436public:
    1425     void operator()(JSCell* cell)
     1437    inline void visit(JSCell* cell)
    14261438    {
    14271439        void** current = reinterpret_cast<void**>(cell);
     
    14351447        for (; current < limit; current++)
    14361448            *current = zombifiedBits;
     1449    }
     1450    IterationStatus operator()(JSCell* cell)
     1451    {
     1452        visit(cell);
     1453        return IterationStatus::Continue;
    14371454    }
    14381455};
  • trunk/Source/JavaScriptCore/heap/HeapStatistics.cpp

    r174509 r183124  
    168168    StorageStatistics();
    169169
    170     void operator()(JSCell*);
     170    IterationStatus operator()(JSCell*);
    171171
    172172    size_t objectWithOutOfLineStorageCount();
     
    177177
    178178private:
     179    void visit(JSCell*);
     180
    179181    size_t m_objectWithOutOfLineStorageCount;
    180182    size_t m_objectCount;
     
    191193}
    192194
    193 inline void StorageStatistics::operator()(JSCell* cell)
     195inline void StorageStatistics::visit(JSCell* cell)
    194196{
    195197    if (!cell->isObject())
     
    208210    m_storageSize += object->structure()->totalStorageSize() * sizeof(WriteBarrierBase<Unknown>);
    209211    m_storageCapacity += object->structure()->totalStorageCapacity() * sizeof(WriteBarrierBase<Unknown>);
     212}
     213
     214inline IterationStatus StorageStatistics::operator()(JSCell* cell)
     215{
     216    visit(cell);
     217    return IterationStatus::Continue;
    210218}
    211219
  • trunk/Source/JavaScriptCore/heap/HeapVerifier.cpp

    r176424 r183124  
    123123    }
    124124
    125     void operator()(JSCell* cell)
     125    inline void visit(JSCell* cell)
    126126    {
    127127        if (!cell->isObject())
     
    129129        LiveObjectData data(asObject(cell));
    130130        m_list.liveObjects.append(data);
     131    }
     132
     133    IterationStatus operator()(JSCell* cell)
     134    {
     135        visit(cell);
     136        return IterationStatus::Continue;
    131137    }
    132138
  • trunk/Source/JavaScriptCore/heap/MarkedBlock.cpp

    r182747 r183124  
    158158    }
    159159
    160     void operator()(JSCell* cell)
     160    IterationStatus operator()(JSCell* cell)
    161161    {
    162162        ASSERT(MarkedBlock::blockFor(cell) == m_block);
    163163        m_block->setNewlyAllocated(cell);
     164        return IterationStatus::Continue;
    164165    }
    165166
  • trunk/Source/JavaScriptCore/heap/MarkedBlock.h

    r182878 r183124  
    2626
    2727#include "HeapOperation.h"
     28#include "IterationStatus.h"
    2829#include "WeakSet.h"
    2930#include <wtf/Bitmap.h>
     
    180181        void willRemoveBlock();
    181182
    182         template <typename Functor> void forEachCell(Functor&);
    183         template <typename Functor> void forEachLiveCell(Functor&);
    184         template <typename Functor> void forEachDeadCell(Functor&);
     183        template <typename Functor> IterationStatus forEachCell(Functor&);
     184        template <typename Functor> IterationStatus forEachLiveCell(Functor&);
     185        template <typename Functor> IterationStatus forEachDeadCell(Functor&);
    185186
    186187        static ptrdiff_t offsetOfMarks() { return OBJECT_OFFSETOF(MarkedBlock, m_marks); }
     
    445446    }
    446447
    447     template <typename Functor> inline void MarkedBlock::forEachCell(Functor& functor)
     448    template <typename Functor> inline IterationStatus MarkedBlock::forEachCell(Functor& functor)
    448449    {
    449450        for (size_t i = firstAtom(); i < m_endAtom; i += m_atomsPerCell) {
    450451            JSCell* cell = reinterpret_cast_ptr<JSCell*>(&atoms()[i]);
    451             functor(cell);
     452            if (functor(cell) == IterationStatus::Done)
     453                return IterationStatus::Done;
    452454        }
    453     }
    454 
    455     template <typename Functor> inline void MarkedBlock::forEachLiveCell(Functor& functor)
     455        return IterationStatus::Continue;
     456    }
     457
     458    template <typename Functor> inline IterationStatus MarkedBlock::forEachLiveCell(Functor& functor)
    456459    {
    457460        for (size_t i = firstAtom(); i < m_endAtom; i += m_atomsPerCell) {
     
    460463                continue;
    461464
    462             functor(cell);
     465            if (functor(cell) == IterationStatus::Done)
     466                return IterationStatus::Done;
    463467        }
    464     }
    465 
    466     template <typename Functor> inline void MarkedBlock::forEachDeadCell(Functor& functor)
     468        return IterationStatus::Continue;
     469    }
     470
     471    template <typename Functor> inline IterationStatus MarkedBlock::forEachDeadCell(Functor& functor)
    467472    {
    468473        for (size_t i = firstAtom(); i < m_endAtom; i += m_atomsPerCell) {
     
    471476                continue;
    472477
    473             functor(cell);
     478            if (functor(cell) == IterationStatus::Done)
     479                return IterationStatus::Done;
    474480        }
     481        return IterationStatus::Continue;
    475482    }
    476483
  • trunk/Source/JavaScriptCore/heap/MarkedSpace.h

    r182747 r183124  
    180180    ASSERT(isIterating());
    181181    BlockIterator end = m_blocks.set().end();
    182     for (BlockIterator it = m_blocks.set().begin(); it != end; ++it)
    183         (*it)->forEachLiveCell(functor);
     182    for (BlockIterator it = m_blocks.set().begin(); it != end; ++it) {
     183        if ((*it)->forEachLiveCell(functor) == IterationStatus::Done)
     184            break;
     185    }
    184186    return functor.returnValue();
    185187}
     
    195197    ASSERT(isIterating());
    196198    BlockIterator end = m_blocks.set().end();
    197     for (BlockIterator it = m_blocks.set().begin(); it != end; ++it)
    198         (*it)->forEachDeadCell(functor);
     199    for (BlockIterator it = m_blocks.set().begin(); it != end; ++it) {
     200        if ((*it)->forEachDeadCell(functor) == IterationStatus::Done)
     201            break;
     202    }
    199203    return functor.returnValue();
    200204}
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp

    r180913 r183124  
    310310class TypeRecompiler : public MarkedBlock::VoidFunctor {
    311311public:
    312     inline void operator()(JSCell* cell)
     312    inline void visit(JSCell* cell)
    313313    {
    314314        if (!cell->inherits(FunctionExecutable::info()))
     
    318318        executable->clearCodeIfNotCompiling();
    319319        executable->clearUnlinkedCodeForRecompilationIfNotCompiling();
     320    }
     321    inline IterationStatus operator()(JSCell* cell)
     322    {
     323        visit(cell);
     324        return IterationStatus::Continue;
    320325    }
    321326};
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r182994 r183124  
    540540public:
    541541    ObjectsWithBrokenIndexingFinder(MarkedArgumentBuffer&, JSGlobalObject*);
    542     void operator()(JSCell*);
     542    IterationStatus operator()(JSCell*);
    543543
    544544private:
     545    void visit(JSCell*);
     546
    545547    MarkedArgumentBuffer& m_foundObjects;
    546548    JSGlobalObject* m_globalObject;
     
    563565}
    564566
    565 void ObjectsWithBrokenIndexingFinder::operator()(JSCell* cell)
     567inline void ObjectsWithBrokenIndexingFinder::visit(JSCell* cell)
    566568{
    567569    if (!cell->isObject())
     
    593595   
    594596    m_foundObjects.append(object);
     597}
     598
     599IterationStatus ObjectsWithBrokenIndexingFinder::operator()(JSCell* cell)
     600{
     601    visit(cell);
     602    return IterationStatus::Continue;
    595603}
    596604
  • trunk/Source/JavaScriptCore/runtime/VM.cpp

    r182915 r183124  
    492492struct StackPreservingRecompiler : public MarkedBlock::VoidFunctor {
    493493    HashSet<FunctionExecutable*> currentlyExecutingFunctions;
    494     void operator()(JSCell* cell)
     494    inline void visit(JSCell* cell)
    495495    {
    496496        if (!cell->inherits(FunctionExecutable::info()))
     
    500500            return;
    501501        executable->clearCodeIfNotCompiling();
     502    }
     503    IterationStatus operator()(JSCell* cell)
     504    {
     505        visit(cell);
     506        return IterationStatus::Continue;
    502507    }
    503508};
  • trunk/Source/JavaScriptCore/tools/JSDollarVMPrototype.cpp

    r183027 r183124  
    153153}
    154154
    155 struct ObjectAddressCheckFunctor : MarkedBlock::CountFunctor {
    156     ObjectAddressCheckFunctor(JSCell* candidate)
     155struct CellAddressCheckFunctor : MarkedBlock::CountFunctor {
     156    CellAddressCheckFunctor(JSCell* candidate)
    157157        : candidate(candidate)
    158158    {
    159159    }
    160160
    161     void operator()(JSCell* cell)
    162     {
    163         if (cell == candidate)
     161    IterationStatus operator()(JSCell* cell)
     162    {
     163        if (cell == candidate) {
    164164            found = true;
     165            return IterationStatus::Done;
     166        }
     167        return IterationStatus::Continue;
    165168    }
    166169
     
    172175{
    173176    HeapIterationScope iterationScope(*heap);
    174     ObjectAddressCheckFunctor functor(candidate);
     177    CellAddressCheckFunctor functor(candidate);
    175178    heap->objectSpace().forEachLiveCell(iterationScope, functor);
    176179    return functor.found;
Note: See TracChangeset for help on using the changeset viewer.