Changeset 143366 in webkit
- Timestamp:
- Feb 19, 2013 11:39:54 AM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r143354 r143366 1 2013-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 1 21 2013-02-19 Mark Hahnenberg <mhahnenberg@apple.com> 2 22 -
trunk/Source/JavaScriptCore/runtime/CodeCache.cpp
r143348 r143366 106 106 UnlinkedFunctionExecutable* CodeCache::getFunctionExecutableFromGlobalCode(JSGlobalData& globalData, const Identifier& name, const SourceCode& source, ParserError& error) 107 107 { 108 SourceCodeKey key = SourceCodeKey(source, name.string(), SourceCodeKey::Function Type, JSParseNormal);108 SourceCodeKey key = SourceCodeKey(source, name.string(), SourceCodeKey::FunctionCallType, JSParseNormal); 109 109 const Strong<JSCell>* result = m_sourceCode.find(key); 110 110 if (result) -
trunk/Source/JavaScriptCore/runtime/CodeCache.h
r143348 r143366 56 56 class SourceCodeKey { 57 57 public: 58 enum CodeType { EvalType, ProgramType, Function Type };58 enum CodeType { EvalType, ProgramType, FunctionCallType, FunctionConstructType }; 59 59 60 60 SourceCodeKey() 61 : m_flags(0) 61 62 { 62 63 } 63 64 64 65 SourceCodeKey(const SourceCode& sourceCode, const String& name, CodeType codeType, JSParserStrictness jsParserStrictness) 65 : m_source Code(sourceCode)66 : m_sourceString(sourceCode.toString()) 66 67 , m_name(name) 67 68 , m_flags((codeType << 1) | jsParserStrictness) 68 , m_hash(string().impl()->hash())69 69 { 70 70 } 71 71 72 72 SourceCodeKey(WTF::HashTableDeletedValueType) 73 : m_ name(WTF::HashTableDeletedValue)73 : m_sourceString(WTF::HashTableDeletedValue) 74 74 { 75 75 } 76 76 77 bool isHashTableDeletedValue() const { return m_ name.isHashTableDeletedValue(); }77 bool isHashTableDeletedValue() const { return m_sourceString.isHashTableDeletedValue(); } 78 78 79 unsigned hash() const { return m_ hash; }79 unsigned hash() const { return m_sourceString.impl()->hash(); } 80 80 81 size_t length() const { return m_source Code.length(); }81 size_t length() const { return m_sourceString.length(); } 82 82 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(); } 88 84 89 85 bool operator==(const SourceCodeKey& other) const 90 86 { 91 return m_hash == other.m_hash 92 && length() == other.length() 93 && m_flags == other.m_flags 87 return m_flags == other.m_flags 94 88 && m_name == other.m_name 95 && string() == other.string();89 && m_sourceString == other.m_sourceString; 96 90 } 97 91 98 92 private: 99 S ourceCode m_sourceCode;93 String m_sourceString; 100 94 String m_name; 101 95 unsigned m_flags; 102 unsigned m_hash;103 96 }; 104 97
Note: See TracChangeset
for help on using the changeset viewer.