Changeset 189888 in webkit for trunk/Source/JavaScriptCore/heap/Heap.cpp
- Timestamp:
- Sep 16, 2015, 5:16:35 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/heap/Heap.cpp
r189616 r189888 347 347 , m_lastFullGCLength(0.01) 348 348 , m_lastEdenGCLength(0.01) 349 , m_lastCodeDiscardTime(WTF::monotonicallyIncreasingTime())350 349 , m_fullActivityCallback(GCActivityCallback::createFullTimer(this)) 351 350 #if ENABLE(GGC) … … 893 892 void Heap::deleteAllCodeBlocks() 894 893 { 895 // If JavaScript is running, it's not safe to delete JavaScript code, since894 // If JavaScript is running, it's not safe to delete all JavaScript code, since 896 895 // we'll end up returning to deleted code. 897 if (m_vm->entryScope) 898 return; 899 900 // If we have things on any worklist, then don't delete code. This is kind of 901 // a weird heuristic. It's definitely not safe to throw away code that is on 902 // the worklist. But this change was made in a hurry so we just avoid throwing 903 // away any code if there is any code on any worklist. I suspect that this 904 // might not actually be too dumb: if there is code on worklists then that 905 // means that we are running some hot JS code right now. Maybe causing 906 // recompilations isn't a good idea. 896 RELEASE_ASSERT(!m_vm->entryScope); 897 907 898 #if ENABLE(DFG_JIT) 908 for (unsigned i = DFG::numberOfWorklists(); i--;) { 909 if (DFG::Worklist* worklist = DFG::worklistForIndexOrNull(i)) { 910 if (worklist->isActiveForVM(*vm())) 911 return; 912 } 913 } 914 #endif // ENABLE(DFG_JIT) 899 DFG::completeAllPlansForVM(*m_vm); 900 #endif 915 901 916 902 for (ExecutableBase* current : m_executables) { … … 983 969 sweepAllLogicallyEmptyWeakBlocks(); 984 970 } 985 986 static double minute = 60.0;987 971 988 972 NEVER_INLINE void Heap::collect(HeapOperation collectionType) … … 1036 1020 } 1037 1021 1038 deleteOldCode(gcStartTime);1039 1022 flushOldStructureIDTables(); 1040 1023 stopAllocation(); … … 1124 1107 if (m_edenActivityCallback) 1125 1108 m_edenActivityCallback->willCollect(); 1126 }1127 1128 void Heap::deleteOldCode(double gcStartTime)1129 {1130 if (m_operationInProgress == EdenCollection)1131 return;1132 1133 GCPHASE(DeleteOldCode);1134 if (gcStartTime - m_lastCodeDiscardTime > minute) {1135 m_vm->regExpCache()->deleteAllCode();1136 deleteAllCodeBlocks();1137 m_lastCodeDiscardTime = WTF::monotonicallyIncreasingTime();1138 }1139 1109 } 1140 1110
Note:
See TracChangeset
for help on using the changeset viewer.