Ignore:
Timestamp:
Feb 7, 2017, 1:22:20 PM (8 years ago)
Author:
[email protected]
Message:

SigillCrashAnalyzer::analyze() should use a do-while loop instead of a lambda.
https://bugs.webkit.org/show_bug.cgi?id=167950

Reviewed by Michael Saboff.

Lambdas aren't free (apparently, the compiler isn't able to detect that the
lambda does not escape and can be inlined completely). So, use a do-while loop
instead since we don't really need a lambda here.

  • tools/SigillCrashAnalyzer.cpp:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/tools/SigillCrashAnalyzer.cpp

    r211828 r211834  
    272272    log("BEGIN SIGILL analysis");
    273273
    274     [&] () {
     274    do {
    275275        // First, dump the signal context info so that we'll at least have the same info
    276276        // that the default crash handler would given us in case this crash analyzer
     
    286286            ASSERT(expectedLocker.error() == VMInspector::Error::TimedOut);
    287287            log("ERROR: Unable to analyze SIGILL. Timed out while waiting to iterate VMs.");
    288             return;
     288            break;
    289289        }
    290290        auto& locker = expectedLocker.value();
     
    294294        if (!isInJITMemory) {
    295295            log("ERROR: Timed out: not able to determine if pc %p is in valid JIT executable memory", pc);
    296             return;
     296            break;
    297297        }
    298298        if (!isInJITMemory.value()) {
    299299            log("pc %p is NOT in valid JIT executable memory", pc);
    300300            crashSource = CrashSource::Other;
    301             return;
     301            break;
    302302        }
    303303        log("pc %p is in valid JIT executable memory", pc);
     
    308308        if (pcAsSize != roundUpToMultipleOf<sizeof(uint32_t)>(pcAsSize)) {
    309309            log("pc %p is NOT properly aligned", pc);
    310             return;
     310            break;
    311311        }
    312312
     
    323323            else
    324324                log("The current thread does not own any VM JSLock");
    325             return;
     325            break;
    326326        }
    327327        CodeBlock* codeBlock = expectedCodeBlock.value();
    328328        if (!codeBlock) {
    329329            log("machine PC %p does not belong to any CodeBlock in the currently entered VM", pc);
    330             return;
     330            break;
    331331        }
    332332
     
    334334
    335335        dumpCodeBlock(codeBlock, pc);
    336     } ();
     336    } while (false);
    337337
    338338    log("END SIGILL analysis");
Note: See TracChangeset for help on using the changeset viewer.