Bug 972793 - Remove GetVersionEx from js/src/. r=luke
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Fri, 28 Feb 2014 07:58:50 +0900
changeset 171450 9257425b1ab09eb870ee2f698b612b7c1a42bdf3
parent 171449 da8693a783a8e44e9093070cb12cc8590e812100
child 171451 629bfbcb8b449e8c9ef66dc6c52908b29c519e9a
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersluke
bugs972793
milestone30.0a1
Bug 972793 - Remove GetVersionEx from js/src/. r=luke
js/src/assembler/jit/ExecutableAllocatorWin.cpp
--- a/js/src/assembler/jit/ExecutableAllocatorWin.cpp
+++ b/js/src/assembler/jit/ExecutableAllocatorWin.cpp
@@ -23,16 +23,17 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include "assembler/jit/ExecutableAllocator.h"
 
 #if ENABLE_ASSEMBLER && WTF_OS_WINDOWS
 
 #include "jswin.h"
+#include "mozilla/WindowsVersion.h"
 
 extern uint64_t random_next(uint64_t *, int);
 
 namespace JSC {
 
 uint64_t ExecutableAllocator::rngSeed;
 
 size_t ExecutableAllocator::determinePageSize()
@@ -67,26 +68,18 @@ void *ExecutableAllocator::computeRandom
 #endif
     uint64_t rand = random_next(&rngSeed, 32) << chunkBits;
     return (void *) (base | rand & mask);
 }
 
 static bool
 RandomizeIsBrokenImpl()
 {
-    OSVERSIONINFO osvi;
-    ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
-    osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-
-    GetVersionEx(&osvi);
-
-    // Version number mapping is available at:
-    // http://msdn.microsoft.com/en-us/library/ms724832%28v=vs.85%29.aspx
     // We disable everything before Vista, for now.
-    return osvi.dwMajorVersion <= 5;
+    return !mozilla::IsVistaOrLater();
 }
 
 static bool
 RandomizeIsBroken()
 {
     // Use the compiler's intrinsic guards for |static type value = expr| to avoid some potential
     // races if runtimes are created from multiple threads.
     static int result = RandomizeIsBrokenImpl();