Title: [143366] trunk/Source/_javascript_Core
Revision
143366
Author
commit-qu...@webkit.org
Date
2013-02-19 11:39:54 -0800 (Tue, 19 Feb 2013)

Log 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....@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):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (143365 => 143366)


--- trunk/Source/_javascript_Core/ChangeLog	2013-02-19 19:34:35 UTC (rev 143365)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-02-19 19:39:54 UTC (rev 143366)
@@ -1,3 +1,23 @@
+2013-02-19  Sheriff Bot  <webkit.review....@gmail.com>
+
+        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).
+
+        * 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):
+
 2013-02-19  Mark Hahnenberg  <mhahnenb...@apple.com>
 
         HeapBlock::destroy should issue warning if result is unused

Modified: trunk/Source/_javascript_Core/runtime/CodeCache.cpp (143365 => 143366)


--- trunk/Source/_javascript_Core/runtime/CodeCache.cpp	2013-02-19 19:34:35 UTC (rev 143365)
+++ trunk/Source/_javascript_Core/runtime/CodeCache.cpp	2013-02-19 19:39:54 UTC (rev 143366)
@@ -105,7 +105,7 @@
 
 UnlinkedFunctionExecutable* CodeCache::getFunctionExecutableFromGlobalCode(JSGlobalData& globalData, const Identifier& name, const SourceCode& source, ParserError& error)
 {
-    SourceCodeKey key = SourceCodeKey(source, name.string(), SourceCodeKey::FunctionType, JSParseNormal);
+    SourceCodeKey key = SourceCodeKey(source, name.string(), SourceCodeKey::FunctionCallType, JSParseNormal);
     const Strong<JSCell>* result = m_sourceCode.find(key);
     if (result)
         return jsCast<UnlinkedFunctionExecutable*>(result->get());

Modified: trunk/Source/_javascript_Core/runtime/CodeCache.h (143365 => 143366)


--- trunk/Source/_javascript_Core/runtime/CodeCache.h	2013-02-19 19:34:35 UTC (rev 143365)
+++ trunk/Source/_javascript_Core/runtime/CodeCache.h	2013-02-19 19:39:54 UTC (rev 143366)
@@ -55,51 +55,44 @@
 
 class SourceCodeKey {
 public:
-    enum CodeType { EvalType, ProgramType, FunctionType };
+    enum CodeType { EvalType, ProgramType, FunctionCallType, FunctionConstructType };
 
     SourceCodeKey()
+        : m_flags(0)
     {
     }
 
     SourceCodeKey(const SourceCode& sourceCode, const String& name, CodeType codeType, JSParserStrictness jsParserStrictness)
-        : m_sourceCode(sourceCode)
+        : m_sourceString(sourceCode.toString())
         , m_name(name)
         , m_flags((codeType << 1) | jsParserStrictness)
-        , m_hash(string().impl()->hash())
     {
     }
 
     SourceCodeKey(WTF::HashTableDeletedValueType)
-        : m_name(WTF::HashTableDeletedValue)
+        : m_sourceString(WTF::HashTableDeletedValue)
     {
     }
 
-    bool isHashTableDeletedValue() const { return m_name.isHashTableDeletedValue(); }
+    bool isHashTableDeletedValue() const { return m_sourceString.isHashTableDeletedValue(); }
 
-    unsigned hash() const { return m_hash; }
+    unsigned hash() const { return m_sourceString.impl()->hash(); }
 
-    size_t length() const { return m_sourceCode.length(); }
+    size_t length() const { return m_sourceString.length(); }
 
-    bool isNull() const { return m_sourceCode.isNull(); }
+    bool isNull() const { return m_sourceString.isNull(); }
 
-    // To save memory, we compute our string on demand. It's expected that source
-    // providers cache their strings to make this efficient.
-    String string() const { return m_sourceCode.toString(); }
-
     bool operator==(const SourceCodeKey& other) const
     {
-        return m_hash == other.m_hash
-            && length() == other.length()
-            && m_flags == other.m_flags
+        return m_flags == other.m_flags
             && m_name == other.m_name
-            && string() == other.string();
+            && m_sourceString == other.m_sourceString;
     }
 
 private:
-    SourceCode m_sourceCode;
+    String m_sourceString;
     String m_name;
     unsigned m_flags;
-    unsigned m_hash;
 };
 
 struct SourceCodeKeyHash {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to