diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:40:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:40:49 +0000 |
commit | 293d3ceaedc60c45e9abe78fee1480d8fb0aae95 (patch) | |
tree | 13860e4bbb3aba054d735643c3d3cf651de11e36 /js/src/vm/JSObject.cpp | |
parent | Adding upstream version 115.11.0esr. (diff) | |
download | firefox-esr-293d3ceaedc60c45e9abe78fee1480d8fb0aae95.tar.xz firefox-esr-293d3ceaedc60c45e9abe78fee1480d8fb0aae95.zip |
Adding upstream version 115.12.0esr.upstream/115.12.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/vm/JSObject.cpp')
-rw-r--r-- | js/src/vm/JSObject.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/js/src/vm/JSObject.cpp b/js/src/vm/JSObject.cpp index 292971cf3e..4398725fde 100644 --- a/js/src/vm/JSObject.cpp +++ b/js/src/vm/JSObject.cpp @@ -1221,6 +1221,10 @@ void JSObject::swap(JSContext* cx, HandleObject a, HandleObject b, MOZ_RELEASE_ASSERT(js::ObjectMayBeSwapped(a)); MOZ_RELEASE_ASSERT(js::ObjectMayBeSwapped(b)); + // Don't allow a GC which may observe intermediate state or run before we + // execute all necessary barriers. + gc::AutoSuppressGC nogc(cx); + if (!Watchtower::watchObjectSwap(cx, a, b)) { oomUnsafe.crash("watchObjectSwap"); } @@ -1311,10 +1315,6 @@ void JSObject::swap(JSContext* cx, HandleObject a, HandleObject b, a->as<ProxyObject>().setInlineValueArray(); } } else { - // Avoid GC in here to avoid confusing the tracing code with our - // intermediate state. - gc::AutoSuppressGC suppress(cx); - // When the objects have different sizes, they will have different numbers // of fixed slots before and after the swap, so the slots for native objects // will need to be rearranged. Remember the original values from the |