summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/parser
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-11-29 12:18:48 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2012-11-29 12:18:57 +0100
commit4c01d0526ba4dd8cff0c0ff22a6f0ab5eb973064 (patch)
treebed2fe914fe0f7ec70abfb47d2d84af8a3604d09 /Source/JavaScriptCore/parser
parent01485457c9a5da3f1121015afd25bb53af77662e (diff)
downloadqtwebkit-4c01d0526ba4dd8cff0c0ff22a6f0ab5eb973064.tar.gz
Imported WebKit commit c60cfe0fc09efd257aa0111d7b133b02deb8a63e (http://svn.webkit.org/repository/webkit/trunk@136119)
New snapshot that includes the fix for installing the QtWebProcess into libexec Change-Id: I01344e079cbdac5678c4cba6ffcc05f4597cf0d7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'Source/JavaScriptCore/parser')
-rw-r--r--Source/JavaScriptCore/parser/Parser.cpp3
-rw-r--r--Source/JavaScriptCore/parser/SourceProviderCacheItem.h19
2 files changed, 14 insertions, 8 deletions
diff --git a/Source/JavaScriptCore/parser/Parser.cpp b/Source/JavaScriptCore/parser/Parser.cpp
index 049a51939..cf3cb4e4f 100644
--- a/Source/JavaScriptCore/parser/Parser.cpp
+++ b/Source/JavaScriptCore/parser/Parser.cpp
@@ -812,6 +812,7 @@ template <FunctionRequirements requirements, bool nameIsInContainingScope, class
{
AutoPopScopeRef functionScope(this, pushScope());
functionScope->setIsFunction();
+ int functionStart = m_token.m_location.startOffset;
if (match(IDENT)) {
name = m_token.m_data.ident;
next();
@@ -865,7 +866,7 @@ template <FunctionRequirements requirements, bool nameIsInContainingScope, class
OwnPtr<SourceProviderCacheItem> newInfo;
int functionLength = closeBracePos - openBracePos;
if (TreeBuilder::CanUseFunctionCache && m_functionCache && functionLength > minimumFunctionLengthToCache) {
- newInfo = adoptPtr(new SourceProviderCacheItem(m_token.m_location.line, closeBracePos));
+ newInfo = adoptPtr(new SourceProviderCacheItem(functionStart, m_token.m_location.line, closeBracePos));
functionScope->saveFunctionInfo(newInfo.get());
}
diff --git a/Source/JavaScriptCore/parser/SourceProviderCacheItem.h b/Source/JavaScriptCore/parser/SourceProviderCacheItem.h
index 9ca121e2a..ec3890560 100644
--- a/Source/JavaScriptCore/parser/SourceProviderCacheItem.h
+++ b/Source/JavaScriptCore/parser/SourceProviderCacheItem.h
@@ -35,8 +35,9 @@ namespace JSC {
class SourceProviderCacheItem {
WTF_MAKE_FAST_ALLOCATED;
public:
- SourceProviderCacheItem(int closeBraceLine, int closeBracePos)
- : closeBraceLine(closeBraceLine)
+ SourceProviderCacheItem(unsigned functionStart, unsigned closeBraceLine, unsigned closeBracePos)
+ : functionStart(functionStart)
+ , closeBraceLine(closeBraceLine)
, closeBracePos(closeBracePos)
{
}
@@ -59,12 +60,16 @@ public:
token.m_location.line = closeBraceLine;
return token;
}
+
+ unsigned functionStart : 31;
+ bool needsFullActivation : 1;
- int closeBraceLine;
- int closeBracePos;
- bool usesEval;
- bool strictMode;
- bool needsFullActivation;
+ unsigned closeBraceLine : 31;
+ bool usesEval : 1;
+
+ unsigned closeBracePos : 31;
+ bool strictMode : 1;
+
Vector<RefPtr<StringImpl> > usedVariables;
Vector<RefPtr<StringImpl> > writtenVariables;
};