diff --git a/js/public/CallArgs.h b/js/public/CallArgs.h index 153441d98ac0..04da7c731d10 100644 --- a/js/public/CallArgs.h +++ b/js/public/CallArgs.h @@ -42,29 +42,6 @@ typedef bool (* JSNative)(JSContext *cx, unsigned argc, JS::Value *vp); -/* Typedef for native functions that may be called in parallel. */ -typedef bool -(* JSParallelNative)(js::ForkJoinContext *cx, unsigned argc, JS::Value *vp); - -/* - * Typedef for native functions that may be called either in parallel or - * sequential execution. - */ -typedef bool -(* JSThreadSafeNative)(js::ThreadSafeContext *cx, unsigned argc, JS::Value *vp); - -/* - * Convenience wrappers for passing in ThreadSafeNative to places that expect - * a JSNative or a JSParallelNative. - */ -template -inline bool -JSNativeThreadSafeWrapper(JSContext *cx, unsigned argc, JS::Value *vp); - -template -inline bool -JSParallelNativeThreadSafeWrapper(js::ForkJoinContext *cx, unsigned argc, JS::Value *vp); - /* * Compute |this| for the |vp| inside a JSNative, either boxing primitives or * replacing with the global object as necessary. diff --git a/js/src/jscntxtinlines.h b/js/src/jscntxtinlines.h index 99333f4b23e7..a5f3ab8633d1 100644 --- a/js/src/jscntxtinlines.h +++ b/js/src/jscntxtinlines.h @@ -485,24 +485,4 @@ JSContext::currentScript(jsbytecode **ppc, return script; } -template -inline bool -JSNativeThreadSafeWrapper(JSContext *cx, unsigned argc, JS::Value *vp) -{ - return threadSafeNative(cx, argc, vp); -} - -template -inline bool -JSParallelNativeThreadSafeWrapper(js::ForkJoinContext *cx, unsigned argc, JS::Value *vp) -{ - return threadSafeNative(cx, argc, vp); -} - -/* static */ inline JSContext * -js::ExecutionModeTraits::toContextType(ExclusiveContext *cx) -{ - return cx->asJSContext(); -} - #endif /* jscntxtinlines_h */ diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h index 388d2bfdb235..08d58bd91719 100644 --- a/js/src/jsfriendapi.h +++ b/js/src/jsfriendapi.h @@ -2165,7 +2165,6 @@ struct JSJitInfo { Getter, Setter, Method, - ParallelNative, StaticMethod, // Must be last OpTypeCount @@ -2220,11 +2219,6 @@ struct JSJitInfo { AliasSetCount }; - bool hasParallelNative() const - { - return type() == ParallelNative; - } - bool needsOuterizedThisObject() const { return type() != Getter && type() != Setter; @@ -2254,8 +2248,6 @@ struct JSJitInfo { JSJitGetterOp getter; JSJitSetterOp setter; JSJitMethodOp method; - /* An alternative native that's safe to call in parallel mode. */ - JSParallelNative parallelNative; /* A DOM static method, used for Promise wrappers */ JSNative staticMethod; }; @@ -2340,45 +2332,6 @@ struct JSTypedMethodJitInfo have side-effects. */ }; -namespace JS { -namespace detail { - -/* NEVER DEFINED, DON'T USE. For use by JS_CAST_PARALLEL_NATIVE_TO only. */ -inline int CheckIsParallelNative(JSParallelNative parallelNative); - -} // namespace detail -} // namespace JS - -#define JS_CAST_PARALLEL_NATIVE_TO(v, To) \ - (static_cast(sizeof(JS::detail::CheckIsParallelNative(v))), \ - reinterpret_cast(v)) - -/* - * You may ask yourself: why do we define a wrapper around a wrapper here? - * The answer is that some compilers don't understand initializing a union - * as we do below with a construct like: - * - * reinterpret_cast(JSParallelNativeThreadSafeWrapper) - * - * (We need the reinterpret_cast because we must initialize the union with - * a datum of the type of the union's first member.) - * - * Presumably this has something to do with template instantiation. - * Initializing with a normal function pointer seems to work fine. Hence - * the ugliness that you see before you. - */ -#define JS_JITINFO_NATIVE_PARALLEL(infoName, parallelOp) \ - const JSJitInfo infoName = \ - {{JS_CAST_PARALLEL_NATIVE_TO(parallelOp, JSJitGetterOp)},0,0,JSJitInfo::ParallelNative,JSJitInfo::AliasEverything,JSVAL_TYPE_MISSING,false,false,false,false,false,0} - -#define JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(infoName, wrapperName, serialOp) \ - bool wrapperName##_ParallelNativeThreadSafeWrapper(js::ForkJoinContext *cx, unsigned argc, \ - JS::Value *vp) \ - { \ - return JSParallelNativeThreadSafeWrapper(cx, argc, vp); \ - } \ - JS_JITINFO_NATIVE_PARALLEL(infoName, wrapperName##_ParallelNativeThreadSafeWrapper) - static MOZ_ALWAYS_INLINE const JSJitInfo * FUNCTION_VALUE_TO_JITINFO(const JS::Value& v) { diff --git a/js/src/jsfun.h b/js/src/jsfun.h index a1c84bfc26b0..702d0de25f03 100644 --- a/js/src/jsfun.h +++ b/js/src/jsfun.h @@ -19,8 +19,6 @@ namespace js { class FunctionExtended; typedef JSNative Native; -typedef JSParallelNative ParallelNative; -typedef JSThreadSafeNative ThreadSafeNative; } struct JSAtomState; @@ -157,9 +155,6 @@ class JSFunction : public js::NativeObject bool isNamedLambda() const { return isLambda() && displayAtom() && !hasGuessedAtom(); } - bool hasParallelNative() const { - return isNative() && jitInfo() && jitInfo()->hasParallelNative(); - } bool isBuiltinFunctionConstructor(); @@ -402,15 +397,6 @@ class JSFunction : public js::NativeObject return isInterpreted() ? nullptr : native(); } - JSParallelNative parallelNative() const { - MOZ_ASSERT(hasParallelNative()); - return jitInfo()->parallelNative; - } - - JSParallelNative maybeParallelNative() const { - return hasParallelNative() ? parallelNative() : nullptr; - } - void initNative(js::Native native, const JSJitInfo *jitinfo) { MOZ_ASSERT(native); u.n.native = native; diff --git a/js/src/jsinfer.h b/js/src/jsinfer.h index c36dcd6aac48..9a2acf48f997 100644 --- a/js/src/jsinfer.h +++ b/js/src/jsinfer.h @@ -181,27 +181,6 @@ ExecutionModeString(ExecutionMode mode) */ static const unsigned NumExecutionModes = ParallelExecution + 1; -template -struct ExecutionModeTraits -{ -}; - -template <> struct ExecutionModeTraits -{ - typedef JSContext * ContextType; - typedef ExclusiveContext * ExclusiveContextType; - - static inline JSContext *toContextType(ExclusiveContext *cx); -}; - -template <> struct ExecutionModeTraits -{ - typedef ForkJoinContext * ContextType; - typedef ForkJoinContext * ExclusiveContextType; - - static inline ForkJoinContext *toContextType(ForkJoinContext *cx) { return cx; } -}; - namespace jit { struct IonScript; class JitAllocPolicy; diff --git a/js/src/vm/ForkJoin.cpp b/js/src/vm/ForkJoin.cpp index fd3a61b9a79e..542b9c421727 100644 --- a/js/src/vm/ForkJoin.cpp +++ b/js/src/vm/ForkJoin.cpp @@ -2123,9 +2123,6 @@ intrinsic_SetForkJoinTargetRegionPar(ForkJoinContext *cx, unsigned argc, Value * return true; } -JS_JITINFO_NATIVE_PARALLEL(js::intrinsic_SetForkJoinTargetRegionInfo, - intrinsic_SetForkJoinTargetRegionPar); - bool js::intrinsic_ClearThreadLocalArenas(JSContext *cx, unsigned argc, Value *vp) { @@ -2138,6 +2135,3 @@ intrinsic_ClearThreadLocalArenasPar(ForkJoinContext *cx, unsigned argc, Value *v //cx->allocator()->arenas.wipeDuringParallelExecution(cx->runtime()); return true; } - -JS_JITINFO_NATIVE_PARALLEL(js::intrinsic_ClearThreadLocalArenasInfo, - intrinsic_ClearThreadLocalArenasPar);