Summary: | FreeBSD Alpha, >3000 cast alignment warnings on build, unaligned access errors on run | ||
---|---|---|---|
Product: | WebKit | Reporter: | Anton Shterenlikht <mexas> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | UNCONFIRMED --- | ||
Severity: | Normal | CC: | ap, bfulgham |
Priority: | P2 | Keywords: | DoNotImportToRadar |
Version: | 528+ (Nightly build) | ||
Hardware: | Other | ||
OS: | Other |
Description
Anton Shterenlikht
2008-09-22 06:54:08 PDT
(In reply to comment #1) > See also: bug 19775. > thanks. Regarding this fix: +#if PLATFORM(ARM) || PLATFORM(SPARC64) + const UChar* aChars = a->characters(); + const UChar* bChars = b->characters(); + for (unsigned i = 0; i != aLength; ++i) + if (*aChars++ != *bChars++) + return false; + + return true; +#else what shall I use for PLATFORM,- FREEBSD or ALPHA ? thanks I think the latter would be correct, as FreeBSD on other platforms doesn't need this change (which likely affects performance negatively). (In reply to comment #1) > See also: bug 19775. > The patches to JavaScriptCore/wtf/Vector.h: WebCore/platform/text/StringHash.h were successful. I reduced the number of alignment warnings from >3000 down to 600. However, the patch for JavaScriptCore/wtf/ListHashSet.h is not having the effect: ./JavaScriptCore/wtf/ListHashSet.h:169: warning: cast from 'uint32_t*' to 'WTF::ListHashSetNode<WebCore::HTMLFormControlElementWithState*>*' increases required alignment of target type I applied the patch just as in bug report 19775: --- JavaScriptCore/wtf/ListHashSet.h.orig Tue Jul 8 23:23:01 2008 +++ JavaScriptCore/wtf/ListHashSet.h Tue Jul 8 23:24:03 2008 @@ -122,7 +122,7 @@ namespace WTF { : m_freeList(pool()) , m_isDoneWithInitialFreeList(false) { - memset(m_pool.pool, 0, sizeof(m_pool.pool)); + memset(m_pool, 0, sizeof(m_pool)); } Node* allocate() @@ -166,7 +166,7 @@ namespace WTF { } private: - Node* pool() { return reinterpret_cast<Node*>(m_pool.pool); } + Node* pool() { return reinterpret_cast<Node*>(m_pool); } Node* pastPool() { return pool() + m_poolSize; } bool inPool(Node* node) @@ -177,10 +177,7 @@ namespace WTF { Node* m_freeList; bool m_isDoneWithInitialFreeList; static const size_t m_poolSize = 256; - union { - char pool[sizeof(Node) * m_poolSize]; - double forAlignment; - } m_pool; + uint32_t m_pool[(sizeof(Node) * m_poolSize + sizeof(uint32_t) - 1) / sizeof(uint32_t)]; }; template<typename ValueArg> struct ListHashSetNode { Line 169 is the one with reinterpred_cast. Not sure what to do next. anton |