Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[JSC] SmallStringsStorage is unnecessary
https://bugs.webkit.org/show_bug.cgi?id=194939 Reviewed by Mark Lam. SmallStrings hold common small JSStrings. Their underlying StringImpl is also held by SmallStringsStorage. But it is duplicate since we can get StringImpl from small JSStrings. This patch removes SmallStringsStorage, and get StringImpls from JSStrings if necessary. We also add m_canAccessHeap flag to SmallStrings. At the time of VM destruction, JSStrings are destroyed when VM's Heap is finalized. We must not touch JSStrings before VM's heap (and JSStrings in SmallStrings) is initialized, and after VM's Heap is destroyed. We add this m_canAccessHeap flag to allow users to get StringImpl during the this sensitive period. If m_canAccessHeap is false, we get StringImpl from AtomicStringImpl::add. * runtime/SmallStrings.cpp: (JSC::SmallStrings::initializeCommonStrings): (JSC::SmallStrings::singleCharacterStringRep): (JSC::SmallStringsStorage::rep): Deleted. (JSC::SmallStringsStorage::SmallStringsStorage): Deleted. (JSC::SmallStrings::createSingleCharacterString): Deleted. * runtime/SmallStrings.h: (JSC::SmallStrings::setCanAccessHeap): * runtime/VM.cpp: (JSC::VM::VM): (JSC::VM::~VM): Canonical link: https://commits.webkit.org/209313@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241954 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
447be36
commit e4fc3ca
Showing
4 changed files
with
53 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters