SERVER-120450 [v8.3] Upgrade MozJS to 140.9 (#50703) (#51098)

GitOrigin-RevId: f5af85fa793dbcd9962aa559bcb17adb1627bc6c
This commit is contained in:
Christopher M. Wolff 2026-04-03 10:36:09 -07:00 committed by MongoDB Bot
parent b0a421a6ae
commit 97d228f704
88 changed files with 706 additions and 544 deletions

View File

@ -46,7 +46,7 @@ a notice will be included in
| [LibTomCrypt] | Unlicense | 1.18.2 | ✗ | ✗ |
| [libunwind] | MIT | 1.8.1 | | ✗ |
| [linenoise] | BSD-2-Clause | 6cdc775807e57b2c3fd64bd207814f8ee1fe35f3 | | ✗ |
| [Mozilla Firefox ESR] | MPL-2.0 | 140.7.0esr | | ✗ |
| [Mozilla Firefox ESR] | MPL-2.0 | 140.9.0esr | | ✗ |
| [MurmurHash3] | Public Domain | a6bd3ce7be8ad147ea820a7cf6229a975c0c96bb | | ✗ |
| [nlohmann/json] | MIT | 3.11.3 | ✗ | |
| [node] | ISC | 22.1.0 | | |

View File

@ -71,7 +71,7 @@
"components": [
{
"type": "library",
"bom-ref": "pkg:deb/debian/firefox-esr@140.7.0esr-1?arch=source",
"bom-ref": "pkg:deb/debian/firefox-esr@140.9.0esr-1?arch=source",
"supplier": {
"name": "Mozilla Corporation",
"url": [
@ -81,7 +81,7 @@
"author": "Mozilla Corporation",
"group": "mozilla",
"name": "Mozilla Firefox ESR",
"version": "140.7.0esr",
"version": "140.9.0esr",
"description": "The C++-only SpiderMonkey component of FireFox ESR used by MongoDB.",
"scope": "required",
"licenses": [
@ -92,8 +92,8 @@
}
],
"copyright": "Mozilla Corporation",
"cpe": "cpe:2.3:a:mozilla:firefox:140.7.0:*:*:*:esr:*:*:*",
"purl": "pkg:deb/debian/firefox-esr@140.7.0esr-1?arch=source",
"cpe": "cpe:2.3:a:mozilla:firefox:140.9.0:*:*:*:esr:*:*:*",
"purl": "pkg:deb/debian/firefox-esr@140.9.0esr-1?arch=source",
"externalReferences": [
{
"url": "https://github.com/mozilla-firefox/firefox.git",
@ -2409,7 +2409,7 @@
],
"dependencies": [
{
"ref": "pkg:deb/debian/firefox-esr@140.7.0esr-1?arch=source",
"ref": "pkg:deb/debian/firefox-esr@140.9.0esr-1?arch=source",
"dependsOn": []
},
{
@ -2557,7 +2557,7 @@
{
"ref": "pkg:github/mongodb/mongo@master",
"dependsOn": [
"pkg:deb/debian/firefox-esr@140.7.0esr-1?arch=source",
"pkg:deb/debian/firefox-esr@140.9.0esr-1?arch=source",
"pkg:generic/intel/IntelRDFPMathLib@2.0.1",
"pkg:generic/unicode-org/unicode@8.0.0",
"pkg:generic/valgrind/valgrind@093bef43d69236287ccc748591c9560a71181b0a",

View File

@ -52,7 +52,7 @@ cp extract/js/src/_build/js/src/gc/StatsPhasesGenerated.inc extract/js/src/gc
# mfbt doesn't change by arch or platform, so keep the same unified cpp
mkdir -p extract/js/src/mfbt
find ./mozilla-release/js/src/_build/mfbt -name "Unified_cpp_mfbt*.cpp" -exec cp '{}' extract/js/src/mfbt ';'
cp ./mozilla-release/js/src/_build/mfbt/Unified_cpp_mfbt*.cpp extract/js/src/mfbt
SEDOPTION="-i"
if [[ "$OSTYPE" == "darwin"* ]]; then
@ -194,74 +194,70 @@ touch include/vtune/VTuneWrapper.h
mkdir -p include/wasm
cp extract/js/src/_build/js/src/wasm/WasmBuiltinModuleGenerated.h include/wasm/
xargs rm -rf<<__XARGS_RM__
extract/js/src/_build/install_dist_bin.track
extract/js/src/_build/install_dist_include.track
extract/js/src/_build/install_dist_private.track
extract/js/src/_build/install_dist_public.track
extract/js/src/_build/install__tests.track
__XARGS_RM__
rm -rf \
extract/js/src/_build/install_dist_bin.track \
extract/js/src/_build/install_dist_include.track \
extract/js/src/_build/install_dist_private.track \
extract/js/src/_build/install_dist_public.track \
extract/js/src/_build/install__tests.track \
xargs rm -r<<__XARGS_RM__
extract/js/src/_build/backend.FasterMakeBackend.in
extract/js/src/_build/backend.RecursiveMakeBackend.in
extract/js/src/_build/dist/bin/
extract/js/src/_build/dist/include/double-conversion/
extract/js/src/_build/dist/include/fdlibm.h
extract/js/src/_build/dist/include/js/
extract/js/src/_build/dist/include/jsapi.h
extract/js/src/_build/dist/include/js-config.h
extract/js/src/_build/dist/include/jsfriendapi.h
extract/js/src/_build/dist/include/jspubtd.h
extract/js/src/_build/dist/include/jstypes.h
extract/js/src/_build/dist/include/malloc_decls.h
extract/js/src/_build/dist/include/mozilla/
extract/js/src/_build/dist/include/mozjemalloc_types.h
extract/js/src/_build/dist/include/mozmemory.h
extract/js/src/_build/dist/include/mozmemory_wrap.h
extract/js/src/_build/.cargo/
extract/js/src/_build/config.statusd/
extract/js/src/_build/faster/
extract/js/src/_build/js/
extract/js/src/_build/memory/backend.mk
extract/js/src/_build/memory/build/
extract/js/src/_build/memory/Makefile
extract/js/src/_build/memory/mozalloc/
extract/js/src/_build/mfbt/backend.mk
extract/js/src/_build/mfbt/.deps/
extract/js/src/_build/mfbt/Makefile
extract/js/src/_build/modules/fdlibm/backend.mk
extract/js/src/_build/modules/fdlibm/Makefile
extract/js/src/_build/modules/fdlibm/src/backend.mk
extract/js/src/_build/modules/fdlibm/src/.deps/
extract/js/src/_build/modules/fdlibm/src/Makefile
extract/js/src/_build/mozglue/backend.mk
extract/js/src/_build/mozglue/build/backend.mk
extract/js/src/_build/mozglue/build/Makefile
extract/js/src/_build/mozglue/Makefile
extract/js/src/_build/mozglue/misc/backend.mk
extract/js/src/_build/mozglue/misc/.deps/
extract/js/src/_build/mozglue/misc/Makefile
extract/js/src/_build/mozinfo.json
extract/js/src/_build/testing/
extract/js/src/_build/_tests/mozbase/
extract/js/src/_build/third_party/
__XARGS_RM__
rm -r \
extract/js/src/_build/backend.FasterMakeBackend.in \
extract/js/src/_build/backend.RecursiveMakeBackend.in \
extract/js/src/_build/dist/bin/ \
extract/js/src/_build/dist/include/double-conversion/ \
extract/js/src/_build/dist/include/fdlibm.h \
extract/js/src/_build/dist/include/js/ \
extract/js/src/_build/dist/include/jsapi.h \
extract/js/src/_build/dist/include/js-config.h \
extract/js/src/_build/dist/include/jsfriendapi.h \
extract/js/src/_build/dist/include/jspubtd.h \
extract/js/src/_build/dist/include/jstypes.h \
extract/js/src/_build/dist/include/malloc_decls.h \
extract/js/src/_build/dist/include/mozilla/ \
extract/js/src/_build/dist/include/mozjemalloc_types.h \
extract/js/src/_build/dist/include/mozmemory.h \
extract/js/src/_build/dist/include/mozmemory_wrap.h \
extract/js/src/_build/.cargo/ \
extract/js/src/_build/config.statusd/ \
extract/js/src/_build/faster/ \
extract/js/src/_build/js/ \
extract/js/src/_build/memory/backend.mk \
extract/js/src/_build/memory/build/ \
extract/js/src/_build/memory/Makefile \
extract/js/src/_build/memory/mozalloc/ \
extract/js/src/_build/mfbt/backend.mk \
extract/js/src/_build/mfbt/.deps/ \
extract/js/src/_build/mfbt/Makefile \
extract/js/src/_build/modules/fdlibm/backend.mk \
extract/js/src/_build/modules/fdlibm/Makefile \
extract/js/src/_build/modules/fdlibm/src/backend.mk \
extract/js/src/_build/modules/fdlibm/src/.deps/ \
extract/js/src/_build/modules/fdlibm/src/Makefile \
extract/js/src/_build/mozglue/backend.mk \
extract/js/src/_build/mozglue/build/backend.mk \
extract/js/src/_build/mozglue/build/Makefile \
extract/js/src/_build/mozglue/Makefile \
extract/js/src/_build/mozglue/misc/backend.mk \
extract/js/src/_build/mozglue/misc/.deps/ \
extract/js/src/_build/mozglue/misc/Makefile \
extract/js/src/_build/mozinfo.json \
extract/js/src/_build/testing/ \
extract/js/src/_build/_tests/mozbase/ \
extract/js/src/_build/third_party/ \
xargs rm -r<<__XARGS_RM__
extract/js/src/build
extract/js/src/devtools/vprof/manifest.mk
extract/js/src/wasm/moz.build
extract/js/src/js-confdefs.h.in
extract/js/src/js-config.h.in
extract/js/src/js-config.mozbuild
extract/js/src/js-cxxflags.mozbuild
extract/js/src/js-standalone.mozbuild
__XARGS_RM__
rm -r \
extract/js/src/build \
extract/js/src/devtools/vprof/manifest.mk \
extract/js/src/wasm/moz.build \
extract/js/src/js-confdefs.h.in \
extract/js/src/js-config.h.in \
extract/js/src/js-config.mozbuild \
extract/js/src/js-cxxflags.mozbuild \
extract/js/src/js-standalone.mozbuild \
# ESR 91.0
xargs rm -r<<__XARGS_RM__
extract/js/src/_build
extract/js/src/make-source-package.py
extract/js/src/jsshell.msg
__XARGS_RM__
rm -r \
extract/js/src/_build \
extract/js/src/make-source-package.py \
extract/js/src/jsshell.msg \

View File

@ -21,8 +21,8 @@
namespace js {
namespace gc {
JS_PUBLIC_API void TraceRealm(JSTracer* trc, JS::Realm* realm,
const char* name);
JS_PUBLIC_API void TraceRealmRoot(JSTracer* trc, JS::Realm* realm,
const char* name);
} // namespace gc
} // namespace js
@ -34,7 +34,7 @@ template <>
struct GCPolicy<Realm*> : public NonGCPointerPolicy<Realm*> {
static void trace(JSTracer* trc, Realm** vp, const char* name) {
if (*vp) {
::js::gc::TraceRealm(trc, *vp, name);
::js::gc::TraceRealmRoot(trc, *vp, name);
}
}
};

View File

@ -426,7 +426,7 @@ constexpr uint64_t CanonicalizedNaNSignificand = 0x8000000000000;
#endif
#if defined(JS_RUNTIME_CANONICAL_NAN)
extern uint64_t CanonicalizedNaNBits;
extern JS_PUBLIC_API uint64_t CanonicalizedNaNBits;
#else
constexpr uint64_t CanonicalizedNaNBits =
mozilla::SpecificNaNBits<double, detail::CanonicalizedNaNSignBit,

View File

@ -36,6 +36,7 @@
#include "vm/Compartment-inl.h"
#include "vm/JSObject-inl.h"
#include "vm/Realm-inl.h"
using namespace js;
@ -1451,6 +1452,7 @@ bool js::atomics_notify_impl(JSContext* cx, SharedArrayRawBuffer* sarb,
// avoid mutex ordering problems.
RootedValue resultMsg(cx, StringValue(cx->names().ok));
for (uint32_t i = 0; i < promisesToResolve.length(); i++) {
AutoRealm ar(cx, promisesToResolve[i]);
if (!PromiseObject::resolve(cx, promisesToResolve[i], resultMsg)) {
MOZ_ASSERT(cx->isThrowingOutOfMemory() || cx->isThrowingOverRecursed());
return false;

View File

@ -913,8 +913,9 @@ bool ModuleObject::isInstance(HandleValue value) {
}
bool ModuleObject::hasCyclicModuleFields() const {
// This currently only returns false if we GC during initialization.
return !getReservedSlot(CyclicModuleFieldsSlot).isUndefined();
bool result = !getReservedSlot(CyclicModuleFieldsSlot).isUndefined();
MOZ_ASSERT_IF(result, !hasSyntheticModuleFields());
return result;
}
CyclicModuleFields* ModuleObject::cyclicModuleFields() {
@ -1496,7 +1497,9 @@ bool ModuleObject::createSyntheticEnvironment(JSContext* cx,
return false;
}
MOZ_ASSERT(env->shape()->propMapLength() == values.length());
// We expect one property per synthetic value plus one for the *namespace*
// binding.
MOZ_ASSERT(env->shape()->propMapLength() == values.length() + 1);
for (uint32_t i = 0; i < values.length(); i++) {
env->setAliasedBinding(env->firstSyntheticValueSlot() + i, values[i]);

View File

@ -1058,7 +1058,7 @@ static constexpr auto AsciiRegExpEscapeMap() {
*/
template <typename CharT>
[[nodiscard]] static bool EncodeForRegExpEscape(
mozilla::Span<const CharT> chars, JSStringBuilder& sb) {
JSContext* cx, mozilla::Span<const CharT> chars, JSStringBuilder& sb) {
MOZ_ASSERT(sb.empty());
const size_t length = chars.size();
@ -1075,7 +1075,7 @@ template <typename CharT>
// Initial scan to determine if escape sequences are needed and to compute
// the output length.
size_t outLength = length;
mozilla::CheckedInt<size_t> outLength = length;
// Leading Ascii alpha-numeric character is hex-escaped.
size_t scanStart = 0;
@ -1115,12 +1115,16 @@ template <typename CharT>
outLength += UnicodeEscapeAddLength;
}
}
if (!outLength.isValid()) {
ReportAllocationOverflow(cx);
return false;
}
// Return if no escape sequences are needed.
if (outLength == length) {
if (outLength.value() == length) {
return true;
}
MOZ_ASSERT(outLength > length);
MOZ_ASSERT(outLength.value() > length);
// Inflating is fallible, so we have to convert to two-byte upfront.
if constexpr (std::is_same_v<CharT, char16_t>) {
@ -1130,7 +1134,7 @@ template <typename CharT>
}
// Allocate memory for the output using the final length.
if (!sb.reserve(outLength)) {
if (!sb.reserve(outLength.value())) {
return false;
}
@ -1230,19 +1234,20 @@ template <typename CharT>
appendUnescaped(length);
}
MOZ_ASSERT(sb.length() == outLength, "all characters were written");
MOZ_ASSERT(sb.length() == outLength.value(), "all characters were written");
return true;
}
[[nodiscard]] static bool EncodeForRegExpEscape(JSLinearString* string,
[[nodiscard]] static bool EncodeForRegExpEscape(JSContext* cx,
JSLinearString* string,
JSStringBuilder& sb) {
JS::AutoCheckCannotGC nogc;
if (string->hasLatin1Chars()) {
auto chars = mozilla::Span(string->latin1Range(nogc));
return EncodeForRegExpEscape(chars, sb);
return EncodeForRegExpEscape(cx, chars, sb);
}
auto chars = mozilla::Span(string->twoByteRange(nogc));
return EncodeForRegExpEscape(chars, sb);
return EncodeForRegExpEscape(cx, chars, sb);
}
/**
@ -1266,7 +1271,7 @@ static bool regexp_escape(JSContext* cx, unsigned argc, Value* vp) {
// Step 2-5.
JSStringBuilder sb(cx);
if (!EncodeForRegExpEscape(string, sb)) {
if (!EncodeForRegExpEscape(cx, string, sb)) {
return false;
}

View File

@ -6160,6 +6160,14 @@ static bool Deserialize(JSContext* cx, unsigned argc, Value* vp) {
}
}
if (scope > JS::StructuredCloneScope::SameProcess &&
(policy.areIntraClusterClonableSharedObjectsAllowed() ||
policy.areSharedMemoryObjectsAllowed())) {
JS_ReportErrorASCII(
cx, "deserialize in DifferentProcess scope cannot allow shared memory");
return false;
}
// Clone buffer was already consumed?
if (!obj->data()) {
JS_ReportErrorASCII(cx,

View File

@ -99,6 +99,7 @@ void DebugScriptObject::finalize(JS::GCContext* gcx, JSObject* obj) {
/* static */
DebugScript* DebugScript::get(JSScript* script) {
MOZ_ASSERT(!IsAboutToBeFinalizedUnbarriered(script));
MOZ_ASSERT(script->hasDebugScript());
DebugScriptMap* map = script->zone()->debugScriptMap;
MOZ_ASSERT(map);
@ -205,7 +206,12 @@ JSBreakpointSite* DebugScript::getOrCreateBreakpointSite(JSContext* cx,
/* static */
void DebugScript::destroyBreakpointSite(JS::GCContext* gcx, JSScript* script,
jsbytecode* pc) {
if (IsAboutToBeFinalizedUnbarriered(script)) {
return;
}
DebugScript* debug = get(script);
JSBreakpointSite*& site = debug->breakpoints[script->pcToOffset(pc)];
MOZ_ASSERT(site);
MOZ_ASSERT(site->isEmpty());
@ -283,6 +289,10 @@ bool DebugScript::incrementStepperCount(JSContext* cx, HandleScript script) {
/* static */
void DebugScript::decrementStepperCount(JS::GCContext* gcx, JSScript* script) {
if (IsAboutToBeFinalizedUnbarriered(script)) {
return;
}
DebugScript* debug = get(script);
MOZ_ASSERT(debug);
MOZ_ASSERT(debug->stepperCount > 0);
@ -328,6 +338,10 @@ bool DebugScript::incrementGeneratorObserverCount(JSContext* cx,
/* static */
void DebugScript::decrementGeneratorObserverCount(JS::GCContext* gcx,
JSScript* script) {
if (IsAboutToBeFinalizedUnbarriered(script)) {
return;
}
DebugScript* debug = get(script);
MOZ_ASSERT(debug);
MOZ_ASSERT(debug->generatorObserverCount > 0);
@ -393,6 +407,10 @@ void DebugAPI::checkDebugScriptAfterMovingGC(DebugScript* ds) {
/* static */
bool DebugAPI::stepModeEnabledSlow(JSScript* script) {
if (IsAboutToBeFinalizedUnbarriered(script)) {
return false;
}
return DebugScript::get(script)->stepperCount > 0;
}

View File

@ -2025,26 +2025,27 @@ Completion Completion::fromJSFramePop(JSContext* cx, AbstractFramePtr frame,
//
// GetGeneratorObjectForFrame can return nullptr even when a generator
// object does exist, if the frame is paused between the Generator and
// SetAliasedVar opcodes. But by checking the opcode first we eliminate that
// possibility, so it's fine to call genObj->isClosed().
// SetAliasedVar opcodes.
Rooted<AbstractGeneratorObject*> generatorObj(
cx, GetGeneratorObjectForFrame(cx, frame));
switch (JSOp(*pc)) {
case JSOp::InitialYield:
MOZ_ASSERT(!generatorObj->isClosed());
return Completion(InitialYield(generatorObj));
case JSOp::Yield:
MOZ_ASSERT(!generatorObj->isClosed());
return Completion(Yield(generatorObj, frame.returnValue()));
if (generatorObj && !generatorObj->isClosed()) {
switch (JSOp(*pc)) {
case JSOp::InitialYield:
return Completion(InitialYield(generatorObj));
case JSOp::Await:
MOZ_ASSERT(!generatorObj->isClosed());
return Completion(Await(generatorObj, frame.returnValue()));
case JSOp::Yield:
return Completion(Yield(generatorObj, frame.returnValue()));
default:
return Completion(Return(frame.returnValue()));
case JSOp::Await:
return Completion(Await(generatorObj, frame.returnValue()));
default:
break;
}
}
return Completion(Return(frame.returnValue()));
}
void Completion::trace(JSTracer* trc) {

View File

@ -894,7 +894,10 @@ bool MarkPagesUnusedSoft(void* region, size_t length) {
int status;
do {
# if defined(XP_DARWIN)
status = madvise(region, length, MADV_FREE_REUSABLE);
// Note: we use MADV_FREE instead of MADV_FREE_REUSABLE + MADV_FREE_REUSE to
// work around a kernel bug on macOS Tahoe. We should change this back once
// that bug is fixed. See bug 2015359.
status = madvise(region, length, MADV_FREE);
# elif defined(XP_SOLARIS)
status = posix_madvise(region, length, POSIX_MADV_DONTNEED);
# else
@ -925,11 +928,6 @@ void MarkPagesInUseSoft(void* region, size_t length) {
MOZ_ASSERT(DecommitEnabled());
CheckDecommit(region, length);
#if defined(XP_DARWIN)
while (madvise(region, length, MADV_FREE_REUSE) == -1 && errno == EAGAIN) {
}
#endif
MOZ_MAKE_MEM_UNDEFINED(region, length);
}

View File

@ -1215,10 +1215,14 @@ void GCRuntime::checkHeapBeforeMinorGC(AutoHeapSession& session) {
// to tenured strings but contain nursery data.
for (ZonesIter zone(rt, SkipAtoms); !zone.done(); zone.next()) {
if (zone->isGCFinished()) {
continue; // Don't access zones that are being swept off thread.
}
for (ArenaIter aiter(zone, gc::AllocKind::STRING); !aiter.done();
aiter.next()) {
for (ArenaCellIterUnderGC cell(aiter.get()); !cell.done(); cell.next()) {
if (cell->is<JSString>() && cell->as<JSString>()->isDependent()) {
if (cell->as<JSString>()->isDependent()) {
JSDependentString* str = &cell->as<JSString>()->asDependent();
if (str->isTenured() && str->base()->isTenured()) {
MOZ_RELEASE_ASSERT(!str->hasCharsInCollectedNurseryRegion());

View File

@ -2980,14 +2980,23 @@ void BaselineCacheIRCompiler::pushArguments(Register argcReg,
Register scratch, Register scratch2,
CallFlags flags, uint32_t argcFixed,
bool isJitCall) {
bool isConstructing = flags.isConstructing();
// Push the formal arguments, and possibly `this` and/or `callee`.
// There are three cases:
// 1. Non-scripted call: all arguments are pushed here.
// 2. Scripted call: all arguments except `callee` are pushed here. `callee`
// must be passed as a CalleeToken, and is pushed below.
// 3. Scripted constructor: only formal arguments are pushed here. We must
// push a new `this` value using createThis, and then push `callee` as
// a CalleeToken. Note that constructors must be Standard or Spread.
switch (flags.getArgFormat()) {
case CallFlags::Standard:
pushStandardArguments(argcReg, scratch, scratch2, argcFixed, isJitCall,
flags.isConstructing());
isConstructing);
break;
case CallFlags::Spread:
pushArrayArguments(argcReg, scratch, scratch2, isJitCall,
flags.isConstructing());
pushArrayArguments(argcReg, scratch, scratch2, isJitCall, isConstructing);
break;
case CallFlags::FunCall:
pushFunCallArguments(argcReg, calleeReg, scratch, scratch2, argcFixed,
@ -3006,6 +3015,16 @@ void BaselineCacheIRCompiler::pushArguments(Register argcReg,
default:
MOZ_CRASH("Invalid arg format");
}
if (isJitCall) {
if (isConstructing) {
createThis(argcReg, calleeReg, scratch, scratch2, flags);
}
// Note that we use Push, not push, so that callJit will align the stack
// properly on ARM.
masm.PushCalleeToken(calleeReg, isConstructing);
}
}
void BaselineCacheIRCompiler::pushStandardArguments(
@ -3013,11 +3032,16 @@ void BaselineCacheIRCompiler::pushStandardArguments(
bool isJitCall, bool isConstructing) {
MOZ_ASSERT(enteredStubFrame_);
// The arguments to the call IC are pushed on the stack left-to-right.
// Our calling conventions want them right-to-left in the callee, so
// we duplicate them on the stack in reverse order.
// The arguments to the call IC were pushed on the stack from left to right,
// meaning that the first argument is at the highest address and the last
// argument is at the lowest address. Our callee needs them to be in the
// opposite order, so we duplicate them now.
bool shouldCopyCallee = !isJitCall;
bool shouldCopyThis = shouldCopyCallee || !isConstructing;
bool shouldCopyNewTarget = isConstructing;
int additionalArgc = shouldCopyCallee + shouldCopyThis + shouldCopyNewTarget;
int additionalArgc = 1 + !isJitCall + isConstructing;
if (argcFixed < MaxUnrolledArgCopy) {
#ifdef DEBUG
Label ok;
@ -3029,7 +3053,8 @@ void BaselineCacheIRCompiler::pushStandardArguments(
size_t realArgc = argcFixed + additionalArgc;
if (isJitCall) {
masm.alignJitStackBasedOnNArgs(realArgc, /*countIncludesThis = */ true);
masm.alignJitStackBasedOnNArgs(realArgc,
/*countIncludesThis = */ shouldCopyThis);
}
for (size_t i = 0; i < realArgc; ++i) {
@ -3057,7 +3082,8 @@ void BaselineCacheIRCompiler::pushStandardArguments(
// Align the stack such that the JitFrameLayout is aligned on the
// JitStackAlignment.
if (isJitCall) {
masm.alignJitStackBasedOnNArgs(countReg, /*countIncludesThis = */ true);
masm.alignJitStackBasedOnNArgs(countReg,
/*countIncludesThis = */ shouldCopyThis);
}
// Push all values, starting at the last one.
@ -3120,15 +3146,15 @@ void BaselineCacheIRCompiler::pushArrayArguments(Register argcReg,
masm.jump(&copyStart);
masm.bind(&copyDone);
// Push |this|.
size_t thisvOffset =
BaselineStubFrameLayout::Size() + (1 + isConstructing) * sizeof(Value);
masm.pushValue(Address(FramePointer, thisvOffset));
bool shouldPushCallee = !isJitCall;
bool shouldPushThis = shouldPushCallee || !isConstructing;
// Push |callee| if needed.
if (!isJitCall) {
size_t calleeOffset =
BaselineStubFrameLayout::Size() + (2 + isConstructing) * sizeof(Value);
if (shouldPushThis) {
size_t thisvOffset = arrayOffset + sizeof(Value);
masm.pushValue(Address(FramePointer, thisvOffset));
}
if (shouldPushCallee) {
size_t calleeOffset = arrayOffset + 2 * sizeof(Value);
masm.pushValue(Address(FramePointer, calleeOffset));
}
}
@ -3355,14 +3381,7 @@ void BaselineCacheIRCompiler::pushBoundFunctionArguments(
}
}
if (isConstructing) {
// Push the |this| Value. This is either the object we allocated or the
// JS_UNINITIALIZED_LEXICAL magic value. It's stored in the BaselineFrame,
// so skip past the stub frame, (unbound) arguments and newTarget.
BaseValueIndex thisAddress(FramePointer, argcReg,
BaselineStubFrameLayout::Size() + sizeof(Value));
masm.pushValue(thisAddress, scratch);
} else {
if (!isConstructing) {
// Push the bound |this|.
Address boundThis(calleeReg, BoundFunctionObject::offsetOfBoundThisSlot());
masm.pushValue(boundThis);
@ -3578,15 +3597,16 @@ bool BaselineCacheIRCompiler::emitCallClassHook(ObjOperandId calleeId,
// and unboxes an object from a specific slot.
void BaselineCacheIRCompiler::loadStackObject(ArgumentKind kind,
CallFlags flags, Register argcReg,
Register dest) {
Register dest,
uint32_t extraArgs) {
MOZ_ASSERT(enteredStubFrame_);
bool addArgc = false;
int32_t slotIndex = GetIndexOfArgument(kind, flags, &addArgc);
if (addArgc) {
int32_t slotOffset =
slotIndex * sizeof(JS::Value) + BaselineStubFrameLayout::Size();
int32_t slotOffset = (slotIndex - extraArgs) * sizeof(JS::Value) +
BaselineStubFrameLayout::Size();
BaseValueIndex slotAddr(FramePointer, argcReg, slotOffset);
masm.unboxObject(slotAddr, dest);
} else {
@ -3597,50 +3617,33 @@ void BaselineCacheIRCompiler::loadStackObject(ArgumentKind kind,
}
}
template <typename T>
void BaselineCacheIRCompiler::storeThis(const T& newThis, Register argcReg,
CallFlags flags) {
switch (flags.getArgFormat()) {
case CallFlags::Standard: {
BaseValueIndex thisAddress(
FramePointer,
argcReg, // Arguments
1 * sizeof(Value) + // NewTarget
BaselineStubFrameLayout::Size()); // Stub frame
masm.storeValue(newThis, thisAddress);
} break;
case CallFlags::Spread: {
Address thisAddress(FramePointer,
2 * sizeof(Value) + // Arg array, NewTarget
BaselineStubFrameLayout::Size()); // Stub frame
masm.storeValue(newThis, thisAddress);
} break;
default:
MOZ_CRASH("Invalid arg format for scripted constructor");
}
}
/*
* Scripted constructors require a |this| object to be created prior to the
* call. When this function is called, the stack looks like (bottom->top):
*
* [..., Callee, ThisV, Arg0V, ..., ArgNV, NewTarget, StubFrameHeader]
*
* At this point, |ThisV| is JSWhyMagic::JS_IS_CONSTRUCTING.
*
* This function calls CreateThis to generate a new |this| object, then
* overwrites the magic ThisV on the stack.
* call. This is called after we have pushed the formal arguments, but before
* pushing the callee token. When this is called, argcReg must contain the
* number of actual arguments (including bound or spread arguments; not
* including `undef` pushed in cases of argument underflow). calleeReg should
* contain the actual callee.
*/
void BaselineCacheIRCompiler::createThis(Register argcReg, Register calleeReg,
Register scratch, CallFlags flags,
bool isBoundFunction) {
Register scratch, Register scratch2,
CallFlags flags,
Maybe<uint32_t> numBoundArgs) {
MOZ_ASSERT(flags.isConstructing());
bool isBoundFunction = numBoundArgs.isSome();
// Derived constructors don't allocate a `this` object. They instead call
// `super`, and the base class constructor will allocate `this`.
if (flags.needsUninitializedThis()) {
storeThis(MagicValue(JS_UNINITIALIZED_LEXICAL), argcReg, flags);
masm.Push(MagicValue(JS_UNINITIALIZED_LEXICAL));
return;
}
// Save a reference to the start of the arguments, so that we can root
// them in CreateThisFromIC.
Register argvReg = scratch2;
masm.moveStackPtrTo(argvReg);
// Save live registers that don't have to be traced.
LiveGeneralRegisterSet liveNonGCRegs;
liveNonGCRegs.add(argcReg);
@ -3648,25 +3651,27 @@ void BaselineCacheIRCompiler::createThis(Register argcReg, Register calleeReg,
// CreateThis takes two arguments: callee, and newTarget.
// Push argv/argc for rooting in CreateThisFromIC
masm.push(argcReg);
masm.push(argvReg);
if (isBoundFunction) {
// Push the bound function's target as callee and newTarget.
Address boundTarget(calleeReg, BoundFunctionObject::offsetOfTargetSlot());
masm.unboxObject(boundTarget, scratch);
masm.push(scratch);
masm.push(scratch);
masm.push(calleeReg);
masm.push(calleeReg);
} else {
// Push newTarget:
loadStackObject(ArgumentKind::NewTarget, flags, argcReg, scratch);
masm.push(scratch);
// Push callee:
loadStackObject(ArgumentKind::Callee, flags, argcReg, scratch);
masm.push(scratch);
// Push callee.
masm.push(calleeReg);
}
// Call CreateThisFromIC.
using Fn =
bool (*)(JSContext*, HandleObject, HandleObject, MutableHandleValue);
bool (*)(JSContext*, HandleObject, HandleObject, Value*, uint32_t,
MutableHandleValue);
callVM<Fn, CreateThisFromIC>(masm);
#ifdef DEBUG
@ -3686,14 +3691,29 @@ void BaselineCacheIRCompiler::createThis(Register argcReg, Register calleeReg,
Address stubAddr(FramePointer, BaselineStubFrameLayout::ICStubOffsetFromFP);
masm.loadPtr(stubAddr, ICStubReg);
// Save |this| value back into pushed arguments on stack.
// Push |this|.
MOZ_ASSERT(!liveNonGCRegs.aliases(JSReturnOperand));
storeThis(JSReturnOperand, argcReg, flags);
masm.Push(TypedOrValueRegister(JSReturnOperand));
// Restore calleeReg. CreateThisFromIC may trigger a GC, so we reload the
// callee from the stub frame (which is traced) instead of spilling it to
// callee from the caller's frame (which is traced) instead of spilling it to
// the stack.
loadStackObject(ArgumentKind::Callee, flags, argcReg, calleeReg);
if (isBoundFunction) {
// Load the callee (which is a bound function).
// At this point, argcReg is the number of actual arguments being passed.
// For bound functions, this includes bound arguments. However, to compute
// the address of `callee` in the caller's frame, we need to know how many
// arguments were passed by the caller. This is argcReg - numBoundArgs.
// We pass in `numBoundArgs` so that loadStackObject can adjust accordingly.
loadStackObject(ArgumentKind::Callee, flags, argcReg, calleeReg,
*numBoundArgs);
// Load the target JSFunction.
Address boundTarget(calleeReg, BoundFunctionObject::offsetOfTargetSlot());
masm.unboxObject(boundTarget, calleeReg);
} else {
loadStackObject(ArgumentKind::Callee, flags, argcReg, calleeReg);
}
}
void BaselineCacheIRCompiler::updateReturnValue() {
@ -3753,11 +3773,6 @@ bool BaselineCacheIRCompiler::emitCallScriptedFunction(ObjOperandId calleeId,
masm.switchToObjectRealm(calleeReg, scratch);
}
if (isConstructing) {
createThis(argcReg, calleeReg, scratch, flags,
/* isBoundFunction = */ false);
}
pushArguments(argcReg, calleeReg, scratch, scratch2, flags, argcFixed,
/*isJitCall =*/true);
@ -3767,7 +3782,6 @@ bool BaselineCacheIRCompiler::emitCallScriptedFunction(ObjOperandId calleeId,
// Note that we use Push, not push, so that callJit will align the stack
// properly on ARM.
masm.PushCalleeToken(calleeReg, isConstructing);
masm.PushFrameDescriptorForJitCall(FrameType::BaselineStub, argcReg, scratch);
// Handle arguments underflow.
@ -3843,11 +3857,11 @@ bool BaselineCacheIRCompiler::emitCallInlinedFunction(ObjOperandId calleeId,
masm.switchToObjectRealm(calleeReg, scratch);
}
pushArguments(argcReg, calleeReg, scratch, scratch2, flags, argcFixed,
/*isJitCall =*/true);
Label baselineScriptDiscarded;
if (isConstructing) {
createThis(argcReg, calleeReg, scratch, flags,
/* isBoundFunction = */ false);
// CreateThisFromIC may trigger a GC and discard the BaselineScript.
// We have already called discardStack, so we can't use a FailurePath.
// Instead, we skip storing the ICScript in the JSContext and use a
@ -3868,12 +3882,8 @@ bool BaselineCacheIRCompiler::emitCallInlinedFunction(ObjOperandId calleeId,
masm.bind(&skip);
}
pushArguments(argcReg, calleeReg, scratch, scratch2, flags, argcFixed,
/*isJitCall =*/true);
// Note that we use Push, not push, so that callJit will align the stack
// properly on ARM.
masm.PushCalleeToken(calleeReg, isConstructing);
masm.PushFrameDescriptorForJitCall(FrameType::BaselineStub, argcReg, scratch);
// Handle arguments underflow.
@ -4035,34 +4045,26 @@ bool BaselineCacheIRCompiler::emitCallBoundScriptedFunction(
AutoStubFrame stubFrame(*this);
stubFrame.enter(masm, scratch);
Address boundTarget(calleeReg, BoundFunctionObject::offsetOfTargetSlot());
// If we're constructing, switch to the target's realm and create |this|. If
// we're not constructing, we switch to the target's realm after pushing the
// arguments and loading the target.
if (isConstructing) {
if (!isSameRealm) {
masm.unboxObject(boundTarget, scratch);
masm.switchToObjectRealm(scratch, scratch);
}
createThis(argcReg, calleeReg, scratch, flags,
/* isBoundFunction = */ true);
}
// Push all arguments, including |this|.
pushBoundFunctionArguments(argcReg, calleeReg, scratch, scratch2, flags,
numBoundArgs, /* isJitCall = */ true);
// Load the target JSFunction.
Address boundTarget(calleeReg, BoundFunctionObject::offsetOfTargetSlot());
masm.unboxObject(boundTarget, calleeReg);
if (!isConstructing && !isSameRealm) {
if (!isSameRealm) {
masm.switchToObjectRealm(calleeReg, scratch);
}
// Update argc.
masm.add32(Imm32(numBoundArgs), argcReg);
if (isConstructing) {
createThis(argcReg, calleeReg, scratch, scratch2, flags,
mozilla::Some(numBoundArgs));
}
// Load the start of the target JitCode.
Register code = scratch2;
masm.loadJitCodeRaw(calleeReg, code);

View File

@ -73,7 +73,7 @@ class MOZ_RAII BaselineCacheIRCompiler : public CacheIRCompiler {
bool updateArgc(CallFlags flags, Register argcReg, Register scratch);
void loadStackObject(ArgumentKind kind, CallFlags flags, Register argcReg,
Register dest);
Register dest, uint32_t extraArgs = 0);
void pushArguments(Register argcReg, Register calleeReg, Register scratch,
Register scratch2, CallFlags flags, uint32_t argcFixed,
bool isJitCall);
@ -93,9 +93,8 @@ class MOZ_RAII BaselineCacheIRCompiler : public CacheIRCompiler {
CallFlags flags, uint32_t numBoundArgs,
bool isJitCall);
void createThis(Register argcReg, Register calleeReg, Register scratch,
CallFlags flags, bool isBoundFunction);
template <typename T>
void storeThis(const T& newThis, Register argcReg, CallFlags flags);
Register scratch2, CallFlags flags,
mozilla::Maybe<uint32_t> numBoundArgs = mozilla::Nothing());
void updateReturnValue();
enum class NativeCallType { Native, ClassHook };

View File

@ -299,7 +299,9 @@ class ICCacheIRStub final : public ICStub {
void trace(JSTracer* trc);
bool traceWeak(JSTracer* trc);
ICCacheIRStub* clone(JSRuntime* rt, ICStubSpace& newSpace);
enum class ICScriptHandling { MarkActive, AssertActive };
ICCacheIRStub* clone(JSRuntime* rt, ICStubSpace& newSpace,
ICScriptHandling icScriptHandling);
// Returns true if this stub can call JS or VM code that can trigger a GC.
bool makesGCCalls() const;

View File

@ -243,6 +243,9 @@ uint32_t CacheIRCloner::getRawInt32Field(uint32_t stubOffset) {
const void* CacheIRCloner::getRawPointerField(uint32_t stubOffset) {
return reinterpret_cast<const void*>(readStubWord(stubOffset));
}
const ICScript* CacheIRCloner::getICScriptField(uint32_t stubOffset) {
return reinterpret_cast<const ICScript*>(readStubWord(stubOffset));
}
uint64_t CacheIRCloner::getRawInt64Field(uint32_t stubOffset) {
return static_cast<uint64_t>(readStubInt64(stubOffset));
}

View File

@ -239,6 +239,7 @@ class StubField {
// These fields take up a single word.
RawInt32,
RawPointer,
ICScript,
Shape,
WeakShape,
WeakGetterSetter,
@ -312,6 +313,8 @@ inline const char* StubFieldTypeName(StubField::Type ty) {
return "RawInt32";
case StubField::Type::RawPointer:
return "RawPointer";
case StubField::Type::ICScript:
return "ICScript";
case StubField::Type::Shape:
return "Shape";
case StubField::Type::WeakShape:

View File

@ -71,6 +71,7 @@ class MOZ_RAII CacheIRCloner {
JitCode* getJitCodeField(uint32_t stubOffset);
uint32_t getRawInt32Field(uint32_t stubOffset);
const void* getRawPointerField(uint32_t stubOffset);
const ICScript* getICScriptField(uint32_t stubOffset);
jsid getIdField(uint32_t stubOffset);
const Value getValueField(uint32_t stubOffset);
uint64_t getRawInt64Field(uint32_t stubOffset);

View File

@ -1119,6 +1119,7 @@ static void InitWordStubField(StubField::Type type, void* dest,
switch (type) {
case StubField::Type::RawInt32:
case StubField::Type::RawPointer:
case StubField::Type::ICScript:
case StubField::Type::AllocSite:
*static_cast<uintptr_t*>(dest) = value;
break;
@ -1179,6 +1180,7 @@ static void InitInt64StubField(StubField::Type type, void* dest,
break;
case StubField::Type::RawInt32:
case StubField::Type::RawPointer:
case StubField::Type::ICScript:
case StubField::Type::AllocSite:
case StubField::Type::Shape:
case StubField::Type::WeakShape:
@ -1209,7 +1211,8 @@ void CacheIRWriter::copyStubData(uint8_t* dest) const {
}
}
ICCacheIRStub* ICCacheIRStub::clone(JSRuntime* rt, ICStubSpace& newSpace) {
ICCacheIRStub* ICCacheIRStub::clone(JSRuntime* rt, ICStubSpace& newSpace,
ICScriptHandling icScriptHandling) {
const CacheIRStubInfo* info = stubInfo();
MOZ_ASSERT(info->makesGCCalls());
@ -1242,6 +1245,15 @@ ICCacheIRStub* ICCacheIRStub::clone(JSRuntime* rt, ICStubSpace& newSpace) {
InitWordStubField(type, dest, *srcField);
src += sizeof(uintptr_t);
dest += sizeof(uintptr_t);
if (type == StubField::Type::ICScript) {
auto* icScript = reinterpret_cast<ICScript*>(*srcField);
if (icScriptHandling == ICScriptHandling::MarkActive) {
icScript->setActive();
} else {
MOZ_ASSERT(icScriptHandling == ICScriptHandling::AssertActive);
MOZ_RELEASE_ASSERT(icScript->active());
}
}
} else {
const uint64_t* srcField = reinterpret_cast<const uint64_t*>(src);
InitInt64StubField(type, dest, *srcField);
@ -1278,6 +1290,7 @@ void jit::TraceCacheIRStub(JSTracer* trc, T* stub,
switch (fieldType) {
case Type::RawInt32:
case Type::RawPointer:
case Type::ICScript:
case Type::RawInt64:
case Type::Double:
break;
@ -1425,6 +1438,7 @@ bool jit::TraceWeakCacheIRStub(JSTracer* trc, T* stub,
return !isDead;
case Type::RawInt32:
case Type::RawPointer:
case Type::ICScript:
case Type::Shape:
case Type::JSObject:
case Type::Symbol:

View File

@ -1931,7 +1931,7 @@
receiver: ObjId
setter: ObjectField
rhs: ValId
icScript: RawPointerField
icScript: ICScriptField
sameRealm: BoolImm
nargsAndFlags: RawInt32Field
@ -2124,7 +2124,7 @@
args:
callee: ObjId
argc: Int32Id
icScript: RawPointerField
icScript: ICScriptField
flags: CallFlagsImm
argcFixed: UInt32Imm
@ -2558,7 +2558,7 @@
args:
receiver: ValId
getter: ObjectField
icScript: RawPointerField
icScript: ICScriptField
sameRealm: BoolImm
nargsAndFlags: RawInt32Field

View File

@ -238,6 +238,9 @@ class MOZ_RAII CacheIRWriter : public JS::CustomAutoRooter {
void writeRawPointerField(const void* ptr) {
addStubField(uintptr_t(ptr), StubField::Type::RawPointer);
}
void writeICScriptField(const ICScript* icScript) {
addStubField(uintptr_t(icScript), StubField::Type::ICScript);
}
void writeIdField(jsid id) {
addStubField(id.asRawBits(), StubField::Type::Id);
}

View File

@ -76,6 +76,7 @@ arg_writer_info = {
"JitCodeField": ("JitCode*", "writeJitCodeField"),
"RawInt32Field": ("uint32_t", "writeRawInt32Field"),
"RawPointerField": ("const void*", "writeRawPointerField"),
"ICScriptField": ("const ICScript*", "writeICScriptField"),
"IdField": ("jsid", "writeIdField"),
"ValueField": ("const Value&", "writeValueField"),
"RawInt64Field": ("uint64_t", "writeRawInt64Field"),
@ -181,6 +182,7 @@ arg_reader_info = {
"JitCodeField": ("uint32_t", "Offset", "reader.stubOffset()"),
"RawInt32Field": ("uint32_t", "Offset", "reader.stubOffset()"),
"RawPointerField": ("uint32_t", "Offset", "reader.stubOffset()"),
"ICScriptField": ("uint32_t", "Offset", "reader.stubOffset()"),
"IdField": ("uint32_t", "Offset", "reader.stubOffset()"),
"ValueField": ("uint32_t", "Offset", "reader.stubOffset()"),
"RawInt64Field": ("uint32_t", "Offset", "reader.stubOffset()"),
@ -276,6 +278,7 @@ arg_spewer_method = {
"JitCodeField": "spewField",
"RawInt32Field": "spewField",
"RawPointerField": "spewField",
"ICScriptField": "spewField",
"IdField": "spewField",
"ValueField": "spewField",
"RawInt64Field": "spewField",
@ -418,6 +421,7 @@ arg_length = {
"JitCodeField": 1,
"RawInt32Field": 1,
"RawPointerField": 1,
"ICScriptField": 1,
"RawInt64Field": 1,
"DoubleField": 1,
"IdField": 1,

View File

@ -568,8 +568,9 @@ static bool BlockIsSingleTest(MBasicBlock* phiBlock, MBasicBlock* testBlock,
*ptest = nullptr;
if (phiBlock != testBlock) {
MOZ_ASSERT(phiBlock->numSuccessors() == 1 &&
phiBlock->getSuccessor(0) == testBlock);
MOZ_RELEASE_ASSERT(phiBlock->lastIns()->isGoto());
MOZ_RELEASE_ASSERT(phiBlock->lastIns()->toGoto()->target() == testBlock);
MOZ_RELEASE_ASSERT(testBlock->numPredecessors() == 1);
if (!phiBlock->begin()->isGoto()) {
return false;
}
@ -686,7 +687,7 @@ static bool IsTestInputMaybeToBool(MTest* test, MDefinition* value) {
blockResult->setImplicitlyUsedUnchecked();
MInstruction* ins = block->lastIns();
MOZ_ASSERT(ins->isGoto());
MOZ_RELEASE_ASSERT(ins->isGoto());
ins->toGoto()->target()->removePredecessor(block);
block->discardLastIns();
@ -707,15 +708,14 @@ static bool IsTestInputMaybeToBool(MTest* test, MDefinition* value) {
MInstruction* ins = block->lastIns();
if (ins->isTest()) {
MTest* test = ins->toTest();
MOZ_ASSERT(test->input() == value);
MOZ_RELEASE_ASSERT(test->input() == value);
if (ifTrue != test->ifTrue()) {
test->ifTrue()->removePredecessor(block);
if (!ifTrue->addPredecessorSameInputsAs(block, existingPred)) {
return false;
}
MOZ_ASSERT(test->ifTrue() == test->getSuccessor(0));
test->replaceSuccessor(0, ifTrue);
test->replaceSuccessor(MTest::TrueBranchIndex, ifTrue);
}
if (ifFalse != test->ifFalse()) {
@ -723,14 +723,13 @@ static bool IsTestInputMaybeToBool(MTest* test, MDefinition* value) {
if (!ifFalse->addPredecessorSameInputsAs(block, existingPred)) {
return false;
}
MOZ_ASSERT(test->ifFalse() == test->getSuccessor(1));
test->replaceSuccessor(1, ifFalse);
test->replaceSuccessor(MTest::FalseBranchIndex, ifFalse);
}
return true;
}
MOZ_ASSERT(ins->isGoto());
MOZ_RELEASE_ASSERT(ins->isGoto());
ins->toGoto()->target()->removePredecessor(block);
block->discardLastIns();
@ -775,8 +774,8 @@ static bool IsDiamondPattern(MBasicBlock* initialBlock) {
return false;
}
MBasicBlock* phiBlock = trueBranch->getSuccessor(0);
if (phiBlock != falseBranch->getSuccessor(0)) {
MBasicBlock* phiBlock = trueBranch->lastIns()->toGoto()->target();
if (phiBlock != falseBranch->lastIns()->toGoto()->target()) {
return false;
}
if (phiBlock->numPredecessors() != 2) {
@ -820,13 +819,13 @@ static bool IsDiamondPattern(MBasicBlock* initialBlock) {
return true;
}
MBasicBlock* phiBlock = trueBranch->getSuccessor(0);
MBasicBlock* phiBlock = trueBranch->lastIns()->toGoto()->target();
MBasicBlock* testBlock = phiBlock;
if (testBlock->numSuccessors() == 1) {
if (testBlock->lastIns()->isGoto()) {
if (testBlock->isLoopBackedge()) {
return true;
}
testBlock = testBlock->getSuccessor(0);
testBlock = testBlock->lastIns()->toGoto()->target();
if (testBlock->numPredecessors() != 1) {
return true;
}
@ -838,7 +837,7 @@ static bool IsDiamondPattern(MBasicBlock* initialBlock) {
return true;
}
MOZ_ASSERT(phi->numOperands() == 2);
MOZ_RELEASE_ASSERT(phi->numOperands() == 2);
// Make sure the test block does not have any outgoing loop backedges.
if (!SplitCriticalEdgesForBlock(graph, testBlock)) {
@ -929,8 +928,8 @@ static bool IsTrianglePattern(MBasicBlock* initialBlock) {
MBasicBlock* trueBranch = initialTest->ifTrue();
MBasicBlock* falseBranch = initialTest->ifFalse();
if (trueBranch->numSuccessors() == 1 &&
trueBranch->getSuccessor(0) == falseBranch) {
if (trueBranch->lastIns()->isGoto() &&
trueBranch->lastIns()->toGoto()->target() == falseBranch) {
if (trueBranch->numPredecessors() != 1) {
return false;
}
@ -940,8 +939,8 @@ static bool IsTrianglePattern(MBasicBlock* initialBlock) {
return true;
}
if (falseBranch->numSuccessors() == 1 &&
falseBranch->getSuccessor(0) == trueBranch) {
if (falseBranch->lastIns()->isGoto() &&
falseBranch->lastIns()->toGoto()->target() == trueBranch) {
if (trueBranch->numPredecessors() != 2) {
return false;
}
@ -999,19 +998,19 @@ static bool IsTrianglePattern(MBasicBlock* initialBlock) {
}
MBasicBlock* phiBlock;
if (trueBranch->numSuccessors() == 1 &&
trueBranch->getSuccessor(0) == falseBranch) {
if (trueBranch->lastIns()->isGoto() &&
trueBranch->lastIns()->toGoto()->target() == falseBranch) {
phiBlock = falseBranch;
} else {
MOZ_ASSERT(falseBranch->getSuccessor(0) == trueBranch);
MOZ_ASSERT(falseBranch->lastIns()->toGoto()->target() == trueBranch);
phiBlock = trueBranch;
}
MBasicBlock* testBlock = phiBlock;
if (testBlock->numSuccessors() == 1) {
MOZ_ASSERT(!testBlock->isLoopBackedge());
if (testBlock->lastIns()->isGoto()) {
MOZ_RELEASE_ASSERT(!testBlock->isLoopBackedge());
testBlock = testBlock->getSuccessor(0);
testBlock = testBlock->lastIns()->toGoto()->target();
if (testBlock->numPredecessors() != 1) {
return true;
}
@ -1023,7 +1022,7 @@ static bool IsTrianglePattern(MBasicBlock* initialBlock) {
return true;
}
MOZ_ASSERT(phi->numOperands() == 2);
MOZ_RELEASE_ASSERT(phi->numOperands() == 2);
// If the phi-operand doesn't match the initial input, we can't fold the test.
auto* phiInputForInitialBlock =
@ -1194,17 +1193,17 @@ static bool IsTrianglePattern(MBasicBlock* initialBlock) {
}
MBasicBlock* testBlock = phiBlock;
if (testBlock->numSuccessors() == 1) {
if (testBlock->lastIns()->isGoto()) {
if (testBlock->isLoopBackedge()) {
return true;
}
testBlock = testBlock->getSuccessor(0);
testBlock = testBlock->lastIns()->toGoto()->target();
if (testBlock->numPredecessors() != 1) {
return true;
}
}
MOZ_ASSERT(!phiBlock->isLoopBackedge());
MOZ_RELEASE_ASSERT(!phiBlock->isLoopBackedge());
MPhi* phi = nullptr;
MTest* finalTest = nullptr;
@ -1212,7 +1211,7 @@ static bool IsTrianglePattern(MBasicBlock* initialBlock) {
return true;
}
MOZ_ASSERT(phiBlock->numPredecessors() == phi->numOperands());
MOZ_RELEASE_ASSERT(phiBlock->numPredecessors() == phi->numOperands());
// If the phi-operand doesn't match the initial input, we can't fold the test.
auto* phiInputForInitialBlock =
@ -1243,7 +1242,7 @@ static bool IsTrianglePattern(MBasicBlock* initialBlock) {
return true;
}
MOZ_ASSERT(!pred->isLoopBackedge());
MOZ_RELEASE_ASSERT(!pred->isLoopBackedge());
}
// Ensure we found the single goto block.
@ -1270,7 +1269,7 @@ static bool IsTrianglePattern(MBasicBlock* initialBlock) {
// Update all test instructions to point to the final target.
while (phiBlock->numPredecessors()) {
mozilla::DebugOnly<size_t> oldNumPred = phiBlock->numPredecessors();
size_t oldNumPred = phiBlock->numPredecessors();
auto* pred = phiBlock->getPredecessor(0);
auto* test = pred->lastIns()->toTest();
@ -1281,7 +1280,7 @@ static bool IsTrianglePattern(MBasicBlock* initialBlock) {
return false;
}
} else {
MOZ_ASSERT(test->ifFalse() == phiBlock);
MOZ_RELEASE_ASSERT(test->ifFalse() == phiBlock);
if (!UpdateTestSuccessors(graph.alloc(), pred, test->input(),
test->ifTrue(), finalTest->ifFalse(),
testBlock)) {
@ -1290,7 +1289,7 @@ static bool IsTrianglePattern(MBasicBlock* initialBlock) {
}
// Ensure we've made progress.
MOZ_ASSERT(phiBlock->numPredecessors() + 1 == oldNumPred);
MOZ_RELEASE_ASSERT(phiBlock->numPredecessors() + 1 == oldNumPred);
}
// Remove phiBlock, if different from testBlock.

View File

@ -1745,6 +1745,7 @@ bool SnapshotIterator::allocationReadable(const RValueAllocation& alloc,
case RValueAllocation::INT64_REG:
return hasRegister(alloc.reg());
case RValueAllocation::INT64_STACK:
case RValueAllocation::INT64_INT32_STACK:
return hasStack(alloc.stackOffset());
#endif
@ -1855,6 +1856,7 @@ Value SnapshotIterator::allocationValue(const RValueAllocation& alloc,
#elif defined(JS_PUNBOX64)
case RValueAllocation::INT64_REG:
case RValueAllocation::INT64_STACK:
case RValueAllocation::INT64_INT32_STACK:
#endif
MOZ_CRASH("Can't read Int64 as Value");
@ -1911,6 +1913,7 @@ bool SnapshotIterator::readMaybeUnpackedBigInt(JSContext* cx,
#elif defined(JS_PUNBOX64)
case RValueAllocation::INT64_REG:
case RValueAllocation::INT64_STACK:
case RValueAllocation::INT64_INT32_STACK:
#endif
{
auto* bigInt = JS::BigInt::createFromInt64(cx, allocationInt64(alloc));
@ -1978,6 +1981,9 @@ int64_t SnapshotIterator::allocationInt64(const RValueAllocation& alloc) {
case RValueAllocation::INT64_STACK: {
return static_cast<int64_t>(fromStack(alloc.stackOffset()));
}
case RValueAllocation::INT64_INT32_STACK: {
return static_cast<int64_t>(ReadFrameInt32Slot(fp_, alloc.stackOffset()));
}
#endif
default:
break;
@ -2051,6 +2057,7 @@ void SnapshotIterator::writeAllocationValuePayload(
#elif defined(JS_PUNBOX64)
case RValueAllocation::INT64_REG:
case RValueAllocation::INT64_STACK:
case RValueAllocation::INT64_INT32_STACK:
#endif
MOZ_CRASH("Not a GC thing: Unexpected write");
break;

View File

@ -532,7 +532,8 @@ void ICScript::purgeStubs(Zone* zone, ICStubSpace& newStubSpace) {
ICCacheIRStub* prev = nullptr;
ICStub* stub = entry.firstStub();
while (stub != fallback) {
ICCacheIRStub* clone = stub->toCacheIRStub()->clone(rt, newStubSpace);
ICCacheIRStub* clone = stub->toCacheIRStub()->clone(
rt, newStubSpace, ICCacheIRStub::ICScriptHandling::AssertActive);
if (prev) {
prev->setNext(clone);
} else {
@ -751,26 +752,15 @@ static void MarkActiveICScriptsAndCopyStubs(
ICCacheIRStub* stub = layout->maybeStubPtr()->toCacheIRStub();
auto lookup = alreadyClonedStubs.lookupForAdd(stub);
if (!lookup) {
ICCacheIRStub* newStub = stub->clone(cx->runtime(), newStubSpace);
ICCacheIRStub* newStub =
stub->clone(cx->runtime(), newStubSpace,
ICCacheIRStub::ICScriptHandling::MarkActive);
AutoEnterOOMUnsafeRegion oomUnsafe;
if (!alreadyClonedStubs.add(lookup, stub, newStub)) {
oomUnsafe.crash("MarkActiveICScriptsAndCopyStubs");
}
}
layout->setStubPtr(lookup->value());
// If this is a trial-inlining call site, also preserve the callee
// ICScript. Inlined constructor calls invoke CreateThisFromIC (which
// can trigger GC) before using the inlined ICScript.
JSJitFrameIter parentFrame(frame);
++parentFrame;
BaselineFrame* blFrame = parentFrame.baselineFrame();
jsbytecode* pc;
parentFrame.baselineScriptAndPc(nullptr, &pc);
uint32_t pcOffset = blFrame->script()->pcToOffset(pc);
if (blFrame->icScript()->hasInlinedChild(pcOffset)) {
blFrame->icScript()->findInlinedChild(pcOffset)->setActive();
}
}
break;
}

View File

@ -1346,7 +1346,6 @@ class MWasmLoadTableElement : public MBinaryInstruction,
wasm::RefType refType)
: MBinaryInstruction(classOpcode, elements, index) {
setResultType(MIRType::WasmAnyRef);
setMovable();
initWasmRefType(wasm::MaybeRefType(refType));
}

View File

@ -154,6 +154,9 @@ using namespace js::jit;
// register/stack-offset correspond to the low 32-bits, and the
// second correspond to the high 32-bits.
//
// INT64_INT32_STACK [STACK_OFFSET]: (64-bit platform)
// Unpacked Int64 value stored in int32_t. Payload is stored at an
// offset on the stack.
const RValueAllocation::Layout& RValueAllocation::layoutFromMode(Mode mode) {
switch (mode) {
@ -308,6 +311,12 @@ const RValueAllocation::Layout& RValueAllocation::layoutFromMode(Mode mode) {
PAYLOAD_STACK_OFFSET, PAYLOAD_NONE, "unpacked int64"};
return layout;
}
case INT64_INT32_STACK: {
static const RValueAllocation::Layout layout = {
PAYLOAD_STACK_OFFSET, PAYLOAD_NONE, "unpacked int64 (int32)"};
return layout;
}
#endif
default: {

View File

@ -82,6 +82,7 @@ class RValueAllocation {
#elif defined(JS_PUNBOX64)
INT64_REG = 0x31,
INT64_STACK = 0x32,
INT64_INT32_STACK = 0x33,
#endif
// This mask can be used with any other valid mode. When this flag is
@ -348,6 +349,11 @@ class RValueAllocation {
static RValueAllocation Int64(int32_t stackOffset) {
return RValueAllocation(INT64_STACK, payloadOfStackOffset(stackOffset));
}
static RValueAllocation Int64Int32(int32_t stackOffset) {
return RValueAllocation(INT64_INT32_STACK,
payloadOfStackOffset(stackOffset));
}
#endif
void setNeedSideEffect() {

View File

@ -887,14 +887,23 @@ bool GetIntrinsicValue(JSContext* cx, Handle<PropertyName*> name,
return GlobalObject::getIntrinsicValue(cx, cx->global(), name, rval);
}
static uint32_t NumTraceableArgsForCreateThis(HandleFunction fun,
uint32_t argc) {
return argc + 1; // Add 1 for newTarget
}
bool CreateThisFromIC(JSContext* cx, HandleObject callee,
HandleObject newTarget, MutableHandleValue rval) {
HandleObject newTarget, Value* argv, uint32_t argc,
MutableHandleValue rval) {
HandleFunction fun = callee.as<JSFunction>();
MOZ_ASSERT(fun->isInterpreted());
MOZ_ASSERT(fun->isConstructor());
MOZ_ASSERT(cx->realm() == fun->realm(),
"Realm switching happens before creating this");
RootedExternalValueArray args(cx, NumTraceableArgsForCreateThis(fun, argc),
argv);
// CreateThis expects rval to be this magic value.
rval.set(MagicValue(JS_IS_CONSTRUCTING));

View File

@ -408,8 +408,8 @@ bool OperatorIn(JSContext* cx, HandleValue key, HandleObject obj, bool* out);
MutableHandleValue rval);
[[nodiscard]] bool CreateThisFromIC(JSContext* cx, HandleObject callee,
HandleObject newTarget,
MutableHandleValue rval);
HandleObject newTarget, Value* argv,
uint32_t argc, MutableHandleValue rval);
[[nodiscard]] bool CreateThisFromIon(JSContext* cx, HandleObject callee,
HandleObject newTarget,
MutableHandleValue rval);

View File

@ -1256,6 +1256,7 @@ bool WarpScriptOracle::replaceNurseryAndAllocSitePointers(
switch (fieldType) {
case StubField::Type::RawInt32:
case StubField::Type::RawPointer:
case StubField::Type::ICScript:
case StubField::Type::RawInt64:
case StubField::Type::Double:
break;

View File

@ -341,6 +341,7 @@ void WarpCacheIR::traceData(JSTracer* trc) {
switch (fieldType) {
case StubField::Type::RawInt32:
case StubField::Type::RawPointer:
case StubField::Type::ICScript:
case StubField::Type::RawInt64:
case StubField::Type::Double:
break;

View File

@ -4862,20 +4862,24 @@ void MacroAssembler::wasmBoundsCheck32(Condition cond, Register index,
void MacroAssembler::wasmBoundsCheck64(Condition cond, Register64 index,
Register64 boundsCheckLimit, Label* ok) {
Label notOk;
MOZ_ASSERT(cond == Assembler::AboveOrEqual || cond == Assembler::Below);
Label rejoin;
Label* failLabel = cond == Assembler::AboveOrEqual ? ok : &rejoin;
cmp32(index.high, Imm32(0));
j(Assembler::NonZero, &notOk);
j(Assembler::NonZero, failLabel);
wasmBoundsCheck32(cond, index.low, boundsCheckLimit.low, ok);
bind(&notOk);
bind(&rejoin);
}
void MacroAssembler::wasmBoundsCheck64(Condition cond, Register64 index,
Address boundsCheckLimit, Label* ok) {
Label notOk;
MOZ_ASSERT(cond == Assembler::AboveOrEqual || cond == Assembler::Below);
Label rejoin;
Label* failLabel = cond == Assembler::AboveOrEqual ? ok : &rejoin;
cmp32(index.high, Imm32(0));
j(Assembler::NonZero, &notOk);
j(Assembler::NonZero, failLabel);
wasmBoundsCheck32(cond, index.low, boundsCheckLimit, ok);
bind(&notOk);
bind(&rejoin);
}
void MacroAssembler::wasmTruncateDoubleToUInt32(FloatRegister input,

View File

@ -599,9 +599,14 @@ void CodeGeneratorShared::encodeAllocation(LSnapshot* snapshot,
if (payload->isGeneralReg()) {
alloc = RValueAllocation::Int64(ToRegister(payload));
} else if (payload->isStackSlot()) {
MOZ_ASSERT(payload->toStackSlot()->width() ==
LStackSlot::width(LDefinition::GENERAL));
alloc = RValueAllocation::Int64(ToStackIndex(payload));
LStackSlot::Width width = payload->toStackSlot()->width();
MOZ_ASSERT(width == LStackSlot::width(LDefinition::GENERAL) ||
width == LStackSlot::width(LDefinition::INT32));
if (width == LStackSlot::width(LDefinition::GENERAL)) {
alloc = RValueAllocation::Int64(ToStackIndex(payload));
} else {
alloc = RValueAllocation::Int64Int32(ToStackIndex(payload));
}
} else {
MOZ_CRASH("Unexpected payload type.");
}

View File

@ -1882,20 +1882,24 @@ void MacroAssembler::patchNearAddressMove(CodeLocationLabel loc,
void MacroAssembler::wasmBoundsCheck64(Condition cond, Register64 index,
Register64 boundsCheckLimit, Label* ok) {
Label notOk;
MOZ_ASSERT(cond == Assembler::AboveOrEqual || cond == Assembler::Below);
Label rejoin;
Label* failLabel = cond == Assembler::AboveOrEqual ? ok : &rejoin;
cmp32(index.high, Imm32(0));
j(Assembler::NonZero, &notOk);
j(Assembler::NonZero, failLabel);
wasmBoundsCheck32(cond, index.low, boundsCheckLimit.low, ok);
bind(&notOk);
bind(&rejoin);
}
void MacroAssembler::wasmBoundsCheck64(Condition cond, Register64 index,
Address boundsCheckLimit, Label* ok) {
Label notOk;
MOZ_ASSERT(cond == Assembler::AboveOrEqual || cond == Assembler::Below);
Label rejoin;
Label* failLabel = cond == Assembler::AboveOrEqual ? ok : &rejoin;
cmp32(index.high, Imm32(0));
j(Assembler::NonZero, &notOk);
j(Assembler::NonZero, failLabel);
wasmBoundsCheck32(cond, index.low, boundsCheckLimit, ok);
bind(&notOk);
bind(&rejoin);
}
void MacroAssembler::wasmMarkCallAsSlow() {

View File

@ -2266,36 +2266,15 @@ ResizableArrayBufferObject::createBufferAndData(
size_t sourceByteLength = source->byteLength();
size_t newMaxByteLength = source->maxByteLength();
if (newByteLength > sourceByteLength) {
// Copy into a larger buffer.
AutoSetNewObjectMetadata metadata(cx);
auto [buffer, toFill] = createBufferAndData<FillContents::Zero>(
cx, newByteLength, newMaxByteLength, metadata, nullptr);
if (!buffer) {
return nullptr;
}
// The `createBufferAndData()` call first zero-initializes the complete
// buffer and then we copy over |sourceByteLength| bytes from |source|. It
// seems prudent to only zero-initialize the trailing bytes of |toFill|
// to avoid writing twice to `toFill[0..newByteLength]`. We don't yet
// implement this optimization, because this method is only called for
// small, inline buffers, so any write optimizations probably won't make
// much of a difference.
std::copy_n(source->dataPointer(), sourceByteLength, toFill);
return buffer;
}
// Copy into a smaller or same size buffer.
AutoSetNewObjectMetadata metadata(cx);
auto [buffer, toFill] = createBufferAndData<FillContents::Uninitialized>(
auto [buffer, toFill] = createBufferAndData<FillContents::Zero>(
cx, newByteLength, newMaxByteLength, metadata, nullptr);
if (!buffer) {
return nullptr;
}
std::uninitialized_copy_n(source->dataPointer(), newByteLength, toFill);
size_t nbytes = std::min(newByteLength, sourceByteLength);
std::copy_n(source->dataPointer(), nbytes, toFill);
return buffer;
}

View File

@ -773,7 +773,7 @@ class ModuleEnvironmentObject : public EnvironmentObject {
// `env` may be a DebugEnvironmentProxy, but not a hollow environment.
static ModuleEnvironmentObject* find(JSObject* env);
uint32_t firstSyntheticValueSlot() { return RESERVED_SLOTS; }
uint32_t firstSyntheticValueSlot() { return RESERVED_SLOTS + 1; }
private:
static bool lookupProperty(JSContext* cx, HandleObject obj, HandleId id,

View File

@ -42,6 +42,7 @@
#include "vm/Watchtower.h"
#include "vm/NativeObject-inl.h"
#include "vm/PlainObject-inl.h" // js::PlainObject::createWithTemplate
#include "vm/Shape-inl.h" // js::GetPropertyAttributes
using namespace js;
@ -1798,25 +1799,23 @@ static bool SuppressDeletedProperty(JSContext* cx, NativeIterator* ni,
// Check whether another property along the prototype chain became
// visible as a result of this deletion.
RootedObject proto(cx);
if (!GetPrototype(cx, obj, &proto)) {
return false;
}
if (proto) {
RootedId id(cx);
RootedValue idv(cx, StringValue(*idp));
if (!PrimitiveValueToId<CanGC>(cx, idv, &id)) {
return false;
}
Rooted<mozilla::Maybe<PropertyDescriptor>> desc(cx);
RootedObject holder(cx);
if (!GetPropertyDescriptor(cx, proto, id, &desc, &holder)) {
return false;
}
if (desc.isSome() && desc->enumerable()) {
continue;
if (obj->hasStaticPrototype()) {
JSObject* proto = obj->staticPrototype();
if (proto) {
JSAtom* atom = AtomizeString(cx, str);
if (!atom) {
return false;
}
PropertyKey key = AtomToId(atom);
NativeObject* holder = nullptr;
PropertyResult prop;
if (LookupPropertyPure(cx, proto, key, &holder, &prop) &&
prop.isFound()) {
JS::PropertyAttributes attrs = GetPropertyAttributes(holder, prop);
if (attrs.enumerable()) {
continue;
}
}
}
}

View File

@ -1366,8 +1366,9 @@ static bool InnerModuleLinking(JSContext* cx, Handle<ModuleObject*> module,
size_t* indexOut) {
// Step 1. If module is not a Cyclic Module Record, then
if (!module->hasCyclicModuleFields()) {
// Step 1.a. Perform ? module.Link(). (Skipped)
// Step 2.b. Return index.
// Step 1.a. Perform ? module.Link().
// (Skipped as we have already created the environment for these modules).
// Step 1.b. Return index.
*indexOut = index;
return true;
}

View File

@ -2355,8 +2355,11 @@ uint64_t ICInterpretOps(uint64_t arg0, uint64_t arg1, ICStub* stub,
ReservedRooted<JSObject*> calleeObj(&ctx.state.obj0, callee);
ReservedRooted<JSObject*> newTargetRooted(
&ctx.state.obj1, &origArgs[0].asValue().toObject());
ReservedRooted<Value> result(&ctx.state.value0);
if (!CreateThisFromIC(cx, calleeObj, newTargetRooted, &result)) {
ReservedRooted<Value> result(&ctx.state.value0,
MagicValue(JS_IS_CONSTRUCTING));
HandleFunction fun = calleeObj.as<JSFunction>();
if (!js::CreateThis(cx, fun, newTargetRooted, GenericObject,
&result)) {
ctx.error = PBIResult::Error;
return IC_ERROR_SENTINEL();
}

View File

@ -254,6 +254,12 @@ void Realm::traceGlobalData(JSTracer* trc) {
DebugAPI::traceFromRealm(trc, this);
}
void Realm::traceGlobalRoot(JSTracer* trc, const char* name) {
if (global_) {
TraceRoot(trc, global_.unbarrieredAddress(), name);
}
}
void ObjectRealm::trace(JSTracer* trc) {
if (objectMetadataTable) {
objectMetadataTable->trace(trc);
@ -276,8 +282,8 @@ void Realm::traceRoots(JSTracer* trc,
//
// If a realm is on-stack, we mark its global so that JSContext::global()
// remains valid.
if (shouldTraceGlobal() && global_) {
TraceRoot(trc, global_.unbarrieredAddress(), "on-stack realm global");
if (shouldTraceGlobal()) {
traceGlobalRoot(trc, "on-stack realm global");
}
// If the realm is still being initialized we set a flag so that it doesn't
@ -633,16 +639,16 @@ void AutoSetNewObjectMetadata::setPendingMetadata() {
(void)SetNewObjectMetadata(cx_, obj);
}
JS_PUBLIC_API void gc::TraceRealm(JSTracer* trc, JS::Realm* realm,
const char* name) {
// The way GC works with compartments is basically incomprehensible.
// For Realms, what we want is very simple: each Realm has a strong
// reference to its GlobalObject, and vice versa.
JS_PUBLIC_API void gc::TraceRealmRoot(JSTracer* trc, JS::Realm* realm,
const char* name) {
// Trace the realm's global object to keep the realm alive.
//
// Here we simply trace our side of that edge. During GC,
// GCRuntime::traceRuntimeCommon() marks all other realm roots, for
// all realms.
realm->traceGlobalData(trc);
// Note: this is called for Rooted<Realm*>. If a realm has been entered with
// AutoRealm, the global object is traced in Realm::traceRoots.
MOZ_RELEASE_ASSERT(realm->hasLiveGlobal(),
"we need to have a global to keep the realm alive");
gc::AssertRootMarkingPhase(trc);
realm->traceGlobalRoot(trc, "rooted realm");
}
JS_PUBLIC_API JS::Realm* JS::GetCurrentRealmOrNull(JSContext* cx) {

View File

@ -542,6 +542,8 @@ class JS::Realm : public JS::shadow::Realm {
*/
void traceGlobalData(JSTracer* trc);
void traceGlobalRoot(JSTracer* trc, const char* name);
void traceWeakGlobalEdge(JSTracer* trc);
/*

View File

@ -161,11 +161,22 @@ SharedShape* js::CreateEnvironmentShapeForSyntheticModule(
RootedId id(cx);
uint32_t slotIndex = numSlots;
auto addProperty = [&](PropertyName* name) {
id = NameToId(name);
return SharedPropMap::addPropertyWithKnownSlot(
cx, cls, &map, &mapLength, id, propFlags, slotIndex, &objectFlags);
};
// Add internal *namespace* property.
if (!addProperty(cx->names().star_namespace_star_)) {
return nullptr;
}
slotIndex++;
// Add synthetic exports.
for (JSAtom* exportName : module->syntheticExportNames()) {
id = NameToId(exportName->asPropertyName());
if (!SharedPropMap::addPropertyWithKnownSlot(cx, cls, &map, &mapLength, id,
propFlags, slotIndex,
&objectFlags)) {
if (!addProperty(exportName->asPropertyName())) {
return nullptr;
}
slotIndex++;

View File

@ -2564,6 +2564,10 @@ JSStructuredCloneReader::JSStructuredCloneReader(
callbacks(cb),
closure(cbClosure),
gcHeap(in.context()) {
// Readers should never enable SAB for a DifferentProcess scope.
MOZ_RELEASE_ASSERT(!(scope == JS::StructuredCloneScope::DifferentProcess &&
cloneDataPolicy.areSharedMemoryObjectsAllowed()));
// Avoid the need to bounds check by keeping a never-matching element at the
// base of the `objState` stack. This append() will always succeed because
// the objState vector has a nonzero MinInlineCapacity.
@ -3444,6 +3448,12 @@ bool JSStructuredCloneReader::readHeader() {
return false;
}
if (allowedScope == JS::StructuredCloneScope::DifferentProcess) {
MOZ_RELEASE_ASSERT(
!cloneDataPolicy.areIntraClusterClonableSharedObjectsAllowed());
MOZ_RELEASE_ASSERT(!cloneDataPolicy.areSharedMemoryObjectsAllowed());
}
return true;
}

View File

@ -8816,27 +8816,25 @@ bool BaseCompiler::emitArrayFill() {
freePtr(RegPtr(PreBarrierReg));
}
// Perform an initialization loop using `numElements` as the loop variable,
// starting at `numElements` and counting down to zero.
// Perform the fill loop using `numElements` as the loop variable, counting
// down to zero.
Label done;
Label loop;
// Skip initialization if numElements = 0
masm.branch32(Assembler::Equal, numElements, Imm32(0), &done);
masm.bind(&loop);
// Move to the next element
masm.bind(&loop);
masm.sub32(Imm32(1), numElements);
// Assign value to rdata[numElements]. All registers are preserved.
if (!emitGcArraySet(rp, rdata, numElements, arrayType, value,
PreBarrierKind::None)) {
PreBarrierKind::Normal)) {
return false;
}
// Loop back if there are still elements to initialize
masm.branch32(Assembler::NotEqual, numElements, Imm32(0), &loop);
masm.bind(&done);
// Clean up
freePtr(rdata);
freeRef(rp);
freeI32(numElements);

View File

@ -1095,7 +1095,7 @@ class HashTableEntry {
void destroy() { destroyStoredT(); }
void swap(HashTableEntry* aOther, bool aIsLive) {
void swap(HashTableEntry* aOther, bool aOtherIsLive) {
// This allows types to use Argument-Dependent-Lookup, and thus use a custom
// std::swap, which is needed by types like JS::Heap and such.
using std::swap;
@ -1103,10 +1103,10 @@ class HashTableEntry {
if (this == aOther) {
return;
}
if (aIsLive) {
if (aOtherIsLive) {
swap(*valuePtr(), *aOther->valuePtr());
} else {
*aOther->valuePtr() = std::move(*valuePtr());
new (KnownNotNull, aOther->valuePtr()) NonConstT(std::move(*valuePtr()));
destroy();
}
}

View File

@ -658,7 +658,7 @@ class MOZ_GSL_POINTER Span {
constexpr Span<element_type, Count> Subspan() const {
const size_t len = size();
MOZ_RELEASE_ASSERT(Offset <= len &&
(Count == dynamic_extent || (Offset + Count <= len)));
(Count == dynamic_extent || (Count <= len - Offset)));
return {data() + Offset, Count == dynamic_extent ? len - Offset : Count};
}
@ -686,7 +686,7 @@ class MOZ_GSL_POINTER Span {
index_type aStart, index_type aLength = dynamic_extent) const {
const size_t len = size();
MOZ_RELEASE_ASSERT(aStart <= len && (aLength == dynamic_extent ||
(aStart + aLength <= len)));
(aLength <= len - aStart)));
return {data() + aStart,
aLength == dynamic_extent ? len - aStart : aLength};
}

View File

@ -24,10 +24,6 @@ static void MmapSIGBUSHandler(int signum, siginfo_t* info, void* context) {
MmapAccessScope* mas = sMmapAccessScope.get();
if (mas && mas->IsInsideBuffer(info->si_addr)) {
// Temporarily instead of handling the signal, we crash intentionally and
// send some diagnostic information to find out why the signal is received.
mas->CrashWithInfo(info->si_addr);
// The address is inside the buffer, handle the failure.
siglongjmp(mas->mJmpBuf, signum);
}

View File

@ -10,6 +10,7 @@
#include "mozilla/Assertions.h"
#include "mozilla/DynamicallyLinkedFunctionPtr.h"
#include "mozilla/WindowsVersion.h"
static_assert(sizeof(PROCESS_MITIGATION_DYNAMIC_CODE_POLICY) == 4);
@ -98,4 +99,54 @@ MFBT_API bool IsUserShadowStackEnabled() {
return polInfo.EnableUserShadowStack;
}
MFBT_API bool IsPreferLoadFromSystem32Available() {
return mozilla::IsWin10AnniversaryUpdateOrLater();
}
MFBT_API bool IsPreferLoadFromSystem32Enabled() {
auto pGetProcessMitigationPolicy = FetchGetProcessMitigationPolicyFunc();
if (!pGetProcessMitigationPolicy) {
return false;
}
PROCESS_MITIGATION_IMAGE_LOAD_POLICY imgLoadPol{};
if (!pGetProcessMitigationPolicy(::GetCurrentProcess(),
ProcessImageLoadPolicy, &imgLoadPol,
sizeof(imgLoadPol))) {
return false;
}
return imgLoadPol.PreferSystem32Images;
}
MFBT_API bool EnablePreferLoadFromSystem32() {
auto pGetProcessMitigationPolicy = FetchGetProcessMitigationPolicyFunc();
if (!pGetProcessMitigationPolicy) {
return false;
}
static const mozilla::StaticDynamicallyLinkedFunctionPtr<
decltype(&::SetProcessMitigationPolicy)>
pSetProcessMitigationPolicy(L"kernel32.dll",
"SetProcessMitigationPolicy");
if (!pSetProcessMitigationPolicy) {
return false;
}
PROCESS_MITIGATION_IMAGE_LOAD_POLICY imgLoadPol{};
if (!pGetProcessMitigationPolicy(::GetCurrentProcess(),
ProcessImageLoadPolicy, &imgLoadPol,
sizeof(imgLoadPol))) {
return false;
}
if (imgLoadPol.PreferSystem32Images) {
return true;
}
imgLoadPol.PreferSystem32Images = 1;
return pSetProcessMitigationPolicy(ProcessImageLoadPolicy, &imgLoadPol,
sizeof(imgLoadPol));
}
} // namespace mozilla

View File

@ -8,9 +8,9 @@ set -vx
NAME=spidermonkey
VERSION="140.7.0esr"
LIB_GIT_BRANCH=spidermonkey-esr140.7-cpp-only
LIB_GIT_REVISION=692674d55f1c4acfae4316efab0f79cd67250341
VERSION="140.9.0esr"
LIB_GIT_BRANCH=spidermonkey-esr140.9-cpp-only
LIB_GIT_REVISION=0f9cdced95d8cb9ce25e75c07327a8bd7a235523
LIB_GIT_REPO=git@github.com:mongodb-forks/spidermonkey.git
# If a local spidermonkey repo exists, this is much faster than fetching from git:
# LIB_GIT_REPO=/home/ubuntu/spidermonkey/.git
@ -22,8 +22,12 @@ LIB_GIT_DIR=$(mktemp -d /tmp/import-spidermonkey.XXXXXX)
# LIB_GIT_DIR=$(mktemp -d /z/import-spidermonkey.XXXXXX)
trap "rm -rf $LIB_GIT_DIR" EXIT
git clone $LIB_GIT_REPO $LIB_GIT_DIR
git -C $LIB_GIT_DIR checkout $LIB_GIT_REVISION
git clone \
--branch "$LIB_GIT_BRANCH" \
--depth 1 \
--single-branch \
"$LIB_GIT_REPO" \
"$LIB_GIT_DIR"
test -d $DEST_DIR/mozilla-release && rm -rf $DEST_DIR/mozilla-release
rm -rf $LIB_GIT_DIR/.git

View File

@ -78,23 +78,23 @@ inline bool ValidFD(T fd) {
return !!fd;
}
# define MMAP_FAULT_HANDLER_BEGIN_HANDLE(fd) \
{ \
void* mmapScopeBuf = nullptr; \
nsCString mmapScopeFilename; \
uint32_t mmapScopeBufLen = 0; \
if (ValidFD(fd) && fd->mMap) { \
mmapScopeBuf = (void*)fd->mFileStart; \
mmapScopeBufLen = fd->mTotalLen; \
} \
if (ValidFD(fd) && fd->mFile) { \
nsCOMPtr<nsIFile> file = fd->mFile.GetBaseFile(); \
if (file) { \
file->GetNativeLeafName(mmapScopeFilename); \
} \
} \
MmapAccessScope mmapScope(mmapScopeBuf, mmapScopeBufLen, \
mmapScopeFilename.get()); \
# define MMAP_FAULT_HANDLER_BEGIN_HANDLE(fd) \
{ \
void* mmapScopeBuf = nullptr; \
nsCString mmapScopeFilename; \
uint32_t mmapScopeBufLen = 0; \
if (ValidFD(fd) && fd->mFileStart && fd->mTotalLen > 0) { \
mmapScopeBuf = (void*)fd->mFileStart; \
mmapScopeBufLen = fd->mTotalLen; \
} \
if (ValidFD(fd) && fd->mFile) { \
nsCOMPtr<nsIFile> file = fd->mFile.GetBaseFile(); \
if (file) { \
file->GetNativeLeafName(mmapScopeFilename); \
} \
} \
MmapAccessScope mmapScope(mmapScopeBuf, mmapScopeBufLen, \
mmapScopeFilename.get()); \
if (sigsetjmp(mmapScope.mJmpBuf, 0) == 0) {
# define MMAP_FAULT_HANDLER_BEGIN_BUFFER(buf, bufLen) \
{ \

View File

@ -16,6 +16,9 @@ MFBT_API void SetWin32kLockedDownInPolicy();
MFBT_API bool IsDynamicCodeDisabled();
MFBT_API bool IsEafPlusEnabled();
MFBT_API bool IsUserShadowStackEnabled();
MFBT_API bool IsPreferLoadFromSystem32Available();
MFBT_API bool IsPreferLoadFromSystem32Enabled();
MFBT_API bool EnablePreferLoadFromSystem32();
} // namespace mozilla

View File

@ -21,8 +21,8 @@
namespace js {
namespace gc {
JS_PUBLIC_API void TraceRealm(JSTracer* trc, JS::Realm* realm,
const char* name);
JS_PUBLIC_API void TraceRealmRoot(JSTracer* trc, JS::Realm* realm,
const char* name);
} // namespace gc
} // namespace js
@ -34,7 +34,7 @@ template <>
struct GCPolicy<Realm*> : public NonGCPointerPolicy<Realm*> {
static void trace(JSTracer* trc, Realm** vp, const char* name) {
if (*vp) {
::js::gc::TraceRealm(trc, *vp, name);
::js::gc::TraceRealmRoot(trc, *vp, name);
}
}
};

View File

@ -426,7 +426,7 @@ constexpr uint64_t CanonicalizedNaNSignificand = 0x8000000000000;
#endif
#if defined(JS_RUNTIME_CANONICAL_NAN)
extern uint64_t CanonicalizedNaNBits;
extern JS_PUBLIC_API uint64_t CanonicalizedNaNBits;
#else
constexpr uint64_t CanonicalizedNaNBits =
mozilla::SpecificNaNBits<double, detail::CanonicalizedNaNSignBit,

View File

@ -1095,7 +1095,7 @@ class HashTableEntry {
void destroy() { destroyStoredT(); }
void swap(HashTableEntry* aOther, bool aIsLive) {
void swap(HashTableEntry* aOther, bool aOtherIsLive) {
// This allows types to use Argument-Dependent-Lookup, and thus use a custom
// std::swap, which is needed by types like JS::Heap and such.
using std::swap;
@ -1103,10 +1103,10 @@ class HashTableEntry {
if (this == aOther) {
return;
}
if (aIsLive) {
if (aOtherIsLive) {
swap(*valuePtr(), *aOther->valuePtr());
} else {
*aOther->valuePtr() = std::move(*valuePtr());
new (KnownNotNull, aOther->valuePtr()) NonConstT(std::move(*valuePtr()));
destroy();
}
}

View File

@ -78,23 +78,23 @@ inline bool ValidFD(T fd) {
return !!fd;
}
# define MMAP_FAULT_HANDLER_BEGIN_HANDLE(fd) \
{ \
void* mmapScopeBuf = nullptr; \
nsCString mmapScopeFilename; \
uint32_t mmapScopeBufLen = 0; \
if (ValidFD(fd) && fd->mMap) { \
mmapScopeBuf = (void*)fd->mFileStart; \
mmapScopeBufLen = fd->mTotalLen; \
} \
if (ValidFD(fd) && fd->mFile) { \
nsCOMPtr<nsIFile> file = fd->mFile.GetBaseFile(); \
if (file) { \
file->GetNativeLeafName(mmapScopeFilename); \
} \
} \
MmapAccessScope mmapScope(mmapScopeBuf, mmapScopeBufLen, \
mmapScopeFilename.get()); \
# define MMAP_FAULT_HANDLER_BEGIN_HANDLE(fd) \
{ \
void* mmapScopeBuf = nullptr; \
nsCString mmapScopeFilename; \
uint32_t mmapScopeBufLen = 0; \
if (ValidFD(fd) && fd->mFileStart && fd->mTotalLen > 0) { \
mmapScopeBuf = (void*)fd->mFileStart; \
mmapScopeBufLen = fd->mTotalLen; \
} \
if (ValidFD(fd) && fd->mFile) { \
nsCOMPtr<nsIFile> file = fd->mFile.GetBaseFile(); \
if (file) { \
file->GetNativeLeafName(mmapScopeFilename); \
} \
} \
MmapAccessScope mmapScope(mmapScopeBuf, mmapScopeBufLen, \
mmapScopeFilename.get()); \
if (sigsetjmp(mmapScope.mJmpBuf, 0) == 0) {
# define MMAP_FAULT_HANDLER_BEGIN_BUFFER(buf, bufLen) \
{ \

View File

@ -658,7 +658,7 @@ class MOZ_GSL_POINTER Span {
constexpr Span<element_type, Count> Subspan() const {
const size_t len = size();
MOZ_RELEASE_ASSERT(Offset <= len &&
(Count == dynamic_extent || (Offset + Count <= len)));
(Count == dynamic_extent || (Count <= len - Offset)));
return {data() + Offset, Count == dynamic_extent ? len - Offset : Count};
}
@ -686,7 +686,7 @@ class MOZ_GSL_POINTER Span {
index_type aStart, index_type aLength = dynamic_extent) const {
const size_t len = size();
MOZ_RELEASE_ASSERT(aStart <= len && (aLength == dynamic_extent ||
(aStart + aLength <= len)));
(aLength <= len - aStart)));
return {data() + aStart,
aLength == dynamic_extent ? len - aStart : aLength};
}

View File

@ -16,6 +16,9 @@ MFBT_API void SetWin32kLockedDownInPolicy();
MFBT_API bool IsDynamicCodeDisabled();
MFBT_API bool IsEafPlusEnabled();
MFBT_API bool IsUserShadowStackEnabled();
MFBT_API bool IsPreferLoadFromSystem32Available();
MFBT_API bool IsPreferLoadFromSystem32Enabled();
MFBT_API bool EnablePreferLoadFromSystem32();
} // namespace mozilla

View File

@ -71,9 +71,9 @@
#define MALLOC_H <malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "140.0"
#define MOZILLA_VERSION "140.7.0"
#define MOZILLA_VERSION "140.9.0"
#define MOZJS_MAJOR_VERSION 140
#define MOZJS_MINOR_VERSION 7
#define MOZJS_MINOR_VERSION 9
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"
#define MOZ_DLL_SUFFIX ".so"

View File

@ -1896,12 +1896,12 @@ void callScriptedSetter_(ObjOperandId receiver, JSObject* setter, ValOperandId r
}\
public:\
private:\
void callInlinedSetter_(ObjOperandId receiver, JSObject* setter, ValOperandId rhs, const void* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
void callInlinedSetter_(ObjOperandId receiver, JSObject* setter, ValOperandId rhs, const ICScript* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
writeOp(CacheOp::CallInlinedSetter);\
writeOperandId(receiver);\
writeObjectField(setter);\
writeOperandId(rhs);\
writeRawPointerField(icScript);\
writeICScriptField(icScript);\
writeBoolImm(sameRealm);\
writeRawInt32Field(nargsAndFlags);\
assertLengthMatches();\
@ -2056,11 +2056,11 @@ void callClassHook_(ObjOperandId callee, Int32OperandId argc, CallFlags flags, u
}\
public:\
private:\
void callInlinedFunction_(ObjOperandId callee, Int32OperandId argc, const void* icScript, CallFlags flags, uint32_t argcFixed) {\
void callInlinedFunction_(ObjOperandId callee, Int32OperandId argc, const ICScript* icScript, CallFlags flags, uint32_t argcFixed) {\
writeOp(CacheOp::CallInlinedFunction);\
writeOperandId(callee);\
writeOperandId(argc);\
writeRawPointerField(icScript);\
writeICScriptField(icScript);\
writeCallFlagsImm(flags);\
writeUInt32Imm(argcFixed);\
assertLengthMatches();\
@ -2406,11 +2406,11 @@ void callScriptedGetterResult_(ValOperandId receiver, JSObject* getter, bool sam
}\
public:\
private:\
void callInlinedGetterResult_(ValOperandId receiver, JSObject* getter, const void* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
void callInlinedGetterResult_(ValOperandId receiver, JSObject* getter, const ICScript* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
writeOp(CacheOp::CallInlinedGetterResult);\
writeOperandId(receiver);\
writeObjectField(getter);\
writeRawPointerField(icScript);\
writeICScriptField(icScript);\
writeBoolImm(sameRealm);\
writeRawInt32Field(nargsAndFlags);\
assertLengthMatches();\
@ -15723,8 +15723,8 @@ void cloneCallInlinedSetter(CacheIRReader& reader, CacheIRWriter& writer) {{\
ValOperandId rhsId = reader.valOperandId();\
writer.writeOperandId(rhsId);\
uint32_t icScriptOffset = reader.stubOffset();\
const void* icScript = getRawPointerField(icScriptOffset);\
writer.writeRawPointerField(icScript);\
const ICScript* icScript = getICScriptField(icScriptOffset);\
writer.writeICScriptField(icScript);\
bool sameRealm = reader.readBool();\
writer.writeBoolImm(sameRealm);\
uint32_t nargsAndFlagsOffset = reader.stubOffset();\
@ -15962,8 +15962,8 @@ void cloneCallInlinedFunction(CacheIRReader& reader, CacheIRWriter& writer) {{\
Int32OperandId argcId = reader.int32OperandId();\
writer.writeOperandId(argcId);\
uint32_t icScriptOffset = reader.stubOffset();\
const void* icScript = getRawPointerField(icScriptOffset);\
writer.writeRawPointerField(icScript);\
const ICScript* icScript = getICScriptField(icScriptOffset);\
writer.writeICScriptField(icScript);\
CallFlags flags = reader.callFlags();\
writer.writeCallFlagsImm(flags);\
uint32_t argcFixed = reader.uint32Immediate();\
@ -16476,8 +16476,8 @@ void cloneCallInlinedGetterResult(CacheIRReader& reader, CacheIRWriter& writer)
JSObject* getter = getObjectField(getterOffset);\
writer.writeObjectField(getter);\
uint32_t icScriptOffset = reader.stubOffset();\
const void* icScript = getRawPointerField(icScriptOffset);\
writer.writeRawPointerField(icScript);\
const ICScript* icScript = getICScriptField(icScriptOffset);\
writer.writeICScriptField(icScript);\
bool sameRealm = reader.readBool();\
writer.writeBoolImm(sameRealm);\
uint32_t nargsAndFlagsOffset = reader.stubOffset();\

View File

@ -71,9 +71,9 @@
#define MALLOC_H <malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "140.0"
#define MOZILLA_VERSION "140.7.0"
#define MOZILLA_VERSION "140.9.0"
#define MOZJS_MAJOR_VERSION 140
#define MOZJS_MINOR_VERSION 7
#define MOZJS_MINOR_VERSION 9
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"
#define MOZ_DLL_SUFFIX ".so"

View File

@ -66,7 +66,7 @@
/* MOZILLA JSAPI version number components */
#define MOZJS_MAJOR_VERSION 140
#define MOZJS_MINOR_VERSION 7
#define MOZJS_MINOR_VERSION 9
/* MONGODB MODIFICATION: Define based on platform */
/* #undef XP_WIN */

View File

@ -61,9 +61,9 @@
#define MALLOC_H <malloc/malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR const
#define MOZILLA_UAVERSION "140.0"
#define MOZILLA_VERSION "140.7.0"
#define MOZILLA_VERSION "140.9.0"
#define MOZJS_MAJOR_VERSION 140
#define MOZJS_MINOR_VERSION 7
#define MOZJS_MINOR_VERSION 9
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"
#define MOZ_DLL_SUFFIX ".dylib"

View File

@ -1896,12 +1896,12 @@ void callScriptedSetter_(ObjOperandId receiver, JSObject* setter, ValOperandId r
}\
public:\
private:\
void callInlinedSetter_(ObjOperandId receiver, JSObject* setter, ValOperandId rhs, const void* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
void callInlinedSetter_(ObjOperandId receiver, JSObject* setter, ValOperandId rhs, const ICScript* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
writeOp(CacheOp::CallInlinedSetter);\
writeOperandId(receiver);\
writeObjectField(setter);\
writeOperandId(rhs);\
writeRawPointerField(icScript);\
writeICScriptField(icScript);\
writeBoolImm(sameRealm);\
writeRawInt32Field(nargsAndFlags);\
assertLengthMatches();\
@ -2056,11 +2056,11 @@ void callClassHook_(ObjOperandId callee, Int32OperandId argc, CallFlags flags, u
}\
public:\
private:\
void callInlinedFunction_(ObjOperandId callee, Int32OperandId argc, const void* icScript, CallFlags flags, uint32_t argcFixed) {\
void callInlinedFunction_(ObjOperandId callee, Int32OperandId argc, const ICScript* icScript, CallFlags flags, uint32_t argcFixed) {\
writeOp(CacheOp::CallInlinedFunction);\
writeOperandId(callee);\
writeOperandId(argc);\
writeRawPointerField(icScript);\
writeICScriptField(icScript);\
writeCallFlagsImm(flags);\
writeUInt32Imm(argcFixed);\
assertLengthMatches();\
@ -2406,11 +2406,11 @@ void callScriptedGetterResult_(ValOperandId receiver, JSObject* getter, bool sam
}\
public:\
private:\
void callInlinedGetterResult_(ValOperandId receiver, JSObject* getter, const void* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
void callInlinedGetterResult_(ValOperandId receiver, JSObject* getter, const ICScript* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
writeOp(CacheOp::CallInlinedGetterResult);\
writeOperandId(receiver);\
writeObjectField(getter);\
writeRawPointerField(icScript);\
writeICScriptField(icScript);\
writeBoolImm(sameRealm);\
writeRawInt32Field(nargsAndFlags);\
assertLengthMatches();\
@ -15723,8 +15723,8 @@ void cloneCallInlinedSetter(CacheIRReader& reader, CacheIRWriter& writer) {{\
ValOperandId rhsId = reader.valOperandId();\
writer.writeOperandId(rhsId);\
uint32_t icScriptOffset = reader.stubOffset();\
const void* icScript = getRawPointerField(icScriptOffset);\
writer.writeRawPointerField(icScript);\
const ICScript* icScript = getICScriptField(icScriptOffset);\
writer.writeICScriptField(icScript);\
bool sameRealm = reader.readBool();\
writer.writeBoolImm(sameRealm);\
uint32_t nargsAndFlagsOffset = reader.stubOffset();\
@ -15962,8 +15962,8 @@ void cloneCallInlinedFunction(CacheIRReader& reader, CacheIRWriter& writer) {{\
Int32OperandId argcId = reader.int32OperandId();\
writer.writeOperandId(argcId);\
uint32_t icScriptOffset = reader.stubOffset();\
const void* icScript = getRawPointerField(icScriptOffset);\
writer.writeRawPointerField(icScript);\
const ICScript* icScript = getICScriptField(icScriptOffset);\
writer.writeICScriptField(icScript);\
CallFlags flags = reader.callFlags();\
writer.writeCallFlagsImm(flags);\
uint32_t argcFixed = reader.uint32Immediate();\
@ -16476,8 +16476,8 @@ void cloneCallInlinedGetterResult(CacheIRReader& reader, CacheIRWriter& writer)
JSObject* getter = getObjectField(getterOffset);\
writer.writeObjectField(getter);\
uint32_t icScriptOffset = reader.stubOffset();\
const void* icScript = getRawPointerField(icScriptOffset);\
writer.writeRawPointerField(icScript);\
const ICScript* icScript = getICScriptField(icScriptOffset);\
writer.writeICScriptField(icScript);\
bool sameRealm = reader.readBool();\
writer.writeBoolImm(sameRealm);\
uint32_t nargsAndFlagsOffset = reader.stubOffset();\

View File

@ -61,9 +61,9 @@
#define MALLOC_H <malloc/malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR const
#define MOZILLA_UAVERSION "140.0"
#define MOZILLA_VERSION "140.7.0"
#define MOZILLA_VERSION "140.9.0"
#define MOZJS_MAJOR_VERSION 140
#define MOZJS_MINOR_VERSION 7
#define MOZJS_MINOR_VERSION 9
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"
#define MOZ_DLL_SUFFIX ".dylib"

View File

@ -66,7 +66,7 @@
/* MOZILLA JSAPI version number components */
#define MOZJS_MAJOR_VERSION 140
#define MOZJS_MINOR_VERSION 7
#define MOZJS_MINOR_VERSION 9
/* MONGODB MODIFICATION: Define based on platform */
/* #undef XP_WIN */

View File

@ -73,9 +73,9 @@
#define MALLOC_H <malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "140.0"
#define MOZILLA_VERSION "140.7.0"
#define MOZILLA_VERSION "140.9.0"
#define MOZJS_MAJOR_VERSION 140
#define MOZJS_MINOR_VERSION 7
#define MOZJS_MINOR_VERSION 9
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"
#define MOZ_DLL_SUFFIX ".so"

View File

@ -1896,12 +1896,12 @@ void callScriptedSetter_(ObjOperandId receiver, JSObject* setter, ValOperandId r
}\
public:\
private:\
void callInlinedSetter_(ObjOperandId receiver, JSObject* setter, ValOperandId rhs, const void* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
void callInlinedSetter_(ObjOperandId receiver, JSObject* setter, ValOperandId rhs, const ICScript* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
writeOp(CacheOp::CallInlinedSetter);\
writeOperandId(receiver);\
writeObjectField(setter);\
writeOperandId(rhs);\
writeRawPointerField(icScript);\
writeICScriptField(icScript);\
writeBoolImm(sameRealm);\
writeRawInt32Field(nargsAndFlags);\
assertLengthMatches();\
@ -2056,11 +2056,11 @@ void callClassHook_(ObjOperandId callee, Int32OperandId argc, CallFlags flags, u
}\
public:\
private:\
void callInlinedFunction_(ObjOperandId callee, Int32OperandId argc, const void* icScript, CallFlags flags, uint32_t argcFixed) {\
void callInlinedFunction_(ObjOperandId callee, Int32OperandId argc, const ICScript* icScript, CallFlags flags, uint32_t argcFixed) {\
writeOp(CacheOp::CallInlinedFunction);\
writeOperandId(callee);\
writeOperandId(argc);\
writeRawPointerField(icScript);\
writeICScriptField(icScript);\
writeCallFlagsImm(flags);\
writeUInt32Imm(argcFixed);\
assertLengthMatches();\
@ -2406,11 +2406,11 @@ void callScriptedGetterResult_(ValOperandId receiver, JSObject* getter, bool sam
}\
public:\
private:\
void callInlinedGetterResult_(ValOperandId receiver, JSObject* getter, const void* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
void callInlinedGetterResult_(ValOperandId receiver, JSObject* getter, const ICScript* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
writeOp(CacheOp::CallInlinedGetterResult);\
writeOperandId(receiver);\
writeObjectField(getter);\
writeRawPointerField(icScript);\
writeICScriptField(icScript);\
writeBoolImm(sameRealm);\
writeRawInt32Field(nargsAndFlags);\
assertLengthMatches();\
@ -15723,8 +15723,8 @@ void cloneCallInlinedSetter(CacheIRReader& reader, CacheIRWriter& writer) {{\
ValOperandId rhsId = reader.valOperandId();\
writer.writeOperandId(rhsId);\
uint32_t icScriptOffset = reader.stubOffset();\
const void* icScript = getRawPointerField(icScriptOffset);\
writer.writeRawPointerField(icScript);\
const ICScript* icScript = getICScriptField(icScriptOffset);\
writer.writeICScriptField(icScript);\
bool sameRealm = reader.readBool();\
writer.writeBoolImm(sameRealm);\
uint32_t nargsAndFlagsOffset = reader.stubOffset();\
@ -15962,8 +15962,8 @@ void cloneCallInlinedFunction(CacheIRReader& reader, CacheIRWriter& writer) {{\
Int32OperandId argcId = reader.int32OperandId();\
writer.writeOperandId(argcId);\
uint32_t icScriptOffset = reader.stubOffset();\
const void* icScript = getRawPointerField(icScriptOffset);\
writer.writeRawPointerField(icScript);\
const ICScript* icScript = getICScriptField(icScriptOffset);\
writer.writeICScriptField(icScript);\
CallFlags flags = reader.callFlags();\
writer.writeCallFlagsImm(flags);\
uint32_t argcFixed = reader.uint32Immediate();\
@ -16476,8 +16476,8 @@ void cloneCallInlinedGetterResult(CacheIRReader& reader, CacheIRWriter& writer)
JSObject* getter = getObjectField(getterOffset);\
writer.writeObjectField(getter);\
uint32_t icScriptOffset = reader.stubOffset();\
const void* icScript = getRawPointerField(icScriptOffset);\
writer.writeRawPointerField(icScript);\
const ICScript* icScript = getICScriptField(icScriptOffset);\
writer.writeICScriptField(icScript);\
bool sameRealm = reader.readBool();\
writer.writeBoolImm(sameRealm);\
uint32_t nargsAndFlagsOffset = reader.stubOffset();\

View File

@ -73,9 +73,9 @@
#define MALLOC_H <malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "140.0"
#define MOZILLA_VERSION "140.7.0"
#define MOZILLA_VERSION "140.9.0"
#define MOZJS_MAJOR_VERSION 140
#define MOZJS_MINOR_VERSION 7
#define MOZJS_MINOR_VERSION 9
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"
#define MOZ_DLL_SUFFIX ".so"

View File

@ -66,7 +66,7 @@
/* MOZILLA JSAPI version number components */
#define MOZJS_MAJOR_VERSION 140
#define MOZJS_MINOR_VERSION 7
#define MOZJS_MINOR_VERSION 9
/* MONGODB MODIFICATION: Define based on platform */
/* #undef XP_WIN */

View File

@ -27,7 +27,6 @@
#define HAVE_GETC_UNLOCKED 1
#define HAVE_GETOPT_H 1
#define HAVE_GETPAGESIZE 1
#define HAVE_GETTID 1
#define HAVE_GMTIME_R 1
#define HAVE_INTTYPES_H 1
#define HAVE_LINUX_IF_ADDR_H 1
@ -42,7 +41,6 @@
#define HAVE_NETINET_IN_H 1
#define HAVE_NL_TYPES_H 1
#define HAVE_POSIX_MEMALIGN 1
#define HAVE_PTHREAD_GETNAME_NP 1
#define HAVE_PTHREAD_H 1
#define HAVE_RES_NINIT 1
#define HAVE_SETPRIORITY 1
@ -73,9 +71,9 @@
#define MALLOC_H <malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "140.0"
#define MOZILLA_VERSION "140.7.0"
#define MOZILLA_VERSION "140.9.0"
#define MOZJS_MAJOR_VERSION 140
#define MOZJS_MINOR_VERSION 7
#define MOZJS_MINOR_VERSION 9
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"
#define MOZ_DLL_SUFFIX ".so"

View File

@ -1896,12 +1896,12 @@ void callScriptedSetter_(ObjOperandId receiver, JSObject* setter, ValOperandId r
}\
public:\
private:\
void callInlinedSetter_(ObjOperandId receiver, JSObject* setter, ValOperandId rhs, const void* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
void callInlinedSetter_(ObjOperandId receiver, JSObject* setter, ValOperandId rhs, const ICScript* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
writeOp(CacheOp::CallInlinedSetter);\
writeOperandId(receiver);\
writeObjectField(setter);\
writeOperandId(rhs);\
writeRawPointerField(icScript);\
writeICScriptField(icScript);\
writeBoolImm(sameRealm);\
writeRawInt32Field(nargsAndFlags);\
assertLengthMatches();\
@ -2056,11 +2056,11 @@ void callClassHook_(ObjOperandId callee, Int32OperandId argc, CallFlags flags, u
}\
public:\
private:\
void callInlinedFunction_(ObjOperandId callee, Int32OperandId argc, const void* icScript, CallFlags flags, uint32_t argcFixed) {\
void callInlinedFunction_(ObjOperandId callee, Int32OperandId argc, const ICScript* icScript, CallFlags flags, uint32_t argcFixed) {\
writeOp(CacheOp::CallInlinedFunction);\
writeOperandId(callee);\
writeOperandId(argc);\
writeRawPointerField(icScript);\
writeICScriptField(icScript);\
writeCallFlagsImm(flags);\
writeUInt32Imm(argcFixed);\
assertLengthMatches();\
@ -2406,11 +2406,11 @@ void callScriptedGetterResult_(ValOperandId receiver, JSObject* getter, bool sam
}\
public:\
private:\
void callInlinedGetterResult_(ValOperandId receiver, JSObject* getter, const void* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
void callInlinedGetterResult_(ValOperandId receiver, JSObject* getter, const ICScript* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
writeOp(CacheOp::CallInlinedGetterResult);\
writeOperandId(receiver);\
writeObjectField(getter);\
writeRawPointerField(icScript);\
writeICScriptField(icScript);\
writeBoolImm(sameRealm);\
writeRawInt32Field(nargsAndFlags);\
assertLengthMatches();\
@ -15723,8 +15723,8 @@ void cloneCallInlinedSetter(CacheIRReader& reader, CacheIRWriter& writer) {{\
ValOperandId rhsId = reader.valOperandId();\
writer.writeOperandId(rhsId);\
uint32_t icScriptOffset = reader.stubOffset();\
const void* icScript = getRawPointerField(icScriptOffset);\
writer.writeRawPointerField(icScript);\
const ICScript* icScript = getICScriptField(icScriptOffset);\
writer.writeICScriptField(icScript);\
bool sameRealm = reader.readBool();\
writer.writeBoolImm(sameRealm);\
uint32_t nargsAndFlagsOffset = reader.stubOffset();\
@ -15962,8 +15962,8 @@ void cloneCallInlinedFunction(CacheIRReader& reader, CacheIRWriter& writer) {{\
Int32OperandId argcId = reader.int32OperandId();\
writer.writeOperandId(argcId);\
uint32_t icScriptOffset = reader.stubOffset();\
const void* icScript = getRawPointerField(icScriptOffset);\
writer.writeRawPointerField(icScript);\
const ICScript* icScript = getICScriptField(icScriptOffset);\
writer.writeICScriptField(icScript);\
CallFlags flags = reader.callFlags();\
writer.writeCallFlagsImm(flags);\
uint32_t argcFixed = reader.uint32Immediate();\
@ -16476,8 +16476,8 @@ void cloneCallInlinedGetterResult(CacheIRReader& reader, CacheIRWriter& writer)
JSObject* getter = getObjectField(getterOffset);\
writer.writeObjectField(getter);\
uint32_t icScriptOffset = reader.stubOffset();\
const void* icScript = getRawPointerField(icScriptOffset);\
writer.writeRawPointerField(icScript);\
const ICScript* icScript = getICScriptField(icScriptOffset);\
writer.writeICScriptField(icScript);\
bool sameRealm = reader.readBool();\
writer.writeBoolImm(sameRealm);\
uint32_t nargsAndFlagsOffset = reader.stubOffset();\

View File

@ -27,7 +27,6 @@
#define HAVE_GETC_UNLOCKED 1
#define HAVE_GETOPT_H 1
#define HAVE_GETPAGESIZE 1
#define HAVE_GETTID 1
#define HAVE_GMTIME_R 1
#define HAVE_INTTYPES_H 1
#define HAVE_LINUX_IF_ADDR_H 1
@ -42,7 +41,6 @@
#define HAVE_NETINET_IN_H 1
#define HAVE_NL_TYPES_H 1
#define HAVE_POSIX_MEMALIGN 1
#define HAVE_PTHREAD_GETNAME_NP 1
#define HAVE_PTHREAD_H 1
#define HAVE_RES_NINIT 1
#define HAVE_SETPRIORITY 1
@ -73,9 +71,9 @@
#define MALLOC_H <malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "140.0"
#define MOZILLA_VERSION "140.7.0"
#define MOZILLA_VERSION "140.9.0"
#define MOZJS_MAJOR_VERSION 140
#define MOZJS_MINOR_VERSION 7
#define MOZJS_MINOR_VERSION 9
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"
#define MOZ_DLL_SUFFIX ".so"

View File

@ -66,7 +66,7 @@
/* MOZILLA JSAPI version number components */
#define MOZJS_MAJOR_VERSION 140
#define MOZJS_MINOR_VERSION 7
#define MOZJS_MINOR_VERSION 9
/* MONGODB MODIFICATION: Define based on platform */
/* #undef XP_WIN */

File diff suppressed because one or more lines are too long

View File

@ -74,9 +74,9 @@
#define MALLOC_H <malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "140.0"
#define MOZILLA_VERSION "140.7.0"
#define MOZILLA_VERSION "140.9.0"
#define MOZJS_MAJOR_VERSION 140
#define MOZJS_MINOR_VERSION 7
#define MOZJS_MINOR_VERSION 9
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"
#define MOZ_DLL_SUFFIX ".so"

View File

@ -1896,12 +1896,12 @@ void callScriptedSetter_(ObjOperandId receiver, JSObject* setter, ValOperandId r
}\
public:\
private:\
void callInlinedSetter_(ObjOperandId receiver, JSObject* setter, ValOperandId rhs, const void* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
void callInlinedSetter_(ObjOperandId receiver, JSObject* setter, ValOperandId rhs, const ICScript* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
writeOp(CacheOp::CallInlinedSetter);\
writeOperandId(receiver);\
writeObjectField(setter);\
writeOperandId(rhs);\
writeRawPointerField(icScript);\
writeICScriptField(icScript);\
writeBoolImm(sameRealm);\
writeRawInt32Field(nargsAndFlags);\
assertLengthMatches();\
@ -2056,11 +2056,11 @@ void callClassHook_(ObjOperandId callee, Int32OperandId argc, CallFlags flags, u
}\
public:\
private:\
void callInlinedFunction_(ObjOperandId callee, Int32OperandId argc, const void* icScript, CallFlags flags, uint32_t argcFixed) {\
void callInlinedFunction_(ObjOperandId callee, Int32OperandId argc, const ICScript* icScript, CallFlags flags, uint32_t argcFixed) {\
writeOp(CacheOp::CallInlinedFunction);\
writeOperandId(callee);\
writeOperandId(argc);\
writeRawPointerField(icScript);\
writeICScriptField(icScript);\
writeCallFlagsImm(flags);\
writeUInt32Imm(argcFixed);\
assertLengthMatches();\
@ -2406,11 +2406,11 @@ void callScriptedGetterResult_(ValOperandId receiver, JSObject* getter, bool sam
}\
public:\
private:\
void callInlinedGetterResult_(ValOperandId receiver, JSObject* getter, const void* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
void callInlinedGetterResult_(ValOperandId receiver, JSObject* getter, const ICScript* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
writeOp(CacheOp::CallInlinedGetterResult);\
writeOperandId(receiver);\
writeObjectField(getter);\
writeRawPointerField(icScript);\
writeICScriptField(icScript);\
writeBoolImm(sameRealm);\
writeRawInt32Field(nargsAndFlags);\
assertLengthMatches();\
@ -15723,8 +15723,8 @@ void cloneCallInlinedSetter(CacheIRReader& reader, CacheIRWriter& writer) {{\
ValOperandId rhsId = reader.valOperandId();\
writer.writeOperandId(rhsId);\
uint32_t icScriptOffset = reader.stubOffset();\
const void* icScript = getRawPointerField(icScriptOffset);\
writer.writeRawPointerField(icScript);\
const ICScript* icScript = getICScriptField(icScriptOffset);\
writer.writeICScriptField(icScript);\
bool sameRealm = reader.readBool();\
writer.writeBoolImm(sameRealm);\
uint32_t nargsAndFlagsOffset = reader.stubOffset();\
@ -15962,8 +15962,8 @@ void cloneCallInlinedFunction(CacheIRReader& reader, CacheIRWriter& writer) {{\
Int32OperandId argcId = reader.int32OperandId();\
writer.writeOperandId(argcId);\
uint32_t icScriptOffset = reader.stubOffset();\
const void* icScript = getRawPointerField(icScriptOffset);\
writer.writeRawPointerField(icScript);\
const ICScript* icScript = getICScriptField(icScriptOffset);\
writer.writeICScriptField(icScript);\
CallFlags flags = reader.callFlags();\
writer.writeCallFlagsImm(flags);\
uint32_t argcFixed = reader.uint32Immediate();\
@ -16476,8 +16476,8 @@ void cloneCallInlinedGetterResult(CacheIRReader& reader, CacheIRWriter& writer)
JSObject* getter = getObjectField(getterOffset);\
writer.writeObjectField(getter);\
uint32_t icScriptOffset = reader.stubOffset();\
const void* icScript = getRawPointerField(icScriptOffset);\
writer.writeRawPointerField(icScript);\
const ICScript* icScript = getICScriptField(icScriptOffset);\
writer.writeICScriptField(icScript);\
bool sameRealm = reader.readBool();\
writer.writeBoolImm(sameRealm);\
uint32_t nargsAndFlagsOffset = reader.stubOffset();\

View File

@ -74,9 +74,9 @@
#define MALLOC_H <malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "140.0"
#define MOZILLA_VERSION "140.7.0"
#define MOZILLA_VERSION "140.9.0"
#define MOZJS_MAJOR_VERSION 140
#define MOZJS_MINOR_VERSION 7
#define MOZJS_MINOR_VERSION 9
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"
#define MOZ_DLL_SUFFIX ".so"

View File

@ -66,7 +66,7 @@
/* MOZILLA JSAPI version number components */
#define MOZJS_MAJOR_VERSION 140
#define MOZJS_MINOR_VERSION 7
#define MOZJS_MINOR_VERSION 9
/* MONGODB MODIFICATION: Define based on platform */
/* #undef XP_WIN */

View File

@ -61,9 +61,9 @@
#define MALLOC_H <malloc/malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR const
#define MOZILLA_UAVERSION "140.0"
#define MOZILLA_VERSION "140.7.0"
#define MOZILLA_VERSION "140.9.0"
#define MOZJS_MAJOR_VERSION 140
#define MOZJS_MINOR_VERSION 7
#define MOZJS_MINOR_VERSION 9
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"
#define MOZ_DLL_SUFFIX ".dylib"

View File

@ -1896,12 +1896,12 @@ void callScriptedSetter_(ObjOperandId receiver, JSObject* setter, ValOperandId r
}\
public:\
private:\
void callInlinedSetter_(ObjOperandId receiver, JSObject* setter, ValOperandId rhs, const void* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
void callInlinedSetter_(ObjOperandId receiver, JSObject* setter, ValOperandId rhs, const ICScript* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
writeOp(CacheOp::CallInlinedSetter);\
writeOperandId(receiver);\
writeObjectField(setter);\
writeOperandId(rhs);\
writeRawPointerField(icScript);\
writeICScriptField(icScript);\
writeBoolImm(sameRealm);\
writeRawInt32Field(nargsAndFlags);\
assertLengthMatches();\
@ -2056,11 +2056,11 @@ void callClassHook_(ObjOperandId callee, Int32OperandId argc, CallFlags flags, u
}\
public:\
private:\
void callInlinedFunction_(ObjOperandId callee, Int32OperandId argc, const void* icScript, CallFlags flags, uint32_t argcFixed) {\
void callInlinedFunction_(ObjOperandId callee, Int32OperandId argc, const ICScript* icScript, CallFlags flags, uint32_t argcFixed) {\
writeOp(CacheOp::CallInlinedFunction);\
writeOperandId(callee);\
writeOperandId(argc);\
writeRawPointerField(icScript);\
writeICScriptField(icScript);\
writeCallFlagsImm(flags);\
writeUInt32Imm(argcFixed);\
assertLengthMatches();\
@ -2406,11 +2406,11 @@ void callScriptedGetterResult_(ValOperandId receiver, JSObject* getter, bool sam
}\
public:\
private:\
void callInlinedGetterResult_(ValOperandId receiver, JSObject* getter, const void* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
void callInlinedGetterResult_(ValOperandId receiver, JSObject* getter, const ICScript* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
writeOp(CacheOp::CallInlinedGetterResult);\
writeOperandId(receiver);\
writeObjectField(getter);\
writeRawPointerField(icScript);\
writeICScriptField(icScript);\
writeBoolImm(sameRealm);\
writeRawInt32Field(nargsAndFlags);\
assertLengthMatches();\
@ -15723,8 +15723,8 @@ void cloneCallInlinedSetter(CacheIRReader& reader, CacheIRWriter& writer) {{\
ValOperandId rhsId = reader.valOperandId();\
writer.writeOperandId(rhsId);\
uint32_t icScriptOffset = reader.stubOffset();\
const void* icScript = getRawPointerField(icScriptOffset);\
writer.writeRawPointerField(icScript);\
const ICScript* icScript = getICScriptField(icScriptOffset);\
writer.writeICScriptField(icScript);\
bool sameRealm = reader.readBool();\
writer.writeBoolImm(sameRealm);\
uint32_t nargsAndFlagsOffset = reader.stubOffset();\
@ -15962,8 +15962,8 @@ void cloneCallInlinedFunction(CacheIRReader& reader, CacheIRWriter& writer) {{\
Int32OperandId argcId = reader.int32OperandId();\
writer.writeOperandId(argcId);\
uint32_t icScriptOffset = reader.stubOffset();\
const void* icScript = getRawPointerField(icScriptOffset);\
writer.writeRawPointerField(icScript);\
const ICScript* icScript = getICScriptField(icScriptOffset);\
writer.writeICScriptField(icScript);\
CallFlags flags = reader.callFlags();\
writer.writeCallFlagsImm(flags);\
uint32_t argcFixed = reader.uint32Immediate();\
@ -16476,8 +16476,8 @@ void cloneCallInlinedGetterResult(CacheIRReader& reader, CacheIRWriter& writer)
JSObject* getter = getObjectField(getterOffset);\
writer.writeObjectField(getter);\
uint32_t icScriptOffset = reader.stubOffset();\
const void* icScript = getRawPointerField(icScriptOffset);\
writer.writeRawPointerField(icScript);\
const ICScript* icScript = getICScriptField(icScriptOffset);\
writer.writeICScriptField(icScript);\
bool sameRealm = reader.readBool();\
writer.writeBoolImm(sameRealm);\
uint32_t nargsAndFlagsOffset = reader.stubOffset();\

View File

@ -61,9 +61,9 @@
#define MALLOC_H <malloc/malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR const
#define MOZILLA_UAVERSION "140.0"
#define MOZILLA_VERSION "140.7.0"
#define MOZILLA_VERSION "140.9.0"
#define MOZJS_MAJOR_VERSION 140
#define MOZJS_MINOR_VERSION 7
#define MOZJS_MINOR_VERSION 9
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX "lib"
#define MOZ_DLL_SUFFIX ".dylib"

View File

@ -66,7 +66,7 @@
/* MOZILLA JSAPI version number components */
#define MOZJS_MAJOR_VERSION 140
#define MOZJS_MINOR_VERSION 7
#define MOZJS_MINOR_VERSION 9
/* MONGODB MODIFICATION: Define based on platform */
/* #undef XP_WIN */

View File

@ -36,9 +36,9 @@
#define MALLOC_H <malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "140.0"
#define MOZILLA_VERSION "140.7.0"
#define MOZILLA_VERSION "140.9.0"
#define MOZJS_MAJOR_VERSION 140
#define MOZJS_MINOR_VERSION 7
#define MOZJS_MINOR_VERSION 9
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX ""
#define MOZ_DLL_SUFFIX ".dll"

View File

@ -1896,12 +1896,12 @@ void callScriptedSetter_(ObjOperandId receiver, JSObject* setter, ValOperandId r
}\
public:\
private:\
void callInlinedSetter_(ObjOperandId receiver, JSObject* setter, ValOperandId rhs, const void* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
void callInlinedSetter_(ObjOperandId receiver, JSObject* setter, ValOperandId rhs, const ICScript* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
writeOp(CacheOp::CallInlinedSetter);\
writeOperandId(receiver);\
writeObjectField(setter);\
writeOperandId(rhs);\
writeRawPointerField(icScript);\
writeICScriptField(icScript);\
writeBoolImm(sameRealm);\
writeRawInt32Field(nargsAndFlags);\
assertLengthMatches();\
@ -2056,11 +2056,11 @@ void callClassHook_(ObjOperandId callee, Int32OperandId argc, CallFlags flags, u
}\
public:\
private:\
void callInlinedFunction_(ObjOperandId callee, Int32OperandId argc, const void* icScript, CallFlags flags, uint32_t argcFixed) {\
void callInlinedFunction_(ObjOperandId callee, Int32OperandId argc, const ICScript* icScript, CallFlags flags, uint32_t argcFixed) {\
writeOp(CacheOp::CallInlinedFunction);\
writeOperandId(callee);\
writeOperandId(argc);\
writeRawPointerField(icScript);\
writeICScriptField(icScript);\
writeCallFlagsImm(flags);\
writeUInt32Imm(argcFixed);\
assertLengthMatches();\
@ -2406,11 +2406,11 @@ void callScriptedGetterResult_(ValOperandId receiver, JSObject* getter, bool sam
}\
public:\
private:\
void callInlinedGetterResult_(ValOperandId receiver, JSObject* getter, const void* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
void callInlinedGetterResult_(ValOperandId receiver, JSObject* getter, const ICScript* icScript, bool sameRealm, uint32_t nargsAndFlags) {\
writeOp(CacheOp::CallInlinedGetterResult);\
writeOperandId(receiver);\
writeObjectField(getter);\
writeRawPointerField(icScript);\
writeICScriptField(icScript);\
writeBoolImm(sameRealm);\
writeRawInt32Field(nargsAndFlags);\
assertLengthMatches();\
@ -15723,8 +15723,8 @@ void cloneCallInlinedSetter(CacheIRReader& reader, CacheIRWriter& writer) {{\
ValOperandId rhsId = reader.valOperandId();\
writer.writeOperandId(rhsId);\
uint32_t icScriptOffset = reader.stubOffset();\
const void* icScript = getRawPointerField(icScriptOffset);\
writer.writeRawPointerField(icScript);\
const ICScript* icScript = getICScriptField(icScriptOffset);\
writer.writeICScriptField(icScript);\
bool sameRealm = reader.readBool();\
writer.writeBoolImm(sameRealm);\
uint32_t nargsAndFlagsOffset = reader.stubOffset();\
@ -15962,8 +15962,8 @@ void cloneCallInlinedFunction(CacheIRReader& reader, CacheIRWriter& writer) {{\
Int32OperandId argcId = reader.int32OperandId();\
writer.writeOperandId(argcId);\
uint32_t icScriptOffset = reader.stubOffset();\
const void* icScript = getRawPointerField(icScriptOffset);\
writer.writeRawPointerField(icScript);\
const ICScript* icScript = getICScriptField(icScriptOffset);\
writer.writeICScriptField(icScript);\
CallFlags flags = reader.callFlags();\
writer.writeCallFlagsImm(flags);\
uint32_t argcFixed = reader.uint32Immediate();\
@ -16476,8 +16476,8 @@ void cloneCallInlinedGetterResult(CacheIRReader& reader, CacheIRWriter& writer)
JSObject* getter = getObjectField(getterOffset);\
writer.writeObjectField(getter);\
uint32_t icScriptOffset = reader.stubOffset();\
const void* icScript = getRawPointerField(icScriptOffset);\
writer.writeRawPointerField(icScript);\
const ICScript* icScript = getICScriptField(icScriptOffset);\
writer.writeICScriptField(icScript);\
bool sameRealm = reader.readBool();\
writer.writeBoolImm(sameRealm);\
uint32_t nargsAndFlagsOffset = reader.stubOffset();\

View File

@ -36,9 +36,9 @@
#define MALLOC_H <malloc.h>
#define MALLOC_USABLE_SIZE_CONST_PTR
#define MOZILLA_UAVERSION "140.0"
#define MOZILLA_VERSION "140.7.0"
#define MOZILLA_VERSION "140.9.0"
#define MOZJS_MAJOR_VERSION 140
#define MOZJS_MINOR_VERSION 7
#define MOZJS_MINOR_VERSION 9
#define MOZ_BUILD_APP js
#define MOZ_DLL_PREFIX ""
#define MOZ_DLL_SUFFIX ".dll"

View File

@ -66,7 +66,7 @@
/* MOZILLA JSAPI version number components */
#define MOZJS_MAJOR_VERSION 140
#define MOZJS_MINOR_VERSION 7
#define MOZJS_MINOR_VERSION 9
/* MONGODB MODIFICATION: Define based on platform */
#define XP_WIN 1