summaryrefslogtreecommitdiffstats
path: root/Source/JavaScriptCore/parser
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/parser')
-rw-r--r--Source/JavaScriptCore/parser/JSParser.cpp4
-rw-r--r--Source/JavaScriptCore/parser/Lexer.h7
2 files changed, 7 insertions, 4 deletions
diff --git a/Source/JavaScriptCore/parser/JSParser.cpp b/Source/JavaScriptCore/parser/JSParser.cpp
index 9245eb0..314691d 100644
--- a/Source/JavaScriptCore/parser/JSParser.cpp
+++ b/Source/JavaScriptCore/parser/JSParser.cpp
@@ -2168,5 +2168,7 @@ template <class TreeBuilder> TreeExpression JSParser::parseUnaryExpression(TreeB
namespace WTF
{
- template <> struct VectorTraits<JSC::JSParser::Scope> : SimpleClassVectorTraits { };
+ template <> struct VectorTraits<JSC::JSParser::Scope> : SimpleClassVectorTraits {
+ static const bool canInitializeWithMemset = false; // Not all Scope data members initialize to 0.
+ };
}
diff --git a/Source/JavaScriptCore/parser/Lexer.h b/Source/JavaScriptCore/parser/Lexer.h
index d4145c1..9dc553a 100644
--- a/Source/JavaScriptCore/parser/Lexer.h
+++ b/Source/JavaScriptCore/parser/Lexer.h
@@ -71,11 +71,12 @@ namespace JSC {
{
m_error = 0;
m_code = m_codeStart + offset;
- m_current = *m_code;
m_buffer8.resize(0);
m_buffer16.resize(0);
- if (UNLIKELY(m_code == m_codeEnd))
- m_current = -1;
+ // Faster than an if-else sequence
+ m_current = -1;
+ if (LIKELY(m_code < m_codeEnd))
+ m_current = *m_code;
}
void setLineNumber(int line)
{