Modified: trunk/Source/_javascript_Core/ChangeLog (184312 => 184313)
--- trunk/Source/_javascript_Core/ChangeLog 2015-05-13 22:16:57 UTC (rev 184312)
+++ trunk/Source/_javascript_Core/ChangeLog 2015-05-13 22:23:52 UTC (rev 184313)
@@ -1,3 +1,13 @@
+2015-05-13 Alexandr Skachkov <[email protected]>
+
+ Small refactoring before ES6 Arrow function implementation.
+ https://bugs.webkit.org/show_bug.cgi?id=144954
+
+ Reviewed by Filip Pizlo.
+
+ * parser/Parser.h:
+ * parser/Parser.cpp:
+
2015-05-13 Filip Pizlo <[email protected]>
The liveness pruning done by ObjectAllocationSinkingPhase ignores the possibility of an object's bytecode liveness being longer than its DFG liveness
Modified: trunk/Source/_javascript_Core/parser/Parser.cpp (184312 => 184313)
--- trunk/Source/_javascript_Core/parser/Parser.cpp 2015-05-13 22:16:57 UTC (rev 184312)
+++ trunk/Source/_javascript_Core/parser/Parser.cpp 2015-05-13 22:23:52 UTC (rev 184313)
@@ -1310,15 +1310,8 @@
return nullptr;
}
-template <typename LexerType>
-template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuilder& context, FunctionRequirements requirements, FunctionParseMode mode,
- bool nameIsInContainingScope, ConstructorKind constructorKind, SuperBinding expectedSuperBinding, int functionKeywordStart, ParserFunctionInfo<TreeBuilder>& info)
+template <typename LexerType> template <class TreeBuilder> int Parser<LexerType>::parseFunctionParamters(TreeBuilder& context, FunctionRequirements requirements, FunctionParseMode mode, bool nameIsInContainingScope, AutoPopScopeRef& functionScope, ParserFunctionInfo<TreeBuilder>& info)
{
- AutoPopScopeRef functionScope(this, pushScope());
- functionScope->setIsFunction();
- int functionNameStart = m_token.m_location.startOffset;
- const Identifier* lastFunctionName = m_lastFunctionName;
- m_lastFunctionName = nullptr;
if (match(IDENT)) {
info.name = m_token.m_data.ident;
m_lastFunctionName = info.name;
@@ -1354,6 +1347,20 @@
}
consumeOrFail(CLOSEPAREN, "Expected a ')' or a ',' after a parameter declaration");
}
+
+ return parametersStart;
+}
+
+template <typename LexerType>
+template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuilder& context, FunctionRequirements requirements, FunctionParseMode mode, bool nameIsInContainingScope, ConstructorKind constructorKind, SuperBinding expectedSuperBinding, int functionKeywordStart, ParserFunctionInfo<TreeBuilder>& info)
+{
+ AutoPopScopeRef functionScope(this, pushScope());
+ functionScope->setIsFunction();
+ int functionNameStart = m_token.m_location.startOffset;
+ const Identifier* lastFunctionName = m_lastFunctionName;
+ m_lastFunctionName = nullptr;
+
+ int parametersStart = parseFunctionParamters(context, requirements, mode, nameIsInContainingScope, functionScope, info);
matchOrFail(OPENBRACE, "Expected an opening '{' at the start of a ", stringForFunctionMode(mode), " body");
Modified: trunk/Source/_javascript_Core/parser/Parser.h (184312 => 184313)
--- trunk/Source/_javascript_Core/parser/Parser.h 2015-05-13 22:16:57 UTC (rev 184312)
+++ trunk/Source/_javascript_Core/parser/Parser.h 2015-05-13 22:23:52 UTC (rev 184313)
@@ -773,6 +773,9 @@
template <class TreeBuilder> NEVER_INLINE TreeDeconstructionPattern tryParseDeconstructionPatternExpression(TreeBuilder&);
template <class TreeBuilder> NEVER_INLINE bool parseFunctionInfo(TreeBuilder&, FunctionRequirements, FunctionParseMode, bool nameIsInContainingScope, ConstructorKind, SuperBinding, int functionKeywordStart, ParserFunctionInfo<TreeBuilder>&);
+
+ template <class TreeBuilder> NEVER_INLINE int parseFunctionParamters(TreeBuilder&, FunctionRequirements, FunctionParseMode, bool, AutoPopScopeRef&, ParserFunctionInfo<TreeBuilder>&);
+
#if ENABLE(ES6_CLASS_SYNTAX)
template <class TreeBuilder> NEVER_INLINE TreeClassExpression parseClass(TreeBuilder&, FunctionRequirements, ParserClassInfo<TreeBuilder>&);
#endif