Ignore:
Timestamp:
Jan 5, 2016, 11:12:05 AM (10 years ago)
Author:
[email protected]
Message:

Add support for aliasing JSC Options.
https://bugs.webkit.org/show_bug.cgi?id=152551

Reviewed by Filip Pizlo.

This allows us to use old options names as well. This is for the benefit of
third party tools which may have been built to rely on those old options. The
old option names will be mapped to the current option names in setOption().

For some options, the old option name specifies the inverse boolean value of the
current option name. setOption() will take care of inverting the value before
applying it to the option.

  • jsc.cpp:

(CommandLine::parseArguments):

  • Switch to dumping only overridden options here. Verbose dumping is too much for common usage.
  • runtime/Options.cpp:

(JSC::overrideOptionWithHeuristic):
(JSC::Options::overrideAliasedOptionWithHeuristic):
(JSC::computeNumberOfWorkerThreads):
(JSC::Options::initialize):
(JSC::Options::setOptionWithoutAlias):
(JSC::invertBoolOptionValue):
(JSC::Options::setAliasedOption):
(JSC::Options::setOption):
(JSC::Options::dumpAllOptions):

  • String.ascii() converts newline characters to '?', and this was messing up the printing of the options. Switched to using String.utf8() instead.

(JSC::Options::dumpOption):

  • runtime/Options.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/Options.h

    r194590 r194591  
    353353    v(bool, exposeInternalModuleLoader, false, "expose the internal module loader object to the global space for debugging") \
    354354
     355enum OptionEquivalence {
     356    SameOption,
     357    InvertedOption,
     358};
     359
     360#define JSC_ALIASED_OPTIONS(v) \
     361    v(enableFunctionDotArguments, useFunctionDotArguments, SameOption) \
     362    v(enableTailCalls, useTailCalls, SameOption) \
     363    v(showDisassembly, dumpDisassembly, SameOption) \
     364    v(showDFGDisassembly, dumpDFGDisassembly, SameOption) \
     365    v(showFTLDisassembly, dumpFTLDisassembly, SameOption) \
     366    v(showAllDFGNodes, dumpAllDFGNodes, SameOption) \
     367    v(alwaysDoFullCollection, useGenerationalGC, InvertedOption) \
     368    v(enableOSREntryToDFG, useOSREntryToDFG, SameOption) \
     369    v(enableOSREntryToFTL, useOSREntryToFTL, SameOption) \
     370    v(enableLLVMFastISel, useLLVMFastISel, SameOption) \
     371    v(enableAccessInlining, useAccessInlining, SameOption) \
     372    v(enablePolyvariantDevirtualization, usePolyvariantDevirtualization, SameOption) \
     373    v(enablePolymorphicAccessInlining, usePolymorphicAccessInlining, SameOption) \
     374    v(enablePolymorphicCallInlining, usePolymorphicCallInlining, SameOption) \
     375    v(enableMovHintRemoval, useMovHintRemoval, SameOption) \
     376    v(enableObjectAllocationSinking, useObjectAllocationSinking, SameOption) \
     377    v(enableCopyBarrierOptimization, useCopyBarrierOptimization, SameOption) \
     378    v(enableConcurrentJIT, useConcurrentJIT, SameOption) \
     379    v(enableProfiler, useProfiler, SameOption) \
     380    v(enableArchitectureSpecificOptimizations, useArchitectureSpecificOptimizations, SameOption) \
     381    v(enablePolyvariantCallInlining, usePolyvariantCallInlining, SameOption) \
     382    v(enablePolyvariantByIdInlining, usePolyvariantByIdInlining, SameOption) \
     383    v(enableMaximalFlushInsertionPhase, useMaximalFlushInsertionPhase, SameOption) \
     384    v(objectsAreImmortal, useImmortalObjects, SameOption) \
     385    v(showObjectStatistics, dumpObjectStatistics, SameOption) \
     386    v(disableGC, useGC, InvertedOption) \
     387    v(enableTypeProfiler, useTypeProfiler, SameOption) \
     388    v(enableControlFlowProfiler, useControlFlowProfiler, SameOption) \
     389    v(enableExceptionFuzz, useExceptionFuzz, SameOption) \
     390    v(enableExecutableAllocationFuzz, useExecutableAllocationFuzz, SameOption) \
     391    v(enableOSRExitFuzz, useOSRExitFuzz, SameOption) \
     392    v(enableDollarVM, useDollarVM, SameOption) \
     393
    355394class Options {
    356395public:
     
    439478        const char* optionHeader, const char* optionFooter, DumpDefaultsOption);
    440479
     480    static bool setOptionWithoutAlias(const char* arg);
     481    static bool setAliasedOption(const char* arg);
     482    static bool overrideAliasedOptionWithHeuristic(const char* name);
     483
    441484    // Declare the singleton instance of the options store:
    442485    JS_EXPORTDATA static Entry s_options[numberOfOptions];
Note: See TracChangeset for help on using the changeset viewer.