Changeset 196217 in webkit
- Timestamp:
- Feb 6, 2016 9:00:30 AM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r196213 r196217 1 2016-02-06 Andreas Kling <akling@apple.com> 2 3 [iOS] Throw away linked code when navigating to a new page. 4 <https://webkit.org/b/153851> 5 6 Reviewed by Gavin Barraclough. 7 8 Add a VM API for throwing away linked code only. 9 10 * runtime/VM.cpp: 11 (JSC::VM::deleteAllLinkedCode): 12 * runtime/VM.h: 13 1 14 2016-02-06 Commit Queue <commit-queue@webkit.org> 2 15 -
trunk/Source/JavaScriptCore/runtime/VM.cpp
r196213 r196217 543 543 } 544 544 545 void VM::deleteAllLinkedCode() 546 { 547 whenIdle([this]() { 548 heap.deleteAllCodeBlocks(); 549 heap.reportAbandonedObjectGraph(); 550 }); 551 } 552 545 553 void VM::deleteAllCode() 546 554 { -
trunk/Source/JavaScriptCore/runtime/VM.h
r196213 r196217 575 575 576 576 JS_EXPORT_PRIVATE void deleteAllCode(); 577 JS_EXPORT_PRIVATE void deleteAllLinkedCode(); 577 578 578 579 void registerWatchpointForImpureProperty(const Identifier&, Watchpoint*); -
trunk/Source/WebCore/ChangeLog
r196216 r196217 1 2016-02-06 Andreas Kling <akling@apple.com> 2 3 [iOS] Throw away linked code when navigating to a new page. 4 <https://webkit.org/b/153851> 5 6 Reviewed by Gavin Barraclough. 7 8 When navigating to a new page, tell JSC to throw out any linked code it has lying around. 9 Linked code is tied to a specific global object, and as we're creating a new one for the 10 new page, none of it is useful to us here. 11 12 In the event that the user navigates back, the cost of relinking some code will be far 13 lower than the memory cost of keeping all of it around. 14 15 This landed previously but was rolled out due to a Speedometer regression. I've made one 16 minor but important change here: only throw away code if we're navigating away from an 17 existing history item. Or in other words, don't throw away code for "force peeks" or any 18 other navigations that are not traditional top-level main frame navigations. 19 20 * bindings/js/GCController.cpp: 21 (WebCore::GCController::deleteAllLinkedCode): 22 * bindings/js/GCController.h: 23 * loader/FrameLoader.cpp: 24 (WebCore::FrameLoader::commitProvisionalLoad): 25 1 26 2016-02-06 Konstantin Tokarev <annulen@yandex.ru> 2 27 -
trunk/Source/WebCore/bindings/js/GCController.cpp
r196213 r196217 123 123 } 124 124 125 void GCController::deleteAllLinkedCode() 126 { 127 JSLockHolder lock(JSDOMWindow::commonVM()); 128 JSDOMWindow::commonVM().deleteAllLinkedCode(); 129 } 130 125 131 } // namespace WebCore -
trunk/Source/WebCore/bindings/js/GCController.h
r196213 r196217 47 47 WEBCORE_EXPORT void setJavaScriptGarbageCollectorTimerEnabled(bool); 48 48 WEBCORE_EXPORT void deleteAllCode(); 49 WEBCORE_EXPORT void deleteAllLinkedCode(); 49 50 50 51 private: -
trunk/Source/WebCore/loader/FrameLoader.cpp
r196213 r196217 67 67 #include "FrameTree.h" 68 68 #include "FrameView.h" 69 #include "GCController.h" 69 70 #include "HTMLAnchorElement.h" 70 71 #include "HTMLFormElement.h" … … 1757 1758 willTransitionToCommitted(); 1758 1759 1759 // Check to see if we need to cache the page we are navigating away from into the back/forward cache.1760 // We are doing this here because we know for sure that a new page is about to be loaded.1761 if (!m_frame.tree().parent() && history().currentItem())1760 if (!m_frame.tree().parent() && history().currentItem()) { 1761 // Check to see if we need to cache the page we are navigating away from into the back/forward cache. 1762 // We are doing this here because we know for sure that a new page is about to be loaded. 1762 1763 PageCache::singleton().addIfCacheable(*history().currentItem(), m_frame.page()); 1764 1765 #if PLATFORM(IOS) 1766 // For top-level navigations, have JSC throw away linked code. The immediate memory savings far 1767 // outweigh the cost of recompiling in the case of a future backwards navigation. 1768 GCController::singleton().deleteAllLinkedCode(); 1769 #endif 1770 } 1763 1771 1764 1772 if (m_loadType != FrameLoadType::Replace)
Note: See TracChangeset
for help on using the changeset viewer.