Create regression tests for the JIT probe.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 23 Jul 2017 20:35:02 +0000 (20:35 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 23 Jul 2017 20:35:02 +0000 (20:35 +0000)
commit2e97543d43b0aff539e5f4fe3548f6a0144ad9a2
tree7a5928dbb3b010556c35b98e51761d7212ba38a7
parent985f74d525dd8f3b057b4e5441aecd163cc175a1
Create regression tests for the JIT probe.
https://bugs.webkit.org/show_bug.cgi?id=174696
<rdar://problem/33436922>

Reviewed by Saam Barati.

The new testmasm will test the following:
1. the probe is able to read the value of CPU registers.
2. the probe is able to write the value of CPU registers.
3. the probe is able to preserve all CPU registers.
4. special case of (2): the probe is able to change the value of the stack pointer.
5. special case of (2): the probe is able to change the value of the program counter
   i.e. the probe can change where the code continues executing upon returning from
   the probe.

Currently, the x86, x86_64, and ARMv7 ports passes the test.  ARM64 does not
because it does not support changing the sp and pc yet.  The ARM64 probe
implementation will be fixed in https://bugs.webkit.org/show_bug.cgi?id=174697
later.

* Configurations/ToolExecutable.xcconfig:
* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/MacroAssembler.h:
(JSC::MacroAssembler::CPUState::pc):
(JSC::MacroAssembler::CPUState::fp):
(JSC::MacroAssembler::CPUState::sp):
(JSC::ProbeContext::pc):
(JSC::ProbeContext::fp):
(JSC::ProbeContext::sp):
* assembler/MacroAssemblerARM64.cpp:
(JSC::arm64ProbeTrampoline):
* assembler/MacroAssemblerPrinter.cpp:
(JSC::Printer::printPCRegister):
* assembler/testmasm.cpp: Added.
(hiddenTruthBecauseNoReturnIsStupid):
(usage):
(JSC::nextID):
(JSC::isPC):
(JSC::isSP):
(JSC::isFP):
(JSC::compile):
(JSC::invoke):
(JSC::compileAndRun):
(JSC::testSimple):
(JSC::testProbeReadsArgumentRegisters):
(JSC::testProbeWritesArgumentRegisters):
(JSC::testFunctionToTrashRegisters):
(JSC::testProbePreservesGPRS):
(JSC::testProbeModifiesStackPointer):
(JSC::testProbeModifiesProgramCounter):
(JSC::run):
(run):
(main):
* b3/air/testair.cpp:
(usage):
* shell/CMakeLists.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219790 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/ToolExecutable.xcconfig
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/assembler/MacroAssembler.h
Source/JavaScriptCore/assembler/MacroAssemblerARM64.cpp
Source/JavaScriptCore/assembler/MacroAssemblerPrinter.cpp
Source/JavaScriptCore/assembler/testmasm.cpp [new file with mode: 0644]
Source/JavaScriptCore/b3/air/testair.cpp
Source/JavaScriptCore/shell/CMakeLists.txt