Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e0d162e570c6fdb5e7566067d4519e8fb152519e
https://github.com/WebKit/WebKit/commit/e0d162e570c6fdb5e7566067d4519e8fb152519e
Author: Keith Miller <[email protected]>
Date: 2026-06-18 (Thu, 18 Jun 2026)
Changed paths:
M Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
M Source/JavaScriptCore/Sources.txt
M Source/JavaScriptCore/runtime/CloneBase.h
M Source/JavaScriptCore/runtime/CloneDeserializerBase.h
M Source/JavaScriptCore/runtime/CloneSerializerBase.h
A Source/JavaScriptCore/runtime/StructuredCloneTags.cpp
M Source/JavaScriptCore/runtime/StructuredCloneTags.h
M Source/WTF/wtf/text/AtomString.h
M Source/WTF/wtf/text/WTFString.h
M Source/WebCore/bindings/js/SerializedScriptValue.cpp
M Source/WebCore/bindings/js/SerializedScriptValue.h
Log Message:
-----------
Migrate cloning cell terminal JS values to JSC
https://bugs.webkit.org/show_bug.cgi?id=317403
rdar://180030830
Reviewed by Yijia Huang.
Continues moving JSC-type serialization into JSC. The previous patch
(315074@main) introduced the JSC base templates and moved the non-cell
immediate JSValues. This patch moves every remaining "terminal" JSC
type (types that emit a single tag plus inline data, with no walker
re-entry). JSC now owns the wire format for: StringTag, EmptyStringTag,
BigIntTag, DateTag, RegExpTag, NumberObjectTag, StringObjectTag /
EmptyStringObjectTag, TrueObjectTag / FalseObjectTag, BigIntObjectTag,
and ErrorInstanceTag.
Helpers and state moved into the JSC bases along with their tags:
- String constant pool: StringConstantPool on the serializer, a
Vector<CachedString> on the deserializer. CachedString /
CachedStringRef move alongside, plus the wire helpers
write(AtomString), write(String), dumpString, dumpStringObject,
writeNullableString, readNullableString, readStringData / readString,
readStringIndex / readConstantPoolIndex.
- BigInt helpers: dumpBigIntData (BigInt32 + heap variants) and
readBigInt.
- Object pool: ObjectPoolMap + m_objectPoolMap, the templated
addToObjectPool / writeObjectReferenceIfDupe / addToObjectPoolIfNotDupe
family, and writeObjectIndex. Cycle detection across the
JSC<->WebCore boundary now goes through a single unified pool in the
JSC base — required so that an object graph with a cycle that
crosses both type universes (e.g. a Blob referenced from a JS
object that points to itself) round-trips.
- Destination global: m_globalObject moves into
CloneDeserializerBase. Date / RegExp / wrapper-object
deserialization needs the destination global's structures
(dateStructure, regExpStructure, booleanObjectStructure, etc).
- Wire-format version: m_majorVersion / m_minorVersion, plus
readAndStoreVersion(), isValid(), shouldRetryWithVersionUpgrade(),
and upgradeVersion(), all live on CloneDeserializerBase. The wire
format itself is currently JSC-owned, so its version state belongs
there.
- Version-aware read(bool&): JSC base reads bool as int32_t for
v < 14 and uint8_t otherwise, matching what write(bool) emits.
ErrorInstance was added in v13 with 4-byte bools.
- Error helpers: SerializableErrorType, errorNameToSerializableErrorType,
and toErrorType move into StructuredCloneTags.h. ErrorInformation
and extractErrorInformationFromErrorInstance are declared there
too, with the body in a new StructuredCloneTags.cpp. Keeping the
body out of the header avoids pulling ErrorInstance,
PropertyDescriptor, ThrowScope, and ExceptionScope into every
WebCore TU that includes SerializedScriptValue.h. Existing
WebCore call sites (Navigation.cpp) reach JSC::ErrorInformation /
JSC::extractErrorInformationFromErrorInstance through `using`
re-exports in SerializedScriptValue.h.
Other cleanups:
- WebCore's ForceReadingAs8Bit enum and the explicit-force overload
of read(bool&) are gone. Just read as a uint8_t and convert to a
bool.
- The `!value.isCell()` branch in WebCore's dumpDerivedTerminal
becomes `ASSERT(value.isCell())`: the JSC base now handles every
non-cell case (including BigInt32) before falling through.
- Add NODELETE unnecessarily to equalIgnoringASCIICase to appease our
SaferCPP overlord.
Canonical link: https://commits.webkit.org/315504@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications