aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-08-17 07:36:18 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-08-17 07:37:14 -0700
commit93b663e43d2288cea5f7b2e8f045c719427a914f (patch)
treea7849c913b6c4814636da3ea08ed98beadaad469 /src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h
parent65820893c966d4f8af2c0058682d30fa6330a219 (diff)
downloadbun-93b663e43d2288cea5f7b2e8f045c719427a914f.tar.gz
bun-93b663e43d2288cea5f7b2e8f045c719427a914f.tar.zst
bun-93b663e43d2288cea5f7b2e8f045c719427a914f.zip
New Zig <> C++ bindings generator. +20% faster HTTP server
Diffstat (limited to 'src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h')
-rw-r--r--src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h b/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h
new file mode 100644
index 000000000..5a7fcc406
--- /dev/null
+++ b/src/bun.js/bindings/ZigGeneratedClasses+lazyStructureImpl.h
@@ -0,0 +1,20 @@
+void GlobalObject::initGeneratedLazyClasses() {
+ m_JSRequest.initLater(
+ [](LazyClassStructure::Initializer& init) {
+ init.setPrototype(WebCore::JSRequest::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.global)));
+ init.setStructure(WebCore::JSRequest::createStructure(init.vm, init.global, init.prototype));
+ init.setConstructor(WebCore::JSRequestConstructor::create(init.vm, init.global, WebCore::JSRequestConstructor::createStructure(init.vm, init.global, init.global->functionPrototype()), jsCast<WebCore::JSRequestPrototype*>(init.prototype)));
+ });
+ m_JSResponse.initLater(
+ [](LazyClassStructure::Initializer& init) {
+ init.setPrototype(WebCore::JSResponse::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.global)));
+ init.setStructure(WebCore::JSResponse::createStructure(init.vm, init.global, init.prototype));
+ init.setConstructor(WebCore::JSResponseConstructor::create(init.vm, init.global, WebCore::JSResponseConstructor::createStructure(init.vm, init.global, init.global->functionPrototype()), jsCast<WebCore::JSResponsePrototype*>(init.prototype)));
+ });
+}
+template<typename Visitor>
+void GlobalObject::visitGeneratedLazyClasses(GlobalObject *thisObject, Visitor& visitor)
+{
+ thisObject->m_JSRequest.visit(visitor);
+ thisObject->m_JSResponse.visit(visitor);
+} \ No newline at end of file