2011-01-29 Daniel Bates <dbates@rim.com>
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Jan 2011 22:17:43 +0000 (22:17 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Jan 2011 22:17:43 +0000 (22:17 +0000)
        Reviewed by Eric Seidel.

        Move wince/mt19937ar.c to ThirdParty and make it a policy choice
        https://bugs.webkit.org/show_bug.cgi?id=53253

        Move implementation of Mersenne Twister pseudorandom number generator to
        ThirdParty since it is a third party library.

        * Source/ThirdParty/mt19937ar.c: Copied from Source/JavaScriptCore/wtf/wince/mt19937ar.c.
2011-01-29  Daniel Bates  <dbates@rim.com>

        Reviewed by Eric Seidel.

        Move wince/mt19937ar.c to ThirdParty and make it a policy choice
        https://bugs.webkit.org/show_bug.cgi?id=53253

        Make inclusion of MT19937 a policy decision.

        Currently, we hardcoded to  use MT19937 when building for
        Windows CE. Instead, we should make this a policy decision
        with the Windows CE port using this by default.

        * JavaScriptCore.pri: Append Source/ThirdParty to the end
        of the list include directories.
        * wtf/CMakeLists.txt: Ditto.
        * wtf/Platform.h: Defined WTF_USE_MERSENNE_TWISTER_19937 when
        building for Windows CE.
        * wtf/RandomNumber.cpp:
        (WTF::randomNumber): Substituted USE(MERSENNE_TWISTER_19937) for OS(WINCE).

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

ChangeLog
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.pri
Source/JavaScriptCore/wtf/CMakeLists.txt
Source/JavaScriptCore/wtf/Platform.h
Source/JavaScriptCore/wtf/RandomNumber.cpp
Source/ThirdParty/mt19937ar.c [moved from Source/JavaScriptCore/wtf/wince/mt19937ar.c with 100% similarity]

index 914c6b963ee519a86a1997e9e0cef210e8d11963..b0b6fd01b2a9be1178e46a93b040f59ede721bee 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2011-01-29  Daniel Bates  <dbates@rim.com>
+
+        Reviewed by Eric Seidel.
+
+        Move wince/mt19937ar.c to ThirdParty and make it a policy choice
+        https://bugs.webkit.org/show_bug.cgi?id=53253
+
+        Move implementation of Mersenne Twister pseudorandom number generator to
+        ThirdParty since it is a third party library.
+
+        * Source/ThirdParty/mt19937ar.c: Copied from Source/JavaScriptCore/wtf/wince/mt19937ar.c.
+
 2011-01-29  Dan Winship  <danw@gnome.org>
 
         Reviewed by Xan Lopez.
index 8a6fc276a98487ddcbeb4472038b4a0b36a74e07..159ba4b9a19b939b0916f245a3a6912305b04fa2 100644 (file)
@@ -1,3 +1,24 @@
+2011-01-29  Daniel Bates  <dbates@rim.com>
+
+        Reviewed by Eric Seidel.
+
+        Move wince/mt19937ar.c to ThirdParty and make it a policy choice
+        https://bugs.webkit.org/show_bug.cgi?id=53253
+
+        Make inclusion of MT19937 a policy decision.
+
+        Currently, we hardcoded to  use MT19937 when building for
+        Windows CE. Instead, we should make this a policy decision
+        with the Windows CE port using this by default.
+
+        * JavaScriptCore.pri: Append Source/ThirdParty to the end
+        of the list include directories.
+        * wtf/CMakeLists.txt: Ditto.
+        * wtf/Platform.h: Defined WTF_USE_MERSENNE_TWISTER_19937 when
+        building for Windows CE.
+        * wtf/RandomNumber.cpp:
+        (WTF::randomNumber): Substituted USE(MERSENNE_TWISTER_19937) for OS(WINCE).
+
 2011-01-29  Cameron Zwarich  <zwarich@apple.com>
 
         Reviewed by David Kilzer.
index f57a062b017d804b055979410c395df26f5bab1f..3342b3955484bfb8d503eec6b33b7652b7ba3d5d 100644 (file)
@@ -23,6 +23,7 @@ CONFIG(standalone_package): DEFINES *= NDEBUG
 JAVASCRIPTCORE_INCLUDEPATH = \
     $$PWD \
     $$PWD/.. \
+    $$PWD/../ThirdParty \
     $$PWD/assembler \
     $$PWD/bytecode \
     $$PWD/bytecompiler \
index b41f6262419409a2617ab4889fc21a8f515ec630..764a898997edf56dfe1b11dab0cbc276b2d4eaeb 100644 (file)
@@ -137,6 +137,7 @@ INCLUDE_IF_EXISTS(${JAVASCRIPTCORE_DIR}/wtf/CMakeLists${PORT}.txt)
 
 LIST(APPEND WTF_INCLUDE_DIRECTORIES
     "${CMAKE_BINARY_DIR}"
+    "${CMAKE_SOURCE_DIR}/ThirdParty"
 )
 
 WEBKIT_WRAP_SOURCELIST(${WTF_SOURCES})
index b340e1142bd01e01fc48c7ab0c8c5e9f6afe47d3..07f57f0a3b0b44045d11a765498d8e6833edbf15 100644 (file)
 
 #if OS(WINCE)
 #include <ce_time.h>
+#define WTF_USE_MERSENNE_TWISTER_19937 1
 #endif
 
 #if (PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(WIN) || (PLATFORM(QT) && OS(DARWIN) && !ENABLE(SINGLE_THREADED))) && !defined(ENABLE_JSC_MULTIPLE_THREADS)
index 0c454165fed8a4dfa8b4c5cf5831b97e12719b04..1574324a354454128f751128b2f2542b1e22debe 100644 (file)
@@ -34,9 +34,9 @@
 #include <stdint.h>
 #include <stdlib.h>
 
-#if OS(WINCE)
+#if USE(MERSENNE_TWISTER_19937)
 extern "C" {
-#include "wince/mt19937ar.c"
+#include "mt19937ar.c"
 }
 #endif
 
@@ -78,7 +78,7 @@ double randomNumber()
     // Mask off the low 53bits
     fullRandom &= (1LL << 53) - 1;
     return static_cast<double>(fullRandom)/static_cast<double>(1LL << 53);
-#elif OS(WINCE)
+#elif USE(MERSENNE_TWISTER_19937)
     return genrand_res53();
 #elif OS(WINDOWS)
     uint32_t part1 = rand() & (RAND_MAX - 1);