Make JSC have a mini mode that kicks in when the JIT is disabled
authorsbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 May 2018 22:47:59 +0000 (22:47 +0000)
committersbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 May 2018 22:47:59 +0000 (22:47 +0000)
commitfb5e8b9ecfe1c886b1c30fbeb822a1903efb8b46
treed04190b4cf05694f3f0bfb0404d19cca93c71dcb
parentd620294ca2e47f94c325f63bb8f051d21f3e0fdf
Make JSC have a mini mode that kicks in when the JIT is disabled
https://bugs.webkit.org/show_bug.cgi?id=185931

Reviewed by Mark Lam.

Source/JavaScriptCore:

This patch makes JSC have a mini VM mode. This currently only kicks in
when the process can't JIT. Mini VM now means a few things:
- We always use a 1.27x heap growth factor. This number was the best tradeoff
  between memory use progression and time regression in run-testmem. We may
  want to tune this more in the future as we make other mini VM changes.
- We always sweep synchronously.
- We disable generational GC.

I'm going to continue to extend what mini VM mode means in future changes.

This patch is a 50% memory progression and an ~8-9% time regression
on run-testmem when running in mini VM mode with the JIT disabled.

* heap/Heap.cpp:
(JSC::Heap::collectNow):
(JSC::Heap::finalize):
(JSC::Heap::useGenerationalGC):
(JSC::Heap::shouldSweepSynchronously):
(JSC::Heap::shouldDoFullCollection):
* heap/Heap.h:
* runtime/Options.h:
* runtime/VM.cpp:
(JSC::VM::isInMiniMode):
* runtime/VM.h:

Tools:

This renames a variable for clarity.

* Scripts/run-testmem:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/heap/Heap.cpp
Source/JavaScriptCore/heap/Heap.h
Source/JavaScriptCore/runtime/Options.h
Source/JavaScriptCore/runtime/VM.cpp
Source/JavaScriptCore/runtime/VM.h
Tools/ChangeLog
Tools/Scripts/run-testmem