From 4a328609b96609dbeb8dc98e19aa2f52d2e5eaab Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Wed, 4 Jan 2023 03:30:15 -0800 Subject: 10x faster `new Buffer` (#1717) Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> --- src/bun.js/bindings/ZigGlobalObject.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/bun.js/bindings/ZigGlobalObject.h') diff --git a/src/bun.js/bindings/ZigGlobalObject.h b/src/bun.js/bindings/ZigGlobalObject.h index 7335c9d97..f07c108dd 100644 --- a/src/bun.js/bindings/ZigGlobalObject.h +++ b/src/bun.js/bindings/ZigGlobalObject.h @@ -197,6 +197,11 @@ public: JSC::JSValue FileSinkPrototype() { return m_JSFileSinkClassStructure.prototypeInitializedOnMainThread(this); } JSC::JSValue JSReadableFileSinkControllerPrototype() { return m_JSFileSinkControllerPrototype.getInitializedOnMainThread(this); } + JSC::Structure* JSBufferStructure() { return m_JSBufferClassStructure.getInitializedOnMainThread(this); } + JSC::JSObject* JSBufferConstructor() { return m_JSBufferClassStructure.constructorInitializedOnMainThread(this); } + JSC::JSValue JSBufferPrototype() { return m_JSBufferClassStructure.prototypeInitializedOnMainThread(this); } + JSC::Structure* JSBufferSubclassStructure() { return m_JSBufferSubclassStructure.getInitializedOnMainThread(this); } + JSC::Structure* ArrayBufferSinkStructure() { return m_JSArrayBufferSinkClassStructure.getInitializedOnMainThread(this); } JSC::JSObject* ArrayBufferSink() { return m_JSArrayBufferSinkClassStructure.constructorInitializedOnMainThread(this); } JSC::JSValue ArrayBufferSinkPrototype() { return m_JSArrayBufferSinkClassStructure.prototypeInitializedOnMainThread(this); } @@ -462,6 +467,7 @@ private: LazyClassStructure m_JSStringDecoderClassStructure; LazyClassStructure m_NapiClassStructure; LazyClassStructure m_callSiteStructure; + LazyClassStructure m_JSBufferClassStructure; /** * WARNING: You must update visitChildrenImpl() if you add a new field. @@ -490,6 +496,7 @@ private: LazyProperty m_processObject; LazyProperty m_subtleCryptoObject; LazyProperty m_JSHTTPResponseController; + LazyProperty m_JSBufferSubclassStructure; DOMGuardedObjectSet m_guardedObjects WTF_GUARDED_BY_LOCK(m_gcLock); void* m_bunVM; -- cgit v1.2.3