|
| 1 | +2017-02-21 Saam Barati < [email protected]> |
| 2 | + |
| 3 | + Air should have a disassembly mode that dumps IR and assembly intermixed |
| 4 | + https://bugs.webkit.org/show_bug.cgi?id=168629 |
| 5 | + |
| 6 | + Reviewed by Filip Pizlo. |
| 7 | + |
| 8 | + This will make dumping FTL disassembly dump Air intermixed |
| 9 | + with the assembly generated by each Air Inst. This is similar |
| 10 | + to how dumpDFGDisassembly dumps the generated assembly for each |
| 11 | + Node. |
| 12 | + |
| 13 | + Here is what the output will look like: |
| 14 | + |
| 15 | + Generated FTL JIT code for foo#CUaFiQ:[0x10b76c960->0x10b76c2d0->0x10b7b6da0, FTLFunctionCall, 40 (NeverInline)], instruction count = 40: |
| 16 | + BB#0: ; frequency = 1.000000 |
| 17 | + 0x469004e02e00: push %rbp |
| 18 | + 0x469004e02e01: mov %rsp, %rbp |
| 19 | + 0x469004e02e04: add $0xffffffffffffffd0, %rsp |
| 20 | + Move $0x10b76c960, %rax, $4487301472(@16) |
| 21 | + 0x469004e02e08: mov $0x10b76c960, %rax |
| 22 | + Move %rax, 16(%rbp), @19 |
| 23 | + 0x469004e02e12: mov %rax, 0x10(%rbp) |
| 24 | + Patch &Patchpoint2, %rbp, %rax, @20 |
| 25 | + 0x469004e02e16: lea -0x50(%rbp), %rax |
| 26 | + 0x469004e02e1a: mov $0x1084081e0, %r11 |
| 27 | + 0x469004e02e24: cmp %rax, (%r11) |
| 28 | + 0x469004e02e27: ja 0x469004e02e9a |
| 29 | + Move 56(%rbp), %rdx, @23 |
| 30 | + 0x469004e02e2d: mov 0x38(%rbp), %rdx |
| 31 | + Move $0xffff000000000002, %rax, $-281474976710654(@15) |
| 32 | + 0x469004e02e31: mov $0xffff000000000002, %rax |
| 33 | + Patch &BranchTest64(3,SameAsRep)1, NonZero, %rdx, %rax, %rdx, @26 |
| 34 | + 0x469004e02e3b: test %rdx, %rax |
| 35 | + 0x469004e02e3e: jnz 0x469004e02f08 |
| 36 | + Move 48(%rbp), %rax, @29 |
| 37 | + 0x469004e02e44: mov 0x30(%rbp), %rax |
| 38 | + Move %rax, %rcx, @31 |
| 39 | + 0x469004e02e48: mov %rax, %rcx |
| 40 | + Xor64 $6, %rcx, @31 |
| 41 | + 0x469004e02e4b: xor $0x6, %rcx |
| 42 | + Patch &BranchTest64(3,SameAsRep)1, NonZero, %rcx, $-2, %rax, @35 |
| 43 | + 0x469004e02e4f: test $0xfffffffffffffffe, %rcx |
| 44 | + 0x469004e02e56: jnz 0x469004e02f12 |
| 45 | + Patch &Branch32(3,SameAsRep)0, NotEqual, (%rdx), $266, %rdx, @45 |
| 46 | + 0x469004e02e5c: cmp $0x10a, (%rdx) |
| 47 | + 0x469004e02e62: jnz 0x469004e02f1c |
| 48 | + BranchTest32 NonZero, %rax, $1, @49 |
| 49 | + 0x469004e02e68: test $0x1, %al |
| 50 | + 0x469004e02e6a: jnz 0x469004e02e91 |
| 51 | + Successors: #3, #1 |
| 52 | + BB#1: ; frequency = 1.000000 |
| 53 | + Predecessors: #0 |
| 54 | + Move $0, %rcx, @65 |
| 55 | + 0x469004e02e70: xor %rcx, %rcx |
| 56 | + Jump @66 |
| 57 | + Successors: #2 |
| 58 | + BB#2: ; frequency = 1.000000 |
| 59 | + Predecessors: #1, #3 |
| 60 | + Move 24(%rdx), %rax, @58 |
| 61 | + 0x469004e02e73: mov 0x18(%rdx), %rax |
| 62 | + Patch &BranchAdd32(4,ForceLateUseUnlessRecoverable)3, Overflow, %rcx, %rax, %rcx, %rcx, %rax, @60 |
| 63 | + 0x469004e02e77: add %eax, %ecx |
| 64 | + 0x469004e02e79: jo 0x469004e02f26 |
| 65 | + Move $0xffff000000000000, %rax, $-281474976710656(@14) |
| 66 | + 0x469004e02e7f: mov $0xffff000000000000, %rax |
| 67 | + Add64 %rcx, %rax, %rax, @62 |
| 68 | + 0x469004e02e89: add %rcx, %rax |
| 69 | + Ret64 %rax, @63 |
| 70 | + 0x469004e02e8c: mov %rbp, %rsp |
| 71 | + 0x469004e02e8f: pop %rbp |
| 72 | + 0x469004e02e90: ret |
| 73 | + BB#3: ; frequency = 1.000000 |
| 74 | + Predecessors: #0 |
| 75 | + Move 16(%rdx), %rcx, @52 |
| 76 | + 0x469004e02e91: mov 0x10(%rdx), %rcx |
| 77 | + Jump @55 |
| 78 | + 0x469004e02e95: jmp 0x469004e02e73 |
| 79 | + Successors: #2 |
| 80 | + |
| 81 | + * CMakeLists.txt: |
| 82 | + * JavaScriptCore.xcodeproj/project.pbxproj: |
| 83 | + * b3/air/AirCode.h: |
| 84 | + (JSC::B3::Air::Code::setDisassembler): |
| 85 | + (JSC::B3::Air::Code::disassembler): |
| 86 | + * b3/air/AirDisassembler.cpp: Added. |
| 87 | + (JSC::B3::Air::Disassembler::startEntrypoint): |
| 88 | + (JSC::B3::Air::Disassembler::endEntrypoint): |
| 89 | + (JSC::B3::Air::Disassembler::startLatePath): |
| 90 | + (JSC::B3::Air::Disassembler::endLatePath): |
| 91 | + (JSC::B3::Air::Disassembler::startBlock): |
| 92 | + (JSC::B3::Air::Disassembler::addInst): |
| 93 | + (JSC::B3::Air::Disassembler::dump): |
| 94 | + * b3/air/AirDisassembler.h: Added. |
| 95 | + * b3/air/AirGenerate.cpp: |
| 96 | + (JSC::B3::Air::generate): |
| 97 | + * ftl/FTLCompile.cpp: |
| 98 | + (JSC::FTL::compile): |
| 99 | + |
1 | 100 | 2017-02-21 Ryan Haddad < [email protected]> |
2 | 101 |
|
3 | 102 | Unreviewed, rolling out r212712. |
|
0 commit comments