Ignore:
Timestamp:
Dec 15, 2011, 4:01:30 AM (13 years ago)
Author:
[email protected]
Message:

Rename JSC::Heuristics to JSC::Options
https://bugs.webkit.org/show_bug.cgi?id=72889

Patch by Andy Wingo <[email protected]> on 2011-12-15
Reviewed by Filip Pizlo.

  • runtime/Options.cpp: Renamed from Source/JavaScriptCore/runtime/Heuristics.cpp.
  • runtime/Options.h: Renamed from Source/JavaScriptCore/runtime/Heuristics.h.
  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Target.pri:
  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::shouldOptimizeNow):

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::likelyToTakeSlowCase):
(JSC::CodeBlock::couldTakeSlowCase):
(JSC::CodeBlock::likelyToTakeSpecialFastCase):
(JSC::CodeBlock::likelyToTakeDeepestSlowCase):
(JSC::CodeBlock::likelyToTakeAnySlowCase):
(JSC::CodeBlock::reoptimizationRetryCounter):
(JSC::CodeBlock::countReoptimization):
(JSC::CodeBlock::counterValueForOptimizeAfterWarmUp):
(JSC::CodeBlock::counterValueForOptimizeAfterLongWarmUp):
(JSC::CodeBlock::optimizeNextInvocation):
(JSC::CodeBlock::dontOptimizeAnytimeSoon):
(JSC::CodeBlock::optimizeSoon):
(JSC::CodeBlock::largeFailCountThreshold):
(JSC::CodeBlock::largeFailCountThresholdForLoop):
(JSC::CodeBlock::shouldReoptimizeNow):
(JSC::CodeBlock::shouldReoptimizeFromLoopNow):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::handleInlining):

  • dfg/DFGCapabilities.h:

(JSC::DFG::mightCompileEval):
(JSC::DFG::mightCompileProgram):
(JSC::DFG::mightCompileFunctionForCall):
(JSC::DFG::mightCompileFunctionForConstruct):
(JSC::DFG::mightInlineFunctionForCall):
(JSC::DFG::mightInlineFunctionForConstruct):

  • dfg/DFGOSRExit.cpp:

(JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):

  • dfg/DFGOSRExitCompiler32_64.cpp:

(JSC::DFG::OSRExitCompiler::compileExit):

  • dfg/DFGOSRExitCompiler64.cpp:

(JSC::DFG::OSRExitCompiler::compileExit):

  • dfg/DFGVariableAccessData.h:

(JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):

  • heap/MarkStack.cpp:

(JSC::MarkStackSegmentAllocator::allocate):
(JSC::MarkStackSegmentAllocator::shrinkReserve):
(JSC::MarkStackArray::MarkStackArray):
(JSC::MarkStackArray::donateSomeCellsTo):
(JSC::MarkStackArray::stealSomeCellsFrom):
(JSC::MarkStackThreadSharedData::MarkStackThreadSharedData):
(JSC::SlotVisitor::donateSlow):
(JSC::SlotVisitor::drain):
(JSC::SlotVisitor::drainFromShared):

  • heap/MarkStack.h:

(JSC::MarkStack::mergeOpaqueRootsIfProfitable):
(JSC::MarkStack::addOpaqueRoot):
(JSC::MarkStackArray::canDonateSomeCells):

  • heap/SlotVisitor.h:

(JSC::SlotVisitor::donate):

  • jit/JIT.cpp:

(JSC::JIT::emitOptimizationCheck):

  • runtime/InitializeThreading.cpp:

(JSC::initializeThreadingOnce): Adapt callers and build systems.

  • testRegExp.cpp:

(CommandLine::CommandLine):

  • jsc.cpp:

(CommandLine::CommandLine):
Rename from Options, to avoid name conflict.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/MarkStack.cpp

    r100242 r102917  
    2929#include "ConservativeRoots.h"
    3030#include "Heap.h"
    31 #include "Heuristics.h"
     31#include "Options.h"
    3232#include "JSArray.h"
    3333#include "JSCell.h"
     
    6161    }
    6262
    63     return static_cast<MarkStackSegment*>(OSAllocator::reserveAndCommit(Heuristics::gcMarkStackSegmentSize));
     63    return static_cast<MarkStackSegment*>(OSAllocator::reserveAndCommit(Options::gcMarkStackSegmentSize));
    6464}
    6565
     
    8282        MarkStackSegment* toFree = segments;
    8383        segments = segments->m_previous;
    84         OSAllocator::decommitAndRelease(toFree, Heuristics::gcMarkStackSegmentSize);
     84        OSAllocator::decommitAndRelease(toFree, Options::gcMarkStackSegmentSize);
    8585    }
    8686}
     
    8888MarkStackArray::MarkStackArray(MarkStackSegmentAllocator& allocator)
    8989    : m_allocator(allocator)
    90     , m_segmentCapacity(MarkStackSegment::capacityFromSize(Heuristics::gcMarkStackSegmentSize))
     90    , m_segmentCapacity(MarkStackSegment::capacityFromSize(Options::gcMarkStackSegmentSize))
    9191    , m_top(0)
    9292    , m_numberOfPreviousSegments(0)
     
    146146       
    147147    // Fast check: see if the other mark stack already has enough segments.
    148     if (other.m_numberOfPreviousSegments + 1 >= Heuristics::maximumNumberOfSharedSegments)
     148    if (other.m_numberOfPreviousSegments + 1 >= Options::maximumNumberOfSharedSegments)
    149149        return false;
    150150       
    151     size_t numberOfCellsToKeep = Heuristics::minimumNumberOfCellsToKeep;
     151    size_t numberOfCellsToKeep = Options::minimumNumberOfCellsToKeep;
    152152    ASSERT(m_top > numberOfCellsToKeep || m_topSegment->m_previous);
    153153       
     
    210210       
    211211    // Otherwise drain 1/Nth of the shared array where N is the number of
    212     // workers, or Heuristics::minimumNumberOfCellsToKeep, whichever is bigger.
    213     size_t numberOfCellsToSteal = std::max((size_t)Heuristics::minimumNumberOfCellsToKeep, other.size() / Heuristics::numberOfGCMarkers);
     212    // workers, or Options::minimumNumberOfCellsToKeep, whichever is bigger.
     213    size_t numberOfCellsToSteal = std::max((size_t)Options::minimumNumberOfCellsToKeep, other.size() / Options::numberOfGCMarkers);
    214214    while (numberOfCellsToSteal-- > 0 && other.canRemoveLast())
    215215        append(other.removeLast());
     
    239239{
    240240#if ENABLE(PARALLEL_GC)
    241     for (unsigned i = 1; i < Heuristics::numberOfGCMarkers; ++i) {
     241    for (unsigned i = 1; i < Options::numberOfGCMarkers; ++i) {
    242242        m_markingThreads.append(createThread(markingThreadStartFunc, this, "JavaScriptCore::Marking"));
    243243        ASSERT(m_markingThreads.last());
     
    330330        // Only wake up threads if the shared stack is big enough; otherwise assume that
    331331        // it's more profitable for us to just scan this ourselves later.
    332         if (m_shared.m_sharedMarkStack.size() >= Heuristics::sharedStackWakeupThreshold)
     332        if (m_shared.m_sharedMarkStack.size() >= Options::sharedStackWakeupThreshold)
    333333            m_shared.m_markingCondition.broadcast();
    334334    }
     
    344344
    345345#if ENABLE(PARALLEL_GC)
    346     if (Heuristics::numberOfGCMarkers > 1) {
     346    if (Options::numberOfGCMarkers > 1) {
    347347        while (!m_stack.isEmpty()) {
    348348            m_stack.refill();
    349             for (unsigned countdown = Heuristics::minimumNumberOfScansBetweenRebalance; m_stack.canRemoveLast() && countdown--;)
     349            for (unsigned countdown = Options::minimumNumberOfScansBetweenRebalance; m_stack.canRemoveLast() && countdown--;)
    350350                visitChildren(*this, m_stack.removeLast(), jsFinalObjectVPtr, jsArrayVPtr, jsStringVPtr);
    351351            donateKnownParallel();
     
    368368    ASSERT(m_isInParallelMode);
    369369   
    370     ASSERT(Heuristics::numberOfGCMarkers);
     370    ASSERT(Options::numberOfGCMarkers);
    371371   
    372372    bool shouldBeParallel;
    373373
    374374#if ENABLE(PARALLEL_GC)
    375     shouldBeParallel = Heuristics::numberOfGCMarkers > 1;
     375    shouldBeParallel = Options::numberOfGCMarkers > 1;
    376376#else
    377     ASSERT(Heuristics::numberOfGCMarkers == 1);
     377    ASSERT(Options::numberOfGCMarkers == 1);
    378378    shouldBeParallel = false;
    379379#endif
Note: See TracChangeset for help on using the changeset viewer.