Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 58e02c19b9aa1d72a3acf3ee1b2c725b407962d5
      
https://github.com/WebKit/WebKit/commit/58e02c19b9aa1d72a3acf3ee1b2c725b407962d5
  Author: Chris Dumez <[email protected]>
  Date:   2026-09-20 (Sun, 20 Sep 2026)

  Changed paths:
    M Source/JavaScriptCore/API/glib/JSCOptions.cpp
    M Source/JavaScriptCore/API/tests/FunctionOverridesTest.cpp
    M Source/JavaScriptCore/assembler/LinkBuffer.h
    M Source/JavaScriptCore/assembler/PerfLog.cpp
    M Source/JavaScriptCore/assembler/PerfLog.h
    M Source/JavaScriptCore/b3/air/AirAllocateRegistersByGreedy.cpp
    M Source/JavaScriptCore/dfg/DFGCommon.cpp
    M Source/JavaScriptCore/dfg/DFGGraph.h
    M Source/JavaScriptCore/dfg/DFGLoopUnrollingPhase.cpp
    M Source/JavaScriptCore/jit/ExecutableAllocator.cpp
    M Source/JavaScriptCore/jit/GdbJIT.cpp
    M Source/JavaScriptCore/jsc.cpp
    M Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
    M Source/JavaScriptCore/parser/SourceProvider.cpp
    M Source/JavaScriptCore/parser/SourceProvider.h
    M Source/JavaScriptCore/runtime/ConfigFile.cpp
    M Source/JavaScriptCore/runtime/ConfigFile.h
    M Source/JavaScriptCore/runtime/FuzzerPredictions.cpp
    M Source/JavaScriptCore/runtime/FuzzerPredictions.h
    M Source/JavaScriptCore/runtime/Options.cpp
    M Source/JavaScriptCore/runtime/OptionsList.h
    M Source/JavaScriptCore/runtime/ProfilerSupport.cpp
    M Source/JavaScriptCore/runtime/SamplingProfiler.cpp
    M Source/JavaScriptCore/tools/FunctionAllowlist.cpp
    M Source/JavaScriptCore/tools/FunctionAllowlist.h
    M Source/JavaScriptCore/tools/FunctionOverrides.cpp
    M Source/JavaScriptCore/tools/FunctionOverrides.h
    M Source/JavaScriptCore/wasm/WasmBBQPlan.cpp
    M Source/JavaScriptCore/wasm/WasmOMGIRGenerator.cpp
    M Source/JavaScriptCore/wasm/WasmOMGPlan.cpp
    M Source/JavaScriptCore/wasm/WasmStreamingParser.cpp
    M Source/WTF/wtf/PrintStream.cpp
    M Source/WTF/wtf/PrintStream.h
    M Source/WTF/wtf/text/WTFString.h
    M Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm

  Log Message:
  -----------
  Carry the encoding in the type for JSC's option strings and JIT-dump object 
strings
https://bugs.webkit.org/show_bug.cgi?id=324652

Reviewed by Yusuke Suzuki.

The two kinds of name on the LinkBuffer -> GdbJIT/PerfLog path reach opposite 
conclusions,
which is the point of typing them. Mach-O and ELF section and segment names are 
ASCII by
construction - every producer passed a literal - so they become ASCIICString, 
whose data() is
already a const char* and needs no legacyCStringPointer() at the strncpy into 
sectname and
segname. The JIT'd function's name cannot be ASCII: LinkBuffer already builds 
it with
StringPrintStream::toUTF8CString(), so CodeDescription, MachO::write(), 
ELFSymbol,
IRDumpDebugInfo and SourceCodeDumpDebugInfo were only slicing a UTF8CString to 
its base class,
as was SourceProvider::sourceCodeDumpFilePath() with fileSystemRepresentation().
ELFStringTable::add() and writeString() take both kinds, so they become 
templates over
CStringWithEncoding rather than an untyped CString. Writer::writeString() had 
no callers and
is deleted.

OptionsStorage::OptionString becomes const char8_t*. It is the same size and 
still trivially
copyable, so it continues to fit the write-protected JSC config page and 
Option::initValue()'s
memcpy, but the encoding travels with the value instead of each caller 
guessing. The helpers
that exist to receive it - FunctionAllowlist, ConfigFile, processConfigFile(),
FunctionOverrides and FuzzerPredictions - take const char8_t* too, so 
byteCast<char> survives
only where a path reaches fopen() or strncpy(). JSCOptions.cpp's GValue 
converters move with
it; GLib strings are UTF-8 by convention, so jsc_options_set_string() and
jsc_options_get_string() are unaffected. WebProcess's caller drops a 
legacyCStringPointer() in
favour of UTF8CString::data(), which is already the right type.

WTF gains String(const char8_t*) and printInternal(PrintStream&, const 
char8_t*) beside their
existing span<const char8_t> overloads, and PerfLog::write()'s span<const char> 
convenience
overload becomes a template, so none of these callers convert by hand.

Four sites decoded these option paths as Latin-1 and now decode them as UTF-8, 
changing what a
non-ASCII directory name resolves to. Nothing else changes: no byte written to 
the object files
or the perf JIT-dump differs, and parse<OptionString>() still leaks its 
fastStrDup() copy.

* Source/JavaScriptCore/API/glib/JSCOptions.cpp:
(valueFromGValue):
(valueToGValue):
(jscOptionsType):
* Source/JavaScriptCore/API/tests/FunctionOverridesTest.cpp:
(testFunctionOverrides):
* Source/JavaScriptCore/assembler/LinkBuffer.h:
(JSC::IRDumpDebugInfo::IRDumpDebugInfo):
(JSC::SourceCodeDumpDebugInfo::SourceCodeDumpDebugInfo):
* Source/JavaScriptCore/assembler/PerfLog.cpp:
(JSC::PerfLog::PerfLog):
(JSC::PerfLog::log):
* Source/JavaScriptCore/assembler/PerfLog.h:
* Source/JavaScriptCore/b3/air/AirAllocateRegistersByGreedy.cpp:
* Source/JavaScriptCore/dfg/DFGCommon.cpp:
(JSC::DFG::ensureGlobalDFGAllowlist):
(JSC::DFG::ensureGlobalFTLAllowlist):
* Source/JavaScriptCore/dfg/DFGGraph.h:
(JSC::DFG::ensureGlobalDumpAllowlist):
* Source/JavaScriptCore/dfg/DFGLoopUnrollingPhase.cpp:
(JSC::DFG::LoopUnrollingPhase::functionAllowlist):
* Source/JavaScriptCore/jit/ExecutableAllocator.cpp:
(JSC::dumpJITMemory):
* Source/JavaScriptCore/jit/GdbJIT.cpp:
(JSC::CodeDescription::name const):
(JSC::CodeDescription::create):
(JSC::CodeDescription::CodeDescription):
(JSC::MachOSection::MachOSection):
(JSC::ELFSection::ELFSection):
(JSC::MachOTextSection::MachOTextSection):
(JSC::FullHeaderELFSection::FullHeaderELFSection):
(JSC::ELFStringTable::ELFStringTable):
(JSC::ELFStringTable::add):
(JSC::ELFStringTable::attachWriter):
(JSC::ELFStringTable::writeString):
(JSC::ELFSection::populateHeader):
(JSC::MachO::write):
(JSC::MachO::writeSymtabCommand):
(JSC::MachO::writeStringTable):
(JSC::ELF::ELF):
(JSC::ELFSymbol::ELFSymbol):
(JSC::ELFSymbol::write const):
(JSC::ELFSymbolTable::ELFSymbolTable):
(JSC::createSymbolsTable):
(JSC::createELFObject):
(JSC::UnwindInfoSection::UnwindInfoSection):
(JSC::addJITCodeEntry):
(JSC::Writer::writeString): Deleted.
* Source/JavaScriptCore/jsc.cpp:
* Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:
(JSC::LLInt::ensureGlobalJITAllowlist):
* Source/JavaScriptCore/parser/SourceProvider.cpp:
(JSC::SourceProvider::sourceCodeDumpFilePath):
* Source/JavaScriptCore/parser/SourceProvider.h:
* Source/JavaScriptCore/runtime/ConfigFile.cpp:
(JSC::ConfigFile::ConfigFile):
(JSC::processConfigFile):
* Source/JavaScriptCore/runtime/ConfigFile.h:
* Source/JavaScriptCore/runtime/FuzzerPredictions.cpp:
(JSC::readFileIntoString):
(JSC::FuzzerPredictions::FuzzerPredictions):
(JSC::ensureGlobalFuzzerPredictions):
* Source/JavaScriptCore/runtime/FuzzerPredictions.h:
* Source/JavaScriptCore/runtime/Options.cpp:
(JSC::parse):
(JSC::Option::dump const):
(JSC::Option::operator== const):
* Source/JavaScriptCore/runtime/OptionsList.h:
* Source/JavaScriptCore/runtime/ProfilerSupport.cpp:
(JSC::ProfilerSupport::ProfilerSupport):
(JSC::ProfilerSupport::dumpIonGraphFunction):
* Source/JavaScriptCore/runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::reportDataToOptionFile):
* Source/JavaScriptCore/tools/FunctionAllowlist.cpp:
(JSC::FunctionAllowlist::FunctionAllowlist):
* Source/JavaScriptCore/tools/FunctionAllowlist.h:
* Source/JavaScriptCore/tools/FunctionOverrides.cpp:
(JSC::FunctionOverrides::overrides):
(JSC::FunctionOverrides::FunctionOverrides):
(JSC::FunctionOverrides::reinstallOverrides):
(JSC::FunctionOverrides::parseOverridesInFile):
* Source/JavaScriptCore/tools/FunctionOverrides.h:
* Source/JavaScriptCore/wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::ensureGlobalBBQAllowlist):
* Source/JavaScriptCore/wasm/WasmOMGIRGenerator.cpp:
(JSC::Wasm::shouldDumpIRFor):
* Source/JavaScriptCore/wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::ensureGlobalOMGAllowlist):
* Source/JavaScriptCore/wasm/WasmStreamingParser.cpp:
(JSC::Wasm::dumpWasmSource):
* Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformSetWebsiteDataStoreParameters):
* Source/WTF/wtf/PrintStream.cpp:
(WTF::printInternal):
* Source/WTF/wtf/PrintStream.h:
* Source/WTF/wtf/text/WTFString.h:
(WTF::String::String):

Canonical link: https://commits.webkit.org/321484@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to