diff options
Diffstat (limited to 'src/javascript/jsc/bindings/BunClientData.cpp')
-rw-r--r-- | src/javascript/jsc/bindings/BunClientData.cpp | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/src/javascript/jsc/bindings/BunClientData.cpp b/src/javascript/jsc/bindings/BunClientData.cpp index 0bda7dd69..9a4fa25f4 100644 --- a/src/javascript/jsc/bindings/BunClientData.cpp +++ b/src/javascript/jsc/bindings/BunClientData.cpp @@ -1,39 +1,47 @@ +#include "root.h" #include "BunClientData.h" -#include "root.h" -#include "JSDOMURL.h" -#include <JavaScriptCore/FastMallocAlignedMemoryAllocator.h> -#include <JavaScriptCore/HeapInlines.h> -#include <JavaScriptCore/IsoHeapCellType.h> -#include <JavaScriptCore/JSDestructibleObjectHeapCellType.h> -#include <JavaScriptCore/MarkingConstraint.h> -#include <JavaScriptCore/SubspaceInlines.h> -#include <JavaScriptCore/VM.h> -#include <wtf/MainThread.h> +#include "ExtendedDOMClientIsoSubspaces.h" +#include "ExtendedDOMIsoSubspaces.h" +#include "JavaScriptCore/FastMallocAlignedMemoryAllocator.h" +#include "JavaScriptCore/HeapInlines.h" +#include "JavaScriptCore/IsoHeapCellType.h" +#include "JavaScriptCore/JSDestructibleObjectHeapCellType.h" +// #include "JavaScriptCore/MarkingConstraint.h" +#include "JavaScriptCore/SubspaceInlines.h" +#include "JavaScriptCore/VM.h" +#include "wtf/MainThread.h" -// #include "BunGCOutputConstraint.h" +#include "JSDOMConstructorBase.h" -namespace Bun { -using namespace JSC; -using namespace WebCore; +#include "BunGCOutputConstraint.h" +#include "WebCoreTypedArrayController.h" -class ExtendedDOMClientIsoSubspaces; -class ExtendedDOMIsoSubspaces; +namespace WebCore { +using namespace JSC; -#define CLIENT_ISO_SUBSPACE_INIT(subspace) subspace(m_heapData->subspace) JSHeapData::JSHeapData(Heap& heap) - : m_domNamespaceObjectSpace ISO_SUBSPACE_INIT(heap, heap.cellHeapCellType, JSDOMObject) + // : m_domNamespaceObjectSpace ISO_SUBSPACE_INIT(heap, heap.cellHeapCellType, JSDOMObject) + // , + : m_subspaces(makeUnique<ExtendedDOMIsoSubspaces>()) + , m_domConstructorSpace ISO_SUBSPACE_INIT(heap, heap.cellHeapCellType, JSDOMConstructorBase) { } +#define CLIENT_ISO_SUBSPACE_INIT(subspace) subspace(m_heapData->subspace) + JSVMClientData::JSVMClientData(VM& vm) : m_builtinNames(vm) , m_heapData(JSHeapData::ensureHeapData(vm.heap)) + , CLIENT_ISO_SUBSPACE_INIT(m_domConstructorSpace) + , m_clientSubspaces(makeUnique<ExtendedDOMClientIsoSubspaces>()) { } +#undef CLIENT_ISO_SUBSPACE_INIT + JSHeapData* JSHeapData::ensureHeapData(Heap& heap) { if (!Options::useGlobalGC()) @@ -53,11 +61,11 @@ void JSVMClientData::create(VM* vm) { JSVMClientData* clientData = new JSVMClientData(*vm); vm->clientData = clientData; // ~VM deletes this pointer. + clientData->m_normalWorld = DOMWrapperWorld::create(*vm, DOMWrapperWorld::Type::Normal); // vm->heap.addMarkingConstraint(makeUnique<BunGCOutputConstraint>(*vm, *clientData)); - // vm->m_typedArrayController = adoptRef(new WebCoreTypedArrayController( - // type == WorkerThreadType::DedicatedWorker || type == WorkerThreadType::Worklet)); + // vm->m_typedArrayController = adoptRef(new WebCoreTypedArrayController(true)); } -} // namespace Bun
\ No newline at end of file +} // namespace WebCore
\ No newline at end of file |