[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
zherczeg at webkit.org
zherczeg at webkit.org
Wed Dec 22 13:10:43 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit ab108614e560480ba4212fec26d7dafa5292dffe
Author: zherczeg at webkit.org <zherczeg at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Sep 8 09:59:24 2010 +0000
Refactoring multiline comments in the lexer
https://bugs.webkit.org/show_bug.cgi?id=45289
Reviewed by Darin Adler.
MultiLine comment parsing is moved to a separate function.
Slight performance increase on --parse-only tests (from 33.6ms to 32.8ms)
SunSpider reports no change (from 523.1ms to 521.2ms).
* parser/Lexer.cpp:
(JSC::Lexer::parseMultilineComment):
(JSC::Lexer::lex):
* parser/Lexer.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66962 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 014c5f8..4f9944e 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-09-08 Zoltan Herczeg <zherczeg at webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Refactoring multiline comments in the lexer
+ https://bugs.webkit.org/show_bug.cgi?id=45289
+
+ MultiLine comment parsing is moved to a separate function.
+
+ Slight performance increase on --parse-only tests (from 33.6ms to 32.8ms)
+ SunSpider reports no change (from 523.1ms to 521.2ms).
+
+ * parser/Lexer.cpp:
+ (JSC::Lexer::parseMultilineComment):
+ (JSC::Lexer::lex):
+ * parser/Lexer.h:
+
2010-09-07 James Robinson <jamesr at chromium.org>
Compile fix attempt for windows.
diff --git a/JavaScriptCore/parser/Lexer.cpp b/JavaScriptCore/parser/Lexer.cpp
index 6c4db32..021dd6b 100644
--- a/JavaScriptCore/parser/Lexer.cpp
+++ b/JavaScriptCore/parser/Lexer.cpp
@@ -675,6 +675,27 @@ ALWAYS_INLINE bool Lexer::parseNumberAfterExponentIndicator()
return true;
}
+ALWAYS_INLINE bool Lexer::parseMultilineComment()
+{
+ while (true) {
+ while (UNLIKELY(m_current == '*')) {
+ shift();
+ if (m_current == '/') {
+ shift();
+ return true;
+ }
+ }
+
+ if (UNLIKELY(m_current == -1))
+ return false;
+
+ if (isLineTerminator(m_current))
+ shiftLineTerminator();
+ else
+ shift();
+ }
+}
+
JSTokenType Lexer::lex(JSTokenData* lvalp, JSTokenInfo* llocp, LexType lexType)
{
ASSERT(!m_error);
@@ -835,7 +856,9 @@ start:
}
if (m_current == '*') {
shift();
- goto inMultiLineComment;
+ if (parseMultilineComment())
+ goto start;
+ goto returnError;
}
if (m_current == '=') {
shift();
@@ -1028,27 +1051,6 @@ inSingleLineComment:
goto doneSemicolon;
goto start;
-inMultiLineComment:
- while (true) {
- if (UNLIKELY(m_current == '*')) {
- shift();
- if (m_current == '/')
- break;
- if (m_current == '*')
- continue;
- }
-
- if (UNLIKELY(m_current == -1))
- goto returnError;
-
- if (isLineTerminator(m_current))
- shiftLineTerminator();
- else
- shift();
- }
- shift();
- goto start;
-
doneSemicolon:
token = SEMICOLON;
m_delimited = true;
diff --git a/JavaScriptCore/parser/Lexer.h b/JavaScriptCore/parser/Lexer.h
index da84a6b..e6c1efd 100644
--- a/JavaScriptCore/parser/Lexer.h
+++ b/JavaScriptCore/parser/Lexer.h
@@ -101,6 +101,7 @@ namespace JSC {
ALWAYS_INLINE bool parseDecimal(double& returnValue);
ALWAYS_INLINE void parseNumberAfterDecimalPoint();
ALWAYS_INLINE bool parseNumberAfterExponentIndicator();
+ ALWAYS_INLINE bool parseMultilineComment();
static const size_t initialReadBufferCapacity = 32;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list