Title: [275374] trunk/Source/_javascript_Core
Revision
275374
Author
tzaga...@apple.com
Date
2021-04-01 13:02:50 -0700 (Thu, 01 Apr 2021)

Log Message

Remove use of ENABLE from API header
https://bugs.webkit.org/show_bug.cgi?id=224060
<rdar://76111678>

Reviewed by Mark Lam.

The use of the ENABLE macro in these API headers has caused build failures. Instead of
conditionally exposing these API methods we make them into no-ops if DFG is disabled.

* API/JSVirtualMachine.mm:
(+[JSVirtualMachine setNumberOfDFGCompilerThreads:]):
(+[JSVirtualMachine setNumberOfFTLCompilerThreads:]):
* API/JSVirtualMachinePrivate.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/API/JSVirtualMachine.mm (275373 => 275374)


--- trunk/Source/_javascript_Core/API/JSVirtualMachine.mm	2021-04-01 20:01:59 UTC (rev 275373)
+++ trunk/Source/_javascript_Core/API/JSVirtualMachine.mm	2021-04-01 20:02:50 UTC (rev 275374)
@@ -272,28 +272,32 @@
     vm->shrinkFootprintWhenIdle();
 }
 
-#if ENABLE(DFG_JIT)
-
 + (NSUInteger)setNumberOfDFGCompilerThreads:(NSUInteger)numberOfThreads
 {
+#if ENABLE(DFG_JIT)
     JSC::DFG::Worklist* worklist = JSC::DFG::existingGlobalDFGWorklistOrNull();
     if (worklist)
         return worklist->setNumberOfThreads(numberOfThreads, JSC::Options::priorityDeltaOfDFGCompilerThreads());
     else
         return JSC::DFG::setNumberOfDFGCompilerThreads(numberOfThreads);
+#else
+    return 0;
+#endif // ENABLE(DFG_JIT)
 }
 
 + (NSUInteger)setNumberOfFTLCompilerThreads:(NSUInteger)numberOfThreads
 {
+#if ENABLE(DFG_JIT)
     JSC::DFG::Worklist* worklist = JSC::DFG::existingGlobalFTLWorklistOrNull();
     if (worklist)
         return worklist->setNumberOfThreads(numberOfThreads, JSC::Options::priorityDeltaOfFTLCompilerThreads());
     else
         return JSC::DFG::setNumberOfFTLCompilerThreads(numberOfThreads);
+#else
+    return 0;
+#endif // ENABLE(DFG_JIT)
 }
 
-#endif // ENABLE(DFG_JIT)
-
 - (JSContextGroupRef)JSContextGroupRef
 {
     return m_group;

Modified: trunk/Source/_javascript_Core/API/JSVirtualMachinePrivate.h (275373 => 275374)


--- trunk/Source/_javascript_Core/API/JSVirtualMachinePrivate.h	2021-04-01 20:01:59 UTC (rev 275373)
+++ trunk/Source/_javascript_Core/API/JSVirtualMachinePrivate.h	2021-04-01 20:02:50 UTC (rev 275374)
@@ -45,8 +45,6 @@
 
 - (void)shrinkFootprintWhenIdle JSC_API_AVAILABLE(macos(10.14), ios(12.0));
 
-#if ENABLE(DFG_JIT)
-
 /*!
 @method
 @abstract Set the number of threads to be used by the DFG JIT compiler.
@@ -80,8 +78,6 @@
 */
 + (void)setCrashOnVMCreation:(BOOL)shouldCrash;
 
-#endif // ENABLE(DFG_JIT)
-
 @end
 
 #endif // JSC_OBJC_API_ENABLED

Modified: trunk/Source/_javascript_Core/ChangeLog (275373 => 275374)


--- trunk/Source/_javascript_Core/ChangeLog	2021-04-01 20:01:59 UTC (rev 275373)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-04-01 20:02:50 UTC (rev 275374)
@@ -1,3 +1,19 @@
+2021-04-01  Tadeu Zagallo  <tzaga...@apple.com>
+
+        Remove use of ENABLE from API header
+        https://bugs.webkit.org/show_bug.cgi?id=224060
+        <rdar://76111678>
+
+        Reviewed by Mark Lam.
+
+        The use of the ENABLE macro in these API headers has caused build failures. Instead of
+        conditionally exposing these API methods we make them into no-ops if DFG is disabled.
+
+        * API/JSVirtualMachine.mm:
+        (+[JSVirtualMachine setNumberOfDFGCompilerThreads:]):
+        (+[JSVirtualMachine setNumberOfFTLCompilerThreads:]):
+        * API/JSVirtualMachinePrivate.h:
+
 2021-04-01  Alexey Shvayka  <shvaikal...@gmail.com>
 
         Optimize createListFromArrayLike() and Proxy's [[OwnPropertyKeys]] method
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to