Changeset 219790 in webkit for trunk/Source/JavaScriptCore/b3


Ignore:
Timestamp:
Jul 23, 2017, 1:35:02 PM (8 years ago)
Author:
[email protected]
Message:

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:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/b3/air/testair.cpp

    r216989 r219790  
    5252static void usage()
    5353{
    54     dataLog("Usage: testb3 [<filter>]\n");
     54    dataLog("Usage: testair [<filter>]\n");
    5555    if (hiddenTruthBecauseNoReturnIsStupid())
    5656        exit(1);
     
    20302030        threads.append(
    20312031            Thread::create(
    2032                 "testb3 thread",
     2032                "testair thread",
    20332033                [&] () {
    20342034                    for (;;) {
Note: See TracChangeset for help on using the changeset viewer.