Skip to content

Commit

Permalink
SERVER-13824: Remove some typing violations from the v8 code
Browse files Browse the repository at this point in the history
Code will now work correctly with GCC 4.9.x with full optimization.
  • Loading branch information
GeertBosch committed Jul 31, 2014
1 parent 6bfddeb commit 0028a33
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/third_party/v8-3.25/src/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,20 @@ namespace internal {
// V8_HOST_ARCH_IA32 on both 32- and 64-bit x86.
#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
#else
#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
#endif // __native_client__
#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(__AARCH64EL__)
#define V8_HOST_ARCH_ARM64 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(__ARMEL__)
#define V8_HOST_ARCH_ARM 1
#define V8_HOST_ARCH_32_BIT 1
Expand Down
2 changes: 2 additions & 0 deletions src/third_party/v8-3.25/src/objects.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8728,6 +8728,7 @@ static inline bool CompareRawStringContents(const Char* const a,
const Char* const b,
int length) {
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
Expand All @@ -8750,6 +8751,7 @@ static inline bool CompareRawStringContents(const Char* const a,
#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]) {
Expand Down
6 changes: 3 additions & 3 deletions src/third_party/v8/src/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,19 @@ 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
// Some CPU-OS combinations allow unaligned access on ARM. We assume
// 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
Expand Down
6 changes: 4 additions & 2 deletions src/third_party/v8/src/objects.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]) {
Expand Down

1 comment on commit 0028a33

@veselov
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This diff doesn't remove V8_HOST_CAN_READ_UNALIGNED define in case of x86/x64 arches (in src/third_party/v8/src/globals.h), is that intended? The binary crashes on x64 with 4.9.2 all the same...

Please sign in to comment.