Title: [163291] trunk/Source/_javascript_Core
Revision
163291
Author
m...@apple.com
Date
2014-02-03 00:17:33 -0800 (Mon, 03 Feb 2014)

Log Message

Stop using PLATFORM(MAC) in _javascript_Core except where it means “OS X but not iOS”
https://bugs.webkit.org/show_bug.cgi?id=128098

Reviewed by Darin Adler.

* API/JSValueRef.cpp:
(JSValueUnprotect): Added an explicit !PLATFORM(IOS) in guards for the Evernote workaround,
which is only needed on OS X.

* API/tests/testapi.c:
(main): Changed PLATFORM(MAC) || PLATFORM(IOS) guards to OS(DARWIN), because they were
surrounding tests for code that is itself guarded by OS(DARWIN).

* runtime/Watchdog.h: Changed PLATFORM(MAC) to OS(DARWIN).

* tools/CodeProfiling.cpp:
(JSC::CodeProfiling::begin): Changed PLATFORM(MAC) to
OS(DARWIN) && !PLATFORM(EFL) && !PLATFORM(GTK).
(JSC::CodeProfiling::end): Ditto.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/API/JSValueRef.cpp (163290 => 163291)


--- trunk/Source/_javascript_Core/API/JSValueRef.cpp	2014-02-03 08:10:03 UTC (rev 163290)
+++ trunk/Source/_javascript_Core/API/JSValueRef.cpp	2014-02-03 08:17:33 UTC (rev 163291)
@@ -44,13 +44,13 @@
 
 #include <algorithm> // for std::min
 
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) && !PLATFORM(IOS)
 #include <mach-o/dyld.h>
 #endif
 
 using namespace JSC;
 
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) && !PLATFORM(IOS)
 static bool evernoteHackNeeded()
 {
     static const int32_t webkitLastVersionWithEvernoteHack = 35133959;
@@ -443,7 +443,7 @@
 
 void JSValueUnprotect(JSContextRef ctx, JSValueRef value)
 {
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) && !PLATFORM(IOS)
     if ((!value || !ctx) && evernoteHackNeeded())
         return;
 #endif

Modified: trunk/Source/_javascript_Core/API/tests/testapi.c (163290 => 163291)


--- trunk/Source/_javascript_Core/API/tests/testapi.c	2014-02-03 08:10:03 UTC (rev 163290)
+++ trunk/Source/_javascript_Core/API/tests/testapi.c	2014-02-03 08:17:33 UTC (rev 163291)
@@ -33,7 +33,7 @@
 #define ASSERT_DISABLED 0
 #include <wtf/Assertions.h>
 
-#if PLATFORM(MAC) || PLATFORM(IOS)
+#if OS(DARWIN)
 #include <mach/mach.h>
 #include <mach/mach_time.h>
 #include <sys/time.h>
@@ -1103,7 +1103,7 @@
     val.name = "something";
 }
 
-#if PLATFORM(MAC) || PLATFORM(IOS)
+#if OS(DARWIN)
 static double currentCPUTime()
 {
     mach_msg_type_number_t infoCount = THREAD_BASIC_INFO_COUNT;
@@ -1162,7 +1162,7 @@
     }
     return true;
 }
-#endif /* PLATFORM(MAC) || PLATFORM(IOS) */
+#endif /* OS(DARWIN) */
 
 
 int main(int argc, char* argv[])
@@ -1853,7 +1853,7 @@
         free(scriptUTF8);
     }
 
-#if PLATFORM(MAC) || PLATFORM(IOS)
+#if OS(DARWIN)
     JSStringRef currentCPUTimeStr = JSStringCreateWithUTF8CString("currentCPUTime");
     JSObjectRef currentCPUTimeFunction = JSObjectMakeFunctionWithCallback(context, currentCPUTimeStr, currentCPUTime_callAsFunction);
     JSObjectSetProperty(context, globalObject, currentCPUTimeStr, currentCPUTimeFunction, kJSPropertyAttributeNone, NULL); 
@@ -2004,7 +2004,7 @@
             failed = true;
         }
     }
-#endif /* PLATFORM(MAC) || PLATFORM(IOS) */
+#endif /* OS(DARWIN) */
 
     // Clear out local variables pointing at JSObjectRefs to allow their values to be collected
     function = NULL;

Modified: trunk/Source/_javascript_Core/ChangeLog (163290 => 163291)


--- trunk/Source/_javascript_Core/ChangeLog	2014-02-03 08:10:03 UTC (rev 163290)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-02-03 08:17:33 UTC (rev 163291)
@@ -1,3 +1,25 @@
+2014-02-03  Dan Bernstein  <m...@apple.com>
+
+        Stop using PLATFORM(MAC) in _javascript_Core except where it means “OS X but not iOS”
+        https://bugs.webkit.org/show_bug.cgi?id=128098
+
+        Reviewed by Darin Adler.
+
+        * API/JSValueRef.cpp:
+        (JSValueUnprotect): Added an explicit !PLATFORM(IOS) in guards for the Evernote workaround,
+        which is only needed on OS X.
+
+        * API/tests/testapi.c:
+        (main): Changed PLATFORM(MAC) || PLATFORM(IOS) guards to OS(DARWIN), because they were
+        surrounding tests for code that is itself guarded by OS(DARWIN).
+
+        * runtime/Watchdog.h: Changed PLATFORM(MAC) to OS(DARWIN).
+
+        * tools/CodeProfiling.cpp:
+        (JSC::CodeProfiling::begin): Changed PLATFORM(MAC) to
+        OS(DARWIN) && !PLATFORM(EFL) && !PLATFORM(GTK).
+        (JSC::CodeProfiling::end): Ditto.
+
 2014-02-02  Mark Lam  <mark....@apple.com>
 
         Repatch code is passing the wrong args to lookupExceptionHandler.

Modified: trunk/Source/_javascript_Core/runtime/Watchdog.h (163290 => 163291)


--- trunk/Source/_javascript_Core/runtime/Watchdog.h	2014-02-03 08:10:03 UTC (rev 163290)
+++ trunk/Source/_javascript_Core/runtime/Watchdog.h	2014-02-03 08:17:33 UTC (rev 163291)
@@ -26,7 +26,7 @@
 #ifndef Watchdog_h
 #define Watchdog_h
 
-#if PLATFORM(MAC) || PLATFORM(IOS)
+#if OS(DARWIN)
 #include <dispatch/dispatch.h>    
 #endif
 
@@ -93,7 +93,7 @@
     void* m_callbackData1;
     void* m_callbackData2;
 
-#if PLATFORM(MAC) || PLATFORM(IOS)
+#if OS(DARWIN)
     dispatch_queue_t m_queue;
     dispatch_source_t m_timer;
 #endif

Modified: trunk/Source/_javascript_Core/tools/CodeProfiling.cpp (163290 => 163291)


--- trunk/Source/_javascript_Core/tools/CodeProfiling.cpp	2014-02-03 08:10:03 UTC (rev 163290)
+++ trunk/Source/_javascript_Core/tools/CodeProfiling.cpp	2014-02-03 08:17:33 UTC (rev 163291)
@@ -48,7 +48,7 @@
 #pragma clang diagnostic ignored "-Wmissing-noreturn"
 #endif
 
-#if (PLATFORM(MAC) && CPU(X86_64)) || (OS(LINUX) && CPU(X86))
+#if (OS(DARWIN) && !PLATFORM(EFL) && !PLATFORM(GTK) && CPU(X86_64)) || (OS(LINUX) && CPU(X86))
 // Helper function to start & stop the timer.
 // Presently we're using the wall-clock timer, since this seems to give the best results.
 static void setProfileTimer(unsigned usec)
@@ -66,7 +66,7 @@
 #pragma clang diagnostic pop
 #endif
 
-#if PLATFORM(MAC) && CPU(X86_64)
+#if OS(DARWIN) && !PLATFORM(EFL) && !PLATFORM(GTK) && CPU(X86_64)
 static void profilingTimer(int, siginfo_t*, void* uap)
 {
     mcontext_t context = static_cast<ucontext_t*>(uap)->uc_mcontext;
@@ -143,7 +143,7 @@
     if (alreadyProfiling)
         return;
 
-#if (PLATFORM(MAC) && CPU(X86_64)) || (OS(LINUX) && CPU(X86))
+#if (OS(DARWIN) && !PLATFORM(EFL) && !PLATFORM(GTK) && CPU(X86_64)) || (OS(LINUX) && CPU(X86))
     // Regsiter a signal handler & itimer.
     struct sigaction action;
     action.sa_sigaction = reinterpret_cast<void (*)(int, siginfo_t *, void *)>(profilingTimer);
@@ -167,7 +167,7 @@
     if (s_profileStack)
         return;
 
-#if (PLATFORM(MAC) && CPU(X86_64)) || (OS(LINUX) && CPU(X86))
+#if (OS(DARWIN) && !PLATFORM(EFL) && !PLATFORM(GTK) && CPU(X86_64)) || (OS(LINUX) && CPU(X86))
     // Stop profiling
     setProfileTimer(0);
 #endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to