aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/sqlite
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js/bindings/sqlite')
-rw-r--r--src/bun.js/bindings/sqlite/JSSQLStatement.cpp12
-rw-r--r--src/bun.js/bindings/sqlite/JSSQLStatement.h17
2 files changed, 8 insertions, 21 deletions
diff --git a/src/bun.js/bindings/sqlite/JSSQLStatement.cpp b/src/bun.js/bindings/sqlite/JSSQLStatement.cpp
index cad20df6f..2ce4cc9a6 100644
--- a/src/bun.js/bindings/sqlite/JSSQLStatement.cpp
+++ b/src/bun.js/bindings/sqlite/JSSQLStatement.cpp
@@ -188,7 +188,7 @@ public:
JSC::JSValue rebind(JSGlobalObject* globalObject, JSC::JSValue values, bool clone);
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
{
- return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+ return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::JSFunctionType, StructureFlags), info());
}
bool need_update() { return version_db->version.load() != version; }
@@ -341,10 +341,6 @@ void JSSQLStatement::destroy(JSC::JSCell* cell)
thisObject->stmt = nullptr;
}
-void JSSQLStatementConstructor::destroy(JSC::JSCell* cell)
-{
-}
-
static inline bool rebindValue(JSC::JSGlobalObject* lexicalGlobalObject, sqlite3_stmt* stmt, int i, JSC::JSValue value, JSC::ThrowScope& scope, bool clone)
{
#define CHECK_BIND(param) \
@@ -695,7 +691,7 @@ JSC_DEFINE_HOST_FUNCTION(jsSQLStatementLoadExtensionFunction, (JSC::JSGlobalObje
return JSValue::encode(JSC::jsUndefined());
}
- if(sqlite3_compileoption_used("SQLITE_OMIT_LOAD_EXTENSION")) {
+ if (sqlite3_compileoption_used("SQLITE_OMIT_LOAD_EXTENSION")) {
throwException(lexicalGlobalObject, scope, createError(lexicalGlobalObject, "This build of sqlite3 does not support dynamic extension loading"_s));
return JSValue::encode(JSC::jsUndefined());
}
@@ -1064,7 +1060,7 @@ static const HashTableValue JSSQLStatementConstructorTableValues[] = {
{ "deserialize"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsSQLStatementDeserialize, 2 } },
};
-const ClassInfo JSSQLStatementConstructor::s_info = { "SQLStatement"_s, nullptr, nullptr, nullptr, CREATE_METHOD_TABLE(JSSQLStatementConstructor) };
+const ClassInfo JSSQLStatementConstructor::s_info = { "SQLStatement"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSQLStatementConstructor) };
void JSSQLStatementConstructor::finishCreation(VM& vm)
{
@@ -1636,7 +1632,7 @@ JSC_DEFINE_HOST_FUNCTION(jsSQLStatementFunctionFinalize, (JSC::JSGlobalObject *
RELEASE_AND_RETURN(scope, JSValue::encode(jsUndefined()));
}
-const ClassInfo JSSQLStatement::s_info = { "SQLStatement"_s, nullptr, nullptr, nullptr, CREATE_METHOD_TABLE(JSSQLStatement) };
+const ClassInfo JSSQLStatement::s_info = { "SQLStatement"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSQLStatement) };
/* Hash table for prototype */
static const HashTableValue JSSQLStatementTableValues[] = {
diff --git a/src/bun.js/bindings/sqlite/JSSQLStatement.h b/src/bun.js/bindings/sqlite/JSSQLStatement.h
index 8566fcdd9..b628f2a38 100644
--- a/src/bun.js/bindings/sqlite/JSSQLStatement.h
+++ b/src/bun.js/bindings/sqlite/JSSQLStatement.h
@@ -50,25 +50,15 @@ namespace WebCore {
class JSSQLStatementConstructor final : public JSC::JSFunction {
public:
using Base = JSC::JSFunction;
+ static constexpr unsigned StructureFlags = Base::StructureFlags;
+
static JSSQLStatementConstructor* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure);
DECLARE_INFO;
- template<typename, SubspaceAccess mode> static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm)
- {
- if constexpr (mode == JSC::SubspaceAccess::Concurrently)
- return nullptr;
- return WebCore::subspaceForImpl<JSSQLStatementConstructor, WebCore::UseCustomHeapCellType::No>(
- vm,
- [](auto& spaces) { return spaces.m_clientSubspaceForJSSQLStatementConstructor.get(); },
- [](auto& spaces, auto&& space) { spaces.m_clientSubspaceForJSSQLStatementConstructor = std::forward<decltype(space)>(space); },
- [](auto& spaces) { return spaces.m_subspaceForJSSQLStatementConstructor.get(); },
- [](auto& spaces, auto&& space) { spaces.m_subspaceForJSSQLStatementConstructor = std::forward<decltype(space)>(space); });
- }
- static void destroy(JSC::JSCell*);
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
{
- return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+ return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSFunctionType, StructureFlags), info());
}
private:
@@ -79,5 +69,6 @@ private:
void finishCreation(JSC::VM&);
};
+static_assert(sizeof(JSSQLStatementConstructor) == sizeof(JSFunction), "Allocate JSSQLStatementConstructor in JSFunction IsoSubspace");
} \ No newline at end of file