Title: [215522] trunk/Source/_javascript_Core
Revision
215522
Author
[email protected]
Date
2017-04-19 11:25:43 -0700 (Wed, 19 Apr 2017)

Log Message

Cannot compile _javascript_Core/runtime/VMTraps.cpp on FreeBSD because std::pair has a non-trivial copy constructor
https://bugs.webkit.org/show_bug.cgi?id=170875

Reviewed by Mark Lam.

WTF::ExpectedDetail::ConstexprBase doesn't have a user-defined
copy constructor, and its implicitly-defined copy constructor is
deleted because the default std::pair implementation on FreeBSD
has a non-trivial copy constructor. /usr/include/c++/v1/__config
says _LIBCPP_TRIVIAL_PAIR_COPY_CTOR is disabled in order to keep
ABI compatibility:
https://svnweb.freebsd.org/changeset/base/261801.

That's a huge bummer, and I'm not a fan of broken stdlibs, but in
this case it's pretty nice to have a custom named type anyways and
costs nothing.

* runtime/VMTraps.cpp:
(JSC::findActiveVMAndStackBounds):
(JSC::handleSigusr1):
(JSC::handleSigtrap):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (215521 => 215522)


--- trunk/Source/_javascript_Core/ChangeLog	2017-04-19 18:17:02 UTC (rev 215521)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-04-19 18:25:43 UTC (rev 215522)
@@ -1,3 +1,27 @@
+2017-04-19  JF Bastien  <[email protected]>
+
+        Cannot compile _javascript_Core/runtime/VMTraps.cpp on FreeBSD because std::pair has a non-trivial copy constructor
+        https://bugs.webkit.org/show_bug.cgi?id=170875
+
+        Reviewed by Mark Lam.
+
+        WTF::ExpectedDetail::ConstexprBase doesn't have a user-defined
+        copy constructor, and its implicitly-defined copy constructor is
+        deleted because the default std::pair implementation on FreeBSD
+        has a non-trivial copy constructor. /usr/include/c++/v1/__config
+        says _LIBCPP_TRIVIAL_PAIR_COPY_CTOR is disabled in order to keep
+        ABI compatibility:
+        https://svnweb.freebsd.org/changeset/base/261801.
+
+        That's a huge bummer, and I'm not a fan of broken stdlibs, but in
+        this case it's pretty nice to have a custom named type anyways and
+        costs nothing.
+
+        * runtime/VMTraps.cpp:
+        (JSC::findActiveVMAndStackBounds):
+        (JSC::handleSigusr1):
+        (JSC::handleSigtrap):
+
 2017-04-19  Andy VanWagoner  <[email protected]>
 
         [INTL] Implement Intl.DateTimeFormat.prototype.formatToParts

Modified: trunk/Source/_javascript_Core/runtime/VMTraps.cpp (215521 => 215522)


--- trunk/Source/_javascript_Core/runtime/VMTraps.cpp	2017-04-19 18:17:02 UTC (rev 215521)
+++ trunk/Source/_javascript_Core/runtime/VMTraps.cpp	2017-04-19 18:25:43 UTC (rev 215522)
@@ -88,7 +88,12 @@
     return !vm.entryScope && !vm.ownerThread();
 }
 
-static Expected<std::pair<VM*, StackBounds>, VMTraps::Error> findActiveVMAndStackBounds(SignalContext& context)
+struct VMAndStackBounds {
+    VM* vm;
+    StackBounds stackBounds;
+};
+
+static Expected<VMAndStackBounds, VMTraps::Error> findActiveVMAndStackBounds(SignalContext& context)
 {
     VMInspector& inspector = VMInspector::instance();
     auto locker = tryHoldLock(inspector.getLock());
@@ -124,7 +129,7 @@
 
     if (!activeVM && unableToAcquireMachineThreadsLock)
         return makeUnexpected(VMTraps::Error::LockUnavailable);
-    return std::make_pair(activeVM, stackBounds);
+    return VMAndStackBounds { activeVM, stackBounds };
 }
 
 static void handleSigusr1(int signalNumber, siginfo_t* info, void* uap)
@@ -132,9 +137,9 @@
     SignalContext context(static_cast<ucontext_t*>(uap)->uc_mcontext);
     auto activeVMAndStackBounds = findActiveVMAndStackBounds(context);
     if (activeVMAndStackBounds) {
-        VM* vm = activeVMAndStackBounds.value().first;
+        VM* vm = activeVMAndStackBounds.value().vm;
         if (vm) {
-            StackBounds stackBounds = activeVMAndStackBounds.value().second;
+            StackBounds stackBounds = activeVMAndStackBounds.value().stackBounds;
             VMTraps& traps = vm->traps();
             if (traps.needTrapHandling())
                 traps.tryInstallTrapBreakpoints(context, stackBounds);
@@ -153,7 +158,7 @@
     if (!activeVMAndStackBounds)
         return; // Let the SignalSender try again later.
 
-    VM* vm = activeVMAndStackBounds.value().first;
+    VM* vm = activeVMAndStackBounds.value().vm;
     if (vm) {
         VMTraps& traps = vm->traps();
         if (!traps.needTrapHandling())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to