Changeset 143366 in webkit


Ignore:
Timestamp:
Feb 19, 2013 11:39:54 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r143348.
http://trac.webkit.org/changeset/143348
https://bugs.webkit.org/show_bug.cgi?id=110242

"Caused a deleted value sentinel crash on the layout tests"
(Requested by ggaren on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-02-19

  • runtime/CodeCache.cpp:

(JSC::CodeCache::getFunctionExecutableFromGlobalCode):

  • runtime/CodeCache.h:

(JSC::SourceCodeKey::SourceCodeKey):
(JSC::SourceCodeKey::isHashTableDeletedValue):
(JSC::SourceCodeKey::hash):
(JSC::SourceCodeKey::length):
(JSC::SourceCodeKey::isNull):
(JSC::SourceCodeKey::operator==):
(SourceCodeKey):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r143354 r143366  
     12013-02-19  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r143348.
     4        http://trac.webkit.org/changeset/143348
     5        https://bugs.webkit.org/show_bug.cgi?id=110242
     6
     7        "Caused a deleted value sentinel crash on the layout tests"
     8        (Requested by ggaren on #webkit).
     9
     10        * runtime/CodeCache.cpp:
     11        (JSC::CodeCache::getFunctionExecutableFromGlobalCode):
     12        * runtime/CodeCache.h:
     13        (JSC::SourceCodeKey::SourceCodeKey):
     14        (JSC::SourceCodeKey::isHashTableDeletedValue):
     15        (JSC::SourceCodeKey::hash):
     16        (JSC::SourceCodeKey::length):
     17        (JSC::SourceCodeKey::isNull):
     18        (JSC::SourceCodeKey::operator==):
     19        (SourceCodeKey):
     20
    1212013-02-19  Mark Hahnenberg  <mhahnenberg@apple.com>
    222
  • trunk/Source/JavaScriptCore/runtime/CodeCache.cpp

    r143348 r143366  
    106106UnlinkedFunctionExecutable* CodeCache::getFunctionExecutableFromGlobalCode(JSGlobalData& globalData, const Identifier& name, const SourceCode& source, ParserError& error)
    107107{
    108     SourceCodeKey key = SourceCodeKey(source, name.string(), SourceCodeKey::FunctionType, JSParseNormal);
     108    SourceCodeKey key = SourceCodeKey(source, name.string(), SourceCodeKey::FunctionCallType, JSParseNormal);
    109109    const Strong<JSCell>* result = m_sourceCode.find(key);
    110110    if (result)
  • trunk/Source/JavaScriptCore/runtime/CodeCache.h

    r143348 r143366  
    5656class SourceCodeKey {
    5757public:
    58     enum CodeType { EvalType, ProgramType, FunctionType };
     58    enum CodeType { EvalType, ProgramType, FunctionCallType, FunctionConstructType };
    5959
    6060    SourceCodeKey()
     61        : m_flags(0)
    6162    {
    6263    }
    6364
    6465    SourceCodeKey(const SourceCode& sourceCode, const String& name, CodeType codeType, JSParserStrictness jsParserStrictness)
    65         : m_sourceCode(sourceCode)
     66        : m_sourceString(sourceCode.toString())
    6667        , m_name(name)
    6768        , m_flags((codeType << 1) | jsParserStrictness)
    68         , m_hash(string().impl()->hash())
    6969    {
    7070    }
    7171
    7272    SourceCodeKey(WTF::HashTableDeletedValueType)
    73         : m_name(WTF::HashTableDeletedValue)
     73        : m_sourceString(WTF::HashTableDeletedValue)
    7474    {
    7575    }
    7676
    77     bool isHashTableDeletedValue() const { return m_name.isHashTableDeletedValue(); }
     77    bool isHashTableDeletedValue() const { return m_sourceString.isHashTableDeletedValue(); }
    7878
    79     unsigned hash() const { return m_hash; }
     79    unsigned hash() const { return m_sourceString.impl()->hash(); }
    8080
    81     size_t length() const { return m_sourceCode.length(); }
     81    size_t length() const { return m_sourceString.length(); }
    8282
    83     bool isNull() const { return m_sourceCode.isNull(); }
    84 
    85     // To save memory, we compute our string on demand. It's expected that source
    86     // providers cache their strings to make this efficient.
    87     String string() const { return m_sourceCode.toString(); }
     83    bool isNull() const { return m_sourceString.isNull(); }
    8884
    8985    bool operator==(const SourceCodeKey& other) const
    9086    {
    91         return m_hash == other.m_hash
    92             && length() == other.length()
    93             && m_flags == other.m_flags
     87        return m_flags == other.m_flags
    9488            && m_name == other.m_name
    95             && string() == other.string();
     89            && m_sourceString == other.m_sourceString;
    9690    }
    9791
    9892private:
    99     SourceCode m_sourceCode;
     93    String m_sourceString;
    10094    String m_name;
    10195    unsigned m_flags;
    102     unsigned m_hash;
    10396};
    10497
Note: See TracChangeset for help on using the changeset viewer.