X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/2d39b0e377c0896910ee49ae70082ba665faf986..refs/heads/master:/bytecode/EvalCodeCache.h?ds=sidebyside diff --git a/bytecode/EvalCodeCache.h b/bytecode/EvalCodeCache.h index 65deb94..b0e5aac 100644 --- a/bytecode/EvalCodeCache.h +++ b/bytecode/EvalCodeCache.h @@ -31,6 +31,7 @@ #include "Executable.h" #include "JSGlobalObject.h" +#include "Options.h" #include "SourceCode.h" #include #include @@ -44,18 +45,18 @@ namespace JSC { public: EvalExecutable* tryGet(bool inStrictContext, const String& evalSource, JSScope* scope) { - if (!inStrictContext && evalSource.length() < maxCacheableSourceLength && scope->begin()->isVariableObject()) + if (!inStrictContext && evalSource.length() < Options::maximumEvalCacheableSourceLength() && scope->begin()->isVariableObject()) return m_cacheMap.get(evalSource.impl()).get(); return 0; } - EvalExecutable* getSlow(ExecState* exec, ScriptExecutable* owner, bool inStrictContext, const String& evalSource, JSScope* scope) + EvalExecutable* getSlow(ExecState* exec, ScriptExecutable* owner, bool inStrictContext, ThisTDZMode thisTDZMode, const String& evalSource, JSScope* scope) { - EvalExecutable* evalExecutable = EvalExecutable::create(exec, makeSource(evalSource), inStrictContext); + EvalExecutable* evalExecutable = EvalExecutable::create(exec, makeSource(evalSource), inStrictContext, thisTDZMode); if (!evalExecutable) return 0; - if (!inStrictContext && evalSource.length() < maxCacheableSourceLength && scope->begin()->isVariableObject() && m_cacheMap.size() < maxCacheEntries) + if (!inStrictContext && evalSource.length() < Options::maximumEvalCacheableSourceLength() && scope->begin()->isVariableObject() && m_cacheMap.size() < maxCacheEntries) m_cacheMap.set(evalSource.impl(), WriteBarrier(exec->vm(), owner, evalExecutable)); return evalExecutable; @@ -71,7 +72,6 @@ namespace JSC { } private: - static const unsigned maxCacheableSourceLength = 256; static const int maxCacheEntries = 64; typedef HashMap, WriteBarrier> EvalCacheMap;