Changeset 90415 in webkit
- Timestamp:
- Jul 5, 2011 4:55:45 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSBase.cpp
r58115 r90415 98 98 99 99 JSGlobalData& globalData = exec->globalData(); 100 if (!globalData.heap.isBusy()) 101 globalData.heap.collectAllGarbage(); 100 if (!globalData.heap.isBusy()) { 101 // releaseExecutableMemory forces a full GC 102 globalData.releaseExecutableMemory(); 103 } 102 104 103 105 // FIXME: Perhaps we should trigger a second mark and sweep -
trunk/Source/JavaScriptCore/ChangeLog
r90414 r90415 1 2011-07-05 Oliver Hunt <oliver@apple.com> 2 3 Don't throw out compiled code repeatedly 4 https://bugs.webkit.org/show_bug.cgi?id=63960 5 6 Reviewed by Gavin Barraclough. 7 8 Stop throwing away all compiled code every time 9 we're told to do a full GC. Instead unlink all 10 callsites during such GC passes to maximise the 11 number of collectable functions, but otherwise 12 leave compiled functions alone. 13 14 * API/JSBase.cpp: 15 (JSGarbageCollect): 16 * bytecode/CodeBlock.cpp: 17 (JSC::CodeBlock::visitAggregate): 18 * heap/Heap.cpp: 19 (JSC::Heap::collectAllGarbage): 20 * heap/MarkStack.h: 21 (JSC::MarkStack::shouldUnlinkCalls): 22 (JSC::MarkStack::setShouldUnlinkCalls): 23 * runtime/JSGlobalData.cpp: 24 (JSC::JSGlobalData::recompileAllJSFunctions): 25 (JSC::JSGlobalData::releaseExecutableMemory): 26 * runtime/RegExp.cpp: 27 (JSC::RegExp::compile): 28 (JSC::RegExp::invalidateCode): 29 * runtime/RegExp.h: 30 1 31 2011-07-05 Filip Pizlo <fpizlo@apple.com> 2 32 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r90371 r90415 1537 1537 visitor.append(&m_functionDecls[i]); 1538 1538 #if ENABLE(JIT) 1539 if (visitor.shouldUnlinkCalls()) 1540 unlinkCalls(); 1539 1541 for (unsigned i = 0; i < numberOfCallLinkInfos(); ++i) 1540 1542 if (callLinkInfo(i).isLinked()) -
trunk/Source/JavaScriptCore/heap/Heap.cpp
r89885 r90415 526 526 void Heap::collectAllGarbage() 527 527 { 528 if (!m_globalData->dynamicGlobalObject) 529 m_globalData->recompileAllJSFunctions(); 530 528 m_slotVisitor.setShouldUnlinkCalls(true); 531 529 collect(DoSweep); 530 m_slotVisitor.setShouldUnlinkCalls(false); 532 531 } 533 532 -
trunk/Source/JavaScriptCore/heap/MarkStack.h
r89630 r90415 98 98 void reset(); 99 99 100 bool shouldUnlinkCalls() const { return m_shouldUnlinkCalls; } 101 void setShouldUnlinkCalls(bool shouldUnlinkCalls) { m_shouldUnlinkCalls = shouldUnlinkCalls; } 102 100 103 protected: 101 104 #if ENABLE(GC_VALIDATION) … … 121 124 bool m_isDraining; 122 125 #endif 126 127 private: 128 bool m_shouldUnlinkCalls; 123 129 }; 124 130 -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp
r89885 r90415 490 490 } 491 491 heap.forEachCell<StackPreservingRecompiler>(recompiler); 492 } 492 } else 493 recompileAllJSFunctions(); 494 493 495 m_regExpCache->invalidateCode(); 494 496 heap.collectAllGarbage(); -
trunk/Source/JavaScriptCore/runtime/RegExp.cpp
r89885 r90415 109 109 ASSERT(m_state == NotCompiled); 110 110 m_representation = adoptPtr(new RegExpRepresentation); 111 m_state = Compiling; 111 112 Yarr::YarrPattern pattern(m_patternString, ignoreCase(), multiline(), &m_constructionError); 112 113 if (m_constructionError) { … … 119 120 120 121 ASSERT(m_numSubpatterns == pattern.m_numSubpatterns); 121 122 m_state = ByteCode;123 122 124 123 #if ENABLE(YARR_JIT) … … 140 139 141 140 m_representation->m_regExpBytecode = Yarr::byteCompile(pattern, &globalData->m_regExpAllocator); 141 142 m_state = ByteCode; 142 143 } 143 144 … … 200 201 void RegExp::invalidateCode() 201 202 { 202 if (!m_representation )203 if (!m_representation || m_state == Compiling) 203 204 return; 204 205 m_state = NotCompiled; -
trunk/Source/JavaScriptCore/runtime/RegExp.h
r87445 r90415 82 82 JITCode, 83 83 ByteCode, 84 NotCompiled 84 NotCompiled, 85 Compiling 85 86 } m_state; 86 87
Note: See TracChangeset
for help on using the changeset viewer.