From 8a0dc2256e32b605e1c591b741af6772d86ead37 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Bargull?= Date: Wed, 3 Apr 2024 07:47:10 +0000 Subject: [PATCH] Bug 1885489 - Part 10: Add SnapshotIterator::readGCCellPtr(). r=iain Depends on D205810 Differential Revision: https://phabricator.services.mozilla.com/D205811 --- js/src/jit/JSJitFrameIter.h | 6 ++++++ js/src/jit/Recover.cpp | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/js/src/jit/JSJitFrameIter.h b/js/src/jit/JSJitFrameIter.h index f5966879dd05..e6d370dae3e3 100644 --- a/js/src/jit/JSJitFrameIter.h +++ b/js/src/jit/JSJitFrameIter.h @@ -525,6 +525,12 @@ class SnapshotIterator { return &val.toObject(); } + JS::GCCellPtr readGCCellPtr() { + Value val = read(); + MOZ_RELEASE_ASSERT(val.isGCThing()); + return val.toGCCellPtr(); + } + // Read the |Normal| value unless it is not available and that the snapshot // provides a |Default| value. This is useful to avoid invalidations of the // frame while we are only interested in a few properties which are provided diff --git a/js/src/jit/Recover.cpp b/js/src/jit/Recover.cpp index 6e9414327920..bff7c3196b49 100644 --- a/js/src/jit/Recover.cpp +++ b/js/src/jit/Recover.cpp @@ -1624,8 +1624,7 @@ RNewPlainObject::RNewPlainObject(CompactBufferReader& reader) { } bool RNewPlainObject::recover(JSContext* cx, SnapshotIterator& iter) const { - Rooted shape(cx, - &iter.read().toGCCellPtr().as().asShared()); + Rooted shape(cx, &iter.readGCCellPtr().as().asShared()); // See CodeGenerator::visitNewPlainObject. JSObject* resultObject = -- 2.11.4.GIT