Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 242566c54a3ccfaa25fcfdbedbbe7be6c32b0b18 https://github.com/WebKit/WebKit/commit/242566c54a3ccfaa25fcfdbedbbe7be6c32b0b18 Author: Mark Lam <mark....@apple.com> Date: 2023-08-28 (Mon, 28 Aug 2023)
Changed paths: M Source/JavaScriptCore/CMakeLists.txt M Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj M Source/JavaScriptCore/assembler/AssemblerCommon.h M Source/JavaScriptCore/assembler/CPU.h A Source/JavaScriptCore/assembler/CPUInlines.h A Source/JavaScriptCore/assembler/OSCheck.h M Source/JavaScriptCore/dfg/DFGFixupPhase.cpp M Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp M Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp M Source/JavaScriptCore/jsc.cpp M Source/JavaScriptCore/runtime/IndexingType.h M Source/JavaScriptCore/runtime/MathCommon.h M Source/JavaScriptCore/runtime/Options.cpp M Source/JavaScriptCore/runtime/Options.h M Source/JavaScriptCore/runtime/OptionsList.h Log Message: ----------- Reduce size of OptionsStorage in JSC::Config. https://bugs.webkit.org/show_bug.cgi?id=260797 rdar://114565432 Reviewed by Justin Michaud. 1. OptionsStorage was storing options default values. This is unnecessary because default values are only used to provide more info when dumping options. We've move default values to a transient OptionsHelper::Metadata data structure that is heap allocated, and now freed in Options::finalize(). 2. Consolidate calls to dump options. Previously, we do it every time in Options::notifyOptionsChanged() and in the jsc shell. Now, we only do it once in Options::finalize(). We also now only assertOptionsAreCoherent() in Options::finalize() instead of doing it repeatedly. 3. Renamed Options::dumpOptionsIfNeeded() into Options::executeDumpOptions(). This is now the entrypoint to dump options (with the exception of dumpAllOptionsInALine() which is used by tests). 4. Moved contents of the OptionReader class into the OptionsHelper namespace to consolidate all the helper tools. 5. Moved Options::s_constMetaData into the OptionsHelper namespace as g_constMetaData. It is only needed for options initialization. 6. Added a g_optionWasOverridden BitSet to track whether an option has been modified (previously, we were comparing the options against their defaults). We keep these as a global instead of in OptionsHelper::Metadata because it is small (56 bytes), and keeping it around makes options dumping more robust in case anyone wants to call the dumpers interactively in a debugging session. g_optionWasOverridden is not protected in JSC::Config because after initialization, it is only used by the dumpers, and is not critical to security. 7. Convert some static functions used for computing default options values into members of Options. On ARM64, OptionsStorage shrinks from 2632 bytes to 1424 bytes. * Source/JavaScriptCore/CMakeLists.txt: * Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj: * Source/JavaScriptCore/assembler/AssemblerCommon.h: (JSC::isDarwin): Deleted. (JSC::isIOS): Deleted. * Source/JavaScriptCore/assembler/CPU.h: (JSC::optimizeForARMv7IDIVSupported): Deleted. (JSC::optimizeForARM64): Deleted. (JSC::optimizeForX86): Deleted. (JSC::optimizeForX86_64): Deleted. (JSC::hasSensibleDoubleToInt): Deleted. * Source/JavaScriptCore/assembler/CPUInlines.h: Added. (JSC::optimizeForARMv7IDIVSupported): (JSC::optimizeForARM64): (JSC::optimizeForX86): (JSC::optimizeForX86_64): (JSC::hasSensibleDoubleToInt): * Source/JavaScriptCore/assembler/OSCheck.h: Added. (JSC::isDarwin): (JSC::isIOS): * Source/JavaScriptCore/dfg/DFGFixupPhase.cpp: * Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp: * Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp: * Source/JavaScriptCore/jsc.cpp: (CommandLine::parseArguments): * Source/JavaScriptCore/runtime/IndexingType.h: * Source/JavaScriptCore/runtime/MathCommon.h: * Source/JavaScriptCore/runtime/Options.cpp: (JSC::OptionsHelper::Option::name const): (JSC::OptionsHelper::Option::description const): (JSC::OptionsHelper::Option::type const): (JSC::OptionsHelper::Option::availability const): (JSC::OptionsHelper::Option::Option): (JSC::OptionsHelper::initialize): (JSC::OptionsHelper::releaseMetadata): (JSC::OptionsHelper::defaultFor): (JSC::OptionsHelper::addressOfOption): (JSC::OptionsHelper::optionFor): (JSC::OptionsHelper::hasMetadata): (JSC::OptionsHelper::wasOverridden): (JSC::OptionsHelper::setWasOverridden): (JSC::Options::computeNumberOfWorkerThreads): (JSC::Options::computePriorityDeltaOfWorkerThreads): (JSC::Options::computeNumberOfGCMarkers): (JSC::Options::defaultTCSMValue): (JSC::OptionRange::isInRange const): (JSC::Options::executeDumpOptions): (JSC::Options::notifyOptionsChanged): (JSC::Options::initialize): (JSC::Options::finalize): (JSC::Options::setOptionWithoutAlias): (JSC::Options::dumpOption): (JSC::OptionsHelper::Option::initValue): (JSC::OptionsHelper::Option::dump const): (JSC::OptionsHelper::Option::operator== const): (JSC::computeNumberOfWorkerThreads): Deleted. (JSC::computePriorityDeltaOfWorkerThreads): Deleted. (JSC::jitEnabledByDefault): Deleted. (JSC::computeNumberOfGCMarkers): Deleted. (JSC::defaultTCSMValue): Deleted. (JSC::OptionRange::isInRange): Deleted. (JSC::Options::dumpOptionsIfNeeded): Deleted. (JSC::Options::addressOfOption): Deleted. (JSC::Options::addressOfOptionDefault): Deleted. (JSC::OptionReader::Option::name const): Deleted. (JSC::OptionReader::Option::description const): Deleted. (JSC::OptionReader::Option::type const): Deleted. (JSC::OptionReader::Option::availability const): Deleted. (JSC::OptionReader::Option::isOverridden const): Deleted. (JSC::OptionReader::Option::Option): Deleted. (JSC::OptionReader::optionFor): Deleted. (JSC::OptionReader::defaultFor): Deleted. (JSC::OptionReader::Option::initValue): Deleted. (JSC::OptionReader::Option::dump const): Deleted. (JSC::OptionReader::Option::operator== const): Deleted. * Source/JavaScriptCore/runtime/Options.h: (JSC::Options::jitEnabledByDefault): * Source/JavaScriptCore/runtime/OptionsList.h: (JSC::OptionRange::OptionRange): (JSC::OptionRange::operator=): Deleted. Canonical link: https://commits.webkit.org/267371@main _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes