Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 394f089

Browse files
committed
Bug 1706694 - Simplify use of Add/RemoveCellMemory r=jandem
These already check whether the associated cell is tenured so we can remove the extra checks. Depends on D113317 Differential Revision: https://phabricator.services.mozilla.com/D113506
1 parent c07c8f2 commit 394f089

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

js/src/vm/StringType.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -858,18 +858,13 @@ finish_node : {
858858
StringFlagsForCharType<CharT>(EXTENSIBLE_FLAGS));
859859
root->setNonInlineChars(wholeChars);
860860
root->d.s.u3.capacity = wholeCapacity;
861-
if (root->isTenured()) {
862-
AddCellMemory(root, root->asLinear().allocSize(),
863-
MemoryUse::StringContents);
864-
}
861+
AddCellMemory(root, root->asLinear().allocSize(), MemoryUse::StringContents);
865862

866863
if (reuseLeftmostBuffer) {
867864
// Remove memory association for left node we're about to make into a
868865
// dependent string.
869866
JSString& left = *leftmostChild;
870-
if (left.isTenured()) {
871-
RemoveCellMemory(&left, left.allocSize(), MemoryUse::StringContents);
872-
}
867+
RemoveCellMemory(&left, left.allocSize(), MemoryUse::StringContents);
873868

874869
uint32_t flags = INIT_DEPENDENT_FLAGS;
875870
if (left.inStringToAtomCache()) {

0 commit comments

Comments
 (0)