diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-22 15:40:17 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-22 15:40:17 +0200 |
commit | 43a42f108af6bcbd91f2672731c3047c26213af1 (patch) | |
tree | 7fa092e5f5d873c72f2486a70e26be26f7a38bec /Source/JavaScriptCore/parser | |
parent | d9cf437c840c6eb7417bdd97e6c40979255d3158 (diff) | |
download | qtwebkit-43a42f108af6bcbd91f2672731c3047c26213af1.tar.gz |
Imported WebKit commit 302e7806bff028bd1167a1ec7c86a1ee00ecfb49 (http://svn.webkit.org/repository/webkit/trunk@132067)
New snapshot that fixes build without QtWidgets
Diffstat (limited to 'Source/JavaScriptCore/parser')
-rw-r--r-- | Source/JavaScriptCore/parser/Lexer.cpp | 4 | ||||
-rw-r--r-- | Source/JavaScriptCore/parser/Lexer.h | 29 | ||||
-rw-r--r-- | Source/JavaScriptCore/parser/Parser.h | 2 |
3 files changed, 31 insertions, 4 deletions
diff --git a/Source/JavaScriptCore/parser/Lexer.cpp b/Source/JavaScriptCore/parser/Lexer.cpp index 8c9eaa12c..8b2020987 100644 --- a/Source/JavaScriptCore/parser/Lexer.cpp +++ b/Source/JavaScriptCore/parser/Lexer.cpp @@ -1617,7 +1617,7 @@ bool Lexer<T>::scanRegExp(const Identifier*& pattern, const Identifier*& flags, } } - pattern = makeIdentifier(m_buffer16.data(), m_buffer16.size()); + pattern = makeIdentifierSameType(m_buffer16.data(), m_buffer16.size()); m_buffer16.resize(0); while (isIdentPart(m_current)) { @@ -1625,7 +1625,7 @@ bool Lexer<T>::scanRegExp(const Identifier*& pattern, const Identifier*& flags, shift(); } - flags = makeIdentifier(m_buffer16.data(), m_buffer16.size()); + flags = makeIdentifierSameType(m_buffer16.data(), m_buffer16.size()); m_buffer16.resize(0); return true; diff --git a/Source/JavaScriptCore/parser/Lexer.h b/Source/JavaScriptCore/parser/Lexer.h index d75f2020d..aa1599b96 100644 --- a/Source/JavaScriptCore/parser/Lexer.h +++ b/Source/JavaScriptCore/parser/Lexer.h @@ -146,6 +146,9 @@ private: ALWAYS_INLINE const Identifier* makeIdentifier(const LChar* characters, size_t length); ALWAYS_INLINE const Identifier* makeIdentifier(const UChar* characters, size_t length); + ALWAYS_INLINE const Identifier* makeLCharIdentifier(const LChar* characters, size_t length); + ALWAYS_INLINE const Identifier* makeLCharIdentifier(const UChar* characters, size_t length); + ALWAYS_INLINE const Identifier* makeIdentifierSameType(const UChar* characters, size_t length); ALWAYS_INLINE const Identifier* makeIdentifierLCharFromUChar(const UChar* characters, size_t length); ALWAYS_INLINE bool lastTokenWasRestrKeyword() const; @@ -239,6 +242,18 @@ ALWAYS_INLINE const Identifier* Lexer<T>::makeIdentifier(const UChar* characters } template <> +ALWAYS_INLINE const Identifier* Lexer<LChar>::makeIdentifierSameType(const UChar* characters, size_t length) +{ + return &m_arena->makeIdentifierLCharFromUChar(m_globalData, characters, length); +} + +template <> +ALWAYS_INLINE const Identifier* Lexer<UChar>::makeIdentifierSameType(const UChar* characters, size_t length) +{ + return &m_arena->makeIdentifier(m_globalData, characters, length); +} + +template <> ALWAYS_INLINE void Lexer<LChar>::setCodeStart(const StringImpl* sourceString) { ASSERT(sourceString->is8Bit()); @@ -259,6 +274,18 @@ ALWAYS_INLINE const Identifier* Lexer<T>::makeIdentifierLCharFromUChar(const UCh } template <typename T> +ALWAYS_INLINE const Identifier* Lexer<T>::makeLCharIdentifier(const LChar* characters, size_t length) +{ + return &m_arena->makeIdentifier(m_globalData, characters, length); +} + +template <typename T> +ALWAYS_INLINE const Identifier* Lexer<T>::makeLCharIdentifier(const UChar* characters, size_t length) +{ + return &m_arena->makeIdentifierLCharFromUChar(m_globalData, characters, length); +} + +template <typename T> ALWAYS_INLINE JSTokenType Lexer<T>::lexExpectIdentifier(JSTokenData* tokenData, JSTokenLocation* tokenLocation, unsigned lexerFlags, bool strictMode) { ASSERT((lexerFlags & LexerFlagsIgnoreReservedWords)); @@ -293,7 +320,7 @@ ALWAYS_INLINE JSTokenType Lexer<T>::lexExpectIdentifier(JSTokenData* tokenData, if (lexerFlags & LexexFlagsDontBuildKeywords) tokenData->ident = 0; else - tokenData->ident = makeIdentifier(start, ptr - start); + tokenData->ident = makeLCharIdentifier(start, ptr - start); tokenLocation->line = m_lineNumber; tokenLocation->startOffset = start - m_codeStart; tokenLocation->endOffset = currentOffset(); diff --git a/Source/JavaScriptCore/parser/Parser.h b/Source/JavaScriptCore/parser/Parser.h index 4c005fa5e..dc42d36ba 100644 --- a/Source/JavaScriptCore/parser/Parser.h +++ b/Source/JavaScriptCore/parser/Parser.h @@ -882,7 +882,7 @@ private: bool canRecurse() { - return m_stack.recursionCheck(); + return m_stack.isSafeToRecurse(); } int lastTokenEnd() const |