From 0028a339876b352575758910a158973852ce4cfe Mon Sep 17 00:00:00 2001
From: Geert Bosch <geert@mongodb.com>
Date: Wed, 30 Jul 2014 23:11:03 -0400
Subject: [PATCH] SERVER-13824: Remove some typing violations from the v8 code

Code will now work correctly with GCC 4.9.x with full optimization.
---
 src/third_party/v8/src/globals.h       | 6 +++---
 src/third_party/v8/src/objects.cc      | 6 ++++--
 4 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/third_party/v8/src/globals.h b/src/third_party/v8/src/globals.h
index 97b033f..baa5915 100644
--- a/src/third_party/v8/src/globals.h
+++ b/src/third_party/v8/src/globals.h
@@ -69,11 +69,11 @@ namespace internal {
 #if defined(_M_X64) || defined(__x86_64__)
 #define V8_HOST_ARCH_X64 1
 #define V8_HOST_ARCH_64_BIT 1
-#define V8_HOST_CAN_READ_UNALIGNED 1
+// (SERVER-13824) #define V8_HOST_CAN_READ_UNALIGNED 1
 #elif defined(_M_IX86) || defined(__i386__)
 #define V8_HOST_ARCH_IA32 1
 #define V8_HOST_ARCH_32_BIT 1
-#define V8_HOST_CAN_READ_UNALIGNED 1
+// (SERVER-13824) #define V8_HOST_CAN_READ_UNALIGNED 1
 #elif defined(__ARMEL__)
 #define V8_HOST_ARCH_ARM 1
 #define V8_HOST_ARCH_32_BIT 1
@@ -81,7 +81,7 @@ namespace internal {
 // that unaligned accesses are not allowed unless the build system
 // defines the CAN_USE_UNALIGNED_ACCESSES macro to be non-zero.
 #if CAN_USE_UNALIGNED_ACCESSES
-#define V8_HOST_CAN_READ_UNALIGNED 1
+// (SERVER-13824) #define V8_HOST_CAN_READ_UNALIGNED 1
 #endif
 #elif defined(__MIPSEL__)
 #define V8_HOST_ARCH_MIPS 1
diff --git a/src/third_party/v8/src/objects.cc b/src/third_party/v8/src/objects.cc
index f45da3d..ff351e9 100644
--- a/src/third_party/v8/src/objects.cc
+++ b/src/third_party/v8/src/objects.cc
@@ -6876,9 +6876,10 @@ template <typename Char>
 static inline bool CompareRawStringContents(Vector<Char> a, Vector<Char> b) {
   int length = a.length();
   ASSERT_EQ(length, b.length());
-  const Char* pa = a.start();
-  const Char* pb = b.start();
+// (SERVER-13824)   const Char* pa = a.start();
+// (SERVER-13824)   const Char* pb = b.start();
   int i = 0;
+#if 0 // (SERVER-13824)
 #ifndef V8_HOST_CAN_READ_UNALIGNED
   // If this architecture isn't comfortable reading unaligned ints
   // then we have to check that the strings are aligned before
@@ -6901,6 +6902,7 @@ static inline bool CompareRawStringContents(Vector<Char> a, Vector<Char> b) {
 #ifndef V8_HOST_CAN_READ_UNALIGNED
   }
 #endif
+#endif // (SERVER-13824)
   // Compare the remaining characters that didn't fit into a block.
   for (; i < length; i++) {
     if (a[i] != b[i]) {
