Ignore:
Timestamp:
Jul 31, 2017, 4:30:38 PM (8 years ago)
Author:
[email protected]
Message:

Added some UNLIKELYs to operationOptimize().
https://bugs.webkit.org/show_bug.cgi?id=174976

Reviewed by JF Bastien.

  • jit/JITOperations.cpp:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JITOperations.cpp

    r218794 r220081  
    12991299   
    13001300    CodeBlock* codeBlock = exec->codeBlock();
    1301     if (codeBlock->jitType() != JITCode::BaselineJIT) {
     1301    if (UNLIKELY(codeBlock->jitType() != JITCode::BaselineJIT)) {
    13021302        dataLog("Unexpected code block in Baseline->DFG tier-up: ", *codeBlock, "\n");
    13031303        RELEASE_ASSERT_NOT_REACHED();
     
    13101310    }
    13111311
    1312     if (Options::verboseOSR()) {
     1312    if (UNLIKELY(Options::verboseOSR())) {
    13131313        dataLog(
    13141314            *codeBlock, ": Entered optimize with bytecodeIndex = ", bytecodeIndex,
     
    13261326        CODEBLOCK_LOG_EVENT(codeBlock, "delayOptimizeToDFG", ("counter = ", codeBlock->jitExecuteCounter()));
    13271327        codeBlock->updateAllPredictions();
    1328         if (Options::verboseOSR())
     1328        if (UNLIKELY(Options::verboseOSR()))
    13291329            dataLog("Choosing not to optimize ", *codeBlock, " yet, because the threshold hasn't been reached.\n");
    13301330        return encodeResult(0, 0);
     
    13321332   
    13331333    Debugger* debugger = codeBlock->globalObject()->debugger();
    1334     if (debugger && (debugger->isStepping() || codeBlock->baselineAlternative()->hasDebuggerRequests())) {
     1334    if (UNLIKELY(debugger && (debugger->isStepping() || codeBlock->baselineAlternative()->hasDebuggerRequests()))) {
    13351335        CODEBLOCK_LOG_EVENT(codeBlock, "delayOptimizeToDFG", ("debugger is stepping or has requests"));
    13361336        updateAllPredictionsAndOptimizeAfterWarmUp(codeBlock);
     
    13411341        CODEBLOCK_LOG_EVENT(codeBlock, "delayOptimizeToDFG", ("should always be inlined"));
    13421342        updateAllPredictionsAndOptimizeAfterWarmUp(codeBlock);
    1343         if (Options::verboseOSR())
     1343        if (UNLIKELY(Options::verboseOSR()))
    13441344            dataLog("Choosing not to optimize ", *codeBlock, " yet, because m_shouldAlwaysBeInlined == true.\n");
    13451345        return encodeResult(0, 0);
     
    13971397            CODEBLOCK_LOG_EVENT(codeBlock, "delayOptimizeToDFG", ("compiled and failed"));
    13981398            codeBlock->updateAllPredictions();
    1399             if (Options::verboseOSR())
     1399            if (UNLIKELY(Options::verboseOSR()))
    14001400                dataLog("Code block ", *codeBlock, " was compiled but it doesn't have an optimized replacement.\n");
    14011401            return encodeResult(0, 0);
    14021402        }
    14031403    } else if (codeBlock->hasOptimizedReplacement()) {
    1404         if (Options::verboseOSR())
     1404        if (UNLIKELY(Options::verboseOSR()))
    14051405            dataLog("Considering OSR ", *codeBlock, " -> ", *codeBlock->replacement(), ".\n");
    14061406        // If we have an optimized replacement, then it must be the case that we entered
     
    14191419        if (codeBlock->replacement()->shouldReoptimizeFromLoopNow()) {
    14201420            CODEBLOCK_LOG_EVENT(codeBlock, "delayOptimizeToDFG", ("should reoptimize from loop now"));
    1421             if (Options::verboseOSR()) {
     1421            if (UNLIKELY(Options::verboseOSR())) {
    14221422                dataLog(
    14231423                    "Triggering reoptimization of ", *codeBlock,
     
    14301430        if (!codeBlock->shouldOptimizeNow()) {
    14311431            CODEBLOCK_LOG_EVENT(codeBlock, "delayOptimizeToDFG", ("insufficient profiling"));
    1432             if (Options::verboseOSR()) {
     1432            if (UNLIKELY(Options::verboseOSR())) {
    14331433                dataLog(
    14341434                    "Delaying optimization for ", *codeBlock,
     
    14381438        }
    14391439
    1440         if (Options::verboseOSR())
     1440        if (UNLIKELY(Options::verboseOSR()))
    14411441            dataLog("Triggering optimized compilation of ", *codeBlock, "\n");
    14421442
     
    14711471    if (void* dataBuffer = DFG::prepareOSREntry(exec, optimizedCodeBlock, bytecodeIndex)) {
    14721472        CODEBLOCK_LOG_EVENT(optimizedCodeBlock, "osrEntry", ("at bc#", bytecodeIndex));
    1473         if (Options::verboseOSR()) {
     1473        if (UNLIKELY(Options::verboseOSR())) {
    14741474            dataLog(
    14751475                "Performing OSR ", *codeBlock, " -> ", *optimizedCodeBlock, ".\n");
     
    14811481    }
    14821482
    1483     if (Options::verboseOSR()) {
     1483    if (UNLIKELY(Options::verboseOSR())) {
    14841484        dataLog(
    14851485            "Optimizing ", *codeBlock, " -> ", *codeBlock->replacement(),
     
    15021502    if (optimizedCodeBlock->shouldReoptimizeNow()) {
    15031503        CODEBLOCK_LOG_EVENT(codeBlock, "delayOptimizeToDFG", ("should reoptimize now"));
    1504         if (Options::verboseOSR()) {
     1504        if (UNLIKELY(Options::verboseOSR())) {
    15051505            dataLog(
    15061506                "Triggering reoptimization of ", *codeBlock, " -> ",
Note: See TracChangeset for help on using the changeset viewer.