Changeset 253015 in webkit
- Timestamp:
- Dec 2, 2019, 4:20:49 PM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r253010 r253015 1 2019-12-02 Mark Lam <mark.lam@apple.com> 2 3 Only check each use...FuzzerAgent() option in VM constructor if any of the options are enabled. 4 https://bugs.webkit.org/show_bug.cgi?id=204763 5 6 Reviewed by Keith Miller. 7 8 We know that we'll never use fuzzer agents in deployment. Hence, we shouldn't 9 spend time checking for them in the normal use case. This probably doesn't matter 10 much for Web processes, but for clients of JSC that repeatedly spawn and kill VMs, 11 it might matter more. We might want to eventually widen this idiom to include 12 other debugging / development options, but for now, I'm only covering the fuzzer 13 agent options. 14 15 * runtime/Options.cpp: 16 (JSC::computeIfUsingFuzzerAgent): 17 (JSC::Options::initialize): 18 * runtime/Options.h: 19 (JSC::Options::isUsingFuzzerAgent): 20 * runtime/OptionsList.h: 21 (JSC::OptionRange::operator bool const): 22 * runtime/VM.cpp: 23 (JSC::VM::VM): 24 1 25 2019-12-02 Tadeu Zagallo <tzagallo@apple.com> 2 26 -
trunk/Source/JavaScriptCore/runtime/Options.cpp
r252978 r253015 537 537 } 538 538 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 539 554 void Options::initialize() 540 555 { … … 610 625 dumpOptionsIfNeeded(); 611 626 ensureOptionsAreCoherent(); 627 computeIfUsingFuzzerAgent(); 612 628 613 629 #if HAVE(MACH_EXCEPTIONS) -
trunk/Source/JavaScriptCore/runtime/Options.h
r252557 r253015 98 98 static bool isAvailable(ID, Availability); 99 99 100 static bool isUsingFuzzerAgent() { return g_jscConfig.options.isUsingFuzzerAgent; } 101 100 102 private: 101 103 struct ConstMetaData { -
trunk/Source/JavaScriptCore/runtime/OptionsList.h
r252978 r253015 573 573 const char* rangeString() const { return (m_state > InitError) ? m_rangeString : s_nullRangeStr; } 574 574 575 operator bool() const { return m_state != Uninitialized; } 576 575 577 void dump(PrintStream& out) const; 576 578 … … 599 601 FOR_EACH_JSC_OPTION(DECLARE_OPTION) 600 602 #undef DECLARE_OPTION 603 604 bool isUsingFuzzerAgent; // This value is computed in Options::initialize(). 601 605 }; 602 606 -
trunk/Source/JavaScriptCore/runtime/VM.cpp
r253007 r253015 463 463 #endif // ENABLE(SAMPLING_PROFILER) 464 464 465 if (Options::useRandomizingFuzzerAgent()) 466 setFuzzerAgent(makeUnique<RandomizingFuzzerAgent>(*this)); 467 if (Options::useDoublePredictionFuzzerAgent()) 468 setFuzzerAgent(makeUnique<DoublePredictionFuzzerAgent>(*this)); 469 if (Options::useFileBasedFuzzerAgent()) 470 setFuzzerAgent(makeUnique<FileBasedFuzzerAgent>(*this)); 471 if (Options::usePredictionFileCreatingFuzzerAgent()) 472 setFuzzerAgent(makeUnique<PredictionFileCreatingFuzzerAgent>(*this)); 465 if (UNLIKELY(Options::isUsingFuzzerAgent())) { 466 if (Options::useRandomizingFuzzerAgent()) 467 setFuzzerAgent(makeUnique<RandomizingFuzzerAgent>(*this)); 468 if (Options::useDoublePredictionFuzzerAgent()) 469 setFuzzerAgent(makeUnique<DoublePredictionFuzzerAgent>(*this)); 470 if (Options::useFileBasedFuzzerAgent()) 471 setFuzzerAgent(makeUnique<FileBasedFuzzerAgent>(*this)); 472 if (Options::usePredictionFileCreatingFuzzerAgent()) 473 setFuzzerAgent(makeUnique<PredictionFileCreatingFuzzerAgent>(*this)); 474 } 473 475 474 476 if (Options::alwaysGeneratePCToCodeOriginMap())
Note:
See TracChangeset
for help on using the changeset viewer.