Ignore:
Timestamp:
Jun 3, 2021, 3:44:03 PM (4 years ago)
Author:
[email protected]
Message:

Unreviewed, reverting r278356.
https://bugs.webkit.org/show_bug.cgi?id=226606

"Breaks jsc tests".

Reverted changeset:

"Convert small JIT pool tests into executable fuzzing"
https://bugs.webkit.org/show_bug.cgi?id=226279
https://trac.webkit.org/changeset/278356

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/ExecutableAllocationFuzz.cpp

    r278356 r278425  
    3030#include <wtf/Atomics.h>
    3131#include <wtf/DataLog.h>
    32 #include <wtf/WeakRandom.h>
    3332
    3433namespace JSC {
     
    4241ExecutableAllocationFuzzResult doExecutableAllocationFuzzing()
    4342{
    44     static WeakRandom random(Options::seedOfVMRandomForFuzzer() ? Options::seedOfVMRandomForFuzzer() : cryptographicallyRandomNumber());
    45 
    4643    ASSERT(Options::useExecutableAllocationFuzz());
    4744   
    48     unsigned numChecks = s_numberOfExecutableAllocationFuzzChecks.value++;
    49 
    50     if (numChecks == Options::fireExecutableAllocationFuzzAt()) {
     45    unsigned oldValue;
     46    unsigned newValue;
     47    do {
     48        oldValue = s_numberOfExecutableAllocationFuzzChecks.load();
     49        newValue = oldValue + 1;
     50    } while (!s_numberOfExecutableAllocationFuzzChecks.compareExchangeWeak(oldValue, newValue));
     51   
     52    if (newValue == Options::fireExecutableAllocationFuzzAt()) {
    5153        if (Options::verboseExecutableAllocationFuzz()) {
    5254            dataLog("Will pretend to fail executable allocation.\n");
     
    5557        return PretendToFailExecutableAllocation;
    5658    }
    57 
     59   
    5860    if (Options::fireExecutableAllocationFuzzAtOrAfter()
    59         && numChecks >= Options::fireExecutableAllocationFuzzAtOrAfter()) {
     61        && newValue >= Options::fireExecutableAllocationFuzzAtOrAfter()) {
    6062        if (Options::verboseExecutableAllocationFuzz()) {
    6163            dataLog("Will pretend to fail executable allocation.\n");
     
    6365        }
    6466        return PretendToFailExecutableAllocation;
    65     } else if (!Options::fireExecutableAllocationFuzzAt() && random.getUint32() < UINT_MAX * Options::randomIntegrityAuditRate())
    66         return PretendToFailExecutableAllocation;
     67    }
    6768   
    6869    return AllowNormalExecutableAllocation;
Note: See TracChangeset for help on using the changeset viewer.