diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-10 19:10:20 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-10 19:10:20 +0200 |
commit | 284837daa07b29d6a63a748544a90b1f5842ac5c (patch) | |
tree | ecd258180bde91fe741e0cfd2638beb3c6da7e8e /Source/JavaScriptCore/bytecode/EvalCodeCache.h | |
parent | 2e2ba8ff45915f40ed3e014101269c175f2a89a0 (diff) | |
download | qtwebkit-284837daa07b29d6a63a748544a90b1f5842ac5c.tar.gz |
Imported WebKit commit 68645295d2e3e09af2c942f092556f06aa5f8b0d (http://svn.webkit.org/repository/webkit/trunk@128073)
New snapshot
Diffstat (limited to 'Source/JavaScriptCore/bytecode/EvalCodeCache.h')
-rw-r--r-- | Source/JavaScriptCore/bytecode/EvalCodeCache.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/Source/JavaScriptCore/bytecode/EvalCodeCache.h b/Source/JavaScriptCore/bytecode/EvalCodeCache.h index fba1d32f5..29b17dd82 100644 --- a/Source/JavaScriptCore/bytecode/EvalCodeCache.h +++ b/Source/JavaScriptCore/bytecode/EvalCodeCache.h @@ -34,7 +34,6 @@ #include "Nodes.h" #include "Parser.h" #include "SourceCode.h" -#include "UString.h" #include <wtf/HashMap.h> #include <wtf/RefPtr.h> #include <wtf/text/StringHash.h> @@ -45,32 +44,32 @@ namespace JSC { class EvalCodeCache { public: - EvalExecutable* tryGet(bool inStrictContext, const UString& evalSource, ScopeChainNode* scopeChain) + EvalExecutable* tryGet(bool inStrictContext, const String& evalSource, JSScope* scope) { - if (!inStrictContext && evalSource.length() < maxCacheableSourceLength && (*scopeChain->begin())->isVariableObject()) + if (!inStrictContext && evalSource.length() < maxCacheableSourceLength && scope->begin()->isVariableObject()) return m_cacheMap.get(evalSource.impl()).get(); return 0; } - EvalExecutable* getSlow(ExecState* exec, ScriptExecutable* owner, bool inStrictContext, const UString& evalSource, ScopeChainNode* scopeChain, JSValue& exceptionValue) + EvalExecutable* getSlow(ExecState* exec, ScriptExecutable* owner, bool inStrictContext, const String& evalSource, JSScope* scope, JSValue& exceptionValue) { EvalExecutable* evalExecutable = EvalExecutable::create(exec, makeSource(evalSource), inStrictContext); - exceptionValue = evalExecutable->compile(exec, scopeChain); + exceptionValue = evalExecutable->compile(exec, scope); if (exceptionValue) return 0; - if (!inStrictContext && evalSource.length() < maxCacheableSourceLength && (*scopeChain->begin())->isVariableObject() && m_cacheMap.size() < maxCacheEntries) + if (!inStrictContext && evalSource.length() < maxCacheableSourceLength && scope->begin()->isVariableObject() && m_cacheMap.size() < maxCacheEntries) m_cacheMap.set(evalSource.impl(), WriteBarrier<EvalExecutable>(exec->globalData(), owner, evalExecutable)); return evalExecutable; } - - EvalExecutable* get(ExecState* exec, ScriptExecutable* owner, bool inStrictContext, const UString& evalSource, ScopeChainNode* scopeChain, JSValue& exceptionValue) + + EvalExecutable* get(ExecState* exec, ScriptExecutable* owner, bool inStrictContext, const String& evalSource, JSScope* scope, JSValue& exceptionValue) { - EvalExecutable* evalExecutable = tryGet(inStrictContext, evalSource, scopeChain); + EvalExecutable* evalExecutable = tryGet(inStrictContext, evalSource, scope); if (!evalExecutable) - evalExecutable = getSlow(exec, owner, inStrictContext, evalSource, scopeChain, exceptionValue); + evalExecutable = getSlow(exec, owner, inStrictContext, evalSource, scope, exceptionValue); return evalExecutable; } |