summaryrefslogtreecommitdiffstats
path: root/js/src/jit/VMFunctions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit/VMFunctions.cpp')
-rw-r--r--js/src/jit/VMFunctions.cpp43
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());