Title: [211834] trunk/Source/_javascript_Core
Revision
211834
Author
mark....@apple.com
Date
2017-02-07 13:22:20 -0800 (Tue, 07 Feb 2017)

Log 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:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (211833 => 211834)


--- trunk/Source/_javascript_Core/ChangeLog	2017-02-07 21:02:43 UTC (rev 211833)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-02-07 21:22:20 UTC (rev 211834)
@@ -1,3 +1,16 @@
+2017-02-07  Mark Lam  <mark....@apple.com>
+
+        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:
+
 2017-02-05  Mark Lam  <mark....@apple.com>
 
         The SigillCrashAnalyzer should play nicer with client code that may install its own SIGILL handler.

Modified: trunk/Source/_javascript_Core/tools/SigillCrashAnalyzer.cpp (211833 => 211834)


--- trunk/Source/_javascript_Core/tools/SigillCrashAnalyzer.cpp	2017-02-07 21:02:43 UTC (rev 211833)
+++ trunk/Source/_javascript_Core/tools/SigillCrashAnalyzer.cpp	2017-02-07 21:22:20 UTC (rev 211834)
@@ -271,7 +271,7 @@
     CrashSource crashSource = CrashSource::Unknown;
     log("BEGIN SIGILL analysis");
 
-    [&] () {
+    do {
         // First, dump the signal context info so that we'll at least have the same info
         // that the default crash handler would given us in case this crash analyzer
         // itself crashes.
@@ -285,7 +285,7 @@
         if (!expectedLocker) {
             ASSERT(expectedLocker.error() == VMInspector::Error::TimedOut);
             log("ERROR: Unable to analyze SIGILL. Timed out while waiting to iterate VMs.");
-            return;
+            break;
         }
         auto& locker = expectedLocker.value();
 
@@ -293,12 +293,12 @@
         auto isInJITMemory = inspector.isValidExecutableMemory(locker, pc);
         if (!isInJITMemory) {
             log("ERROR: Timed out: not able to determine if pc %p is in valid JIT executable memory", pc);
-            return;
+            break;
         }
         if (!isInJITMemory.value()) {
             log("pc %p is NOT in valid JIT executable memory", pc);
             crashSource = CrashSource::Other;
-            return;
+            break;
         }
         log("pc %p is in valid JIT executable memory", pc);
         crashSource = CrashSource::_javascript_Core;
@@ -307,7 +307,7 @@
         size_t pcAsSize = reinterpret_cast<size_t>(pc);
         if (pcAsSize != roundUpToMultipleOf<sizeof(uint32_t)>(pcAsSize)) {
             log("pc %p is NOT properly aligned", pc);
-            return;
+            break;
         }
 
         // We know it's safe to read the word at the PC because we're handling a SIGILL.
@@ -322,18 +322,18 @@
                 log("ERROR: Timed out: not able to determine if pc %p is in a valid CodeBlock", pc);
             else
                 log("The current thread does not own any VM JSLock");
-            return;
+            break;
         }
         CodeBlock* codeBlock = expectedCodeBlock.value();
         if (!codeBlock) {
             log("machine PC %p does not belong to any CodeBlock in the currently entered VM", pc);
-            return;
+            break;
         }
 
         log("pc %p belongs to CodeBlock %p of type %s", pc, codeBlock, JITCode::typeName(codeBlock->jitType()));
 
         dumpCodeBlock(codeBlock, pc);
-    } ();
+    } while (false);
 
     log("END SIGILL analysis");
     return crashSource;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to