Add JSVirtualMachine SPI to shrink the memory footprint of the VM
authorsbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 May 2018 20:11:31 +0000 (20:11 +0000)
committersbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 May 2018 20:11:31 +0000 (20:11 +0000)
commitb2faff78e0dbd49003b1133dfc1583e4fa7cd46a
treef8ed260a41f9581672dc9905e613e8abd7672305
parent7656242dc992b6c00d6b14cb8a68ef0e6563ddc7
Add JSVirtualMachine SPI to shrink the memory footprint of the VM
https://bugs.webkit.org/show_bug.cgi?id=185441
<rdar://problem/39999414>

Reviewed by Keith Miller.

This patch adds JSVirtualMachine SPI to release as much memory as possible.
The SPI does:
- Deletes all code caches.
- Synchronous GC.
- Run the scavenger.

* API/JSVirtualMachine.mm:
(-[JSVirtualMachine shrinkFootprint]):
* API/JSVirtualMachinePrivate.h: Added.
* API/tests/testapi.mm:
(testObjectiveCAPIMain):
* JavaScriptCore.xcodeproj/project.pbxproj:
* runtime/VM.cpp:
(JSC::VM::shrinkFootprint):
* runtime/VM.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/API/JSVirtualMachine.mm
Source/JavaScriptCore/API/JSVirtualMachinePrivate.h [new file with mode: 0644]
Source/JavaScriptCore/API/tests/testapi.mm
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/runtime/VM.cpp
Source/JavaScriptCore/runtime/VM.h