Changeset 225315 in webkit for trunk/Source/JavaScriptCore/heap/CodeBlockSet.cpp
- Timestamp:
- Nov 29, 2017, 8:48:52 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/heap/CodeBlockSet.cpp
r219702 r225315 29 29 #include "CodeBlock.h" 30 30 #include "JSCInlines.h" 31 #include "SuperSampler.h" 31 32 #include <wtf/CommaPrinter.h> 32 33 … … 75 76 { 76 77 LockHolder locker(&m_lock); 77 Vector<CodeBlock*> unmarked; 78 79 // Destroying a CodeBlock takes about 1us on average in Speedometer. Full collections in Speedometer 80 // usually have ~2000 CodeBlocks to process. The time it takes to process the whole list varies a 81 // lot. In one extreme case I saw 18ms (on my fast MBP). 82 // 83 // FIXME: use Subspace instead of HashSet and adopt Subspace-based constraint solving. This may 84 // remove the need to eagerly destruct CodeBlocks. 85 // https://bugs.webkit.org/show_bug.cgi?id=180089 86 // 87 // FIXME: make CodeBlock::~CodeBlock a lot faster. It seems insane for that to take 1us or more. 88 // https://bugs.webkit.org/show_bug.cgi?id=180109 78 89 79 90 auto consider = [&] (HashSet<CodeBlock*>& set) { 80 for (CodeBlock* codeBlock : set) { 81 if (Heap::isMarked(codeBlock)) 82 continue;; 83 unmarked.append(codeBlock); 84 } 85 for (CodeBlock* codeBlock : unmarked) { 86 codeBlock->structure(vm)->classInfo()->methodTable.destroy(codeBlock); 87 set.remove(codeBlock); 88 } 89 unmarked.shrink(0); 91 set.removeIf( 92 [&] (CodeBlock* codeBlock) -> bool { 93 if (Heap::isMarked(codeBlock)) 94 return false; 95 codeBlock->structure(vm)->classInfo()->methodTable.destroy(codeBlock); 96 return true; 97 }); 90 98 }; 91 99
Note:
See TracChangeset
for help on using the changeset viewer.