diff options
author | Tobias Netzel <tobias.netzel@googlemail.com> | 2013-04-04 13:59:03 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-04 14:32:49 +0200 |
commit | b5924dc9e872e73489c30efec775bcfe78a345e5 (patch) | |
tree | 1f3c45bb6242233f25efe669810aef18a21aeec0 /Source/JavaScriptCore/yarr/YarrJIT.cpp | |
parent | 23bde0cf8565bb36b9df638de874ad04607e84d3 (diff) | |
download | qtwebkit-b5924dc9e872e73489c30efec775bcfe78a345e5.tar.gz |
Yarr JIT isn't big endian compatible
https://bugs.webkit.org/show_bug.cgi?id=102897
Patch by Tobias Netzel <tobias.netzel@googlemail.com> on 2013-01-22
Reviewed by Oliver Hunt.
This patch was tested in the current mozilla codebase only and has passed the regexp tests there.
* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::generatePatternCharacterOnce):
Change-Id: I1eb463aa79a7976a87d1f36a6c0123b058c3ec87
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140438 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'Source/JavaScriptCore/yarr/YarrJIT.cpp')
-rw-r--r-- | Source/JavaScriptCore/yarr/YarrJIT.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/JavaScriptCore/yarr/YarrJIT.cpp b/Source/JavaScriptCore/yarr/YarrJIT.cpp index d5b215413..1aef49bdf 100644 --- a/Source/JavaScriptCore/yarr/YarrJIT.cpp +++ b/Source/JavaScriptCore/yarr/YarrJIT.cpp @@ -756,7 +756,11 @@ class YarrGenerator : private MacroAssembler { const RegisterID character = regT0; int maxCharactersAtOnce = m_charSize == Char8 ? 4 : 2; unsigned ignoreCaseMask = 0; +#if CPU(BIG_ENDIAN) + int allCharacters = ch << (m_charSize == Char8 ? 24 : 16); +#else int allCharacters = ch; +#endif int numberCharacters; int startTermPosition = term->inputPosition; @@ -765,7 +769,11 @@ class YarrGenerator : private MacroAssembler { ASSERT(!m_pattern.m_ignoreCase || isASCIIAlpha(ch) || isCanonicallyUnique(ch)); if (m_pattern.m_ignoreCase && isASCIIAlpha(ch)) +#if CPU(BIG_ENDIAN) + ignoreCaseMask |= 32 << (m_charSize == Char8 ? 24 : 16); +#else ignoreCaseMask |= 32; +#endif for (numberCharacters = 1; numberCharacters < maxCharactersAtOnce && nextOp->m_op == OpTerm; ++numberCharacters, nextOp = &m_ops[opIndex + numberCharacters]) { PatternTerm* nextTerm = nextOp->m_term; @@ -778,7 +786,11 @@ class YarrGenerator : private MacroAssembler { nextOp->m_isDeadCode = true; +#if CPU(BIG_ENDIAN) + int shiftAmount = (m_charSize == Char8 ? 24 : 16) - ((m_charSize == Char8 ? 8 : 16) * numberCharacters); +#else int shiftAmount = (m_charSize == Char8 ? 8 : 16) * numberCharacters; +#endif UChar currentCharacter = nextTerm->patternCharacter; |