diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /js/src/jit/VMFunctions.cpp | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip |
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/jit/VMFunctions.cpp')
-rw-r--r-- | js/src/jit/VMFunctions.cpp | 43 |
1 files changed, 10 insertions, 33 deletions
diff --git a/js/src/jit/VMFunctions.cpp b/js/src/jit/VMFunctions.cpp index 3ec85a72c2..7d729351b7 100644 --- a/js/src/jit/VMFunctions.cpp +++ b/js/src/jit/VMFunctions.cpp @@ -38,6 +38,7 @@ #include "vm/SelfHosting.h" #include "vm/StaticStrings.h" #include "vm/TypedArrayObject.h" +#include "vm/TypeofEqOperand.h" // TypeofEqOperand #include "vm/Watchtower.h" #include "wasm/WasmGcObject.h" @@ -545,39 +546,6 @@ bool InvokeFunction(JSContext* cx, HandleObject obj, bool constructing, return Call(cx, fval, thisv, args, rval); } -bool InvokeNativeFunction(JSContext* cx, bool constructing, - bool ignoresReturnValue, uint32_t argc, Value* argv, - MutableHandleValue rval) { - // Ensure argv array is rooted - we may GC in here. - size_t numValues = argc + 2 + constructing; - RootedExternalValueArray argvRoot(cx, numValues, argv); - - // Data in the argument vector is arranged for a JIT -> C++ call. - CallArgs callArgs = CallArgsFromSp(argc + constructing, argv + numValues, - constructing, ignoresReturnValue); - - // This function is only called when the callee is a native function. - MOZ_ASSERT(callArgs.callee().as<JSFunction>().isNativeWithoutJitEntry()); - - if (constructing) { - MOZ_ASSERT(callArgs.thisv().isMagic(JS_IS_CONSTRUCTING)); - - if (!ConstructFromStack(cx, callArgs)) { - return false; - } - - MOZ_ASSERT(callArgs.rval().isObject(), - "native constructors don't return primitives"); - } else { - if (!CallFromStack(cx, callArgs)) { - return false; - } - } - - rval.set(callArgs.rval()); - return true; -} - void* GetContextSensitiveInterpreterStub() { return TlsContext.get()->runtime()->jitRuntime()->interpreterStub().value; } @@ -2280,6 +2248,15 @@ JSString* TypeOfNameObject(JSObject* obj, JSRuntime* rt) { return TypeName(type, *rt->commonNames); } +bool TypeOfEqObject(JSObject* obj, TypeofEqOperand operand) { + AutoUnsafeCallWithABI unsafe; + bool result = js::TypeOfObject(obj) == operand.type(); + if (operand.compareOp() == JSOp::Ne) { + result = !result; + } + return result; +} + bool GetPrototypeOf(JSContext* cx, HandleObject target, MutableHandleValue rval) { MOZ_ASSERT(target->hasDynamicPrototype()); |