diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2019-07-14 19:04:34 -0400 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2019-07-18 22:38:45 -0400 |
commit | 449ea84dcc7dffb2f042fc414eb7238ae842d596 (patch) | |
tree | 7e22a358e60b66fd67e838416210d727d83a030d /js/src/vm/Interpreter.cpp | |
parent | aa65e8a189d81cba75f101d07ef591b751881fe8 (diff) | |
download | UXP-449ea84dcc7dffb2f042fc414eb7238ae842d596.tar UXP-449ea84dcc7dffb2f042fc414eb7238ae842d596.tar.gz UXP-449ea84dcc7dffb2f042fc414eb7238ae842d596.tar.lz UXP-449ea84dcc7dffb2f042fc414eb7238ae842d596.tar.xz UXP-449ea84dcc7dffb2f042fc414eb7238ae842d596.zip |
1344477 - Part 1: Add JSOP_CALL_IGNORES_RV for function call that ignores return value.
Diffstat (limited to 'js/src/vm/Interpreter.cpp')
-rw-r--r-- | js/src/vm/Interpreter.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/js/src/vm/Interpreter.cpp b/js/src/vm/Interpreter.cpp index ad9e87a50..030f0f3b6 100644 --- a/js/src/vm/Interpreter.cpp +++ b/js/src/vm/Interpreter.cpp @@ -470,7 +470,13 @@ js::InternalCallOrConstruct(JSContext* cx, const CallArgs& args, MaybeConstruct if (fun->isNative()) { MOZ_ASSERT_IF(construct, !fun->isConstructor()); - return CallJSNative(cx, fun->native(), args); + JSNative native = fun->native(); + if (!construct && args.ignoresReturnValue()) { + const JSJitInfo* jitInfo = fun->jitInfo(); + if (jitInfo && jitInfo->type() == JSJitInfo::IgnoresReturnValueNative) + native = jitInfo->ignoresReturnValueMethod; + } + return CallJSNative(cx, native, args); } if (!JSFunction::getOrCreateScript(cx, fun)) @@ -2975,6 +2981,7 @@ CASE(JSOP_FUNAPPLY) CASE(JSOP_NEW) CASE(JSOP_CALL) +CASE(JSOP_CALL_IGNORES_RV) CASE(JSOP_CALLITER) CASE(JSOP_SUPERCALL) CASE(JSOP_FUNCALL) @@ -2983,10 +2990,11 @@ CASE(JSOP_FUNCALL) cx->runtime()->spsProfiler.updatePC(script, REGS.pc); MaybeConstruct construct = MaybeConstruct(*REGS.pc == JSOP_NEW || *REGS.pc == JSOP_SUPERCALL); + bool ignoresReturnValue = *REGS.pc == JSOP_CALL_IGNORES_RV; unsigned argStackSlots = GET_ARGC(REGS.pc) + construct; MOZ_ASSERT(REGS.stackDepth() >= 2u + GET_ARGC(REGS.pc)); - CallArgs args = CallArgsFromSp(argStackSlots, REGS.sp, construct); + CallArgs args = CallArgsFromSp(argStackSlots, REGS.sp, construct, ignoresReturnValue); JSFunction* maybeFun; bool isFunction = IsFunctionObject(args.calleev(), &maybeFun); |