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/modules/BufferModule.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/bun.js/modules/BufferModule.h') diff --git a/src/bun.js/modules/BufferModule.h b/src/bun.js/modules/BufferModule.h index c6e3aa651..afc00ffd1 100644 --- a/src/bun.js/modules/BufferModule.h +++ b/src/bun.js/modules/BufferModule.h @@ -14,16 +14,14 @@ inline void generateBufferSourceCode(JSC::JSGlobalObject *lexicalGlobalObject, reinterpret_cast(lexicalGlobalObject); exportNames.append(JSC::Identifier::fromString(vm, "Buffer"_s)); - exportValues.append(WebCore::JSBuffer::getConstructor(vm, globalObject)); + exportValues.append(globalObject->JSBufferConstructor()); auto *slowBuffer = JSC::JSFunction::create( vm, globalObject, 0, "SlowBuffer"_s, WebCore::constructSlowBuffer, ImplementationVisibility::Public, NoIntrinsic, WebCore::constructSlowBuffer); slowBuffer->putDirect( - vm, vm.propertyNames->prototype, - WebCore::JSBuffer::prototype( - vm, *jsCast(lexicalGlobalObject)), + vm, vm.propertyNames->prototype, globalObject->JSBufferPrototype(), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::DontDelete); exportNames.append(JSC::Identifier::fromString(vm, "SlowBuffer"_s)); -- cgit v1.2.3