WebContent crash loading page on seas.upenn.edu @ JavaScriptCore: vmEntryToJavaScript
authormsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 May 2018 18:39:13 +0000 (18:39 +0000)
committermsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 May 2018 18:39:13 +0000 (18:39 +0000)
commit567f584ca8ea519a50554c1c8ec69aeef21dc0cb
treead2911229b3ed3ed27930299f4b0ff308dfece04
parentbd3a4fdb4d91161d0fcb1bfd5c7ecb392075ccc0
WebContent crash loading page on seas.upenn.edu @ JavaScriptCore: vmEntryToJavaScript
https://bugs.webkit.org/show_bug.cgi?id=185231

Reviewed by Saam Barati.

We weren't clearing the scratch register cache when switching back and forth between
allowing scratch register usage.  We disallow scratch register usage when we are in
code that will freely allocate and use any register.  Such usage can change the
contents of scratch registers.  For ARM64, where we cache the contents of scratch
registers to reuse some or all of the contained values, we need to invalidate these
caches.  We do this when re-enabling scratch register usage, that is when we transition
from disallow to allow scratch register usage.

Added a new Air regression test.

* assembler/AllowMacroScratchRegisterUsage.h:
(JSC::AllowMacroScratchRegisterUsage::AllowMacroScratchRegisterUsage):
* assembler/AllowMacroScratchRegisterUsageIf.h:
(JSC::AllowMacroScratchRegisterUsageIf::AllowMacroScratchRegisterUsageIf):
* assembler/DisallowMacroScratchRegisterUsage.h:
(JSC::DisallowMacroScratchRegisterUsage::~DisallowMacroScratchRegisterUsage):
* b3/air/testair.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231317 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/assembler/AllowMacroScratchRegisterUsage.h
Source/JavaScriptCore/assembler/AllowMacroScratchRegisterUsageIf.h
Source/JavaScriptCore/assembler/DisallowMacroScratchRegisterUsage.h
Source/JavaScriptCore/b3/air/testair.cpp