Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r241954,r241955 - [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):
- Loading branch information
1 parent
87ff66e
commit ac6f53f
Showing
4 changed files
with
65 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