webkit-fix-pool.patch 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. Description: Fixup pool and add sparc support
  2. Nixed from gentoo
  3. --- webkit-1.2.1.orig/JavaScriptCore/wtf/ListHashSet.h
  4. +++ webkit-1.2.1/JavaScriptCore/wtf/ListHashSet.h
  5. @@ -127,7 +127,7 @@ namespace WTF {
  6. : m_freeList(pool())
  7. , m_isDoneWithInitialFreeList(false)
  8. {
  9. - memset(m_pool.pool, 0, sizeof(m_pool.pool));
  10. + memset(m_pool, 0, sizeof(m_pool));
  11. }
  12. Node* allocate()
  13. @@ -171,7 +171,7 @@ namespace WTF {
  14. }
  15. private:
  16. - Node* pool() { return reinterpret_cast<Node*>(m_pool.pool); }
  17. + Node* pool() { return reinterpret_cast<Node*>(m_pool); }
  18. Node* pastPool() { return pool() + m_poolSize; }
  19. bool inPool(Node* node)
  20. @@ -182,10 +182,7 @@ namespace WTF {
  21. Node* m_freeList;
  22. bool m_isDoneWithInitialFreeList;
  23. static const size_t m_poolSize = 256;
  24. - union {
  25. - char pool[sizeof(Node) * m_poolSize];
  26. - double forAlignment;
  27. - } m_pool;
  28. + uint32_t m_pool[(sizeof(Node) * m_poolSize + sizeof(uint32_t) - 1) / sizeof(uint32_t)];
  29. };
  30. template<typename ValueArg> struct ListHashSetNode {
  31. --- webkit-1.2.1.orig/WebCore/platform/text/AtomicString.cpp
  32. +++ webkit-1.2.1/WebCore/platform/text/AtomicString.cpp
  33. @@ -103,9 +103,9 @@ static inline bool equal(StringImpl* str
  34. if (string->length() != length)
  35. return false;
  36. +#if CPU(ARM) || CPU(SPARC) || CPU(SH4)
  37. // FIXME: perhaps we should have a more abstract macro that indicates when
  38. // going 4 bytes at a time is unsafe
  39. -#if CPU(ARM) || CPU(SH4)
  40. const UChar* stringCharacters = string->characters();
  41. for (unsigned i = 0; i != length; ++i) {
  42. if (*stringCharacters++ != *characters++)
  43. --- webkit-1.2.1.orig/WebCore/platform/text/StringHash.h
  44. +++ webkit-1.2.1/WebCore/platform/text/StringHash.h
  45. @@ -54,13 +54,13 @@ namespace WebCore {
  46. // FIXME: perhaps we should have a more abstract macro that indicates when
  47. // going 4 bytes at a time is unsafe
  48. -#if CPU(ARM) || CPU(SH4)
  49. +#if CPU(ARM) || CPU(SPARC) || CPU(SH4)
  50. const UChar* aChars = a->characters();
  51. const UChar* bChars = b->characters();
  52. - for (unsigned i = 0; i != aLength; ++i) {
  53. + for (unsigned i = 0; i != aLength; ++i)
  54. if (*aChars++ != *bChars++)
  55. return false;
  56. - }
  57. +
  58. return true;
  59. #else
  60. /* Do it 4-bytes-at-a-time on architectures where it's safe */