⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 183962 in webkit


Ignore:
Timestamp:
May 7, 2015, 5:20:58 PM (11 years ago)
Author:
saambarati1@gmail.com
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/JavaScriptCore:

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:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r183961 r183962  
     12015-05-07  Saam Barati  <saambarati1@gmail.com>
     2
     3        exceptionFuzz tests should explicitly initialize the exceptionFuzz boolean in JavaScript code through a function in jsc.cpp
     4        https://bugs.webkit.org/show_bug.cgi?id=144753
     5
     6        Reviewed by Mark Lam.
     7
     8        This allows the BytecodeGenerator to freely emit startup code that "may"
     9        throw exceptions without worrying that this startup code will trigger
     10        the exceptionFuzz exception. The exceptionFuzz counter will only begin
     11        ticking when the 'enableExceptionFuzz' function is explicitly called in
     12        the exceptionFuzz tests.
     13
     14        * jsc.cpp:
     15        (GlobalObject::finishCreation):
     16        (functionEnableExceptionFuzz):
     17        * tests/exceptionFuzz/3d-cube.js:
     18        * tests/exceptionFuzz/date-format-xparb.js:
     19        * tests/exceptionFuzz/earley-boyer.js:
     20
    1212015-05-07  Andreas Kling  <akling@apple.com>
    222
  • trunk/Source/JavaScriptCore/jsc.cpp

    r183872 r183962  
    479479static EncodedJSValue JSC_HOST_CALL functionDumpBasicBlockExecutionRanges(ExecState*);
    480480static EncodedJSValue JSC_HOST_CALL functionHasBasicBlockExecuted(ExecState*);
     481static EncodedJSValue JSC_HOST_CALL functionEnableExceptionFuzz(ExecState*);
    481482
    482483#if ENABLE(SAMPLING_FLAGS)
     
    636637        addFunction(vm, "dumpBasicBlockExecutionRanges", functionDumpBasicBlockExecutionRanges , 0);
    637638        addFunction(vm, "hasBasicBlockExecuted", functionHasBasicBlockExecuted, 2);
     639
     640        addFunction(vm, "enableExceptionFuzz", functionEnableExceptionFuzz, 0);
    638641       
    639642        JSArray* array = constructEmptyArray(globalExec(), 0);
     
    11281131    bool hasExecuted = exec->vm().controlFlowProfiler()->hasBasicBlockAtTextOffsetBeenExecuted(offset, executable->sourceID(), exec->vm());
    11291132    return JSValue::encode(jsBoolean(hasExecuted));
     1133}
     1134
     1135EncodedJSValue JSC_HOST_CALL functionEnableExceptionFuzz(ExecState*)
     1136{
     1137    Options::enableExceptionFuzz() = true;
     1138    return JSValue::encode(jsUndefined());
    11301139}
    11311140
  • trunk/Source/JavaScriptCore/tests/exceptionFuzz/3d-cube.js

    r171213 r183962  
    44// http://www.speich.net/computer/moztesting/3d.htm
    55// Created by Simon Speich
     6
     7enableExceptionFuzz();
     8
    69
    710var Q = new Array();
  • trunk/Source/JavaScriptCore/tests/exceptionFuzz/date-format-xparb.js

    r171213 r183962  
    1313 * details.
    1414 */
     15
     16enableExceptionFuzz();
     17
    1518
    1619Date.parseFunctions = {count:0};
  • trunk/Source/JavaScriptCore/tests/exceptionFuzz/earley-boyer.js

    r171213 r183962  
    3939}
    4040*/
     41
     42enableExceptionFuzz();
    4143
    4244
  • trunk/Tools/ChangeLog

    r183954 r183962  
     12015-05-07  Saam Barati  <saambarati1@gmail.com>
     2
     3        exceptionFuzz tests should explicitly initialize the exceptionFuzz boolean in JavaScript code through a function in jsc.cpp
     4        https://bugs.webkit.org/show_bug.cgi?id=144753
     5
     6        Reviewed by Mark Lam.
     7
     8        * Scripts/jsc-stress-test-helpers/js-exception-fuzz:
     9
    1102015-05-07  Beth Dakin  <bdakin@apple.com>
    211
  • trunk/Tools/Scripts/jsc-stress-test-helpers/js-exception-fuzz

    r175801 r183962  
    7272}
    7373
    74 open (my $testInput, "$commandString --enableExceptionFuzz=true |") or fail("Cannot execute initial command when getting check count");
     74open (my $testInput, "$commandString |") or fail("Cannot execute initial command when getting check count");
    7575while (my $inputLine = <$testInput>) {
    7676    chomp($inputLine);
     
    105105        print "iteration($iteration) target($target): Running.\n";
    106106    }
    107     open ($testInput, "$commandString --enableExceptionFuzz=true --fireExceptionFuzzAt=$target |") or fail("Cannot execute command on iteration $iteration");
     107    open ($testInput, "$commandString --fireExceptionFuzzAt=$target |") or fail("Cannot execute command on iteration $iteration");
    108108    my $state = "waiting";
    109109    while (my $inputLine = <$testInput>) {
Note: See TracChangeset for help on using the changeset viewer.