Fix bugs in probe code to change sp on x86, x86_64 and 32-bit ARM.
https://bugs.webkit.org/show_bug.cgi?id=174809
<rdar://problem/
33504759>
Reviewed by Filip Pizlo.
1. When the probe handler function changes the sp register to point to the
region of stack in the middle of the ProbeContext on the stack, there is a
bug where the ProbeContext's register values to be restored can be over-written
before they can be restored. This is now fixed.
2. Added more robust probe tests for changing the sp register.
3. Made existing probe tests to ensure that probe handlers were actually called.
4. Added some verification to testProbePreservesGPRS().
5. Change all the probe tests to fail early on discovering an error instead of
batching till the end of the test. This helps point a finger to the failing
issue earlier.
This patch was tested on x86, x86_64, and ARMv7. ARM64 probe code will be fixed
next in https://bugs.webkit.org/show_bug.cgi?id=174697.
* assembler/MacroAssemblerARM.cpp:
* assembler/MacroAssemblerARMv7.cpp:
* assembler/MacroAssemblerX86Common.cpp:
* assembler/testmasm.cpp:
(JSC::testProbeReadsArgumentRegisters):
(JSC::testProbeWritesArgumentRegisters):
(JSC::testProbePreservesGPRS):
(JSC::testProbeModifiesStackPointer):
(JSC::testProbeModifiesStackPointerToInsideProbeContextOnStack):
(JSC::testProbeModifiesStackPointerToNBytesBelowSP):
(JSC::testProbeModifiesProgramCounter):
(JSC::run):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219885
268f45cc-cd09-0410-ab3c-
d52691b4dbfc