Title: [193424] trunk/Source/_javascript_Core
Revision
193424
Author
keith_mil...@apple.com
Date
2015-12-04 10:45:43 -0800 (Fri, 04 Dec 2015)

Log Message

Add an option to emit instructions validating exceptions in the DFG rather than always emiting them.
https://bugs.webkit.org/show_bug.cgi?id=151841

Reviewed by Saam Barati.

Add a new option that validates the DFG execption checking. The default value for the option is
true in Debug builds and false in Release builds. Additionally, renamed jitAssertNoException to
jitReleaseAssertNoException for consistency with our ASSERT naming convention.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileCurrentBlock):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::jitReleaseAssertNoException):
(JSC::AssemblyHelpers::jitAssertNoException): Deleted.
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::jitAssertNoException): Deleted.
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):
* runtime/Options.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (193423 => 193424)


--- trunk/Source/_javascript_Core/ChangeLog	2015-12-04 18:08:27 UTC (rev 193423)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-12-04 18:45:43 UTC (rev 193424)
@@ -1,3 +1,25 @@
+2015-12-04  Keith Miller  <keith_mil...@apple.com>
+
+        Add an option to emit instructions validating exceptions in the DFG rather than always emiting them.
+        https://bugs.webkit.org/show_bug.cgi?id=151841
+
+        Reviewed by Saam Barati.
+
+        Add a new option that validates the DFG execption checking. The default value for the option is
+        true in Debug builds and false in Release builds. Additionally, renamed jitAssertNoException to
+        jitReleaseAssertNoException for consistency with our ASSERT naming convention.
+
+        * dfg/DFGSpeculativeJIT.cpp:
+        (JSC::DFG::SpeculativeJIT::compileCurrentBlock):
+        * jit/AssemblyHelpers.cpp:
+        (JSC::AssemblyHelpers::jitReleaseAssertNoException):
+        (JSC::AssemblyHelpers::jitAssertNoException): Deleted.
+        * jit/AssemblyHelpers.h:
+        (JSC::AssemblyHelpers::jitAssertNoException): Deleted.
+        * runtime/Options.cpp:
+        (JSC::recomputeDependentOptions):
+        * runtime/Options.h:
+
 2015-12-04  Csaba Osztrogonác  <o...@webkit.org>
 
         Fix the !ENABLE(DFG_JIT) build after r190735

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp (193423 => 193424)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp	2015-12-04 18:08:27 UTC (rev 193423)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp	2015-12-04 18:45:43 UTC (rev 193424)
@@ -1494,9 +1494,10 @@
                 m_currentNode->origin.semantic.bytecodeIndex, m_jit.debugOffset());
             dataLog("\n");
         }
-        
-        m_jit.jitAssertNoException();
 
+        if (Options::validateDFGExceptionHandling() && mayExit(m_jit.graph(), m_currentNode) != DoesNotExit)
+            m_jit.jitReleaseAssertNoException();
+
         compile(m_currentNode);
         
         if (belongsInMinifiedGraph(m_currentNode->op()))

Modified: trunk/Source/_javascript_Core/jit/AssemblyHelpers.cpp (193423 => 193424)


--- trunk/Source/_javascript_Core/jit/AssemblyHelpers.cpp	2015-12-04 18:08:27 UTC (rev 193423)
+++ trunk/Source/_javascript_Core/jit/AssemblyHelpers.cpp	2015-12-04 18:45:43 UTC (rev 193424)
@@ -299,7 +299,9 @@
     ok.link(this);
 }
 
-void AssemblyHelpers::jitAssertNoException()
+#endif // !ASSERT_DISABLED
+
+void AssemblyHelpers::jitReleaseAssertNoException()
 {
     Jump noException;
 #if USE(JSVALUE64)
@@ -311,8 +313,6 @@
     noException.link(this);
 }
 
-#endif // !ASSERT_DISABLED
-
 void AssemblyHelpers::callExceptionFuzz()
 {
     if (!Options::useExceptionFuzz())

Modified: trunk/Source/_javascript_Core/jit/AssemblyHelpers.h (193423 => 193424)


--- trunk/Source/_javascript_Core/jit/AssemblyHelpers.h	2015-12-04 18:08:27 UTC (rev 193423)
+++ trunk/Source/_javascript_Core/jit/AssemblyHelpers.h	2015-12-04 18:45:43 UTC (rev 193424)
@@ -995,7 +995,6 @@
     void jitAssertIsNull(GPRReg);
     void jitAssertTagsInPlace();
     void jitAssertArgumentCountSane();
-    void jitAssertNoException();
 #else
     void jitAssertIsInt32(GPRReg) { }
     void jitAssertIsJSInt32(GPRReg) { }
@@ -1006,8 +1005,9 @@
     void jitAssertIsNull(GPRReg) { }
     void jitAssertTagsInPlace() { }
     void jitAssertArgumentCountSane() { }
-    void jitAssertNoException() { }
 #endif
+
+    void jitReleaseAssertNoException();
     
     void purifyNaN(FPRReg);
 

Modified: trunk/Source/_javascript_Core/runtime/Options.cpp (193423 => 193424)


--- trunk/Source/_javascript_Core/runtime/Options.cpp	2015-12-04 18:08:27 UTC (rev 193423)
+++ trunk/Source/_javascript_Core/runtime/Options.cpp	2015-12-04 18:45:43 UTC (rev 193424)
@@ -252,6 +252,9 @@
 
 static void recomputeDependentOptions()
 {
+#if !defined(NDEBUG)
+    Options::validateDFGExceptionHandling() = true;
+#endif
 #if !ENABLE(JIT)
     Options::useLLInt() = true;
     Options::useJIT() = false;

Modified: trunk/Source/_javascript_Core/runtime/Options.h (193423 => 193424)


--- trunk/Source/_javascript_Core/runtime/Options.h	2015-12-04 18:08:27 UTC (rev 193423)
+++ trunk/Source/_javascript_Core/runtime/Options.h	2015-12-04 18:45:43 UTC (rev 193424)
@@ -326,6 +326,7 @@
     \
     v(bool, useExceptionFuzz, false, nullptr) \
     v(unsigned, fireExceptionFuzzAt, 0, nullptr) \
+    v(bool, validateDFGExceptionHandling, false, "Causes the DFG to emit code validating exception handling for each node that can exit") /* This is true by default on Debug builds */\
     \
     v(bool, useExecutableAllocationFuzz, false, nullptr) \
     v(unsigned, fireExecutableAllocationFuzzAt, 0, nullptr) \
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to