Changeset 253164 in webkit


Ignore:
Timestamp:
Dec 5, 2019, 12:23:32 PM (5 years ago)
Author:
mark.lam@apple.com
Message:

computeIfUsingFuzzerAgent() is called before parsing command line arguments.
https://bugs.webkit.org/show_bug.cgi?id=204886

Reviewed by Saam Barati.

Rolling out r253015 which introduced computeIfUsingFuzzerAgent().

  • runtime/Options.cpp:

(JSC::Options::initialize):
(JSC::computeIfUsingFuzzerAgent): Deleted.

  • runtime/Options.h:

(JSC::Options::isUsingFuzzerAgent): Deleted.

  • runtime/OptionsList.h:

(JSC::OptionRange::operator bool const): Deleted.

  • runtime/VM.cpp:

(JSC::VM::VM):

Location:
trunk/Source/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r253144 r253164  
     12019-12-05  Mark Lam  <mark.lam@apple.com>
     2
     3        computeIfUsingFuzzerAgent() is called before parsing command line arguments.
     4        https://bugs.webkit.org/show_bug.cgi?id=204886
     5
     6        Reviewed by Saam Barati.
     7
     8        Rolling out r253015 which introduced computeIfUsingFuzzerAgent().
     9
     10        * runtime/Options.cpp:
     11        (JSC::Options::initialize):
     12        (JSC::computeIfUsingFuzzerAgent): Deleted.
     13        * runtime/Options.h:
     14        (JSC::Options::isUsingFuzzerAgent): Deleted.
     15        * runtime/OptionsList.h:
     16        (JSC::OptionRange::operator bool const): Deleted.
     17        * runtime/VM.cpp:
     18        (JSC::VM::VM):
     19
    1202019-12-04  Yusuke Suzuki  <ysuzuki@apple.com>
    221
  • trunk/Source/JavaScriptCore/runtime/Options.cpp

    r253015 r253164  
    537537}
    538538
    539 static void computeIfUsingFuzzerAgent()
    540 {
    541     g_jscConfig.options.isUsingFuzzerAgent = false;
    542 #define CHECK_IF_USING_FUZZER_AGENT(type_, name_, defaultValue_, availability_, description_) { \
    543         const char name[] = #name_; \
    544         unsigned nameLength = strlen(name); \
    545         if (nameLength > 14 && !strncmp(name, "use", 3) && !strncmp(&name[nameLength -11], "FuzzerAgent", 11)) { \
    546             if (Options::name_()) \
    547                 g_jscConfig.options.isUsingFuzzerAgent = true; \
    548         } \
    549     }
    550     FOR_EACH_JSC_OPTION(CHECK_IF_USING_FUZZER_AGENT)
    551 #undef CHECK_IF_USING_FUZZER_AGENT
    552 }
    553 
    554539void Options::initialize()
    555540{
     
    625610            dumpOptionsIfNeeded();
    626611            ensureOptionsAreCoherent();
    627             computeIfUsingFuzzerAgent();
    628612
    629613#if HAVE(MACH_EXCEPTIONS)
  • trunk/Source/JavaScriptCore/runtime/Options.h

    r253015 r253164  
    9898    static bool isAvailable(ID, Availability);
    9999
    100     static bool isUsingFuzzerAgent() { return g_jscConfig.options.isUsingFuzzerAgent; }
    101 
    102100private:
    103101    struct ConstMetaData {
  • trunk/Source/JavaScriptCore/runtime/OptionsList.h

    r253015 r253164  
    573573    const char* rangeString() const { return (m_state > InitError) ? m_rangeString : s_nullRangeStr; }
    574574   
    575     operator bool() const { return m_state != Uninitialized; }
    576 
    577575    void dump(PrintStream& out) const;
    578576
     
    601599FOR_EACH_JSC_OPTION(DECLARE_OPTION)
    602600#undef DECLARE_OPTION
    603 
    604     bool isUsingFuzzerAgent; // This value is computed in Options::initialize().
    605601};
    606602
  • trunk/Source/JavaScriptCore/runtime/VM.cpp

    r253143 r253164  
    494494#endif // ENABLE(SAMPLING_PROFILER)
    495495
    496     if (UNLIKELY(Options::isUsingFuzzerAgent())) {
    497         if (Options::useRandomizingFuzzerAgent())
    498             setFuzzerAgent(makeUnique<RandomizingFuzzerAgent>(*this));
    499         if (Options::useDoublePredictionFuzzerAgent())
    500             setFuzzerAgent(makeUnique<DoublePredictionFuzzerAgent>(*this));
    501         if (Options::useFileBasedFuzzerAgent())
    502             setFuzzerAgent(makeUnique<FileBasedFuzzerAgent>(*this));
    503         if (Options::usePredictionFileCreatingFuzzerAgent())
    504             setFuzzerAgent(makeUnique<PredictionFileCreatingFuzzerAgent>(*this));
    505     }
     496    if (Options::useRandomizingFuzzerAgent())
     497        setFuzzerAgent(makeUnique<RandomizingFuzzerAgent>(*this));
     498    if (Options::useDoublePredictionFuzzerAgent())
     499        setFuzzerAgent(makeUnique<DoublePredictionFuzzerAgent>(*this));
     500    if (Options::useFileBasedFuzzerAgent())
     501        setFuzzerAgent(makeUnique<FileBasedFuzzerAgent>(*this));
     502    if (Options::usePredictionFileCreatingFuzzerAgent())
     503        setFuzzerAgent(makeUnique<PredictionFileCreatingFuzzerAgent>(*this));
    506504
    507505    if (Options::alwaysGeneratePCToCodeOriginMap())
Note: See TracChangeset for help on using the changeset viewer.