Title: [153671] trunk/Source/_javascript_Core
Revision
153671
Author
[email protected]
Date
2013-08-02 14:50:56 -0700 (Fri, 02 Aug 2013)

Log Message

DFG validation can cause assertion failures due to dumping
https://bugs.webkit.org/show_bug.cgi?id=119456

Reviewed by Geoffrey Garen.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::hasHash):
(JSC::CodeBlock::isSafeToComputeHash):
(JSC::CodeBlock::hash):
(JSC::CodeBlock::dumpAssumingJITType):
* bytecode/CodeBlock.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (153670 => 153671)


--- trunk/Source/_javascript_Core/ChangeLog	2013-08-02 21:35:36 UTC (rev 153670)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-08-02 21:50:56 UTC (rev 153671)
@@ -1,3 +1,17 @@
+2013-08-02  Mark Hahnenberg  <[email protected]>
+
+        DFG validation can cause assertion failures due to dumping
+        https://bugs.webkit.org/show_bug.cgi?id=119456
+
+        Reviewed by Geoffrey Garen.
+
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::hasHash):
+        (JSC::CodeBlock::isSafeToComputeHash):
+        (JSC::CodeBlock::hash):
+        (JSC::CodeBlock::dumpAssumingJITType):
+        * bytecode/CodeBlock.h:
+
 2013-08-02  Chris Curtis  <[email protected]>
 
         Have vm's exceptionStack match java's vm's exceptionStack.

Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp (153670 => 153671)


--- trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2013-08-02 21:35:36 UTC (rev 153670)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2013-08-02 21:50:56 UTC (rev 153671)
@@ -83,10 +83,20 @@
     }
 }
 
+bool CodeBlock::hasHash() const
+{
+    return !!m_hash;
+}
+
+bool CodeBlock::isSafeToComputeHash() const
+{
+    return !isCompilationThread();
+}
+
 CodeBlockHash CodeBlock::hash() const
 {
     if (!m_hash) {
-        RELEASE_ASSERT(!isCompilationThread());
+        RELEASE_ASSERT(isSafeToComputeHash());
         m_hash = CodeBlockHash(ownerExecutable()->source(), specializationKind());
     }
     return m_hash;
@@ -117,7 +127,11 @@
 
 void CodeBlock::dumpAssumingJITType(PrintStream& out, JITCode::JITType jitType) const
 {
-    out.print(inferredName(), "#", hash(), ":[", RawPointer(this), "->", RawPointer(ownerExecutable()), ", ", jitType, codeType());
+    if (hasHash() || isSafeToComputeHash())
+        out.print(inferredName(), "#", hash(), ":[", RawPointer(this), "->", RawPointer(ownerExecutable()), ", ", jitType, codeType());
+    else
+        out.print(inferredName(), "#<no-hash>:[", RawPointer(this), "->", RawPointer(ownerExecutable()), ", ", jitType, codeType());
+
     if (codeType() == FunctionCode)
         out.print(specializationKind());
     if (this->jitType() == JITCode::BaselineJIT && m_shouldAlwaysBeInlined)

Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.h (153670 => 153671)


--- trunk/Source/_javascript_Core/bytecode/CodeBlock.h	2013-08-02 21:35:36 UTC (rev 153670)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.h	2013-08-02 21:50:56 UTC (rev 153671)
@@ -111,6 +111,8 @@
 
     CString inferredName() const;
     CodeBlockHash hash() const;
+    bool hasHash() const;
+    bool isSafeToComputeHash() const;
     CString sourceCodeForTools() const; // Not quite the actual source we parsed; this will do things like prefix the source for a function with a reified signature.
     CString sourceCodeOnOneLine() const; // As sourceCodeForTools(), but replaces all whitespace runs with a single space.
     void dumpAssumingJITType(PrintStream&, JITCode::JITType) const;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to