Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions packages/bun-native-plugin-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,21 +278,13 @@ macro_rules! define_bun_plugin {
unsafe impl Sync for BunPluginName {}

use std::{
any::TypeId,
borrow::Cow,
cell::UnsafeCell,
ffi::{c_char, c_void},
marker::PhantomData,
str::Utf8Error,
sync::PoisonError,
};

Comment thread
robobun marked this conversation as resolved.
Resolved
#[repr(C)]
pub struct TaggedObject<T> {
type_id: TypeId,
pub(crate) object: Option<T>,
}

struct SourceCodeContext {
source_ptr: *mut u8,
source_len: usize,
Expand Down
6 changes: 1 addition & 5 deletions src/codegen/bindgen-lib-internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ export class TypeImpl<K extends TypeKind = TypeKind> {
return "bun.String";
case "boolean":
return "bool";
case "strictBoolean":
return "bool";
case "f64":
case "i8":
case "i16":
Expand All @@ -195,8 +193,6 @@ export class TypeImpl<K extends TypeKind = TypeKind> {
case "record": // undecided how to lower records
case "sequence": // []const T
return null;
case "externalClass":
throw new Error("TODO");
case "dictionary": {
let existing = typeHashToStruct.get(this.hash());
if (existing) return existing;
Expand Down Expand Up @@ -489,7 +485,7 @@ export class TypeImpl<K extends TypeKind = TypeKind> {
}

isObjectType() {
return this.kind === "externalClass" || this.kind === "dictionary";
return this.kind === "dictionary";
}

[Symbol.toStringTag] = "Type";
Expand Down
10 changes: 0 additions & 10 deletions src/codegen/bindgen-lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ export namespace t {
export const undefined = builtinType<undefined>()("undefined");
/** Does not throw on parse. Equivalent to `!!value` */
export const boolean = builtinType<boolean>()("boolean");
/** Throws if the value is not a boolean. */
export const strictBoolean = builtinType<boolean>()("strictBoolean");

/**
* Equivalent to IDL's `unrestricted double`, allowing NaN and Infinity.
Expand Down Expand Up @@ -244,14 +242,6 @@ export namespace t {
return new TypeImpl("ref", name);
}

/**
* Reference an external class type that is not defined with `bindgen`,
* from either WebCore, JavaScriptCore, or Bun.
*/
export function externalClass<T>(name: string): Type<T> {
return new TypeImpl("ref", name);
}

export function oneOf<T extends Type<any>[]>(
...types: T
): Type<
Expand Down
2 changes: 0 additions & 2 deletions src/js/internal/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,11 @@ hideFromStack(getValidatedPath, getValidatedFsPath, throwIfNullBytesInFileName);

// Must match jsFunction_validateObject in NodeValidator.cpp. The values are node's:
// https://github.com/nodejs/node/blob/v26.3.0/lib/internal/validators.js#L224-L227
const kValidateObjectNone = 0;
const kValidateObjectAllowNullable = 1 << 0;
const kValidateObjectAllowArray = 1 << 1;
const kValidateObjectAllowFunction = 1 << 2;

export default {
kValidateObjectNone,
kValidateObjectAllowNullable,
kValidateObjectAllowArray,
kValidateObjectAllowFunction,
Expand Down
26 changes: 0 additions & 26 deletions src/jsc/bindings/IDLTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,11 @@ class DOMPromise;
template<typename T>
struct IDLType {
using ImplementationType = T;
using StorageType = T;
using SequenceStorageType = T;
using ConversionResultType = T;
using NullableConversionResultType = std::optional<T>;

using ParameterType = T;
using NullableParameterType = std::optional<ImplementationType>;

using InnerParameterType = T;
using NullableInnerParameterType = std::optional<ImplementationType>;

using NullableType = std::optional<ImplementationType>;
Expand All @@ -77,8 +73,6 @@ struct IDLAny : IDLType<JSC::Strong<JSC::Unknown>> {
// IDLSequence<IDLAny> would yield a Vector<JSC::JSValue>, whose contents
// are invisible to the GC.
// [do not uncomment] using SequenceStorageType = JSC::JSValue;
using ConversionResultType = JSC::JSValue;
using NullableConversionResultType = JSC::JSValue;
using ParameterType = JSC::JSValue;
using NullableParameterType = JSC::JSValue;

Expand Down Expand Up @@ -117,11 +111,9 @@ struct IDLUnsignedLongLong : IDLInteger<uint64_t> {
};

template<typename T> struct IDLClampAdaptor : IDLInteger<typename T::ImplementationType> {
using InnerType = T;
};

template<typename T> struct IDLEnforceRangeAdaptor : IDLInteger<typename T::ImplementationType> {
using InnerType = T;
};

template<typename FloatingPointType> struct IDLFloatingPoint : IDLNumber<FloatingPointType> {
Expand All @@ -136,8 +128,6 @@ struct IDLUnrestrictedDouble : IDLFloatingPoint<double> {
};

template<typename StringType> struct IDLString : IDLType<StringType> {
using ConversionResultType = StringType;
using NullableConversionResultType = StringType;
using ParameterType = const StringType&;
using NullableParameterType = const StringType&;

Expand All @@ -158,20 +148,15 @@ struct IDLUSVString : IDLString<String> {
};

template<typename T> struct IDLAtomStringAdaptor : IDLString<AtomString> {
using InnerType = T;
};

template<typename T> struct IDLRequiresExistingAtomStringAdaptor : IDLString<AtomString> {
using InnerType = T;
};

template<typename T> struct IDLAllowSharedAdaptor : T {
using InnerType = T;
};

struct IDLObject : IDLType<JSC::Strong<JSC::JSObject>> {
using ConversionResultType = JSC::Strong<JSC::JSObject>;
using NullableConversionResultType = JSC::Strong<JSC::JSObject>;
using NullableType = JSC::Strong<JSC::JSObject>;

static inline NullableType nullValue() { return {}; }
Expand All @@ -182,14 +167,10 @@ struct IDLObject : IDLType<JSC::Strong<JSC::JSObject>> {
template<typename T> struct IDLWrapper : IDLType<RefPtr<T>> {
using RawType = T;

using StorageType = Ref<T>;
using ConversionResultType = std::reference_wrapper<T>;
using NullableConversionResultType = T*;

using ParameterType = T&;
using NullableParameterType = T*;

using InnerParameterType = Ref<T>;
using NullableInnerParameterType = RefPtr<T>;

using NullableType = RefPtr<T>;
Expand All @@ -214,14 +195,10 @@ template<typename T> struct IDLEnumeration : IDLType<T> {
};

template<typename T> struct IDLNullable : IDLType<typename T::NullableType> {
using InnerType = T;

using ConversionResultType = typename T::NullableConversionResultType;
using NullableConversionResultType = std::optional<ConversionResultType>;
using ParameterType = typename T::NullableParameterType;
using NullableParameterType = typename T::NullableParameterType;

using InnerParameterType = typename T::NullableInnerParameterType;
using NullableInnerParameterType = typename T::NullableInnerParameterType;

using NullableType = typename T::NullableType;
Expand All @@ -236,14 +213,12 @@ template<typename T> struct IDLOptional : IDLNullable<T> {

template<typename T, typename VectorType = Vector<typename T::SequenceStorageType>>
struct IDLSequence : IDLType<VectorType> {
using InnerType = T;

using ParameterType = const VectorType&;
using NullableParameterType = const std::optional<VectorType>&;
};

template<typename T> struct IDLFrozenArray : IDLType<Vector<typename T::SequenceStorageType>> {
using InnerType = T;

using ParameterType = const Vector<typename T::SequenceStorageType>&;
using NullableParameterType = const std::optional<Vector<typename T::SequenceStorageType>>&;
Expand All @@ -258,7 +233,6 @@ template<typename K, typename V> struct IDLRecord : IDLType<Vector<KeyValuePair<
};

template<typename T> struct IDLPromise : IDLWrapper<DOMPromise> {
using InnerType = T;
};

template<typename... Ts>
Expand Down
4 changes: 0 additions & 4 deletions src/jsc/bindings/node/http/JSHTTPParserPrototype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ JSC_DEFINE_HOST_FUNCTION(jsHTTPParser_free, (JSGlobalObject * globalObject, Call
return JSValue::encode(jsUndefined());
}

// TODO: TODO!
// parser->emitTraceEventDestroy();
// parser->emitDestroy();

return JSValue::encode(jsUndefined());
}

Expand Down
1 change: 0 additions & 1 deletion src/jsc/bindings/webcore/DOMClientIsoSubspaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ class DOMClientIsoSubspaces {
GCClient::IsoSubspace* m_clientSubspaceForReadIntoRequest { nullptr };
GCClient::IsoSubspace* m_clientSubspaceForPullIntoDescriptor { nullptr };
GCClient::IsoSubspace* m_clientSubspaceForStreamTeeState { nullptr };
GCClient::IsoSubspace* m_clientSubspaceForCrossRealmTransformState { nullptr };
GCClient::IsoSubspace* m_clientSubspaceForStreamFromIterableContext { nullptr };
GCClient::IsoSubspace* m_clientSubspaceForDirectStreamController { nullptr };
GCClient::IsoSubspace* m_clientSubspaceForNativeStreamSourceAdapter { nullptr };
Expand Down
1 change: 0 additions & 1 deletion src/jsc/bindings/webcore/DOMIsoSubspaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ class DOMIsoSubspaces {
IsoSubspace* m_subspaceForReadIntoRequest { nullptr };
IsoSubspace* m_subspaceForPullIntoDescriptor { nullptr };
IsoSubspace* m_subspaceForStreamTeeState { nullptr };
IsoSubspace* m_subspaceForCrossRealmTransformState { nullptr };
IsoSubspace* m_subspaceForStreamFromIterableContext { nullptr };
IsoSubspace* m_subspaceForDirectStreamController { nullptr };
IsoSubspace* m_subspaceForNativeStreamSourceAdapter { nullptr };
Expand Down
2 changes: 0 additions & 2 deletions src/jsc/bindings/webcore/JSMessageChannelCustom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ void JSMessageChannel::visitAdditionalChildrenInGCThread(Visitor& visitor)
{
visitor.addOpaqueRoot(WTF::getPtr(wrapped().port1()));
visitor.addOpaqueRoot(WTF::getPtr(wrapped().port2()));
// addWebCoreOpaqueRoot(visitor, wrapped().port1());
// addWebCoreOpaqueRoot(visitor, wrapped().port2());
}

DEFINE_VISIT_ADDITIONAL_CHILDREN_IN_GC_THREAD(JSMessageChannel);
Expand Down
18 changes: 0 additions & 18 deletions src/jsc/bindings/webcore/Performance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,13 @@ Vector<RefPtr<PerformanceEntry>> Performance::getEntries() const
{
Vector<RefPtr<PerformanceEntry>> entries;

// if (m_navigationTiming)
// entries.append(m_navigationTiming);

// entries.appendVector(m_resourceTimingBuffer);

if (m_userTiming) {
entries.appendVector(m_userTiming->getMarks());
entries.appendVector(m_userTiming->getMeasures());
}

// if (m_firstContentfulPaint)
// entries.append(m_firstContentfulPaint);

std::sort(entries.begin(), entries.end(), PerformanceEntry::startTimeCompareLessThan);
return entries;
}
Expand All @@ -126,15 +120,9 @@ Vector<RefPtr<PerformanceEntry>> Performance::getEntriesByType(const String& ent
{
Vector<RefPtr<PerformanceEntry>> entries;

// if (m_navigationTiming && entryType == "navigation"_s)
// entries.append(m_navigationTiming);

if (entryType == "resource"_s)
entries.appendVector(m_resourceTimingBuffer);

// if (m_firstContentfulPaint && entryType == "paint"_s)
// entries.append(m_firstContentfulPaint);

if (m_userTiming) {
if (entryType == "mark"_s)
entries.appendVector(m_userTiming->getMarks());
Expand All @@ -160,19 +148,13 @@ Vector<RefPtr<PerformanceEntry>> Performance::getEntriesByName(const String& nam
{
Vector<RefPtr<PerformanceEntry>> entries;

// if (m_navigationTiming && (entryType.isNull() || entryType == "navigation"_s) && name == m_navigationTiming->name())
// entries.append(m_navigationTiming);

if (entryType.isNull() || entryType == "resource"_s) {
for (auto& resource : m_resourceTimingBuffer) {
if (resource->name() == name)
entries.append(resource);
}
}

// if (m_firstContentfulPaint && (entryType.isNull() || entryType == "paint"_s) && name == "first-contentful-paint"_s)
// entries.append(m_firstContentfulPaint);

if (m_userTiming) {
if (entryType.isNull() || entryType == "mark"_s)
entries.appendVector(m_userTiming->getMarks(name));
Expand Down
18 changes: 0 additions & 18 deletions src/jsc/bindings/webcore/streams/CrossRealmTransform.cpp

This file was deleted.

76 changes: 0 additions & 76 deletions src/jsc/bindings/webcore/streams/JSCrossRealmTransformState.cpp

This file was deleted.

Loading
Loading