Defer installing mach breakpoint handler until watchdog is actually called
authorkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 3 Jun 2017 01:09:50 +0000 (01:09 +0000)
committerkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 3 Jun 2017 01:09:50 +0000 (01:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=172885

Reviewed by Saam Barati.

Eagerly installing the mach breakpoint handler causes issues with Xcode GUI debugging.
This hides the issue, so it won't occur as often.

* runtime/VMTraps.cpp:
(JSC::VMTraps::SignalSender::send):
(JSC::VMTraps::VMTraps): Deleted.
* runtime/VMTraps.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217745 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/VMTraps.cpp
Source/JavaScriptCore/runtime/VMTraps.h

index 51e9ee9..72af8a2 100644 (file)
@@ -1,3 +1,18 @@
+2017-06-02  Keith Miller  <keith_miller@apple.com>
+
+        Defer installing mach breakpoint handler until watchdog is actually called
+        https://bugs.webkit.org/show_bug.cgi?id=172885
+
+        Reviewed by Saam Barati.
+
+        Eagerly installing the mach breakpoint handler causes issues with Xcode GUI debugging.
+        This hides the issue, so it won't occur as often.
+
+        * runtime/VMTraps.cpp:
+        (JSC::VMTraps::SignalSender::send):
+        (JSC::VMTraps::VMTraps): Deleted.
+        * runtime/VMTraps.h:
+
 2017-06-02  Filip Pizlo  <fpizlo@apple.com>
 
         Atomics.load and Atomics.store need to be fully fenced
index 8c57c45..51f28d3 100644 (file)
@@ -338,18 +338,6 @@ void VMTraps::invalidateCodeBlocksOnStack(Locker<Lock>&, ExecState* topCallFrame
 
 #endif // ENABLE(SIGNAL_BASED_VM_TRAPS)
 
-VMTraps::VMTraps()
-{
-#if ENABLE(SIGNAL_BASED_VM_TRAPS)
-    if (!Options::usePollingTraps()) {
-        static std::once_flag once;
-        std::call_once(once, [] {
-            installSignalHandler();
-        });
-    }
-#endif
-}
-
 void VMTraps::willDestroyVM()
 {
     m_isShuttingDown = true;
@@ -394,6 +382,11 @@ void VMTraps::SignalSender::willDestroyVM()
 
 void VMTraps::SignalSender::send()
 {
+    static std::once_flag once;
+    std::call_once(once, [] {
+        installSignalHandler();
+    });
+
     while (true) {
         // We need a nested scope so that we'll release the lock before we sleep below.
         {
index 5425b18..9b72647 100644 (file)
@@ -86,7 +86,6 @@ public:
         BitField m_mask;
     };
 
-    VMTraps();
     ~VMTraps()
     {
 #if ENABLE(SIGNAL_BASED_VM_TRAPS)