Ignore:
Timestamp:
Dec 1, 2015, 5:37:19 PM (10 years ago)
Author:
[email protected]
Message:

Unreviewed, rolling out r192914.
https://bugs.webkit.org/show_bug.cgi?id=151734

JSC tests for this change are failing on 32 and 64-bit bots
(Requested by ryanhaddad on #webkit).

Reverted changeset:

"[ES6] Implement LLInt/Baseline Support for ES6 Generators and
enable this feature"
https://bugs.webkit.org/show_bug.cgi?id=150792
http://trac.webkit.org/changeset/192914

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/EvalCodeCache.h

    r192914 r192935  
    3535#include "Options.h"
    3636#include "SourceCode.h"
    37 #include "SourceCodeKey.h"
    3837#include <wtf/HashMap.h>
    3938#include <wtf/RefPtr.h>
     
    4645    class EvalCodeCache {
    4746    public:
    48         EvalExecutable* tryGet(bool inStrictContext, const SourceCode& evalSource, ThisTDZMode thisTDZMode, JSScope* scope)
     47        EvalExecutable* tryGet(bool inStrictContext, const String& evalSource, JSScope* scope)
    4948        {
    50             if (isCacheable(inStrictContext, evalSource, scope)) {
    51                 ASSERT(!inStrictContext);
    52                 SourceCodeKey sourceCodeKey(evalSource, String(), SourceCodeKey::EvalType, JSParserBuiltinMode::NotBuiltin, JSParserStrictMode::NotStrict, thisTDZMode);
    53                 return m_cacheMap.get(sourceCodeKey).get();
    54             }
    55             return nullptr;
     49            if (isCacheable(inStrictContext, evalSource, scope))
     50                return m_cacheMap.get(evalSource.impl()).get();
     51            return 0;
    5652        }
    5753       
    58         EvalExecutable* getSlow(ExecState* exec, JSCell* owner, bool inStrictContext, ThisTDZMode thisTDZMode, const SourceCode& evalSource, JSScope* scope)
     54        EvalExecutable* getSlow(ExecState* exec, JSCell* owner, bool inStrictContext, ThisTDZMode thisTDZMode, const String& evalSource, JSScope* scope)
    5955        {
    6056            VariableEnvironment variablesUnderTDZ;
    6157            JSScope::collectVariablesUnderTDZ(scope, variablesUnderTDZ);
    62             EvalExecutable* evalExecutable = EvalExecutable::create(exec, evalSource, inStrictContext, thisTDZMode, &variablesUnderTDZ);
     58            EvalExecutable* evalExecutable = EvalExecutable::create(exec, makeSource(evalSource), inStrictContext, thisTDZMode, &variablesUnderTDZ);
    6359            if (!evalExecutable)
    64                 return nullptr;
     60                return 0;
    6561
    66             if (isCacheable(inStrictContext, evalSource, scope) && m_cacheMap.size() < maxCacheEntries) {
    67                 ASSERT(!inStrictContext);
    68                 SourceCodeKey sourceCodeKey(evalSource, String(), SourceCodeKey::EvalType, JSParserBuiltinMode::NotBuiltin, JSParserStrictMode::NotStrict, thisTDZMode);
    69                 m_cacheMap.set(sourceCodeKey, WriteBarrier<EvalExecutable>(exec->vm(), owner, evalExecutable));
    70             }
     62            if (isCacheable(inStrictContext, evalSource, scope) && m_cacheMap.size() < maxCacheEntries)
     63                m_cacheMap.set(evalSource.impl(), WriteBarrier<EvalExecutable>(exec->vm(), owner, evalExecutable));
    7164           
    7265            return evalExecutable;
     
    8881        }
    8982
    90         ALWAYS_INLINE bool isCacheable(bool inStrictContext, const SourceCode& evalSource, JSScope* scope)
     83        ALWAYS_INLINE bool isCacheable(bool inStrictContext, const String& evalSource, JSScope* scope)
    9184        {
    9285            // If eval() is called and it has access to a lexical scope, we can't soundly cache it.
    9386            // If the eval() only has access to the "var" scope, then we can cache it.
    9487            return !inStrictContext
    95                 && static_cast<size_t>(evalSource.length()) < Options::maximumEvalCacheableSourceLength()
     88                && evalSource.length() < Options::maximumEvalCacheableSourceLength()
    9689                && isCacheableScope(scope);
    9790        }
    9891        static const int maxCacheEntries = 64;
    9992
    100         typedef HashMap<SourceCodeKey, WriteBarrier<EvalExecutable>, SourceCodeKeyHash, SourceCodeKeyHashTraits> EvalCacheMap;
     93        typedef HashMap<RefPtr<StringImpl>, WriteBarrier<EvalExecutable>> EvalCacheMap;
    10194        EvalCacheMap m_cacheMap;
    10295    };
Note: See TracChangeset for help on using the changeset viewer.