diff options
Diffstat (limited to '')
-rw-r--r-- | js/src/jsapi.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 77c3ae5f09..8dda64d4f1 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -40,6 +40,7 @@ #include "gc/Marking.h" #include "gc/PublicIterators.h" #include "jit/JitSpewer.h" +#include "jit/TrampolineNatives.h" #include "js/CallAndConstruct.h" // JS::IsCallable #include "js/CharacterEncoding.h" #include "js/ColumnNumber.h" // JS::TaggedColumnNumberOneOrigin, JS::ColumnNumberOneOrigin @@ -49,6 +50,7 @@ #include "js/Date.h" // JS::GetReduceMicrosecondTimePrecisionCallback #include "js/ErrorInterceptor.h" #include "js/ErrorReport.h" // JSErrorBase +#include "js/experimental/JitInfo.h" // JSJitInfo #include "js/friend/ErrorMessages.h" // js::GetErrorMessage, JSMSG_* #include "js/friend/StackLimits.h" // js::AutoCheckRecursionLimit #include "js/GlobalObject.h" @@ -1602,7 +1604,8 @@ JS_PUBLIC_API bool JS::ToPrimitive(JSContext* cx, HandleObject obj, JSType hint, return ToPrimitiveSlow(cx, hint, vp); } -JS_PUBLIC_API bool JS::GetFirstArgumentAsTypeHint(JSContext* cx, CallArgs args, +JS_PUBLIC_API bool JS::GetFirstArgumentAsTypeHint(JSContext* cx, + const CallArgs& args, JSType* result) { if (!args.get(0).isString()) { JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, @@ -2335,8 +2338,12 @@ JS_PUBLIC_API JSFunction* JS::NewFunctionFromSpec(JSContext* cx, return nullptr; } - if (fs->call.info) { - fun->setJitInfo(fs->call.info); + if (auto* jitInfo = fs->call.info) { + if (jitInfo->type() == JSJitInfo::OpType::TrampolineNative) { + jit::SetTrampolineNativeJitEntry(cx, fun, jitInfo->trampolineNative); + } else { + fun->setJitInfo(jitInfo); + } } return fun; } |