sync webkit (#21436)

### What does this PR do?

<!-- **Please explain what your changes do**, example: -->

<!--

This adds a new flag --bail to bun test. When set, it will stop running
tests after the first failure. This is useful for CI environments where
you want to fail fast.

-->

### How did you verify your code works?
ran fuzzy-wuzzy.test.ts
<!-- **For code changes, please include automated tests**. Feel free to
uncomment the line below -->

<!-- I wrote automated tests -->

<!-- If JavaScript/TypeScript modules or builtins changed:

- [ ] I included a test for the new code, or existing tests cover it
- [ ] I ran my tests locally and they pass (`bun-debug test
test-file-name.test`)

-->

<!-- If Zig files changed:

- [ ] I checked the lifetime of memory allocated to verify it's (1)
freed and (2) only freed when it should be
- [ ] I included a test for the new code, or an existing test covers it
- [ ] JSValue used outside of the stack is either wrapped in a
JSC.Strong or is JSValueProtect'ed
- [ ] I wrote TypeScript/JavaScript tests and they pass locally
(`bun-debug test test-file-name.test`)
-->

<!-- If new methods, getters, or setters were added to a publicly
exposed class:

- [ ] I added TypeScript types for the new methods, getters, or setters
-->

<!-- If dependencies in tests changed:

- [ ] I made sure that specific versions of dependencies are used
instead of ranged or tagged versions
-->

<!-- If a new builtin ESM/CJS module was added:

- [ ] I updated Aliases in `module_loader.zig` to include the new module
- [ ] I added a test that imports the module
- [ ] I added a test that require() the module
-->
This commit is contained in:
Dylan Conway
2025-07-30 15:49:15 -07:00
committed by GitHub
parent a1f44caa87
commit 53b24ace79
42 changed files with 61 additions and 53 deletions

View File

@@ -2,7 +2,7 @@ option(WEBKIT_VERSION "The version of WebKit to use")
option(WEBKIT_LOCAL "If a local version of WebKit should be used instead of downloading")
if(NOT WEBKIT_VERSION)
set(WEBKIT_VERSION 1098cc50652ab1eab171f58f7669e19ca6c276ae)
set(WEBKIT_VERSION 642e2252f6298387edb6d2f991a0408fd0320466)
endif()
string(SUBSTRING ${WEBKIT_VERSION} 0 16 WEBKIT_VERSION_PREFIX)

View File

@@ -36,7 +36,7 @@ enum class UseCustomHeapCellType { Yes,
class JSHeapData {
WTF_MAKE_NONCOPYABLE(JSHeapData);
WTF_MAKE_FAST_ALLOCATED;
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(JSHeapData);
friend class JSVMClientData;
public:
@@ -77,7 +77,7 @@ DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(JSVMClientData);
class JSVMClientData : public JSC::VM::ClientData {
WTF_MAKE_NONCOPYABLE(JSVMClientData);
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(JSVMClientData);
WTF_DEPRECATED_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(JSVMClientData, JSVMClientData);
public:
explicit JSVMClientData(JSC::VM&, RefPtr<JSC::SourceProvider>);

View File

@@ -36,7 +36,7 @@ namespace WebCore {
class JSHeapData;
class DOMGCOutputConstraint : public JSC::MarkingConstraint {
WTF_MAKE_FAST_ALLOCATED;
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(DOMEGCOutputConstraint);
public:
DOMGCOutputConstraint(JSC::VM&, JSHeapData&);

View File

@@ -20,7 +20,7 @@ using InspectorScriptProfilerAgent = Inspector::InspectorScriptProfilerAgent;
using namespace JSC;
class ConsoleObject final : public JSC::ConsoleClient {
WTF_MAKE_FAST_ALLOCATED;
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(ConsoleObject);
public:
~ConsoleObject() final {}

View File

@@ -46,7 +46,7 @@ class HTMLFormElement;
DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(DOMFormData);
class DOMFormData : public RefCounted<DOMFormData>, public ContextDestructionObserver {
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(DOMFormData);
WTF_DEPRECATED_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(DOMFormData, DOMFormData);
public:
using FormDataEntryValue = std::variant<String, RefPtr<Blob>>;

View File

@@ -132,7 +132,7 @@ public:
}
bool isConstructor() const
{
return m_codeBlock && (JSC::CodeForConstruct == m_codeBlock->specializationKind());
return m_codeBlock && (JSC::CodeSpecializationKind::CodeForConstruct == m_codeBlock->specializationKind());
}
private:

View File

@@ -31,7 +31,7 @@ InspectorBunFrontendDevServerAgent::InspectorBunFrontendDevServerAgent(JSC::JSGl
InspectorBunFrontendDevServerAgent::~InspectorBunFrontendDevServerAgent() = default;
void InspectorBunFrontendDevServerAgent::didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*)
void InspectorBunFrontendDevServerAgent::didCreateFrontendAndBackend()
{
}

View File

@@ -25,7 +25,7 @@ public:
virtual ~InspectorBunFrontendDevServerAgent() final;
// InspectorAgentBase
virtual void didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) final;
virtual void didCreateFrontendAndBackend() final;
virtual void willDestroyFrontendAndBackend(DisconnectReason) final;
// BunFrontendDevServerBackendDispatcherHandler

View File

@@ -38,7 +38,7 @@ InspectorHTTPServerAgent::~InspectorHTTPServerAgent()
}
}
void InspectorHTTPServerAgent::didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*)
void InspectorHTTPServerAgent::didCreateFrontendAndBackend()
{
}

View File

@@ -28,7 +28,7 @@ public:
virtual ~InspectorHTTPServerAgent();
// InspectorAgentBase
virtual void didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) final;
virtual void didCreateFrontendAndBackend() final;
virtual void willDestroyFrontendAndBackend(DisconnectReason) final;
// HTTPServerBackendDispatcherHandler

View File

@@ -61,7 +61,7 @@ InspectorLifecycleAgent::~InspectorLifecycleAgent()
}
}
void InspectorLifecycleAgent::didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*)
void InspectorLifecycleAgent::didCreateFrontendAndBackend()
{
}

View File

@@ -25,7 +25,7 @@ public:
virtual ~InspectorLifecycleAgent();
// InspectorAgentBase
virtual void didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) final;
virtual void didCreateFrontendAndBackend() final;
virtual void willDestroyFrontendAndBackend(DisconnectReason) final;
// LifecycleReporterBackendDispatcherHandler

View File

@@ -109,7 +109,7 @@ InspectorTestReporterAgent::~InspectorTestReporterAgent()
}
}
void InspectorTestReporterAgent::didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*)
void InspectorTestReporterAgent::didCreateFrontendAndBackend()
{
}

View File

@@ -25,7 +25,7 @@ public:
virtual ~InspectorTestReporterAgent();
// InspectorAgentBase
virtual void didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) final;
virtual void didCreateFrontendAndBackend() final;
virtual void willDestroyFrontendAndBackend(DisconnectReason) final;
// TestReporterBackendDispatcherHandler

View File

@@ -123,17 +123,20 @@ static bool evaluateCommonJSModuleOnce(JSC::VM& vm, Zig::GlobalObject* globalObj
JSFunction* resolveFunction = nullptr;
JSFunction* requireFunction = nullptr;
const auto initializeModuleObject = [&]() {
SourceCode resolveSourceCode = makeSource("resolve"_s, SourceOrigin(), SourceTaintedOrigin::Untainted);
resolveFunction = JSC::JSBoundFunction::create(vm,
globalObject,
globalObject->requireResolveFunctionUnbound(),
moduleObject->filename(),
ArgList(), 1, globalObject->commonStrings().resolveString(globalObject));
ArgList(), 1, globalObject->commonStrings().resolveString(globalObject), resolveSourceCode);
RETURN_IF_EXCEPTION(scope, );
SourceCode requireSourceCode = makeSource("require"_s, SourceOrigin(), SourceTaintedOrigin::Untainted);
requireFunction = JSC::JSBoundFunction::create(vm,
globalObject,
globalObject->requireFunctionUnbound(),
moduleObject,
ArgList(), 1, globalObject->commonStrings().requireString(globalObject));
ArgList(), 1, globalObject->commonStrings().requireString(globalObject), requireSourceCode);
RETURN_IF_EXCEPTION(scope, );
requireFunction->putDirect(vm, vm.propertyNames->resolve, resolveFunction, 0);
RETURN_IF_EXCEPTION(scope, );
@@ -1549,18 +1552,22 @@ JSObject* JSCommonJSModule::createBoundRequireFunction(VM& vm, JSGlobalObject* l
globalObject->CommonJSModuleObjectStructure(),
filename, filename, dirname, SourceCode());
SourceCode requireSourceCode = makeSource("require"_s, SourceOrigin(), SourceTaintedOrigin::Untainted);
JSFunction* requireFunction = JSC::JSBoundFunction::create(vm,
globalObject,
globalObject->requireFunctionUnbound(),
moduleObject,
ArgList(), 1, globalObject->commonStrings().requireString(globalObject));
ArgList(), 1, globalObject->commonStrings().requireString(globalObject), requireSourceCode);
RETURN_IF_EXCEPTION(scope, nullptr);
SourceCode resolveSourceCode = makeSource("resolve"_s, SourceOrigin(), SourceTaintedOrigin::Untainted);
JSFunction* resolveFunction = JSC::JSBoundFunction::create(vm,
globalObject,
globalObject->requireResolveFunctionUnbound(),
moduleObject->filename(),
ArgList(), 1, globalObject->commonStrings().resolveString(globalObject));
ArgList(), 1, globalObject->commonStrings().resolveString(globalObject), resolveSourceCode);
RETURN_IF_EXCEPTION(scope, nullptr);
requireFunction->putDirect(vm, vm.propertyNames->resolve, resolveFunction, 0);

View File

@@ -39,7 +39,7 @@
class FFICallbackFunctionWrapper {
WTF_MAKE_FAST_ALLOCATED;
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(FFICallbackFunctionWrapper);
public:
JSC::Strong<JSC::JSFunction> m_function;

View File

@@ -33,7 +33,7 @@ public:
return new JSPropertyIterator(vm, data);
}
WTF_MAKE_FAST_ALLOCATED;
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(JSPropertyIterator);
};
extern "C" JSPropertyIterator* Bun__JSPropertyIterator__create(JSC::JSGlobalObject* globalObject, JSC::EncodedJSValue encodedValue, size_t* count, bool own_properties_only, bool only_non_index_properties)

View File

@@ -41,7 +41,7 @@ DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(ScriptExecutionContext);
#endif
class ScriptExecutionContext : public CanMakeWeakPtr<ScriptExecutionContext>, public RefCounted<ScriptExecutionContext> {
#if ENABLE(MALLOC_BREAKDOWN)
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(ScriptExecutionContext);
WTF_DEPRECATED_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(ScriptExecutionContext, ScriptExecutionContext);
#else
WTF_MAKE_TZONE_ALLOCATED(ScriptExecutionContext);
#endif

View File

@@ -4464,7 +4464,8 @@ static JSC::JSPromise* handleResponseOnStreamingAction(JSGlobalObject* lexicalGl
JSC::JSLockHolder locker(vm);
auto promise = JSC::JSPromise::create(vm, globalObject->promiseStructure());
auto compiler = JSC::Wasm::StreamingCompiler::create(vm, mode, globalObject, promise, importObject);
auto sourceCode = makeSource("[wasm code]"_s, SourceOrigin(), SourceTaintedOrigin::Untainted);
auto compiler = JSC::Wasm::StreamingCompiler::create(vm, mode, globalObject, promise, importObject, sourceCode);
// getBodyStreamOrBytesForWasmStreaming throws the proper exception. Since this is being
// executed in a .then(...) callback, throwing is perfectly fine.

View File

@@ -25,7 +25,7 @@ JSC::SourceID sourceIDForSourceURL(const WTF::String& sourceURL);
void* sourceMappingForSourceURL(const WTF::String& sourceURL);
JSC::SourceOrigin toSourceOrigin(const String& sourceURL, bool isBuiltin);
class SourceProvider final : public JSC::SourceProvider {
WTF_MAKE_FAST_ALLOCATED;
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(SourceProvider);
using Base = JSC::SourceProvider;
using BytecodeCacheGenerator = JSC::BytecodeCacheGenerator;
using UnlinkedFunctionExecutable = JSC::UnlinkedFunctionExecutable;

View File

@@ -202,7 +202,7 @@ static inline JSC::JSValue jsBigIntFromSQLite(JSC::JSGlobalObject* globalObject,
DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(VersionSqlite3);
class VersionSqlite3 {
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(VersionSqlite3);
WTF_DEPRECATED_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(VersionSqlite3, VersionSqlite3);
public:
explicit VersionSqlite3(sqlite3* db)

View File

@@ -10,7 +10,7 @@ using namespace JSC;
class DOMClientIsoSubspaces {
WTF_MAKE_NONCOPYABLE(DOMClientIsoSubspaces);
WTF_MAKE_FAST_ALLOCATED(DOMClientIsoSubspaces);
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(DOMClientIsoSubspaces);
public:
DOMClientIsoSubspaces() = default;

View File

@@ -868,7 +868,7 @@ static constexpr unsigned numberOfDOMConstructors = numberOfDOMConstructorsBase
class DOMConstructors {
WTF_MAKE_NONCOPYABLE(DOMConstructors);
WTF_MAKE_FAST_ALLOCATED(DOMConstructors);
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(DOMConstructors);
public:
using ConstructorArray = std::array<JSC::WriteBarrier<JSC::JSObject>, numberOfDOMConstructors>;

View File

@@ -11,7 +11,7 @@ using namespace JSC;
class DOMIsoSubspaces {
WTF_MAKE_NONCOPYABLE(DOMIsoSubspaces);
WTF_MAKE_FAST_ALLOCATED(DOMIsoSubspaces);
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(DOMIsoSubspaces);
public:
DOMIsoSubspaces() = default;

View File

@@ -35,7 +35,7 @@ namespace WebCore {
template<typename IDLType>
class DOMPromiseProxy {
WTF_MAKE_FAST_ALLOCATED;
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(DOMPromiseProxy);
public:
using Value = typename IDLType::StorageType;
@@ -62,7 +62,7 @@ private:
template<>
class DOMPromiseProxy<IDLUndefined> {
WTF_MAKE_FAST_ALLOCATED;
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(DOMPromiseProxy<IDLUndefined>);
public:
DOMPromiseProxy() = default;
@@ -88,7 +88,7 @@ private:
// FontFace and FontFaceSet.
template<typename IDLType>
class DOMPromiseProxyWithResolveCallback {
WTF_MAKE_FAST_ALLOCATED;
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(DOMPromiseProxyWithResolveCallback);
public:
using ResolveCallback = Function<typename IDLType::ParameterType()>;

View File

@@ -35,7 +35,7 @@
namespace WebCore {
class EventContext {
WTF_MAKE_FAST_ALLOCATED;
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(EventContext);
public:
using EventInvokePhase = EventTarget::EventInvokePhase;

View File

@@ -42,7 +42,7 @@ namespace WebCore {
struct EventNames {
WTF_MAKE_NONCOPYABLE(EventNames);
WTF_MAKE_FAST_ALLOCATED;
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(EventNames);
public:
#define DOM_EVENT_NAMES_DECLARE(name) const AtomString name##Event;

View File

@@ -35,7 +35,7 @@ class Page;
template<typename T> class EventSender {
WTF_MAKE_NONCOPYABLE(EventSender);
WTF_MAKE_FAST_ALLOCATED;
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(EventSender);
public:
explicit EventSender(const AtomString& eventType);

View File

@@ -41,7 +41,7 @@ class ScriptExecutionContext;
DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(FetchHeaders);
class FetchHeaders : public RefCounted<FetchHeaders> {
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(FetchHeaders);
WTF_DEPRECATED_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(FetchHeaders, FetchHeaders);
public:
enum class Guard {

View File

@@ -42,7 +42,7 @@ namespace WebCore {
// (and synchronization would be slow).
class JSCallbackData {
WTF_MAKE_FAST_ALLOCATED;
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(JSCallbackData);
public:
enum class CallbackType { Function,

View File

@@ -213,7 +213,7 @@ private:
};
class DOMPromiseDeferredBase {
WTF_MAKE_FAST_ALLOCATED;
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(DOMPromiseDeferredBase);
public:
DOMPromiseDeferredBase(Ref<DeferredPromise>&& genericPromise)

View File

@@ -7,7 +7,7 @@ namespace WebCore {
// Wrapper type for JSEventEmitter's castedThis because JSDOMWindow and JSWorkerGlobalScope do not inherit JSEventEmitter.
class JSEventEmitterWrapper {
WTF_MAKE_FAST_ALLOCATED;
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(JSEventEmitterWrapper);
public:
JSEventEmitterWrapper(EventEmitter& wrapped, JSC::JSObject* wrapper)

View File

@@ -32,7 +32,7 @@ namespace WebCore {
// Wrapper type for JSEventTarget's castedThis because JSDOMWindow and JSWorkerGlobalScope do not inherit JSEventTarget.
class JSEventTargetWrapper {
WTF_MAKE_FAST_ALLOCATED;
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(JSEventTargetWrapper);
public:
JSEventTargetWrapper(EventTarget& wrapped, JSC::JSObject& wrapper)

View File

@@ -61,7 +61,7 @@ constexpr MonotonicTime reusedTLSConnectionSentinel { MonotonicTime::fromRawSeco
struct AdditionalNetworkLoadMetricsForWebInspector;
class NetworkLoadMetrics {
WTF_MAKE_FAST_ALLOCATED(NetworkLoadMetrics);
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(NetworkLoadMetrics);
public:
WEBCORE_EXPORT NetworkLoadMetrics();

View File

@@ -39,7 +39,7 @@ namespace WebCore {
DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(PerformanceEntry);
class PerformanceEntry : public RefCounted<PerformanceEntry> {
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(PerformanceEntry);
WTF_DEPRECATED_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(PerformanceEntry, PerformanceEntry);
public:
virtual ~PerformanceEntry();

View File

@@ -34,7 +34,7 @@ namespace WebCore {
class PerformanceEntry;
class PerformanceObserverEntryList : public RefCounted<PerformanceObserverEntryList> {
WTF_MAKE_FAST_ALLOCATED;
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(PerformanceObserverEntryList);
public:
static Ref<PerformanceObserverEntryList> create(Vector<RefPtr<PerformanceEntry>>&& entries);

View File

@@ -42,7 +42,7 @@ class Performance;
using PerformanceEntryMap = HashMap<String, Vector<RefPtr<PerformanceEntry>>>;
class PerformanceUserTiming {
WTF_MAKE_FAST_ALLOCATED;
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(PerformanceUserTiming);
public:
explicit PerformanceUserTiming(Performance&);

View File

@@ -42,7 +42,7 @@ class SecurityOrigin;
DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(ResourceTiming);
class ResourceTiming {
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(ResourceTiming);
WTF_DEPRECATED_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(ResourceTiming, ResourceTiming);
public:
// static ResourceTiming fromMemoryCache(const URL&, const String& initiator const ResourceResponse&, const NetworkLoadMetrics&, const SecurityOrigin&);

View File

@@ -86,7 +86,7 @@ using WasmMemoryHandleArray = Vector<RefPtr<JSC::SharedArrayBufferContents>>;
DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(SerializedScriptValue);
class SerializedScriptValue : public ThreadSafeRefCounted<SerializedScriptValue> {
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(SerializedScriptValue);
WTF_DEPRECATED_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(SerializedScriptValue, SerializedScriptValue);
public:
static SYSV_ABI void writeBytesForBun(CloneSerializer*, const uint8_t*, uint32_t);
@@ -249,7 +249,7 @@ void SerializedScriptValue::encode(Encoder& encoder) const
for (const auto& videoChunk : m_serializedVideoChunks)
encoder << videoChunk->data();
// FIXME: encode video frames
// FIXME: encode video frames
#endif
}

View File

@@ -34,7 +34,7 @@
namespace WebCore {
class CryptoAlgorithmParameters {
WTF_MAKE_FAST_ALLOCATED;
WTF_DEPRECATED_MAKE_FAST_ALLOCATED(CryptoAlgorithmParameters);
public:
enum class Class {

View File

@@ -75,7 +75,7 @@ struct CryptoDigestContext {
template<typename SHAContext, typename SHAFunctions>
struct CryptoDigestContextImpl : public CryptoDigestContext {
WTF_MAKE_STRUCT_FAST_ALLOCATED;
WTF_DEPRECATED_MAKE_STRUCT_FAST_ALLOCATED(CryptoDigestContextImpl);
static std::unique_ptr<CryptoDigestContext> create()
{

View File

@@ -225,10 +225,10 @@ JSC_DEFINE_HOST_FUNCTION(functionMemoryUsageStatistics,
}
const auto createdSortedTypeCounts =
[&](JSC::TypeCountSet* typeCounts) -> JSC::JSValue {
[&](JSC::TypeCountSet const& typeCounts) -> JSC::JSValue {
WTF::Vector<std::pair<Identifier, unsigned>> counts;
counts.reserveInitialCapacity(typeCounts->size());
for (auto& it : *typeCounts) {
counts.reserveInitialCapacity(typeCounts.size());
for (auto& it : typeCounts) {
if (it.value > 0)
counts.append(
std::make_pair(Identifier::fromString(vm, it.key), it.value));
@@ -264,8 +264,8 @@ JSC_DEFINE_HOST_FUNCTION(functionMemoryUsageStatistics,
return objectTypeCounts;
};
JSValue objectTypeCounts = createdSortedTypeCounts(vm.heap.objectTypeCounts().get());
JSValue protectedCounts = createdSortedTypeCounts(vm.heap.protectedObjectTypeCounts().get());
JSValue objectTypeCounts = createdSortedTypeCounts(vm.heap.objectTypeCounts());
JSValue protectedCounts = createdSortedTypeCounts(vm.heap.protectedObjectTypeCounts());
JSObject* object = constructEmptyObject(globalObject);
object->putDirect(vm, Identifier::fromString(vm, "objectTypeCounts"_s),