Title: [183962] trunk
Revision
183962
Author
[email protected]
Date
2015-05-07 17:20:58 -0700 (Thu, 07 May 2015)

Log Message

exceptionFuzz tests should explicitly initialize the exceptionFuzz boolean in _javascript_ code through a function in jsc.cpp
https://bugs.webkit.org/show_bug.cgi?id=144753

Reviewed by Mark Lam.

Source/_javascript_Core:

This allows the BytecodeGenerator to freely emit startup code that "may"
throw exceptions without worrying that this startup code will trigger
the exceptionFuzz exception. The exceptionFuzz counter will only begin
ticking when the 'enableExceptionFuzz' function is explicitly called in
the exceptionFuzz tests.

* jsc.cpp:
(GlobalObject::finishCreation):
(functionEnableExceptionFuzz):
* tests/exceptionFuzz/3d-cube.js:
* tests/exceptionFuzz/date-format-xparb.js:
* tests/exceptionFuzz/earley-boyer.js:

Tools:

* Scripts/jsc-stress-test-helpers/js-exception-fuzz:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (183961 => 183962)


--- trunk/Source/_javascript_Core/ChangeLog	2015-05-08 00:17:48 UTC (rev 183961)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-05-08 00:20:58 UTC (rev 183962)
@@ -1,3 +1,23 @@
+2015-05-07  Saam Barati  <[email protected]>
+
+        exceptionFuzz tests should explicitly initialize the exceptionFuzz boolean in _javascript_ code through a function in jsc.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=144753
+
+        Reviewed by Mark Lam.
+
+        This allows the BytecodeGenerator to freely emit startup code that "may"
+        throw exceptions without worrying that this startup code will trigger
+        the exceptionFuzz exception. The exceptionFuzz counter will only begin
+        ticking when the 'enableExceptionFuzz' function is explicitly called in 
+        the exceptionFuzz tests.
+
+        * jsc.cpp:
+        (GlobalObject::finishCreation):
+        (functionEnableExceptionFuzz):
+        * tests/exceptionFuzz/3d-cube.js:
+        * tests/exceptionFuzz/date-format-xparb.js:
+        * tests/exceptionFuzz/earley-boyer.js:
+
 2015-05-07  Andreas Kling  <[email protected]>
 
         Optimize serialization of quoted JSON strings.

Modified: trunk/Source/_javascript_Core/jsc.cpp (183961 => 183962)


--- trunk/Source/_javascript_Core/jsc.cpp	2015-05-08 00:17:48 UTC (rev 183961)
+++ trunk/Source/_javascript_Core/jsc.cpp	2015-05-08 00:20:58 UTC (rev 183962)
@@ -478,6 +478,7 @@
 static EncodedJSValue JSC_HOST_CALL functionReturnTypeFor(ExecState*);
 static EncodedJSValue JSC_HOST_CALL functionDumpBasicBlockExecutionRanges(ExecState*);
 static EncodedJSValue JSC_HOST_CALL functionHasBasicBlockExecuted(ExecState*);
+static EncodedJSValue JSC_HOST_CALL functionEnableExceptionFuzz(ExecState*);
 
 #if ENABLE(SAMPLING_FLAGS)
 static EncodedJSValue JSC_HOST_CALL functionSetSamplingFlags(ExecState*);
@@ -635,6 +636,8 @@
 
         addFunction(vm, "dumpBasicBlockExecutionRanges", functionDumpBasicBlockExecutionRanges , 0);
         addFunction(vm, "hasBasicBlockExecuted", functionHasBasicBlockExecuted, 2);
+
+        addFunction(vm, "enableExceptionFuzz", functionEnableExceptionFuzz, 0);
         
         JSArray* array = constructEmptyArray(globalExec(), 0);
         for (size_t i = 0; i < arguments.size(); ++i)
@@ -1129,6 +1132,12 @@
     return JSValue::encode(jsBoolean(hasExecuted));
 }
 
+EncodedJSValue JSC_HOST_CALL functionEnableExceptionFuzz(ExecState*)
+{
+    Options::enableExceptionFuzz() = true;
+    return JSValue::encode(jsUndefined());
+}
+
 // Use SEH for Release builds only to get rid of the crash report dialog
 // (luckily the same tests fail in Release and Debug builds so far). Need to
 // be in a separate main function because the jscmain function requires object

Modified: trunk/Source/_javascript_Core/tests/exceptionFuzz/3d-cube.js (183961 => 183962)


--- trunk/Source/_javascript_Core/tests/exceptionFuzz/3d-cube.js	2015-05-08 00:17:48 UTC (rev 183961)
+++ trunk/Source/_javascript_Core/tests/exceptionFuzz/3d-cube.js	2015-05-08 00:20:58 UTC (rev 183962)
@@ -4,6 +4,9 @@
 // http://www.speich.net/computer/moztesting/3d.htm
 // Created by Simon Speich
 
+enableExceptionFuzz();
+
+
 var Q = new Array();
 var MTrans = new Array();  // transformation matrix
 var MQube = new Array();  // position information of qube

Modified: trunk/Source/_javascript_Core/tests/exceptionFuzz/date-format-xparb.js (183961 => 183962)


--- trunk/Source/_javascript_Core/tests/exceptionFuzz/date-format-xparb.js	2015-05-08 00:17:48 UTC (rev 183961)
+++ trunk/Source/_javascript_Core/tests/exceptionFuzz/date-format-xparb.js	2015-05-08 00:20:58 UTC (rev 183962)
@@ -13,6 +13,9 @@
  * details.
  */
 
+enableExceptionFuzz();
+
+
 Date.parseFunctions = {count:0};
 Date.parseRegexes = [];
 Date.formatFunctions = {count:0};

Modified: trunk/Source/_javascript_Core/tests/exceptionFuzz/earley-boyer.js (183961 => 183962)


--- trunk/Source/_javascript_Core/tests/exceptionFuzz/earley-boyer.js	2015-05-08 00:17:48 UTC (rev 183961)
+++ trunk/Source/_javascript_Core/tests/exceptionFuzz/earley-boyer.js	2015-05-08 00:20:58 UTC (rev 183962)
@@ -39,7 +39,9 @@
 }
 */
 
+enableExceptionFuzz();
 
+
 function sc_print_debug() {
     sc_print.apply(null, arguments);
 }

Modified: trunk/Tools/ChangeLog (183961 => 183962)


--- trunk/Tools/ChangeLog	2015-05-08 00:17:48 UTC (rev 183961)
+++ trunk/Tools/ChangeLog	2015-05-08 00:20:58 UTC (rev 183962)
@@ -1,3 +1,12 @@
+2015-05-07  Saam Barati  <[email protected]>
+
+        exceptionFuzz tests should explicitly initialize the exceptionFuzz boolean in _javascript_ code through a function in jsc.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=144753
+
+        Reviewed by Mark Lam.
+
+        * Scripts/jsc-stress-test-helpers/js-exception-fuzz:
+
 2015-05-07  Beth Dakin  <[email protected]>
 
         New force-related DOM events should fire in WK1 views

Modified: trunk/Tools/Scripts/jsc-stress-test-helpers/js-exception-fuzz (183961 => 183962)


--- trunk/Tools/Scripts/jsc-stress-test-helpers/js-exception-fuzz	2015-05-08 00:17:48 UTC (rev 183961)
+++ trunk/Tools/Scripts/jsc-stress-test-helpers/js-exception-fuzz	2015-05-08 00:20:58 UTC (rev 183962)
@@ -71,7 +71,7 @@
     die "Ignoring garbage arguments; only the first non-option argument is used as the command string.";
 }
 
-open (my $testInput, "$commandString --enableExceptionFuzz=true |") or fail("Cannot execute initial command when getting check count");
+open (my $testInput, "$commandString |") or fail("Cannot execute initial command when getting check count");
 while (my $inputLine = <$testInput>) {
     chomp($inputLine);
     my $handled = 0;
@@ -104,7 +104,7 @@
     if ($verbose) {
         print "iteration($iteration) target($target): Running.\n";
     }
-    open ($testInput, "$commandString --enableExceptionFuzz=true --fireExceptionFuzzAt=$target |") or fail("Cannot execute command on iteration $iteration");
+    open ($testInput, "$commandString --fireExceptionFuzzAt=$target |") or fail("Cannot execute command on iteration $iteration");
     my $state = "waiting";
     while (my $inputLine = <$testInput>) {
         chomp($inputLine);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to