From 1230808583c0484678a4352d46586cc7f198dc3c Mon Sep 17 00:00:00 2001 From: Martok Date: Sat, 21 Jan 2023 22:44:26 +0100 Subject: [PATCH] No issue - Cleanup unused function exports to self-hosted global Based-on: m-c 1325696 --- js/src/vm/SelfHosting.cpp | 55 --------------------------------------- 1 file changed, 55 deletions(-) diff --git a/js/src/vm/SelfHosting.cpp b/js/src/vm/SelfHosting.cpp index 686b2e9c28..0edf403726 100644 --- a/js/src/vm/SelfHosting.cpp +++ b/js/src/vm/SelfHosting.cpp @@ -601,23 +601,6 @@ intrinsic_FinishBoundFunctionInit(JSContext* cx, unsigned argc, Value* vp) return true; } -static bool -intrinsic_SetPrototype(JSContext *cx, unsigned argc, Value *vp) -{ - CallArgs args = CallArgsFromVp(argc, vp); - MOZ_ASSERT(args.length() == 2); - MOZ_ASSERT(args[0].isObject()); - MOZ_ASSERT(args[1].isObjectOrNull()); - - RootedObject obj(cx, &args[0].toObject()); - RootedObject proto(cx, args[1].toObjectOrNull()); - if (!SetPrototype(cx, obj, proto)) - return false; - - args.rval().setUndefined(); - return true; -} - /* * Used to decompile values in the nearest non-builtin stack frame, falling * back to decompiling in the current frame. Helpful for printing higher-order @@ -768,34 +751,6 @@ intrinsic_UnsafeGetBooleanFromReservedSlot(JSContext* cx, unsigned argc, Value* return true; } -/** - * Intrinsic for creating an empty array in the compartment of the object - * passed as the first argument. - * - * Returns the array, wrapped in the default wrapper to use between the two - * compartments. - */ -static bool -intrinsic_NewArrayInCompartment(JSContext* cx, unsigned argc, Value* vp) -{ - CallArgs args = CallArgsFromVp(argc, vp); - MOZ_ASSERT(args.length() == 1); - RootedObject wrapped(cx, &args[0].toObject()); - MOZ_ASSERT(IsWrapper(wrapped)); - RootedObject obj(cx, UncheckedUnwrap(wrapped)); - - RootedArrayObject arr(cx); - { - AutoCompartment ac(cx, obj); - arr = NewDenseEmptyArray(cx); - if (!arr) - return false; - } - - args.rval().setObject(*arr); - return wrapped->compartment()->wrap(cx, args.rval()); -} - static bool intrinsic_IsPackedArray(JSContext* cx, unsigned argc, Value* vp) { @@ -2189,8 +2144,6 @@ static const JSFunctionSpec intrinsic_functions[] = { JS_INLINABLE_FN("std_Math_max", math_max, 2,0, MathMax), JS_INLINABLE_FN("std_Math_min", math_min, 2,0, MathMin), JS_INLINABLE_FN("std_Math_abs", math_abs, 1,0, MathAbs), - JS_INLINABLE_FN("std_Math_imul", math_imul, 2,0, MathImul), - JS_INLINABLE_FN("std_Math_log2", math_log2, 1,0, MathLog2), JS_FN("std_Map_has", MapObject::has, 1,0), JS_FN("std_Map_iterator", MapObject::entries, 0,0), @@ -2203,7 +2156,6 @@ static const JSFunctionSpec intrinsic_functions[] = { JS_FN("std_Object_getOwnPropertyNames", obj_getOwnPropertyNames, 1,0), JS_FN("std_Object_getOwnPropertyDescriptor", obj_getOwnPropertyDescriptor, 2,0), JS_FN("std_Object_hasOwnProperty", obj_hasOwnProperty, 1,0), - JS_FN("std_Object_setPrototypeOf", intrinsic_SetPrototype, 2,0), JS_FN("std_Object_toString", obj_toString, 0,0), JS_FN("std_Reflect_getPrototypeOf", Reflect_getPrototypeOf, 1,0), @@ -2265,7 +2217,6 @@ static const JSFunctionSpec intrinsic_functions[] = { JS_INLINABLE_FN("IsCallable", intrinsic_IsCallable, 1,0, IntrinsicIsCallable), JS_INLINABLE_FN("IsConstructor", intrinsic_IsConstructor, 1,0, IntrinsicIsConstructor), - JS_FN("IsFunctionObject",intrinsic_IsInstanceOfBuiltin, 1,0), JS_FN("GetBuiltinConstructorImpl", intrinsic_GetBuiltinConstructor, 1,0), JS_FN("MakeConstructible", intrinsic_MakeConstructible, 2,0), JS_FN("_ConstructFunction", intrinsic_ConstructFunction, 2,0), @@ -2306,8 +2257,6 @@ static const JSFunctionSpec intrinsic_functions[] = { JS_INLINABLE_FN("UnsafeGetBooleanFromReservedSlot", intrinsic_UnsafeGetBooleanFromReservedSlot,2,0, IntrinsicUnsafeGetBooleanFromReservedSlot), - JS_FN("NewArrayInCompartment", intrinsic_NewArrayInCompartment, 1,0), - JS_FN("IsPackedArray", intrinsic_IsPackedArray, 1,0), JS_FN("GetIteratorPrototype", intrinsic_GetIteratorPrototype, 0,0), @@ -2444,10 +2393,6 @@ static const JSFunctionSpec intrinsic_functions[] = { JS_FN("CallWeakSetMethodIfWrapped", CallNonGenericSelfhostedMethod>, 2, 0), - JS_FN("Promise_static_resolve", Promise_static_resolve, 1, 0), - JS_FN("Promise_static_reject", Promise_reject, 1, 0), - JS_FN("Promise_then", Promise_then, 2, 0), - // See builtin/TypedObject.h for descriptors of the typedobj functions. JS_FN("NewOpaqueTypedObject", js::NewOpaqueTypedObject, 1, 0), JS_FN("NewDerivedTypedObject", js::NewDerivedTypedObject, 3, 0),