Changeset 196104 in webkit
- Timestamp:
- Feb 3, 2016 7:12:23 PM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r196077 r196104 1 2016-02-03 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-03 Michael Catanzaro <mcatanzaro@igalia.com> 2 15 -
trunk/Source/JavaScriptCore/runtime/VM.cpp
r196022 r196104 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
r196022 r196104 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
r196101 r196104 1 2016-02-03 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 In the event that the user navigates back, the cost of relinking some code will be far 12 lower than the memory cost of keeping all of it around. 13 14 * bindings/js/GCController.cpp: 15 (WebCore::GCController::deleteAllLinkedCode): 16 * bindings/js/GCController.h: 17 * loader/FrameLoader.cpp: 18 (WebCore::FrameLoader::commitProvisionalLoad): 19 1 20 2016-02-03 Alex Christensen <achristensen@webkit.org> 2 21 -
trunk/Source/WebCore/bindings/js/GCController.cpp
r192775 r196104 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
r188394 r196104 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
r195948 r196104 67 67 #include "FrameTree.h" 68 68 #include "FrameView.h" 69 #include "GCController.h" 69 70 #include "HTMLAnchorElement.h" 70 71 #include "HTMLFormElement.h" … … 1762 1763 PageCache::singleton().addIfCacheable(*history().currentItem(), m_frame.page()); 1763 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 if (!m_frame.tree().parent()) 1769 GCController::singleton().deleteAllLinkedCode(); 1770 #endif 1771 1764 1772 if (m_loadType != FrameLoadType::Replace) 1765 1773 closeOldDataSources();
Note: See TracChangeset
for help on using the changeset viewer.