Created
October 9, 2024 17:40
-
-
Save mdboom/9dd24fa96f8fd2839defcc2dff9139e3 to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 42b823dd93eac573fa501050980cc3aa37ea73edd06e71d225164b3ef93e787f | |
// $ 'C:\Program Files\Python311\python.exe' 'C:\actions-runner\_work\benchmarking\benchmarking\cpython\Tools\jit\build.py' x86_64-pc-windows-msvc | |
void | |
emit__BINARY_OP( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BINARY_OP.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 5d f0 movq -0x10(%rbp), %rbx | |
// 8: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// c: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 10: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0x17 <_JIT_ENTRY+0x17> | |
// 0000000000000013: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 17: 48 8b 3d 00 00 00 00 movq (%rip), %rdi # 0x1e <_JIT_ENTRY+0x1e> | |
// 000000000000001a: IMAGE_REL_AMD64_REL32 __imp__PyEval_BinaryOps | |
// 1e: 48 89 d9 movq %rbx, %rcx | |
// 21: 48 89 f2 movq %rsi, %rdx | |
// 24: ff 14 c7 callq *(%rdi,%rax,8) | |
// 27: 48 89 c7 movq %rax, %rdi | |
// 2a: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 2e: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 36: 48 8b 03 movq (%rbx), %rax | |
// 39: 85 c0 testl %eax, %eax | |
// 3b: 78 08 js 0x45 <_JIT_ENTRY+0x45> | |
// 3d: 48 ff c8 decq %rax | |
// 40: 48 89 03 movq %rax, (%rbx) | |
// 43: 74 1a je 0x5f <_JIT_ENTRY+0x5f> | |
// 45: 48 8b 06 movq (%rsi), %rax | |
// 48: 85 c0 testl %eax, %eax | |
// 4a: 78 23 js 0x6f <_JIT_ENTRY+0x6f> | |
// 4c: 48 ff c8 decq %rax | |
// 4f: 48 89 06 movq %rax, (%rsi) | |
// 52: 75 1b jne 0x6f <_JIT_ENTRY+0x6f> | |
// 54: 48 89 f1 movq %rsi, %rcx | |
// 57: ff 15 00 00 00 00 callq *(%rip) # 0x5d <_JIT_ENTRY+0x5d> | |
// 0000000000000059: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 5d: eb 10 jmp 0x6f <_JIT_ENTRY+0x6f> | |
// 5f: 48 89 d9 movq %rbx, %rcx | |
// 62: ff 15 00 00 00 00 callq *(%rip) # 0x68 <_JIT_ENTRY+0x68> | |
// 0000000000000064: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 68: 48 8b 06 movq (%rsi), %rax | |
// 6b: 85 c0 testl %eax, %eax | |
// 6d: 79 dd jns 0x4c <_JIT_ENTRY+0x4c> | |
// 6f: 48 85 ff testq %rdi, %rdi | |
// 72: 74 13 je 0x87 <_JIT_ENTRY+0x87> | |
// 74: 48 89 7d f0 movq %rdi, -0x10(%rbp) | |
// 78: 48 83 c5 f8 addq $-0x8, %rbp | |
// 7c: 48 83 c4 28 addq $0x28, %rsp | |
// 80: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x87 <_JIT_ENTRY+0x87> | |
// 0000000000000083: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 87: 48 83 c4 28 addq $0x28, %rsp | |
// 8b: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x92 <_JIT_ENTRY+0x92> | |
// 000000000000008e: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 92: | |
const unsigned char code_body[146] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x5d, 0xf0, | |
0x48, 0x8b, 0x75, 0xf8, 0x49, 0x89, 0x6d, 0x40, | |
0x0f, 0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, | |
0xd9, 0x48, 0x89, 0xf2, 0xff, 0x14, 0xc7, 0x48, | |
0x89, 0xc7, 0x49, 0x8b, 0x6d, 0x40, 0x49, 0xc7, | |
0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, | |
0x03, 0x85, 0xc0, 0x78, 0x08, 0x48, 0xff, 0xc8, | |
0x48, 0x89, 0x03, 0x74, 0x1a, 0x48, 0x8b, 0x06, | |
0x85, 0xc0, 0x78, 0x23, 0x48, 0xff, 0xc8, 0x48, | |
0x89, 0x06, 0x75, 0x1b, 0x48, 0x89, 0xf1, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0xeb, 0x10, 0x48, | |
0x89, 0xd9, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8b, 0x06, 0x85, 0xc0, 0x79, 0xdd, 0x48, | |
0x85, 0xff, 0x74, 0x13, 0x48, 0x89, 0x7d, 0xf0, | |
0x48, 0x83, 0xc5, 0xf8, 0x48, 0x83, 0xc4, 0x28, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &_PyEval_BinaryOps+0x0 | |
// 10: &_Py_Dealloc+0x0 | |
// 18: CONTINUE | |
// 20: ERROR_TARGET | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&_PyEval_BinaryOps); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x18, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x20, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x13, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1a, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x59, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x64, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x83, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x8e, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__BINARY_OP_ADD_FLOAT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BINARY_OP_ADD_FLOAT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 7d f0 movq -0x10(%rbp), %rdi | |
// 8: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// c: f2 0f 10 47 10 movsd 0x10(%rdi), %xmm0 | |
// 11: f2 0f 58 46 10 addsd 0x10(%rsi), %xmm0 | |
// 16: 48 83 3f 01 cmpq $0x1, (%rdi) | |
// 1a: 75 27 jne 0x43 <_JIT_ENTRY+0x43> | |
// 1c: f2 0f 11 47 10 movsd %xmm0, 0x10(%rdi) | |
// 21: 48 8b 06 movq (%rsi), %rax | |
// 24: 85 c0 testl %eax, %eax | |
// 26: 78 08 js 0x30 <_JIT_ENTRY+0x30> | |
// 28: 48 ff c8 decq %rax | |
// 2b: 48 89 06 movq %rax, (%rsi) | |
// 2e: 74 7c je 0xac <_JIT_ENTRY+0xac> | |
// 30: 48 89 7d f0 movq %rdi, -0x10(%rbp) | |
// 34: 48 83 c5 f8 addq $-0x8, %rbp | |
// 38: 48 83 c4 28 addq $0x28, %rsp | |
// 3c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x43 <_JIT_ENTRY+0x43> | |
// 000000000000003f: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 43: 48 83 3e 01 cmpq $0x1, (%rsi) | |
// 47: 75 28 jne 0x71 <_JIT_ENTRY+0x71> | |
// 49: f2 0f 11 46 10 movsd %xmm0, 0x10(%rsi) | |
// 4e: 48 8b 07 movq (%rdi), %rax | |
// 51: 85 c0 testl %eax, %eax | |
// 53: 78 06 js 0x5b <_JIT_ENTRY+0x5b> | |
// 55: 48 ff c8 decq %rax | |
// 58: 48 89 07 movq %rax, (%rdi) | |
// 5b: 48 89 f7 movq %rsi, %rdi | |
// 5e: 48 89 7d f0 movq %rdi, -0x10(%rbp) | |
// 62: 48 83 c5 f8 addq $-0x8, %rbp | |
// 66: 48 83 c4 28 addq $0x28, %rsp | |
// 6a: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x71 <_JIT_ENTRY+0x71> | |
// 000000000000006d: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 71: ff 15 00 00 00 00 callq *(%rip) # 0x77 <_JIT_ENTRY+0x77> | |
// 0000000000000073: IMAGE_REL_AMD64_REL32 __imp_PyFloat_FromDouble | |
// 77: 48 85 c0 testq %rax, %rax | |
// 7a: 74 4c je 0xc8 <_JIT_ENTRY+0xc8> | |
// 7c: 48 8b 0f movq (%rdi), %rcx | |
// 7f: 85 c9 testl %ecx, %ecx | |
// 81: 78 06 js 0x89 <_JIT_ENTRY+0x89> | |
// 83: 48 ff c9 decq %rcx | |
// 86: 48 89 0f movq %rcx, (%rdi) | |
// 89: 48 8b 0e movq (%rsi), %rcx | |
// 8c: 85 c9 testl %ecx, %ecx | |
// 8e: 78 06 js 0x96 <_JIT_ENTRY+0x96> | |
// 90: 48 ff c9 decq %rcx | |
// 93: 48 89 0e movq %rcx, (%rsi) | |
// 96: 48 89 c7 movq %rax, %rdi | |
// 99: 48 89 7d f0 movq %rdi, -0x10(%rbp) | |
// 9d: 48 83 c5 f8 addq $-0x8, %rbp | |
// a1: 48 83 c4 28 addq $0x28, %rsp | |
// a5: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xac <_JIT_ENTRY+0xac> | |
// 00000000000000a8: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// ac: 48 89 f1 movq %rsi, %rcx | |
// af: ff 15 00 00 00 00 callq *(%rip) # 0xb5 <_JIT_ENTRY+0xb5> | |
// 00000000000000b1: IMAGE_REL_AMD64_REL32 __imp__PyFloat_ExactDealloc | |
// b5: 48 89 7d f0 movq %rdi, -0x10(%rbp) | |
// b9: 48 83 c5 f8 addq $-0x8, %rbp | |
// bd: 48 83 c4 28 addq $0x28, %rsp | |
// c1: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xc8 <_JIT_ENTRY+0xc8> | |
// 00000000000000c4: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// c8: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0xcf <_JIT_ENTRY+0xcf> | |
// 00000000000000cb: IMAGE_REL_AMD64_REL32 __imp__JIT_EXECUTOR | |
// cf: 49 89 84 24 08 01 00 00 movq %rax, 0x108(%r12) | |
// d7: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// db: 31 c0 xorl %eax, %eax | |
// dd: 48 83 c4 28 addq $0x28, %rsp | |
// e1: c3 retq | |
// e2: | |
const unsigned char code_body[226] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x7d, 0xf0, | |
0x48, 0x8b, 0x75, 0xf8, 0xf2, 0x0f, 0x10, 0x47, | |
0x10, 0xf2, 0x0f, 0x58, 0x46, 0x10, 0x48, 0x83, | |
0x3f, 0x01, 0x75, 0x27, 0xf2, 0x0f, 0x11, 0x47, | |
0x10, 0x48, 0x8b, 0x06, 0x85, 0xc0, 0x78, 0x08, | |
0x48, 0xff, 0xc8, 0x48, 0x89, 0x06, 0x74, 0x7c, | |
0x48, 0x89, 0x7d, 0xf0, 0x48, 0x83, 0xc5, 0xf8, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x83, 0x3e, 0x01, 0x75, | |
0x28, 0xf2, 0x0f, 0x11, 0x46, 0x10, 0x48, 0x8b, | |
0x07, 0x85, 0xc0, 0x78, 0x06, 0x48, 0xff, 0xc8, | |
0x48, 0x89, 0x07, 0x48, 0x89, 0xf7, 0x48, 0x89, | |
0x7d, 0xf0, 0x48, 0x83, 0xc5, 0xf8, 0x48, 0x83, | |
0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x85, 0xc0, 0x74, 0x4c, 0x48, 0x8b, 0x0f, 0x85, | |
0xc9, 0x78, 0x06, 0x48, 0xff, 0xc9, 0x48, 0x89, | |
0x0f, 0x48, 0x8b, 0x0e, 0x85, 0xc9, 0x78, 0x06, | |
0x48, 0xff, 0xc9, 0x48, 0x89, 0x0e, 0x48, 0x89, | |
0xc7, 0x48, 0x89, 0x7d, 0xf0, 0x48, 0x83, 0xc5, | |
0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0xf1, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0x7d, | |
0xf0, 0x48, 0x83, 0xc5, 0xf8, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x49, | |
0x89, 0x84, 0x24, 0x08, 0x01, 0x00, 0x00, 0x49, | |
0x89, 0x6d, 0x40, 0x31, 0xc0, 0x48, 0x83, 0xc4, | |
0x28, 0xc3, | |
}; | |
// 0: | |
// 0: CONTINUE | |
// 8: &PyFloat_FromDouble+0x0 | |
// 10: &_PyFloat_ExactDealloc+0x0 | |
// 18: EXECUTOR | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x8, (uintptr_t)&PyFloat_FromDouble); | |
patch_64(data + 0x10, (uintptr_t)&_PyFloat_ExactDealloc); | |
patch_64(data + 0x18, (uintptr_t)executor); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3f, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x6d, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x73, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0xa8, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0xb1, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xc4, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0xcb, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__BINARY_OP_ADD_INT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BINARY_OP_ADD_INT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 7d f0 movq -0x10(%rbp), %rdi | |
// 8: 48 8b 5d f8 movq -0x8(%rbp), %rbx | |
// c: 48 89 f9 movq %rdi, %rcx | |
// f: 48 89 da movq %rbx, %rdx | |
// 12: ff 15 00 00 00 00 callq *(%rip) # 0x18 <_JIT_ENTRY+0x18> | |
// 0000000000000014: IMAGE_REL_AMD64_REL32 __imp__PyLong_Add | |
// 18: 48 89 c6 movq %rax, %rsi | |
// 1b: 48 8b 03 movq (%rbx), %rax | |
// 1e: 85 c0 testl %eax, %eax | |
// 20: 78 08 js 0x2a <_JIT_ENTRY+0x2a> | |
// 22: 48 ff c8 decq %rax | |
// 25: 48 89 03 movq %rax, (%rbx) | |
// 28: 74 1a je 0x44 <_JIT_ENTRY+0x44> | |
// 2a: 48 8b 07 movq (%rdi), %rax | |
// 2d: 85 c0 testl %eax, %eax | |
// 2f: 78 23 js 0x54 <_JIT_ENTRY+0x54> | |
// 31: 48 ff c8 decq %rax | |
// 34: 48 89 07 movq %rax, (%rdi) | |
// 37: 75 1b jne 0x54 <_JIT_ENTRY+0x54> | |
// 39: 48 89 f9 movq %rdi, %rcx | |
// 3c: ff 15 00 00 00 00 callq *(%rip) # 0x42 <_JIT_ENTRY+0x42> | |
// 000000000000003e: IMAGE_REL_AMD64_REL32 __imp_PyObject_Free | |
// 42: eb 10 jmp 0x54 <_JIT_ENTRY+0x54> | |
// 44: 48 89 d9 movq %rbx, %rcx | |
// 47: ff 15 00 00 00 00 callq *(%rip) # 0x4d <_JIT_ENTRY+0x4d> | |
// 0000000000000049: IMAGE_REL_AMD64_REL32 __imp_PyObject_Free | |
// 4d: 48 8b 07 movq (%rdi), %rax | |
// 50: 85 c0 testl %eax, %eax | |
// 52: 79 dd jns 0x31 <_JIT_ENTRY+0x31> | |
// 54: 48 85 f6 testq %rsi, %rsi | |
// 57: 74 13 je 0x6c <_JIT_ENTRY+0x6c> | |
// 59: 48 89 75 f0 movq %rsi, -0x10(%rbp) | |
// 5d: 48 83 c5 f8 addq $-0x8, %rbp | |
// 61: 48 83 c4 28 addq $0x28, %rsp | |
// 65: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x6c <_JIT_ENTRY+0x6c> | |
// 0000000000000068: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 6c: 48 83 c4 28 addq $0x28, %rsp | |
// 70: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x77 <_JIT_ENTRY+0x77> | |
// 0000000000000073: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 77: | |
const unsigned char code_body[119] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x7d, 0xf0, | |
0x48, 0x8b, 0x5d, 0xf8, 0x48, 0x89, 0xf9, 0x48, | |
0x89, 0xda, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x89, 0xc6, 0x48, 0x8b, 0x03, 0x85, 0xc0, | |
0x78, 0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x03, | |
0x74, 0x1a, 0x48, 0x8b, 0x07, 0x85, 0xc0, 0x78, | |
0x23, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x07, 0x75, | |
0x1b, 0x48, 0x89, 0xf9, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0xeb, 0x10, 0x48, 0x89, 0xd9, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x07, | |
0x85, 0xc0, 0x79, 0xdd, 0x48, 0x85, 0xf6, 0x74, | |
0x13, 0x48, 0x89, 0x75, 0xf0, 0x48, 0x83, 0xc5, | |
0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, 0x28, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &_PyLong_Add+0x0 | |
// 8: &PyObject_Free+0x0 | |
// 10: CONTINUE | |
// 18: ERROR_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&_PyLong_Add); | |
patch_64(data + 0x8, (uintptr_t)&PyObject_Free); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x14, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x3e, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x49, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x68, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x73, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__BINARY_OP_ADD_UNICODE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BINARY_OP_ADD_UNICODE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 5d f0 movq -0x10(%rbp), %rbx | |
// 8: 48 8b 7d f8 movq -0x8(%rbp), %rdi | |
// c: 48 89 d9 movq %rbx, %rcx | |
// f: 48 89 fa movq %rdi, %rdx | |
// 12: ff 15 00 00 00 00 callq *(%rip) # 0x18 <_JIT_ENTRY+0x18> | |
// 0000000000000014: IMAGE_REL_AMD64_REL32 __imp_PyUnicode_Concat | |
// 18: 48 89 c6 movq %rax, %rsi | |
// 1b: 48 8b 03 movq (%rbx), %rax | |
// 1e: 85 c0 testl %eax, %eax | |
// 20: 78 08 js 0x2a <_JIT_ENTRY+0x2a> | |
// 22: 48 ff c8 decq %rax | |
// 25: 48 89 03 movq %rax, (%rbx) | |
// 28: 74 1a je 0x44 <_JIT_ENTRY+0x44> | |
// 2a: 48 8b 07 movq (%rdi), %rax | |
// 2d: 85 c0 testl %eax, %eax | |
// 2f: 78 23 js 0x54 <_JIT_ENTRY+0x54> | |
// 31: 48 ff c8 decq %rax | |
// 34: 48 89 07 movq %rax, (%rdi) | |
// 37: 75 1b jne 0x54 <_JIT_ENTRY+0x54> | |
// 39: 48 89 f9 movq %rdi, %rcx | |
// 3c: ff 15 00 00 00 00 callq *(%rip) # 0x42 <_JIT_ENTRY+0x42> | |
// 000000000000003e: IMAGE_REL_AMD64_REL32 __imp__PyUnicode_ExactDealloc | |
// 42: eb 10 jmp 0x54 <_JIT_ENTRY+0x54> | |
// 44: 48 89 d9 movq %rbx, %rcx | |
// 47: ff 15 00 00 00 00 callq *(%rip) # 0x4d <_JIT_ENTRY+0x4d> | |
// 0000000000000049: IMAGE_REL_AMD64_REL32 __imp__PyUnicode_ExactDealloc | |
// 4d: 48 8b 07 movq (%rdi), %rax | |
// 50: 85 c0 testl %eax, %eax | |
// 52: 79 dd jns 0x31 <_JIT_ENTRY+0x31> | |
// 54: 48 85 f6 testq %rsi, %rsi | |
// 57: 74 13 je 0x6c <_JIT_ENTRY+0x6c> | |
// 59: 48 89 75 f0 movq %rsi, -0x10(%rbp) | |
// 5d: 48 83 c5 f8 addq $-0x8, %rbp | |
// 61: 48 83 c4 28 addq $0x28, %rsp | |
// 65: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x6c <_JIT_ENTRY+0x6c> | |
// 0000000000000068: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 6c: 48 83 c4 28 addq $0x28, %rsp | |
// 70: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x77 <_JIT_ENTRY+0x77> | |
// 0000000000000073: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 77: | |
const unsigned char code_body[119] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x5d, 0xf0, | |
0x48, 0x8b, 0x7d, 0xf8, 0x48, 0x89, 0xd9, 0x48, | |
0x89, 0xfa, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x89, 0xc6, 0x48, 0x8b, 0x03, 0x85, 0xc0, | |
0x78, 0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x03, | |
0x74, 0x1a, 0x48, 0x8b, 0x07, 0x85, 0xc0, 0x78, | |
0x23, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x07, 0x75, | |
0x1b, 0x48, 0x89, 0xf9, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0xeb, 0x10, 0x48, 0x89, 0xd9, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x07, | |
0x85, 0xc0, 0x79, 0xdd, 0x48, 0x85, 0xf6, 0x74, | |
0x13, 0x48, 0x89, 0x75, 0xf0, 0x48, 0x83, 0xc5, | |
0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, 0x28, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PyUnicode_Concat+0x0 | |
// 8: &_PyUnicode_ExactDealloc+0x0 | |
// 10: CONTINUE | |
// 18: ERROR_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyUnicode_Concat); | |
patch_64(data + 0x8, (uintptr_t)&_PyUnicode_ExactDealloc); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x14, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x3e, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x49, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x68, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x73, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__BINARY_OP_INPLACE_ADD_UNICODE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BINARY_OP_INPLACE_ADD_UNICODE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 45 f0 movq -0x10(%rbp), %rax | |
// 8: 48 63 3d 00 00 00 00 movslq (%rip), %rdi # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// f: 49 39 44 fd 50 cmpq %rax, 0x50(%r13,%rdi,8) | |
// 14: 75 64 jne 0x7a <_JIT_ENTRY+0x7a> | |
// 16: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// 1a: 48 8b 08 movq (%rax), %rcx | |
// 1d: 85 c9 testl %ecx, %ecx | |
// 1f: 78 0b js 0x2c <_JIT_ENTRY+0x2c> | |
// 21: 48 ff c9 decq %rcx | |
// 24: 48 89 08 movq %rcx, (%rax) | |
// 27: 49 8b 44 fd 50 movq 0x50(%r13,%rdi,8), %rax | |
// 2c: 48 89 44 24 20 movq %rax, 0x20(%rsp) | |
// 31: 48 8d 4c 24 20 leaq 0x20(%rsp), %rcx | |
// 36: 48 89 f2 movq %rsi, %rdx | |
// 39: ff 15 00 00 00 00 callq *(%rip) # 0x3f <_JIT_ENTRY+0x3f> | |
// 000000000000003b: IMAGE_REL_AMD64_REL32 __imp_PyUnicode_Append | |
// 3f: 48 8b 44 24 20 movq 0x20(%rsp), %rax | |
// 44: 49 89 44 fd 50 movq %rax, 0x50(%r13,%rdi,8) | |
// 49: 48 8b 0e movq (%rsi), %rcx | |
// 4c: 85 c9 testl %ecx, %ecx | |
// 4e: 78 16 js 0x66 <_JIT_ENTRY+0x66> | |
// 50: 48 ff c9 decq %rcx | |
// 53: 48 89 0e movq %rcx, (%rsi) | |
// 56: 75 09 jne 0x61 <_JIT_ENTRY+0x61> | |
// 58: 48 89 f1 movq %rsi, %rcx | |
// 5b: ff 15 00 00 00 00 callq *(%rip) # 0x61 <_JIT_ENTRY+0x61> | |
// 000000000000005d: IMAGE_REL_AMD64_REL32 __imp__PyUnicode_ExactDealloc | |
// 61: 49 8b 44 fd 50 movq 0x50(%r13,%rdi,8), %rax | |
// 66: 48 85 c0 testq %rax, %rax | |
// 69: 74 1a je 0x85 <_JIT_ENTRY+0x85> | |
// 6b: 48 83 c5 f0 addq $-0x10, %rbp | |
// 6f: 48 83 c4 28 addq $0x28, %rsp | |
// 73: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x7a <_JIT_ENTRY+0x7a> | |
// 0000000000000076: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 7a: 48 83 c4 28 addq $0x28, %rsp | |
// 7e: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x85 <_JIT_ENTRY+0x85> | |
// 0000000000000081: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 85: 48 83 c4 28 addq $0x28, %rsp | |
// 89: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x90 <_JIT_ENTRY+0x90> | |
// 000000000000008c: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 90: | |
const unsigned char code_body[144] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x45, 0xf0, | |
0x48, 0x63, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x49, | |
0x39, 0x44, 0xfd, 0x50, 0x75, 0x64, 0x48, 0x8b, | |
0x75, 0xf8, 0x48, 0x8b, 0x08, 0x85, 0xc9, 0x78, | |
0x0b, 0x48, 0xff, 0xc9, 0x48, 0x89, 0x08, 0x49, | |
0x8b, 0x44, 0xfd, 0x50, 0x48, 0x89, 0x44, 0x24, | |
0x20, 0x48, 0x8d, 0x4c, 0x24, 0x20, 0x48, 0x89, | |
0xf2, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x44, 0x24, 0x20, 0x49, 0x89, 0x44, 0xfd, | |
0x50, 0x48, 0x8b, 0x0e, 0x85, 0xc9, 0x78, 0x16, | |
0x48, 0xff, 0xc9, 0x48, 0x89, 0x0e, 0x75, 0x09, | |
0x48, 0x89, 0xf1, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0x49, 0x8b, 0x44, 0xfd, 0x50, 0x48, 0x85, | |
0xc0, 0x74, 0x1a, 0x48, 0x83, 0xc5, 0xf0, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: &PyUnicode_Append+0x0 | |
// 10: &_PyUnicode_ExactDealloc+0x0 | |
// 18: CONTINUE | |
// 20: JUMP_TARGET | |
// 28: ERROR_TARGET | |
const unsigned char data_body[48] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, (uintptr_t)&PyUnicode_Append); | |
patch_64(data + 0x10, (uintptr_t)&_PyUnicode_ExactDealloc); | |
patch_64(data + 0x18, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x20, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x28, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x3b, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x5d, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x76, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x81, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0x8c, (uintptr_t)data + 0x24); | |
} | |
void | |
emit__BINARY_OP_MULTIPLY_FLOAT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BINARY_OP_MULTIPLY_FLOAT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 7d f0 movq -0x10(%rbp), %rdi | |
// 8: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// c: f2 0f 10 47 10 movsd 0x10(%rdi), %xmm0 | |
// 11: f2 0f 59 46 10 mulsd 0x10(%rsi), %xmm0 | |
// 16: 48 83 3f 01 cmpq $0x1, (%rdi) | |
// 1a: 75 27 jne 0x43 <_JIT_ENTRY+0x43> | |
// 1c: f2 0f 11 47 10 movsd %xmm0, 0x10(%rdi) | |
// 21: 48 8b 06 movq (%rsi), %rax | |
// 24: 85 c0 testl %eax, %eax | |
// 26: 78 08 js 0x30 <_JIT_ENTRY+0x30> | |
// 28: 48 ff c8 decq %rax | |
// 2b: 48 89 06 movq %rax, (%rsi) | |
// 2e: 74 7c je 0xac <_JIT_ENTRY+0xac> | |
// 30: 48 89 7d f0 movq %rdi, -0x10(%rbp) | |
// 34: 48 83 c5 f8 addq $-0x8, %rbp | |
// 38: 48 83 c4 28 addq $0x28, %rsp | |
// 3c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x43 <_JIT_ENTRY+0x43> | |
// 000000000000003f: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 43: 48 83 3e 01 cmpq $0x1, (%rsi) | |
// 47: 75 28 jne 0x71 <_JIT_ENTRY+0x71> | |
// 49: f2 0f 11 46 10 movsd %xmm0, 0x10(%rsi) | |
// 4e: 48 8b 07 movq (%rdi), %rax | |
// 51: 85 c0 testl %eax, %eax | |
// 53: 78 06 js 0x5b <_JIT_ENTRY+0x5b> | |
// 55: 48 ff c8 decq %rax | |
// 58: 48 89 07 movq %rax, (%rdi) | |
// 5b: 48 89 f7 movq %rsi, %rdi | |
// 5e: 48 89 7d f0 movq %rdi, -0x10(%rbp) | |
// 62: 48 83 c5 f8 addq $-0x8, %rbp | |
// 66: 48 83 c4 28 addq $0x28, %rsp | |
// 6a: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x71 <_JIT_ENTRY+0x71> | |
// 000000000000006d: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 71: ff 15 00 00 00 00 callq *(%rip) # 0x77 <_JIT_ENTRY+0x77> | |
// 0000000000000073: IMAGE_REL_AMD64_REL32 __imp_PyFloat_FromDouble | |
// 77: 48 85 c0 testq %rax, %rax | |
// 7a: 74 4c je 0xc8 <_JIT_ENTRY+0xc8> | |
// 7c: 48 8b 0f movq (%rdi), %rcx | |
// 7f: 85 c9 testl %ecx, %ecx | |
// 81: 78 06 js 0x89 <_JIT_ENTRY+0x89> | |
// 83: 48 ff c9 decq %rcx | |
// 86: 48 89 0f movq %rcx, (%rdi) | |
// 89: 48 8b 0e movq (%rsi), %rcx | |
// 8c: 85 c9 testl %ecx, %ecx | |
// 8e: 78 06 js 0x96 <_JIT_ENTRY+0x96> | |
// 90: 48 ff c9 decq %rcx | |
// 93: 48 89 0e movq %rcx, (%rsi) | |
// 96: 48 89 c7 movq %rax, %rdi | |
// 99: 48 89 7d f0 movq %rdi, -0x10(%rbp) | |
// 9d: 48 83 c5 f8 addq $-0x8, %rbp | |
// a1: 48 83 c4 28 addq $0x28, %rsp | |
// a5: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xac <_JIT_ENTRY+0xac> | |
// 00000000000000a8: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// ac: 48 89 f1 movq %rsi, %rcx | |
// af: ff 15 00 00 00 00 callq *(%rip) # 0xb5 <_JIT_ENTRY+0xb5> | |
// 00000000000000b1: IMAGE_REL_AMD64_REL32 __imp__PyFloat_ExactDealloc | |
// b5: 48 89 7d f0 movq %rdi, -0x10(%rbp) | |
// b9: 48 83 c5 f8 addq $-0x8, %rbp | |
// bd: 48 83 c4 28 addq $0x28, %rsp | |
// c1: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xc8 <_JIT_ENTRY+0xc8> | |
// 00000000000000c4: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// c8: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0xcf <_JIT_ENTRY+0xcf> | |
// 00000000000000cb: IMAGE_REL_AMD64_REL32 __imp__JIT_EXECUTOR | |
// cf: 49 89 84 24 08 01 00 00 movq %rax, 0x108(%r12) | |
// d7: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// db: 31 c0 xorl %eax, %eax | |
// dd: 48 83 c4 28 addq $0x28, %rsp | |
// e1: c3 retq | |
// e2: | |
const unsigned char code_body[226] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x7d, 0xf0, | |
0x48, 0x8b, 0x75, 0xf8, 0xf2, 0x0f, 0x10, 0x47, | |
0x10, 0xf2, 0x0f, 0x59, 0x46, 0x10, 0x48, 0x83, | |
0x3f, 0x01, 0x75, 0x27, 0xf2, 0x0f, 0x11, 0x47, | |
0x10, 0x48, 0x8b, 0x06, 0x85, 0xc0, 0x78, 0x08, | |
0x48, 0xff, 0xc8, 0x48, 0x89, 0x06, 0x74, 0x7c, | |
0x48, 0x89, 0x7d, 0xf0, 0x48, 0x83, 0xc5, 0xf8, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x83, 0x3e, 0x01, 0x75, | |
0x28, 0xf2, 0x0f, 0x11, 0x46, 0x10, 0x48, 0x8b, | |
0x07, 0x85, 0xc0, 0x78, 0x06, 0x48, 0xff, 0xc8, | |
0x48, 0x89, 0x07, 0x48, 0x89, 0xf7, 0x48, 0x89, | |
0x7d, 0xf0, 0x48, 0x83, 0xc5, 0xf8, 0x48, 0x83, | |
0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x85, 0xc0, 0x74, 0x4c, 0x48, 0x8b, 0x0f, 0x85, | |
0xc9, 0x78, 0x06, 0x48, 0xff, 0xc9, 0x48, 0x89, | |
0x0f, 0x48, 0x8b, 0x0e, 0x85, 0xc9, 0x78, 0x06, | |
0x48, 0xff, 0xc9, 0x48, 0x89, 0x0e, 0x48, 0x89, | |
0xc7, 0x48, 0x89, 0x7d, 0xf0, 0x48, 0x83, 0xc5, | |
0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0xf1, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0x7d, | |
0xf0, 0x48, 0x83, 0xc5, 0xf8, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x49, | |
0x89, 0x84, 0x24, 0x08, 0x01, 0x00, 0x00, 0x49, | |
0x89, 0x6d, 0x40, 0x31, 0xc0, 0x48, 0x83, 0xc4, | |
0x28, 0xc3, | |
}; | |
// 0: | |
// 0: CONTINUE | |
// 8: &PyFloat_FromDouble+0x0 | |
// 10: &_PyFloat_ExactDealloc+0x0 | |
// 18: EXECUTOR | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x8, (uintptr_t)&PyFloat_FromDouble); | |
patch_64(data + 0x10, (uintptr_t)&_PyFloat_ExactDealloc); | |
patch_64(data + 0x18, (uintptr_t)executor); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3f, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x6d, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x73, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0xa8, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0xb1, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xc4, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0xcb, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__BINARY_OP_MULTIPLY_INT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BINARY_OP_MULTIPLY_INT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 7d f0 movq -0x10(%rbp), %rdi | |
// 8: 48 8b 5d f8 movq -0x8(%rbp), %rbx | |
// c: 48 89 f9 movq %rdi, %rcx | |
// f: 48 89 da movq %rbx, %rdx | |
// 12: ff 15 00 00 00 00 callq *(%rip) # 0x18 <_JIT_ENTRY+0x18> | |
// 0000000000000014: IMAGE_REL_AMD64_REL32 __imp__PyLong_Multiply | |
// 18: 48 89 c6 movq %rax, %rsi | |
// 1b: 48 8b 03 movq (%rbx), %rax | |
// 1e: 85 c0 testl %eax, %eax | |
// 20: 78 08 js 0x2a <_JIT_ENTRY+0x2a> | |
// 22: 48 ff c8 decq %rax | |
// 25: 48 89 03 movq %rax, (%rbx) | |
// 28: 74 1a je 0x44 <_JIT_ENTRY+0x44> | |
// 2a: 48 8b 07 movq (%rdi), %rax | |
// 2d: 85 c0 testl %eax, %eax | |
// 2f: 78 23 js 0x54 <_JIT_ENTRY+0x54> | |
// 31: 48 ff c8 decq %rax | |
// 34: 48 89 07 movq %rax, (%rdi) | |
// 37: 75 1b jne 0x54 <_JIT_ENTRY+0x54> | |
// 39: 48 89 f9 movq %rdi, %rcx | |
// 3c: ff 15 00 00 00 00 callq *(%rip) # 0x42 <_JIT_ENTRY+0x42> | |
// 000000000000003e: IMAGE_REL_AMD64_REL32 __imp_PyObject_Free | |
// 42: eb 10 jmp 0x54 <_JIT_ENTRY+0x54> | |
// 44: 48 89 d9 movq %rbx, %rcx | |
// 47: ff 15 00 00 00 00 callq *(%rip) # 0x4d <_JIT_ENTRY+0x4d> | |
// 0000000000000049: IMAGE_REL_AMD64_REL32 __imp_PyObject_Free | |
// 4d: 48 8b 07 movq (%rdi), %rax | |
// 50: 85 c0 testl %eax, %eax | |
// 52: 79 dd jns 0x31 <_JIT_ENTRY+0x31> | |
// 54: 48 85 f6 testq %rsi, %rsi | |
// 57: 74 13 je 0x6c <_JIT_ENTRY+0x6c> | |
// 59: 48 89 75 f0 movq %rsi, -0x10(%rbp) | |
// 5d: 48 83 c5 f8 addq $-0x8, %rbp | |
// 61: 48 83 c4 28 addq $0x28, %rsp | |
// 65: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x6c <_JIT_ENTRY+0x6c> | |
// 0000000000000068: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 6c: 48 83 c4 28 addq $0x28, %rsp | |
// 70: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x77 <_JIT_ENTRY+0x77> | |
// 0000000000000073: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 77: | |
const unsigned char code_body[119] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x7d, 0xf0, | |
0x48, 0x8b, 0x5d, 0xf8, 0x48, 0x89, 0xf9, 0x48, | |
0x89, 0xda, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x89, 0xc6, 0x48, 0x8b, 0x03, 0x85, 0xc0, | |
0x78, 0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x03, | |
0x74, 0x1a, 0x48, 0x8b, 0x07, 0x85, 0xc0, 0x78, | |
0x23, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x07, 0x75, | |
0x1b, 0x48, 0x89, 0xf9, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0xeb, 0x10, 0x48, 0x89, 0xd9, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x07, | |
0x85, 0xc0, 0x79, 0xdd, 0x48, 0x85, 0xf6, 0x74, | |
0x13, 0x48, 0x89, 0x75, 0xf0, 0x48, 0x83, 0xc5, | |
0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, 0x28, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &_PyLong_Multiply+0x0 | |
// 8: &PyObject_Free+0x0 | |
// 10: CONTINUE | |
// 18: ERROR_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&_PyLong_Multiply); | |
patch_64(data + 0x8, (uintptr_t)&PyObject_Free); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x14, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x3e, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x49, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x68, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x73, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__BINARY_OP_SUBTRACT_FLOAT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BINARY_OP_SUBTRACT_FLOAT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 7d f0 movq -0x10(%rbp), %rdi | |
// 8: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// c: f2 0f 10 47 10 movsd 0x10(%rdi), %xmm0 | |
// 11: f2 0f 5c 46 10 subsd 0x10(%rsi), %xmm0 | |
// 16: 48 83 3f 01 cmpq $0x1, (%rdi) | |
// 1a: 75 27 jne 0x43 <_JIT_ENTRY+0x43> | |
// 1c: f2 0f 11 47 10 movsd %xmm0, 0x10(%rdi) | |
// 21: 48 8b 06 movq (%rsi), %rax | |
// 24: 85 c0 testl %eax, %eax | |
// 26: 78 08 js 0x30 <_JIT_ENTRY+0x30> | |
// 28: 48 ff c8 decq %rax | |
// 2b: 48 89 06 movq %rax, (%rsi) | |
// 2e: 74 7c je 0xac <_JIT_ENTRY+0xac> | |
// 30: 48 89 7d f0 movq %rdi, -0x10(%rbp) | |
// 34: 48 83 c5 f8 addq $-0x8, %rbp | |
// 38: 48 83 c4 28 addq $0x28, %rsp | |
// 3c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x43 <_JIT_ENTRY+0x43> | |
// 000000000000003f: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 43: 48 83 3e 01 cmpq $0x1, (%rsi) | |
// 47: 75 28 jne 0x71 <_JIT_ENTRY+0x71> | |
// 49: f2 0f 11 46 10 movsd %xmm0, 0x10(%rsi) | |
// 4e: 48 8b 07 movq (%rdi), %rax | |
// 51: 85 c0 testl %eax, %eax | |
// 53: 78 06 js 0x5b <_JIT_ENTRY+0x5b> | |
// 55: 48 ff c8 decq %rax | |
// 58: 48 89 07 movq %rax, (%rdi) | |
// 5b: 48 89 f7 movq %rsi, %rdi | |
// 5e: 48 89 7d f0 movq %rdi, -0x10(%rbp) | |
// 62: 48 83 c5 f8 addq $-0x8, %rbp | |
// 66: 48 83 c4 28 addq $0x28, %rsp | |
// 6a: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x71 <_JIT_ENTRY+0x71> | |
// 000000000000006d: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 71: ff 15 00 00 00 00 callq *(%rip) # 0x77 <_JIT_ENTRY+0x77> | |
// 0000000000000073: IMAGE_REL_AMD64_REL32 __imp_PyFloat_FromDouble | |
// 77: 48 85 c0 testq %rax, %rax | |
// 7a: 74 4c je 0xc8 <_JIT_ENTRY+0xc8> | |
// 7c: 48 8b 0f movq (%rdi), %rcx | |
// 7f: 85 c9 testl %ecx, %ecx | |
// 81: 78 06 js 0x89 <_JIT_ENTRY+0x89> | |
// 83: 48 ff c9 decq %rcx | |
// 86: 48 89 0f movq %rcx, (%rdi) | |
// 89: 48 8b 0e movq (%rsi), %rcx | |
// 8c: 85 c9 testl %ecx, %ecx | |
// 8e: 78 06 js 0x96 <_JIT_ENTRY+0x96> | |
// 90: 48 ff c9 decq %rcx | |
// 93: 48 89 0e movq %rcx, (%rsi) | |
// 96: 48 89 c7 movq %rax, %rdi | |
// 99: 48 89 7d f0 movq %rdi, -0x10(%rbp) | |
// 9d: 48 83 c5 f8 addq $-0x8, %rbp | |
// a1: 48 83 c4 28 addq $0x28, %rsp | |
// a5: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xac <_JIT_ENTRY+0xac> | |
// 00000000000000a8: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// ac: 48 89 f1 movq %rsi, %rcx | |
// af: ff 15 00 00 00 00 callq *(%rip) # 0xb5 <_JIT_ENTRY+0xb5> | |
// 00000000000000b1: IMAGE_REL_AMD64_REL32 __imp__PyFloat_ExactDealloc | |
// b5: 48 89 7d f0 movq %rdi, -0x10(%rbp) | |
// b9: 48 83 c5 f8 addq $-0x8, %rbp | |
// bd: 48 83 c4 28 addq $0x28, %rsp | |
// c1: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xc8 <_JIT_ENTRY+0xc8> | |
// 00000000000000c4: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// c8: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0xcf <_JIT_ENTRY+0xcf> | |
// 00000000000000cb: IMAGE_REL_AMD64_REL32 __imp__JIT_EXECUTOR | |
// cf: 49 89 84 24 08 01 00 00 movq %rax, 0x108(%r12) | |
// d7: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// db: 31 c0 xorl %eax, %eax | |
// dd: 48 83 c4 28 addq $0x28, %rsp | |
// e1: c3 retq | |
// e2: | |
const unsigned char code_body[226] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x7d, 0xf0, | |
0x48, 0x8b, 0x75, 0xf8, 0xf2, 0x0f, 0x10, 0x47, | |
0x10, 0xf2, 0x0f, 0x5c, 0x46, 0x10, 0x48, 0x83, | |
0x3f, 0x01, 0x75, 0x27, 0xf2, 0x0f, 0x11, 0x47, | |
0x10, 0x48, 0x8b, 0x06, 0x85, 0xc0, 0x78, 0x08, | |
0x48, 0xff, 0xc8, 0x48, 0x89, 0x06, 0x74, 0x7c, | |
0x48, 0x89, 0x7d, 0xf0, 0x48, 0x83, 0xc5, 0xf8, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x83, 0x3e, 0x01, 0x75, | |
0x28, 0xf2, 0x0f, 0x11, 0x46, 0x10, 0x48, 0x8b, | |
0x07, 0x85, 0xc0, 0x78, 0x06, 0x48, 0xff, 0xc8, | |
0x48, 0x89, 0x07, 0x48, 0x89, 0xf7, 0x48, 0x89, | |
0x7d, 0xf0, 0x48, 0x83, 0xc5, 0xf8, 0x48, 0x83, | |
0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x85, 0xc0, 0x74, 0x4c, 0x48, 0x8b, 0x0f, 0x85, | |
0xc9, 0x78, 0x06, 0x48, 0xff, 0xc9, 0x48, 0x89, | |
0x0f, 0x48, 0x8b, 0x0e, 0x85, 0xc9, 0x78, 0x06, | |
0x48, 0xff, 0xc9, 0x48, 0x89, 0x0e, 0x48, 0x89, | |
0xc7, 0x48, 0x89, 0x7d, 0xf0, 0x48, 0x83, 0xc5, | |
0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0xf1, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0x7d, | |
0xf0, 0x48, 0x83, 0xc5, 0xf8, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x49, | |
0x89, 0x84, 0x24, 0x08, 0x01, 0x00, 0x00, 0x49, | |
0x89, 0x6d, 0x40, 0x31, 0xc0, 0x48, 0x83, 0xc4, | |
0x28, 0xc3, | |
}; | |
// 0: | |
// 0: CONTINUE | |
// 8: &PyFloat_FromDouble+0x0 | |
// 10: &_PyFloat_ExactDealloc+0x0 | |
// 18: EXECUTOR | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x8, (uintptr_t)&PyFloat_FromDouble); | |
patch_64(data + 0x10, (uintptr_t)&_PyFloat_ExactDealloc); | |
patch_64(data + 0x18, (uintptr_t)executor); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3f, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x6d, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x73, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0xa8, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0xb1, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xc4, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0xcb, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__BINARY_OP_SUBTRACT_INT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BINARY_OP_SUBTRACT_INT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 7d f0 movq -0x10(%rbp), %rdi | |
// 8: 48 8b 5d f8 movq -0x8(%rbp), %rbx | |
// c: 48 89 f9 movq %rdi, %rcx | |
// f: 48 89 da movq %rbx, %rdx | |
// 12: ff 15 00 00 00 00 callq *(%rip) # 0x18 <_JIT_ENTRY+0x18> | |
// 0000000000000014: IMAGE_REL_AMD64_REL32 __imp__PyLong_Subtract | |
// 18: 48 89 c6 movq %rax, %rsi | |
// 1b: 48 8b 03 movq (%rbx), %rax | |
// 1e: 85 c0 testl %eax, %eax | |
// 20: 78 08 js 0x2a <_JIT_ENTRY+0x2a> | |
// 22: 48 ff c8 decq %rax | |
// 25: 48 89 03 movq %rax, (%rbx) | |
// 28: 74 1a je 0x44 <_JIT_ENTRY+0x44> | |
// 2a: 48 8b 07 movq (%rdi), %rax | |
// 2d: 85 c0 testl %eax, %eax | |
// 2f: 78 23 js 0x54 <_JIT_ENTRY+0x54> | |
// 31: 48 ff c8 decq %rax | |
// 34: 48 89 07 movq %rax, (%rdi) | |
// 37: 75 1b jne 0x54 <_JIT_ENTRY+0x54> | |
// 39: 48 89 f9 movq %rdi, %rcx | |
// 3c: ff 15 00 00 00 00 callq *(%rip) # 0x42 <_JIT_ENTRY+0x42> | |
// 000000000000003e: IMAGE_REL_AMD64_REL32 __imp_PyObject_Free | |
// 42: eb 10 jmp 0x54 <_JIT_ENTRY+0x54> | |
// 44: 48 89 d9 movq %rbx, %rcx | |
// 47: ff 15 00 00 00 00 callq *(%rip) # 0x4d <_JIT_ENTRY+0x4d> | |
// 0000000000000049: IMAGE_REL_AMD64_REL32 __imp_PyObject_Free | |
// 4d: 48 8b 07 movq (%rdi), %rax | |
// 50: 85 c0 testl %eax, %eax | |
// 52: 79 dd jns 0x31 <_JIT_ENTRY+0x31> | |
// 54: 48 85 f6 testq %rsi, %rsi | |
// 57: 74 13 je 0x6c <_JIT_ENTRY+0x6c> | |
// 59: 48 89 75 f0 movq %rsi, -0x10(%rbp) | |
// 5d: 48 83 c5 f8 addq $-0x8, %rbp | |
// 61: 48 83 c4 28 addq $0x28, %rsp | |
// 65: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x6c <_JIT_ENTRY+0x6c> | |
// 0000000000000068: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 6c: 48 83 c4 28 addq $0x28, %rsp | |
// 70: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x77 <_JIT_ENTRY+0x77> | |
// 0000000000000073: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 77: | |
const unsigned char code_body[119] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x7d, 0xf0, | |
0x48, 0x8b, 0x5d, 0xf8, 0x48, 0x89, 0xf9, 0x48, | |
0x89, 0xda, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x89, 0xc6, 0x48, 0x8b, 0x03, 0x85, 0xc0, | |
0x78, 0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x03, | |
0x74, 0x1a, 0x48, 0x8b, 0x07, 0x85, 0xc0, 0x78, | |
0x23, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x07, 0x75, | |
0x1b, 0x48, 0x89, 0xf9, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0xeb, 0x10, 0x48, 0x89, 0xd9, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x07, | |
0x85, 0xc0, 0x79, 0xdd, 0x48, 0x85, 0xf6, 0x74, | |
0x13, 0x48, 0x89, 0x75, 0xf0, 0x48, 0x83, 0xc5, | |
0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, 0x28, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &_PyLong_Subtract+0x0 | |
// 8: &PyObject_Free+0x0 | |
// 10: CONTINUE | |
// 18: ERROR_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&_PyLong_Subtract); | |
patch_64(data + 0x8, (uintptr_t)&PyObject_Free); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x14, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x3e, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x49, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x68, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x73, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__BINARY_SLICE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BINARY_SLICE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 55 f8 movq -0x8(%rbp), %rdx | |
// 8: 48 8b 75 e8 movq -0x18(%rbp), %rsi | |
// c: 48 8b 4d f0 movq -0x10(%rbp), %rcx | |
// 10: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 14: ff 15 00 00 00 00 callq *(%rip) # 0x1a <_JIT_ENTRY+0x1a> | |
// 0000000000000016: IMAGE_REL_AMD64_REL32 __imp__PyBuildSlice_ConsumeRefs | |
// 1a: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 1e: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 26: 48 85 c0 testq %rax, %rax | |
// 29: 74 4b je 0x76 <_JIT_ENTRY+0x76> | |
// 2b: 48 89 c3 movq %rax, %rbx | |
// 2e: 48 83 c5 f0 addq $-0x10, %rbp | |
// 32: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 36: 48 89 f1 movq %rsi, %rcx | |
// 39: 48 89 c2 movq %rax, %rdx | |
// 3c: ff 15 00 00 00 00 callq *(%rip) # 0x42 <_JIT_ENTRY+0x42> | |
// 000000000000003e: IMAGE_REL_AMD64_REL32 __imp_PyObject_GetItem | |
// 42: 48 89 c7 movq %rax, %rdi | |
// 45: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 49: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 51: 48 8b 03 movq (%rbx), %rax | |
// 54: 85 c0 testl %eax, %eax | |
// 56: 78 11 js 0x69 <_JIT_ENTRY+0x69> | |
// 58: 48 ff c8 decq %rax | |
// 5b: 48 89 03 movq %rax, (%rbx) | |
// 5e: 75 09 jne 0x69 <_JIT_ENTRY+0x69> | |
// 60: 48 89 d9 movq %rbx, %rcx | |
// 63: ff 15 00 00 00 00 callq *(%rip) # 0x69 <_JIT_ENTRY+0x69> | |
// 0000000000000065: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 69: 48 83 c5 10 addq $0x10, %rbp | |
// 6d: 48 8b 06 movq (%rsi), %rax | |
// 70: 85 c0 testl %eax, %eax | |
// 72: 79 0b jns 0x7f <_JIT_ENTRY+0x7f> | |
// 74: eb 11 jmp 0x87 <_JIT_ENTRY+0x87> | |
// 76: 31 ff xorl %edi, %edi | |
// 78: 48 8b 06 movq (%rsi), %rax | |
// 7b: 85 c0 testl %eax, %eax | |
// 7d: 78 08 js 0x87 <_JIT_ENTRY+0x87> | |
// 7f: 48 ff c8 decq %rax | |
// 82: 48 89 06 movq %rax, (%rsi) | |
// 85: 74 18 je 0x9f <_JIT_ENTRY+0x9f> | |
// 87: 48 85 ff testq %rdi, %rdi | |
// 8a: 74 21 je 0xad <_JIT_ENTRY+0xad> | |
// 8c: 48 89 7d e8 movq %rdi, -0x18(%rbp) | |
// 90: 48 83 c5 f0 addq $-0x10, %rbp | |
// 94: 48 83 c4 28 addq $0x28, %rsp | |
// 98: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x9f <_JIT_ENTRY+0x9f> | |
// 000000000000009b: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 9f: 48 89 f1 movq %rsi, %rcx | |
// a2: ff 15 00 00 00 00 callq *(%rip) # 0xa8 <_JIT_ENTRY+0xa8> | |
// 00000000000000a4: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// a8: 48 85 ff testq %rdi, %rdi | |
// ab: 75 df jne 0x8c <_JIT_ENTRY+0x8c> | |
// ad: 48 83 c4 28 addq $0x28, %rsp | |
// b1: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xb8 <_JIT_ENTRY+0xb8> | |
// 00000000000000b4: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// b8: | |
const unsigned char code_body[184] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x55, 0xf8, | |
0x48, 0x8b, 0x75, 0xe8, 0x48, 0x8b, 0x4d, 0xf0, | |
0x49, 0x89, 0x6d, 0x40, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, 0xc7, | |
0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x48, 0x85, | |
0xc0, 0x74, 0x4b, 0x48, 0x89, 0xc3, 0x48, 0x83, | |
0xc5, 0xf0, 0x49, 0x89, 0x6d, 0x40, 0x48, 0x89, | |
0xf1, 0x48, 0x89, 0xc2, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x89, 0xc7, 0x49, 0x8b, 0x6d, | |
0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x8b, 0x03, 0x85, 0xc0, 0x78, 0x11, | |
0x48, 0xff, 0xc8, 0x48, 0x89, 0x03, 0x75, 0x09, | |
0x48, 0x89, 0xd9, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x83, 0xc5, 0x10, 0x48, 0x8b, 0x06, | |
0x85, 0xc0, 0x79, 0x0b, 0xeb, 0x11, 0x31, 0xff, | |
0x48, 0x8b, 0x06, 0x85, 0xc0, 0x78, 0x08, 0x48, | |
0xff, 0xc8, 0x48, 0x89, 0x06, 0x74, 0x18, 0x48, | |
0x85, 0xff, 0x74, 0x21, 0x48, 0x89, 0x7d, 0xe8, | |
0x48, 0x83, 0xc5, 0xf0, 0x48, 0x83, 0xc4, 0x28, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x89, 0xf1, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x85, 0xff, 0x75, 0xdf, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &_PyBuildSlice_ConsumeRefs+0x0 | |
// 8: &PyObject_GetItem+0x0 | |
// 10: &_Py_Dealloc+0x0 | |
// 18: CONTINUE | |
// 20: ERROR_TARGET | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&_PyBuildSlice_ConsumeRefs); | |
patch_64(data + 0x8, (uintptr_t)&PyObject_GetItem); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x18, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x20, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x16, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x3e, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x65, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x9b, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xa4, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xb4, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__BINARY_SUBSCR( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BINARY_SUBSCR.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 5d f0 movq -0x10(%rbp), %rbx | |
// 8: 48 8b 7d f8 movq -0x8(%rbp), %rdi | |
// c: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 10: 48 89 d9 movq %rbx, %rcx | |
// 13: 48 89 fa movq %rdi, %rdx | |
// 16: ff 15 00 00 00 00 callq *(%rip) # 0x1c <_JIT_ENTRY+0x1c> | |
// 0000000000000018: IMAGE_REL_AMD64_REL32 __imp_PyObject_GetItem | |
// 1c: 48 89 c6 movq %rax, %rsi | |
// 1f: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 23: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 2b: 48 8b 03 movq (%rbx), %rax | |
// 2e: 85 c0 testl %eax, %eax | |
// 30: 78 08 js 0x3a <_JIT_ENTRY+0x3a> | |
// 32: 48 ff c8 decq %rax | |
// 35: 48 89 03 movq %rax, (%rbx) | |
// 38: 74 1a je 0x54 <_JIT_ENTRY+0x54> | |
// 3a: 48 8b 07 movq (%rdi), %rax | |
// 3d: 85 c0 testl %eax, %eax | |
// 3f: 78 23 js 0x64 <_JIT_ENTRY+0x64> | |
// 41: 48 ff c8 decq %rax | |
// 44: 48 89 07 movq %rax, (%rdi) | |
// 47: 75 1b jne 0x64 <_JIT_ENTRY+0x64> | |
// 49: 48 89 f9 movq %rdi, %rcx | |
// 4c: ff 15 00 00 00 00 callq *(%rip) # 0x52 <_JIT_ENTRY+0x52> | |
// 000000000000004e: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 52: eb 10 jmp 0x64 <_JIT_ENTRY+0x64> | |
// 54: 48 89 d9 movq %rbx, %rcx | |
// 57: ff 15 00 00 00 00 callq *(%rip) # 0x5d <_JIT_ENTRY+0x5d> | |
// 0000000000000059: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 5d: 48 8b 07 movq (%rdi), %rax | |
// 60: 85 c0 testl %eax, %eax | |
// 62: 79 dd jns 0x41 <_JIT_ENTRY+0x41> | |
// 64: 48 85 f6 testq %rsi, %rsi | |
// 67: 74 13 je 0x7c <_JIT_ENTRY+0x7c> | |
// 69: 48 89 75 f0 movq %rsi, -0x10(%rbp) | |
// 6d: 48 83 c5 f8 addq $-0x8, %rbp | |
// 71: 48 83 c4 28 addq $0x28, %rsp | |
// 75: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x7c <_JIT_ENTRY+0x7c> | |
// 0000000000000078: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 7c: 48 83 c4 28 addq $0x28, %rsp | |
// 80: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x87 <_JIT_ENTRY+0x87> | |
// 0000000000000083: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 87: | |
const unsigned char code_body[135] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x5d, 0xf0, | |
0x48, 0x8b, 0x7d, 0xf8, 0x49, 0x89, 0x6d, 0x40, | |
0x48, 0x89, 0xd9, 0x48, 0x89, 0xfa, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0xc6, 0x49, | |
0x8b, 0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x8b, 0x03, 0x85, 0xc0, | |
0x78, 0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x03, | |
0x74, 0x1a, 0x48, 0x8b, 0x07, 0x85, 0xc0, 0x78, | |
0x23, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x07, 0x75, | |
0x1b, 0x48, 0x89, 0xf9, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0xeb, 0x10, 0x48, 0x89, 0xd9, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x07, | |
0x85, 0xc0, 0x79, 0xdd, 0x48, 0x85, 0xf6, 0x74, | |
0x13, 0x48, 0x89, 0x75, 0xf0, 0x48, 0x83, 0xc5, | |
0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, 0x28, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PyObject_GetItem+0x0 | |
// 8: &_Py_Dealloc+0x0 | |
// 10: CONTINUE | |
// 18: ERROR_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyObject_GetItem); | |
patch_64(data + 0x8, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x18, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x4e, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x59, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x78, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x83, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__BINARY_SUBSCR_CHECK_FUNC( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BINARY_SUBSCR_CHECK_FUNC.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f0 movq -0x10(%rbp), %rax | |
// 4: 48 8b 48 08 movq 0x8(%rax), %rcx | |
// 8: f6 81 a9 00 00 00 02 testb $0x2, 0xa9(%rcx) | |
// f: 74 4a je 0x5b <_JIT_ENTRY+0x5b> | |
// 11: 48 8b 81 90 03 00 00 movq 0x390(%rcx), %rax | |
// 18: 48 85 c0 testq %rax, %rax | |
// 1b: 74 3e je 0x5b <_JIT_ENTRY+0x5b> | |
// 1d: 8b 90 90 00 00 00 movl 0x90(%rax), %edx | |
// 23: 3b 91 98 03 00 00 cmpl 0x398(%rcx), %edx | |
// 29: 75 30 jne 0x5b <_JIT_ENTRY+0x5b> | |
// 2b: 49 8b 8c 24 e8 00 00 00 movq 0xe8(%r12), %rcx | |
// 33: 48 85 c9 testq %rcx, %rcx | |
// 36: 74 23 je 0x5b <_JIT_ENTRY+0x5b> | |
// 38: 48 8b 40 30 movq 0x30(%rax), %rax | |
// 3c: 48 63 40 4c movslq 0x4c(%rax), %rax | |
// 40: 49 8b 94 24 f0 00 00 00 movq 0xf0(%r12), %rdx | |
// 48: 48 29 ca subq %rcx, %rdx | |
// 4b: 48 c1 fa 03 sarq $0x3, %rdx | |
// 4f: 48 39 c2 cmpq %rax, %rdx | |
// 52: 7e 07 jle 0x5b <_JIT_ENTRY+0x5b> | |
// 54: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x5b <_JIT_ENTRY+0x5b> | |
// 0000000000000057: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 5b: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x62 <_JIT_ENTRY+0x62> | |
// 000000000000005e: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 62: | |
const unsigned char code_body[98] = { | |
0x48, 0x8b, 0x45, 0xf0, 0x48, 0x8b, 0x48, 0x08, | |
0xf6, 0x81, 0xa9, 0x00, 0x00, 0x00, 0x02, 0x74, | |
0x4a, 0x48, 0x8b, 0x81, 0x90, 0x03, 0x00, 0x00, | |
0x48, 0x85, 0xc0, 0x74, 0x3e, 0x8b, 0x90, 0x90, | |
0x00, 0x00, 0x00, 0x3b, 0x91, 0x98, 0x03, 0x00, | |
0x00, 0x75, 0x30, 0x49, 0x8b, 0x8c, 0x24, 0xe8, | |
0x00, 0x00, 0x00, 0x48, 0x85, 0xc9, 0x74, 0x23, | |
0x48, 0x8b, 0x40, 0x30, 0x48, 0x63, 0x40, 0x4c, | |
0x49, 0x8b, 0x94, 0x24, 0xf0, 0x00, 0x00, 0x00, | |
0x48, 0x29, 0xca, 0x48, 0xc1, 0xfa, 0x03, 0x48, | |
0x39, 0xc2, 0x7e, 0x07, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, | |
}; | |
// 0: | |
// 0: CONTINUE | |
// 8: JUMP_TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x57, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x5e, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__BINARY_SUBSCR_DICT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BINARY_SUBSCR_DICT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 5d f0 movq -0x10(%rbp), %rbx | |
// 8: 48 8b 43 08 movq 0x8(%rbx), %rax | |
// c: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x13 <_JIT_ENTRY+0x13> | |
// 000000000000000f: IMAGE_REL_AMD64_REL32 __imp_PyDict_Type | |
// 13: 74 0b je 0x20 <_JIT_ENTRY+0x20> | |
// 15: 48 83 c4 28 addq $0x28, %rsp | |
// 19: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x20 <_JIT_ENTRY+0x20> | |
// 000000000000001c: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 20: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// 24: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 28: 4c 8d 44 24 20 leaq 0x20(%rsp), %r8 | |
// 2d: 48 89 d9 movq %rbx, %rcx | |
// 30: 48 89 f2 movq %rsi, %rdx | |
// 33: ff 15 00 00 00 00 callq *(%rip) # 0x39 <_JIT_ENTRY+0x39> | |
// 0000000000000035: IMAGE_REL_AMD64_REL32 __imp_PyDict_GetItemRef | |
// 39: 89 c7 movl %eax, %edi | |
// 3b: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 3f: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 47: 85 c0 testl %eax, %eax | |
// 49: 74 09 je 0x54 <_JIT_ENTRY+0x54> | |
// 4b: 48 8b 03 movq (%rbx), %rax | |
// 4e: 85 c0 testl %eax, %eax | |
// 50: 79 22 jns 0x74 <_JIT_ENTRY+0x74> | |
// 52: eb 31 jmp 0x85 <_JIT_ENTRY+0x85> | |
// 54: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 58: 48 89 f1 movq %rsi, %rcx | |
// 5b: ff 15 00 00 00 00 callq *(%rip) # 0x61 <_JIT_ENTRY+0x61> | |
// 000000000000005d: IMAGE_REL_AMD64_REL32 __imp__PyErr_SetKeyError | |
// 61: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 65: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 6d: 48 8b 03 movq (%rbx), %rax | |
// 70: 85 c0 testl %eax, %eax | |
// 72: 78 11 js 0x85 <_JIT_ENTRY+0x85> | |
// 74: 48 ff c8 decq %rax | |
// 77: 48 89 03 movq %rax, (%rbx) | |
// 7a: 75 09 jne 0x85 <_JIT_ENTRY+0x85> | |
// 7c: 48 89 d9 movq %rbx, %rcx | |
// 7f: ff 15 00 00 00 00 callq *(%rip) # 0x85 <_JIT_ENTRY+0x85> | |
// 0000000000000081: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 85: 48 8b 06 movq (%rsi), %rax | |
// 88: 85 c0 testl %eax, %eax | |
// 8a: 78 08 js 0x94 <_JIT_ENTRY+0x94> | |
// 8c: 48 ff c8 decq %rax | |
// 8f: 48 89 06 movq %rax, (%rsi) | |
// 92: 74 1c je 0xb0 <_JIT_ENTRY+0xb0> | |
// 94: 85 ff testl %edi, %edi | |
// 96: 7e 25 jle 0xbd <_JIT_ENTRY+0xbd> | |
// 98: 48 8b 44 24 20 movq 0x20(%rsp), %rax | |
// 9d: 48 89 45 f0 movq %rax, -0x10(%rbp) | |
// a1: 48 83 c5 f8 addq $-0x8, %rbp | |
// a5: 48 83 c4 28 addq $0x28, %rsp | |
// a9: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xb0 <_JIT_ENTRY+0xb0> | |
// 00000000000000ac: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// b0: 48 89 f1 movq %rsi, %rcx | |
// b3: ff 15 00 00 00 00 callq *(%rip) # 0xb9 <_JIT_ENTRY+0xb9> | |
// 00000000000000b5: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// b9: 85 ff testl %edi, %edi | |
// bb: 7f db jg 0x98 <_JIT_ENTRY+0x98> | |
// bd: 48 83 c4 28 addq $0x28, %rsp | |
// c1: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xc8 <_JIT_ENTRY+0xc8> | |
// 00000000000000c4: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// c8: | |
const unsigned char code_body[200] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x5d, 0xf0, | |
0x48, 0x8b, 0x43, 0x08, 0x48, 0x3b, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x74, 0x0b, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8b, 0x75, 0xf8, 0x49, 0x89, 0x6d, 0x40, | |
0x4c, 0x8d, 0x44, 0x24, 0x20, 0x48, 0x89, 0xd9, | |
0x48, 0x89, 0xf2, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0x89, 0xc7, 0x49, 0x8b, 0x6d, 0x40, 0x49, | |
0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x85, | |
0xc0, 0x74, 0x09, 0x48, 0x8b, 0x03, 0x85, 0xc0, | |
0x79, 0x22, 0xeb, 0x31, 0x49, 0x89, 0x6d, 0x40, | |
0x48, 0x89, 0xf1, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, 0xc7, 0x45, | |
0x40, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x03, | |
0x85, 0xc0, 0x78, 0x11, 0x48, 0xff, 0xc8, 0x48, | |
0x89, 0x03, 0x75, 0x09, 0x48, 0x89, 0xd9, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x06, | |
0x85, 0xc0, 0x78, 0x08, 0x48, 0xff, 0xc8, 0x48, | |
0x89, 0x06, 0x74, 0x1c, 0x85, 0xff, 0x7e, 0x25, | |
0x48, 0x8b, 0x44, 0x24, 0x20, 0x48, 0x89, 0x45, | |
0xf0, 0x48, 0x83, 0xc5, 0xf8, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x89, 0xf1, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0x85, 0xff, 0x7f, 0xdb, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PyDict_Type+0x0 | |
// 8: JUMP_TARGET | |
// 10: &PyDict_GetItemRef+0x0 | |
// 18: &_PyErr_SetKeyError+0x0 | |
// 20: &_Py_Dealloc+0x0 | |
// 28: CONTINUE | |
// 30: ERROR_TARGET | |
const unsigned char data_body[56] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyDict_Type); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x10, (uintptr_t)&PyDict_GetItemRef); | |
patch_64(data + 0x18, (uintptr_t)&_PyErr_SetKeyError); | |
patch_64(data + 0x20, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x28, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x30, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xf, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1c, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x35, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x5d, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x81, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0xac, (uintptr_t)data + 0x24); | |
patch_x86_64_32rx(code + 0xb5, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0xc4, (uintptr_t)data + 0x2c); | |
} | |
void | |
emit__BINARY_SUBSCR_INIT_CALL( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BINARY_SUBSCR_INIT_CALL.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 0f 10 45 f0 movups -0x10(%rbp), %xmm0 | |
// 4: 48 8b 45 f0 movq -0x10(%rbp), %rax | |
// 8: 48 8b 40 08 movq 0x8(%rax), %rax | |
// c: 48 8b 90 90 03 00 00 movq 0x390(%rax), %rdx | |
// 13: 8b 02 movl (%rdx), %eax | |
// 15: ff c0 incl %eax | |
// 17: 74 02 je 0x1b <_JIT_ENTRY+0x1b> | |
// 19: 89 02 movl %eax, (%rdx) | |
// 1b: 48 8b 4a 30 movq 0x30(%rdx), %rcx | |
// 1f: 49 8b 84 24 e8 00 00 00 movq 0xe8(%r12), %rax | |
// 27: 48 63 71 4c movslq 0x4c(%rcx), %rsi | |
// 2b: 48 8d 34 f0 leaq (%rax,%rsi,8), %rsi | |
// 2f: 49 89 b4 24 e8 00 00 00 movq %rsi, 0xe8(%r12) | |
// 37: 4c 89 68 08 movq %r13, 0x8(%rax) | |
// 3b: 48 89 50 10 movq %rdx, 0x10(%rax) | |
// 3f: 8b 31 movl (%rcx), %esi | |
// 41: ff c6 incl %esi | |
// 43: 74 02 je 0x47 <_JIT_ENTRY+0x47> | |
// 45: 89 31 movl %esi, (%rcx) | |
// 47: 48 89 08 movq %rcx, (%rax) | |
// 4a: 0f 10 4a 10 movups 0x10(%rdx), %xmm1 | |
// 4e: 0f 11 48 18 movups %xmm1, 0x18(%rax) | |
// 52: 48 c7 40 28 00 00 00 00 movq $0x0, 0x28(%rax) | |
// 5a: 48 63 51 48 movslq 0x48(%rcx), %rdx | |
// 5e: 48 81 c1 c8 00 00 00 addq $0xc8, %rcx | |
// 65: 48 8d 34 d0 leaq (%rax,%rdx,8), %rsi | |
// 69: 48 83 c6 50 addq $0x50, %rsi | |
// 6d: 48 89 70 40 movq %rsi, 0x40(%rax) | |
// 71: 48 c7 40 30 00 00 00 00 movq $0x0, 0x30(%rax) | |
// 79: 48 89 48 38 movq %rcx, 0x38(%rax) | |
// 7d: 66 c7 40 48 00 00 movw $0x0, 0x48(%rax) | |
// 83: c6 40 4a 00 movb $0x0, 0x4a(%rax) | |
// 87: 48 83 fa 03 cmpq $0x3, %rdx | |
// 8b: 7c 54 jl 0xe1 <_JIT_ENTRY+0xe1> | |
// 8d: 89 d1 movl %edx, %ecx | |
// 8f: 48 8d 71 fe leaq -0x2(%rcx), %rsi | |
// 93: ba 02 00 00 00 movl $0x2, %edx | |
// 98: 48 83 fe 04 cmpq $0x4, %rsi | |
// 9c: 72 32 jb 0xd0 <_JIT_ENTRY+0xd0> | |
// 9e: 48 89 f2 movq %rsi, %rdx | |
// a1: 48 83 e2 fc andq $-0x4, %rdx | |
// a5: 31 ff xorl %edi, %edi | |
// a7: 0f 57 c9 xorps %xmm1, %xmm1 | |
// aa: 66 0f 1f 44 00 00 nopw (%rax,%rax) | |
// b0: 0f 11 4c f8 60 movups %xmm1, 0x60(%rax,%rdi,8) | |
// b5: 0f 11 4c f8 70 movups %xmm1, 0x70(%rax,%rdi,8) | |
// ba: 48 83 c7 04 addq $0x4, %rdi | |
// be: 48 39 fa cmpq %rdi, %rdx | |
// c1: 75 ed jne 0xb0 <_JIT_ENTRY+0xb0> | |
// c3: 48 39 d6 cmpq %rdx, %rsi | |
// c6: 74 19 je 0xe1 <_JIT_ENTRY+0xe1> | |
// c8: 48 83 ca 02 orq $0x2, %rdx | |
// cc: 0f 1f 40 00 nopl (%rax) | |
// d0: 48 c7 44 d0 50 00 00 00 00 movq $0x0, 0x50(%rax,%rdx,8) | |
// d9: 48 ff c2 incq %rdx | |
// dc: 48 39 d1 cmpq %rdx, %rcx | |
// df: 75 ef jne 0xd0 <_JIT_ENTRY+0xd0> | |
// e1: 0f 11 40 50 movups %xmm0, 0x50(%rax) | |
// e5: 66 41 c7 45 48 02 00 movw $0x2, 0x48(%r13) | |
// ec: 48 89 45 f0 movq %rax, -0x10(%rbp) | |
// f0: 48 83 c5 f8 addq $-0x8, %rbp | |
// f4: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xfb <_JIT_ENTRY+0xfb> | |
// 00000000000000f7: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// f4: | |
const unsigned char code_body[244] = { | |
0x0f, 0x10, 0x45, 0xf0, 0x48, 0x8b, 0x45, 0xf0, | |
0x48, 0x8b, 0x40, 0x08, 0x48, 0x8b, 0x90, 0x90, | |
0x03, 0x00, 0x00, 0x8b, 0x02, 0xff, 0xc0, 0x74, | |
0x02, 0x89, 0x02, 0x48, 0x8b, 0x4a, 0x30, 0x49, | |
0x8b, 0x84, 0x24, 0xe8, 0x00, 0x00, 0x00, 0x48, | |
0x63, 0x71, 0x4c, 0x48, 0x8d, 0x34, 0xf0, 0x49, | |
0x89, 0xb4, 0x24, 0xe8, 0x00, 0x00, 0x00, 0x4c, | |
0x89, 0x68, 0x08, 0x48, 0x89, 0x50, 0x10, 0x8b, | |
0x31, 0xff, 0xc6, 0x74, 0x02, 0x89, 0x31, 0x48, | |
0x89, 0x08, 0x0f, 0x10, 0x4a, 0x10, 0x0f, 0x11, | |
0x48, 0x18, 0x48, 0xc7, 0x40, 0x28, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x63, 0x51, 0x48, 0x48, 0x81, | |
0xc1, 0xc8, 0x00, 0x00, 0x00, 0x48, 0x8d, 0x34, | |
0xd0, 0x48, 0x83, 0xc6, 0x50, 0x48, 0x89, 0x70, | |
0x40, 0x48, 0xc7, 0x40, 0x30, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x89, 0x48, 0x38, 0x66, 0xc7, 0x40, | |
0x48, 0x00, 0x00, 0xc6, 0x40, 0x4a, 0x00, 0x48, | |
0x83, 0xfa, 0x03, 0x7c, 0x54, 0x89, 0xd1, 0x48, | |
0x8d, 0x71, 0xfe, 0xba, 0x02, 0x00, 0x00, 0x00, | |
0x48, 0x83, 0xfe, 0x04, 0x72, 0x32, 0x48, 0x89, | |
0xf2, 0x48, 0x83, 0xe2, 0xfc, 0x31, 0xff, 0x0f, | |
0x57, 0xc9, 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00, | |
0x0f, 0x11, 0x4c, 0xf8, 0x60, 0x0f, 0x11, 0x4c, | |
0xf8, 0x70, 0x48, 0x83, 0xc7, 0x04, 0x48, 0x39, | |
0xfa, 0x75, 0xed, 0x48, 0x39, 0xd6, 0x74, 0x19, | |
0x48, 0x83, 0xca, 0x02, 0x0f, 0x1f, 0x40, 0x00, | |
0x48, 0xc7, 0x44, 0xd0, 0x50, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0xff, 0xc2, 0x48, 0x39, 0xd1, 0x75, | |
0xef, 0x0f, 0x11, 0x40, 0x50, 0x66, 0x41, 0xc7, | |
0x45, 0x48, 0x02, 0x00, 0x48, 0x89, 0x45, 0xf0, | |
0x48, 0x83, 0xc5, 0xf8, | |
}; | |
// 0: | |
memcpy(code, code_body, sizeof(code_body)); | |
} | |
void | |
emit__BINARY_SUBSCR_LIST_INT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BINARY_SUBSCR_LIST_INT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 4d f8 movq -0x8(%rbp), %rcx | |
// 8: 48 8b 41 08 movq 0x8(%rcx), %rax | |
// c: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x13 <_JIT_ENTRY+0x13> | |
// 000000000000000f: IMAGE_REL_AMD64_REL32 __imp_PyLong_Type | |
// 13: 75 74 jne 0x89 <_JIT_ENTRY+0x89> | |
// 15: 48 8b 75 f0 movq -0x10(%rbp), %rsi | |
// 19: 48 8b 46 08 movq 0x8(%rsi), %rax | |
// 1d: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x24 <_JIT_ENTRY+0x24> | |
// 0000000000000020: IMAGE_REL_AMD64_REL32 __imp_PyList_Type | |
// 24: 75 63 jne 0x89 <_JIT_ENTRY+0x89> | |
// 26: 48 83 79 10 09 cmpq $0x9, 0x10(%rcx) | |
// 2b: 73 5c jae 0x89 <_JIT_ENTRY+0x89> | |
// 2d: 8b 41 18 movl 0x18(%rcx), %eax | |
// 30: 48 39 46 10 cmpq %rax, 0x10(%rsi) | |
// 34: 7e 53 jle 0x89 <_JIT_ENTRY+0x89> | |
// 36: 48 8b 56 18 movq 0x18(%rsi), %rdx | |
// 3a: 48 8b 1c c2 movq (%rdx,%rax,8), %rbx | |
// 3e: 8b 03 movl (%rbx), %eax | |
// 40: ff c0 incl %eax | |
// 42: 74 02 je 0x46 <_JIT_ENTRY+0x46> | |
// 44: 89 03 movl %eax, (%rbx) | |
// 46: 48 8b 01 movq (%rcx), %rax | |
// 49: 85 c0 testl %eax, %eax | |
// 4b: 78 0e js 0x5b <_JIT_ENTRY+0x5b> | |
// 4d: 48 ff c8 decq %rax | |
// 50: 48 89 01 movq %rax, (%rcx) | |
// 53: 75 06 jne 0x5b <_JIT_ENTRY+0x5b> | |
// 55: ff 15 00 00 00 00 callq *(%rip) # 0x5b <_JIT_ENTRY+0x5b> | |
// 0000000000000057: IMAGE_REL_AMD64_REL32 __imp_PyObject_Free | |
// 5b: 48 8d 7d f8 leaq -0x8(%rbp), %rdi | |
// 5f: 48 8b 06 movq (%rsi), %rax | |
// 62: 85 c0 testl %eax, %eax | |
// 64: 78 11 js 0x77 <_JIT_ENTRY+0x77> | |
// 66: 48 ff c8 decq %rax | |
// 69: 48 89 06 movq %rax, (%rsi) | |
// 6c: 75 09 jne 0x77 <_JIT_ENTRY+0x77> | |
// 6e: 48 89 f1 movq %rsi, %rcx | |
// 71: ff 15 00 00 00 00 callq *(%rip) # 0x77 <_JIT_ENTRY+0x77> | |
// 0000000000000073: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 77: 48 89 5d f0 movq %rbx, -0x10(%rbp) | |
// 7b: 48 89 fd movq %rdi, %rbp | |
// 7e: 48 83 c4 28 addq $0x28, %rsp | |
// 82: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x89 <_JIT_ENTRY+0x89> | |
// 0000000000000085: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 89: 48 83 c4 28 addq $0x28, %rsp | |
// 8d: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x94 <_JIT_ENTRY+0x94> | |
// 0000000000000090: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 94: | |
const unsigned char code_body[148] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x4d, 0xf8, | |
0x48, 0x8b, 0x41, 0x08, 0x48, 0x3b, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x75, 0x74, 0x48, 0x8b, 0x75, | |
0xf0, 0x48, 0x8b, 0x46, 0x08, 0x48, 0x3b, 0x05, | |
0x00, 0x00, 0x00, 0x00, 0x75, 0x63, 0x48, 0x83, | |
0x79, 0x10, 0x09, 0x73, 0x5c, 0x8b, 0x41, 0x18, | |
0x48, 0x39, 0x46, 0x10, 0x7e, 0x53, 0x48, 0x8b, | |
0x56, 0x18, 0x48, 0x8b, 0x1c, 0xc2, 0x8b, 0x03, | |
0xff, 0xc0, 0x74, 0x02, 0x89, 0x03, 0x48, 0x8b, | |
0x01, 0x85, 0xc0, 0x78, 0x0e, 0x48, 0xff, 0xc8, | |
0x48, 0x89, 0x01, 0x75, 0x06, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x8d, 0x7d, 0xf8, 0x48, | |
0x8b, 0x06, 0x85, 0xc0, 0x78, 0x11, 0x48, 0xff, | |
0xc8, 0x48, 0x89, 0x06, 0x75, 0x09, 0x48, 0x89, | |
0xf1, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x89, 0x5d, 0xf0, 0x48, 0x89, 0xfd, 0x48, 0x83, | |
0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PyLong_Type+0x0 | |
// 8: &PyList_Type+0x0 | |
// 10: &PyObject_Free+0x0 | |
// 18: &_Py_Dealloc+0x0 | |
// 20: CONTINUE | |
// 28: JUMP_TARGET | |
const unsigned char data_body[48] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyLong_Type); | |
patch_64(data + 0x8, (uintptr_t)&PyList_Type); | |
patch_64(data + 0x10, (uintptr_t)&PyObject_Free); | |
patch_64(data + 0x18, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x20, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x28, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xf, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x20, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x57, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x73, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x85, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0x90, (uintptr_t)data + 0x24); | |
} | |
void | |
emit__BINARY_SUBSCR_STR_INT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BINARY_SUBSCR_STR_INT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 4d f8 movq -0x8(%rbp), %rcx | |
// 8: 48 8b 41 08 movq 0x8(%rcx), %rax | |
// c: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x13 <_JIT_ENTRY+0x13> | |
// 000000000000000f: IMAGE_REL_AMD64_REL32 __imp_PyLong_Type | |
// 13: 0f 85 be 00 00 00 jne 0xd7 <_JIT_ENTRY+0xd7> | |
// 19: 48 8b 75 f0 movq -0x10(%rbp), %rsi | |
// 1d: 48 8b 46 08 movq 0x8(%rsi), %rax | |
// 21: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x28 <_JIT_ENTRY+0x28> | |
// 0000000000000024: IMAGE_REL_AMD64_REL32 __imp_PyUnicode_Type | |
// 28: 0f 85 a9 00 00 00 jne 0xd7 <_JIT_ENTRY+0xd7> | |
// 2e: 48 83 79 10 09 cmpq $0x9, 0x10(%rcx) | |
// 33: 0f 83 9e 00 00 00 jae 0xd7 <_JIT_ENTRY+0xd7> | |
// 39: 8b 41 18 movl 0x18(%rcx), %eax | |
// 3c: 48 39 46 10 cmpq %rax, 0x10(%rsi) | |
// 40: 0f 8e 91 00 00 00 jle 0xd7 <_JIT_ENTRY+0xd7> | |
// 46: 8b 56 20 movl 0x20(%rsi), %edx | |
// 49: 89 d7 movl %edx, %edi | |
// 4b: c1 ef 02 shrl $0x2, %edi | |
// 4e: 83 e7 07 andl $0x7, %edi | |
// 51: 83 ff 02 cmpl $0x2, %edi | |
// 54: 74 14 je 0x6a <_JIT_ENTRY+0x6a> | |
// 56: 83 ff 01 cmpl $0x1, %edi | |
// 59: 75 1e jne 0x79 <_JIT_ENTRY+0x79> | |
// 5b: f6 c2 20 testb $0x20, %dl | |
// 5e: 75 24 jne 0x84 <_JIT_ENTRY+0x84> | |
// 60: 48 8b 56 38 movq 0x38(%rsi), %rdx | |
// 64: 0f b6 1c 02 movzbl (%rdx,%rax), %ebx | |
// 68: eb 65 jmp 0xcf <_JIT_ENTRY+0xcf> | |
// 6a: f6 c2 20 testb $0x20, %dl | |
// 6d: 75 2f jne 0x9e <_JIT_ENTRY+0x9e> | |
// 6f: 48 8b 56 38 movq 0x38(%rsi), %rdx | |
// 73: 0f b7 1c 42 movzwl (%rdx,%rax,2), %ebx | |
// 77: eb 56 jmp 0xcf <_JIT_ENTRY+0xcf> | |
// 79: f6 c2 20 testb $0x20, %dl | |
// 7c: 75 3a jne 0xb8 <_JIT_ENTRY+0xb8> | |
// 7e: 48 8b 56 38 movq 0x38(%rsi), %rdx | |
// 82: eb 48 jmp 0xcc <_JIT_ENTRY+0xcc> | |
// 84: 31 ff xorl %edi, %edi | |
// 86: f6 c2 40 testb $0x40, %dl | |
// 89: 40 0f 94 c7 sete %dil | |
// 8d: c1 e7 04 shll $0x4, %edi | |
// 90: 48 8d 14 3e leaq (%rsi,%rdi), %rdx | |
// 94: 48 83 c2 28 addq $0x28, %rdx | |
// 98: 0f b6 1c 02 movzbl (%rdx,%rax), %ebx | |
// 9c: eb 31 jmp 0xcf <_JIT_ENTRY+0xcf> | |
// 9e: 31 ff xorl %edi, %edi | |
// a0: f6 c2 40 testb $0x40, %dl | |
// a3: 40 0f 94 c7 sete %dil | |
// a7: c1 e7 04 shll $0x4, %edi | |
// aa: 48 8d 14 3e leaq (%rsi,%rdi), %rdx | |
// ae: 48 83 c2 28 addq $0x28, %rdx | |
// b2: 0f b7 1c 42 movzwl (%rdx,%rax,2), %ebx | |
// b6: eb 17 jmp 0xcf <_JIT_ENTRY+0xcf> | |
// b8: 31 ff xorl %edi, %edi | |
// ba: f6 c2 40 testb $0x40, %dl | |
// bd: 40 0f 94 c7 sete %dil | |
// c1: c1 e7 04 shll $0x4, %edi | |
// c4: 48 8d 14 3e leaq (%rsi,%rdi), %rdx | |
// c8: 48 83 c2 28 addq $0x28, %rdx | |
// cc: 8b 1c 82 movl (%rdx,%rax,4), %ebx | |
// cf: 81 fb 80 00 00 00 cmpl $0x80, %ebx | |
// d5: 72 0b jb 0xe2 <_JIT_ENTRY+0xe2> | |
// d7: 48 83 c4 28 addq $0x28, %rsp | |
// db: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xe2 <_JIT_ENTRY+0xe2> | |
// 00000000000000de: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// e2: 48 8b 01 movq (%rcx), %rax | |
// e5: 85 c0 testl %eax, %eax | |
// e7: 78 0e js 0xf7 <_JIT_ENTRY+0xf7> | |
// e9: 48 ff c8 decq %rax | |
// ec: 48 89 01 movq %rax, (%rcx) | |
// ef: 75 06 jne 0xf7 <_JIT_ENTRY+0xf7> | |
// f1: ff 15 00 00 00 00 callq *(%rip) # 0xf7 <_JIT_ENTRY+0xf7> | |
// 00000000000000f3: IMAGE_REL_AMD64_REL32 __imp_PyObject_Free | |
// f7: 48 8d 7d f8 leaq -0x8(%rbp), %rdi | |
// fb: 48 8b 06 movq (%rsi), %rax | |
// fe: 85 c0 testl %eax, %eax | |
// 100: 78 11 js 0x113 <_JIT_ENTRY+0x113> | |
// 102: 48 ff c8 decq %rax | |
// 105: 48 89 06 movq %rax, (%rsi) | |
// 108: 75 09 jne 0x113 <_JIT_ENTRY+0x113> | |
// 10a: 48 89 f1 movq %rsi, %rcx | |
// 10d: ff 15 00 00 00 00 callq *(%rip) # 0x113 <_JIT_ENTRY+0x113> | |
// 000000000000010f: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 113: 89 d8 movl %ebx, %eax | |
// 115: 48 8d 04 40 leaq (%rax,%rax,2), %rax | |
// 119: 48 c1 e0 04 shlq $0x4, %rax | |
// 11d: 48 8b 0d 00 00 00 00 movq (%rip), %rcx # 0x124 <_JIT_ENTRY+0x124> | |
// 0000000000000120: IMAGE_REL_AMD64_REL32 __imp__PyRuntime | |
// 124: 48 01 c8 addq %rcx, %rax | |
// 127: 48 05 d8 1e 01 00 addq $0x11ed8, %rax # imm = 0x11ED8 | |
// 12d: 48 89 45 f0 movq %rax, -0x10(%rbp) | |
// 131: 48 89 fd movq %rdi, %rbp | |
// 134: 48 83 c4 28 addq $0x28, %rsp | |
// 138: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x13f <_JIT_ENTRY+0x13f> | |
// 000000000000013b: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 138: | |
const unsigned char code_body[312] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x4d, 0xf8, | |
0x48, 0x8b, 0x41, 0x08, 0x48, 0x3b, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x0f, 0x85, 0xbe, 0x00, 0x00, | |
0x00, 0x48, 0x8b, 0x75, 0xf0, 0x48, 0x8b, 0x46, | |
0x08, 0x48, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, | |
0x0f, 0x85, 0xa9, 0x00, 0x00, 0x00, 0x48, 0x83, | |
0x79, 0x10, 0x09, 0x0f, 0x83, 0x9e, 0x00, 0x00, | |
0x00, 0x8b, 0x41, 0x18, 0x48, 0x39, 0x46, 0x10, | |
0x0f, 0x8e, 0x91, 0x00, 0x00, 0x00, 0x8b, 0x56, | |
0x20, 0x89, 0xd7, 0xc1, 0xef, 0x02, 0x83, 0xe7, | |
0x07, 0x83, 0xff, 0x02, 0x74, 0x14, 0x83, 0xff, | |
0x01, 0x75, 0x1e, 0xf6, 0xc2, 0x20, 0x75, 0x24, | |
0x48, 0x8b, 0x56, 0x38, 0x0f, 0xb6, 0x1c, 0x02, | |
0xeb, 0x65, 0xf6, 0xc2, 0x20, 0x75, 0x2f, 0x48, | |
0x8b, 0x56, 0x38, 0x0f, 0xb7, 0x1c, 0x42, 0xeb, | |
0x56, 0xf6, 0xc2, 0x20, 0x75, 0x3a, 0x48, 0x8b, | |
0x56, 0x38, 0xeb, 0x48, 0x31, 0xff, 0xf6, 0xc2, | |
0x40, 0x40, 0x0f, 0x94, 0xc7, 0xc1, 0xe7, 0x04, | |
0x48, 0x8d, 0x14, 0x3e, 0x48, 0x83, 0xc2, 0x28, | |
0x0f, 0xb6, 0x1c, 0x02, 0xeb, 0x31, 0x31, 0xff, | |
0xf6, 0xc2, 0x40, 0x40, 0x0f, 0x94, 0xc7, 0xc1, | |
0xe7, 0x04, 0x48, 0x8d, 0x14, 0x3e, 0x48, 0x83, | |
0xc2, 0x28, 0x0f, 0xb7, 0x1c, 0x42, 0xeb, 0x17, | |
0x31, 0xff, 0xf6, 0xc2, 0x40, 0x40, 0x0f, 0x94, | |
0xc7, 0xc1, 0xe7, 0x04, 0x48, 0x8d, 0x14, 0x3e, | |
0x48, 0x83, 0xc2, 0x28, 0x8b, 0x1c, 0x82, 0x81, | |
0xfb, 0x80, 0x00, 0x00, 0x00, 0x72, 0x0b, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x8b, 0x01, 0x85, 0xc0, 0x78, | |
0x0e, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x01, 0x75, | |
0x06, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8d, 0x7d, 0xf8, 0x48, 0x8b, 0x06, 0x85, 0xc0, | |
0x78, 0x11, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x06, | |
0x75, 0x09, 0x48, 0x89, 0xf1, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x89, 0xd8, 0x48, 0x8d, 0x04, | |
0x40, 0x48, 0xc1, 0xe0, 0x04, 0x48, 0x8b, 0x0d, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x01, 0xc8, 0x48, | |
0x05, 0xd8, 0x1e, 0x01, 0x00, 0x48, 0x89, 0x45, | |
0xf0, 0x48, 0x89, 0xfd, 0x48, 0x83, 0xc4, 0x28, | |
}; | |
// 0: | |
// 0: &PyLong_Type+0x0 | |
// 8: &PyUnicode_Type+0x0 | |
// 10: JUMP_TARGET | |
// 18: &PyObject_Free+0x0 | |
// 20: &_Py_Dealloc+0x0 | |
// 28: &_PyRuntime+0x0 | |
const unsigned char data_body[48] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyLong_Type); | |
patch_64(data + 0x8, (uintptr_t)&PyUnicode_Type); | |
patch_64(data + 0x10, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x18, (uintptr_t)&PyObject_Free); | |
patch_64(data + 0x20, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x28, (uintptr_t)&_PyRuntime); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xf, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x24, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0xde, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xf3, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x10f, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0x120, (uintptr_t)data + 0x24); | |
} | |
void | |
emit__BINARY_SUBSCR_TUPLE_INT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BINARY_SUBSCR_TUPLE_INT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 4d f8 movq -0x8(%rbp), %rcx | |
// 8: 48 8b 41 08 movq 0x8(%rcx), %rax | |
// c: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x13 <_JIT_ENTRY+0x13> | |
// 000000000000000f: IMAGE_REL_AMD64_REL32 __imp_PyLong_Type | |
// 13: 75 71 jne 0x86 <_JIT_ENTRY+0x86> | |
// 15: 48 8b 75 f0 movq -0x10(%rbp), %rsi | |
// 19: 48 8b 46 08 movq 0x8(%rsi), %rax | |
// 1d: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x24 <_JIT_ENTRY+0x24> | |
// 0000000000000020: IMAGE_REL_AMD64_REL32 __imp_PyTuple_Type | |
// 24: 75 60 jne 0x86 <_JIT_ENTRY+0x86> | |
// 26: 48 83 79 10 09 cmpq $0x9, 0x10(%rcx) | |
// 2b: 73 59 jae 0x86 <_JIT_ENTRY+0x86> | |
// 2d: 8b 41 18 movl 0x18(%rcx), %eax | |
// 30: 48 39 46 10 cmpq %rax, 0x10(%rsi) | |
// 34: 7e 50 jle 0x86 <_JIT_ENTRY+0x86> | |
// 36: 48 8b 5c c6 18 movq 0x18(%rsi,%rax,8), %rbx | |
// 3b: 8b 03 movl (%rbx), %eax | |
// 3d: ff c0 incl %eax | |
// 3f: 74 02 je 0x43 <_JIT_ENTRY+0x43> | |
// 41: 89 03 movl %eax, (%rbx) | |
// 43: 48 8b 01 movq (%rcx), %rax | |
// 46: 85 c0 testl %eax, %eax | |
// 48: 78 0e js 0x58 <_JIT_ENTRY+0x58> | |
// 4a: 48 ff c8 decq %rax | |
// 4d: 48 89 01 movq %rax, (%rcx) | |
// 50: 75 06 jne 0x58 <_JIT_ENTRY+0x58> | |
// 52: ff 15 00 00 00 00 callq *(%rip) # 0x58 <_JIT_ENTRY+0x58> | |
// 0000000000000054: IMAGE_REL_AMD64_REL32 __imp_PyObject_Free | |
// 58: 48 8d 7d f8 leaq -0x8(%rbp), %rdi | |
// 5c: 48 8b 06 movq (%rsi), %rax | |
// 5f: 85 c0 testl %eax, %eax | |
// 61: 78 11 js 0x74 <_JIT_ENTRY+0x74> | |
// 63: 48 ff c8 decq %rax | |
// 66: 48 89 06 movq %rax, (%rsi) | |
// 69: 75 09 jne 0x74 <_JIT_ENTRY+0x74> | |
// 6b: 48 89 f1 movq %rsi, %rcx | |
// 6e: ff 15 00 00 00 00 callq *(%rip) # 0x74 <_JIT_ENTRY+0x74> | |
// 0000000000000070: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 74: 48 89 5d f0 movq %rbx, -0x10(%rbp) | |
// 78: 48 89 fd movq %rdi, %rbp | |
// 7b: 48 83 c4 28 addq $0x28, %rsp | |
// 7f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x86 <_JIT_ENTRY+0x86> | |
// 0000000000000082: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 86: 48 83 c4 28 addq $0x28, %rsp | |
// 8a: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x91 <_JIT_ENTRY+0x91> | |
// 000000000000008d: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 91: | |
const unsigned char code_body[145] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x4d, 0xf8, | |
0x48, 0x8b, 0x41, 0x08, 0x48, 0x3b, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x75, 0x71, 0x48, 0x8b, 0x75, | |
0xf0, 0x48, 0x8b, 0x46, 0x08, 0x48, 0x3b, 0x05, | |
0x00, 0x00, 0x00, 0x00, 0x75, 0x60, 0x48, 0x83, | |
0x79, 0x10, 0x09, 0x73, 0x59, 0x8b, 0x41, 0x18, | |
0x48, 0x39, 0x46, 0x10, 0x7e, 0x50, 0x48, 0x8b, | |
0x5c, 0xc6, 0x18, 0x8b, 0x03, 0xff, 0xc0, 0x74, | |
0x02, 0x89, 0x03, 0x48, 0x8b, 0x01, 0x85, 0xc0, | |
0x78, 0x0e, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x01, | |
0x75, 0x06, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8d, 0x7d, 0xf8, 0x48, 0x8b, 0x06, 0x85, | |
0xc0, 0x78, 0x11, 0x48, 0xff, 0xc8, 0x48, 0x89, | |
0x06, 0x75, 0x09, 0x48, 0x89, 0xf1, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0x5d, 0xf0, | |
0x48, 0x89, 0xfd, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x83, | |
0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, | |
}; | |
// 0: | |
// 0: &PyLong_Type+0x0 | |
// 8: &PyTuple_Type+0x0 | |
// 10: &PyObject_Free+0x0 | |
// 18: &_Py_Dealloc+0x0 | |
// 20: CONTINUE | |
// 28: JUMP_TARGET | |
const unsigned char data_body[48] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyLong_Type); | |
patch_64(data + 0x8, (uintptr_t)&PyTuple_Type); | |
patch_64(data + 0x10, (uintptr_t)&PyObject_Free); | |
patch_64(data + 0x18, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x20, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x28, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xf, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x20, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x54, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x70, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x82, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0x8d, (uintptr_t)data + 0x24); | |
} | |
void | |
emit__BUILD_LIST( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BUILD_LIST.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 3d 00 00 00 00 movq (%rip), %rdi # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: 0f b7 d7 movzwl %di, %edx | |
// e: 8d 04 d5 00 00 00 00 leal (,%rdx,8), %eax | |
// 15: 48 89 ee movq %rbp, %rsi | |
// 18: 48 29 c6 subq %rax, %rsi | |
// 1b: 48 89 f1 movq %rsi, %rcx | |
// 1e: ff 15 00 00 00 00 callq *(%rip) # 0x24 <_JIT_ENTRY+0x24> | |
// 0000000000000020: IMAGE_REL_AMD64_REL32 __imp__PyList_FromStackRefSteal | |
// 24: 48 85 c0 testq %rax, %rax | |
// 27: 74 1f je 0x48 <_JIT_ENTRY+0x48> | |
// 29: 0f b7 cf movzwl %di, %ecx | |
// 2c: 48 89 06 movq %rax, (%rsi) | |
// 2f: b8 01 00 00 00 movl $0x1, %eax | |
// 34: 29 c8 subl %ecx, %eax | |
// 36: 48 98 cltq | |
// 38: 48 8d 6c c5 00 leaq (%rbp,%rax,8), %rbp | |
// 3d: 48 83 c4 28 addq $0x28, %rsp | |
// 41: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x48 <_JIT_ENTRY+0x48> | |
// 0000000000000044: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 48: 48 83 c4 28 addq $0x28, %rsp | |
// 4c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x53 <_JIT_ENTRY+0x53> | |
// 000000000000004f: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 53: | |
const unsigned char code_body[83] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x3d, 0x00, | |
0x00, 0x00, 0x00, 0x0f, 0xb7, 0xd7, 0x8d, 0x04, | |
0xd5, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0xee, | |
0x48, 0x29, 0xc6, 0x48, 0x89, 0xf1, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x85, 0xc0, 0x74, | |
0x1f, 0x0f, 0xb7, 0xcf, 0x48, 0x89, 0x06, 0xb8, | |
0x01, 0x00, 0x00, 0x00, 0x29, 0xc8, 0x48, 0x98, | |
0x48, 0x8d, 0x6c, 0xc5, 0x00, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &_PyList_FromStackRefSteal+0x0 | |
// 10: CONTINUE | |
// 18: ERROR_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&_PyList_FromStackRefSteal); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x20, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x44, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x4f, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__BUILD_MAP( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BUILD_MAP.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 38 subq $0x38, %rsp | |
// 4: 4c 89 64 24 30 movq %r12, 0x30(%rsp) | |
// 9: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x10 <_JIT_ENTRY+0x10> | |
// 000000000000000c: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 10: 0f b7 d8 movzwl %ax, %ebx | |
// 13: 01 db addl %ebx, %ebx | |
// 15: 89 d9 movl %ebx, %ecx | |
// 17: f7 d9 negl %ecx | |
// 19: 4c 63 f1 movslq %ecx, %r14 | |
// 1c: 4a 8d 34 f5 00 00 00 00 leaq (,%r14,8), %rsi | |
// 24: 48 01 ee addq %rbp, %rsi | |
// 27: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 2b: 44 0f b7 f8 movzwl %ax, %r15d | |
// 2f: 4e 8d 44 f5 08 leaq 0x8(%rbp,%r14,8), %r8 | |
// 34: 4c 89 7c 24 20 movq %r15, 0x20(%rsp) | |
// 39: ba 02 00 00 00 movl $0x2, %edx | |
// 3e: 41 b9 02 00 00 00 movl $0x2, %r9d | |
// 44: 48 89 f1 movq %rsi, %rcx | |
// 47: ff 15 00 00 00 00 callq *(%rip) # 0x4d <_JIT_ENTRY+0x4d> | |
// 0000000000000049: IMAGE_REL_AMD64_REL32 __imp__PyDict_FromItems | |
// 4d: 48 89 c7 movq %rax, %rdi | |
// 50: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 54: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 5c: 66 45 85 ff testw %r15w, %r15w | |
// 60: 75 28 jne 0x8a <_JIT_ENTRY+0x8a> | |
// 62: 48 85 ff testq %rdi, %rdi | |
// 65: 74 5b je 0xc2 <_JIT_ENTRY+0xc2> | |
// 67: 4a 89 7c f5 00 movq %rdi, (%rbp,%r14,8) | |
// 6c: b8 01 00 00 00 movl $0x1, %eax | |
// 71: 29 d8 subl %ebx, %eax | |
// 73: 48 98 cltq | |
// 75: 48 8d 6c c5 00 leaq (%rbp,%rax,8), %rbp | |
// 7a: 4c 8b 64 24 30 movq 0x30(%rsp), %r12 | |
// 7f: 48 83 c4 38 addq $0x38, %rsp | |
// 83: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x8a <_JIT_ENTRY+0x8a> | |
// 0000000000000086: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 8a: 4e 8d 3c 7d 01 00 00 00 leaq 0x1(,%r15,2), %r15 | |
// 92: 4c 8b 25 00 00 00 00 movq (%rip), %r12 # 0x99 <_JIT_ENTRY+0x99> | |
// 0000000000000095: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 99: eb 0e jmp 0xa9 <_JIT_ENTRY+0xa9> | |
// 9b: 0f 1f 44 00 00 nopl (%rax,%rax) | |
// a0: 49 ff cf decq %r15 | |
// a3: 49 83 ff 01 cmpq $0x1, %r15 | |
// a7: 76 b9 jbe 0x62 <_JIT_ENTRY+0x62> | |
// a9: 4a 8b 4c fe f0 movq -0x10(%rsi,%r15,8), %rcx | |
// ae: 48 8b 01 movq (%rcx), %rax | |
// b1: 85 c0 testl %eax, %eax | |
// b3: 78 eb js 0xa0 <_JIT_ENTRY+0xa0> | |
// b5: 48 ff c8 decq %rax | |
// b8: 48 89 01 movq %rax, (%rcx) | |
// bb: 75 e3 jne 0xa0 <_JIT_ENTRY+0xa0> | |
// bd: 41 ff d4 callq *%r12 | |
// c0: eb de jmp 0xa0 <_JIT_ENTRY+0xa0> | |
// c2: 4c 8b 64 24 30 movq 0x30(%rsp), %r12 | |
// c7: 48 83 c4 38 addq $0x38, %rsp | |
// cb: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xd2 <_JIT_ENTRY+0xd2> | |
// 00000000000000ce: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// d2: | |
const unsigned char code_body[210] = { | |
0x48, 0x83, 0xec, 0x38, 0x4c, 0x89, 0x64, 0x24, | |
0x30, 0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, | |
0x0f, 0xb7, 0xd8, 0x01, 0xdb, 0x89, 0xd9, 0xf7, | |
0xd9, 0x4c, 0x63, 0xf1, 0x4a, 0x8d, 0x34, 0xf5, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x01, 0xee, 0x49, | |
0x89, 0x6d, 0x40, 0x44, 0x0f, 0xb7, 0xf8, 0x4e, | |
0x8d, 0x44, 0xf5, 0x08, 0x4c, 0x89, 0x7c, 0x24, | |
0x20, 0xba, 0x02, 0x00, 0x00, 0x00, 0x41, 0xb9, | |
0x02, 0x00, 0x00, 0x00, 0x48, 0x89, 0xf1, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0xc7, | |
0x49, 0x8b, 0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, | |
0x00, 0x00, 0x00, 0x00, 0x66, 0x45, 0x85, 0xff, | |
0x75, 0x28, 0x48, 0x85, 0xff, 0x74, 0x5b, 0x4a, | |
0x89, 0x7c, 0xf5, 0x00, 0xb8, 0x01, 0x00, 0x00, | |
0x00, 0x29, 0xd8, 0x48, 0x98, 0x48, 0x8d, 0x6c, | |
0xc5, 0x00, 0x4c, 0x8b, 0x64, 0x24, 0x30, 0x48, | |
0x83, 0xc4, 0x38, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x4e, 0x8d, 0x3c, 0x7d, 0x01, 0x00, | |
0x00, 0x00, 0x4c, 0x8b, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0xeb, 0x0e, 0x0f, 0x1f, 0x44, 0x00, 0x00, | |
0x49, 0xff, 0xcf, 0x49, 0x83, 0xff, 0x01, 0x76, | |
0xb9, 0x4a, 0x8b, 0x4c, 0xfe, 0xf0, 0x48, 0x8b, | |
0x01, 0x85, 0xc0, 0x78, 0xeb, 0x48, 0xff, 0xc8, | |
0x48, 0x89, 0x01, 0x75, 0xe3, 0x41, 0xff, 0xd4, | |
0xeb, 0xde, 0x4c, 0x8b, 0x64, 0x24, 0x30, 0x48, | |
0x83, 0xc4, 0x38, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &_PyDict_FromItems+0x0 | |
// 10: CONTINUE | |
// 18: &_Py_Dealloc+0x0 | |
// 20: ERROR_TARGET | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&_PyDict_FromItems); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x20, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xc, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x49, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x86, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x95, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xce, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__BUILD_SET( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BUILD_SET.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 38 subq $0x38, %rsp | |
// 4: 48 89 ee movq %rbp, %rsi | |
// 7: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// b: 31 c9 xorl %ecx, %ecx | |
// d: ff 15 00 00 00 00 callq *(%rip) # 0x13 <_JIT_ENTRY+0x13> | |
// 000000000000000f: IMAGE_REL_AMD64_REL32 __imp_PySet_New | |
// 13: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 17: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 1f: 48 85 c0 testq %rax, %rax | |
// 22: 0f 84 af 00 00 00 je 0xd7 <_JIT_ENTRY+0xd7> | |
// 28: 48 89 c7 movq %rax, %rdi | |
// 2b: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x32 <_JIT_ENTRY+0x32> | |
// 000000000000002e: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 32: 0f b7 c8 movzwl %ax, %ecx | |
// 35: 0f b7 d0 movzwl %ax, %edx | |
// 38: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x3f <_JIT_ENTRY+0x3f> | |
// 000000000000003b: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 3f: 66 85 c0 testw %ax, %ax | |
// 42: 0f 84 07 01 00 00 je 0x14f <_JIT_ENTRY+0x14f> | |
// 48: 4c 89 64 24 30 movq %r12, 0x30(%rsp) | |
// 4d: 48 89 54 24 28 movq %rdx, 0x28(%rsp) | |
// 52: 8d 04 d5 00 00 00 00 leal (,%rdx,8), %eax | |
// 59: 48 29 c6 subq %rax, %rsi | |
// 5c: 83 f9 01 cmpl $0x1, %ecx | |
// 5f: 89 4c 24 24 movl %ecx, 0x24(%rsp) | |
// 63: 41 89 ce movl %ecx, %r14d | |
// 66: 41 83 d6 00 adcl $0x0, %r14d | |
// 6a: 45 31 e4 xorl %r12d, %r12d | |
// 6d: 4c 8b 3d 00 00 00 00 movq (%rip), %r15 # 0x74 <_JIT_ENTRY+0x74> | |
// 0000000000000070: IMAGE_REL_AMD64_REL32 __imp_PySet_Add | |
// 74: 31 db xorl %ebx, %ebx | |
// 76: eb 14 jmp 0x8c <_JIT_ENTRY+0x8c> | |
// 78: 0f 1f 84 00 00 00 00 00 nopl (%rax,%rax) | |
// 80: 49 ff c4 incq %r12 | |
// 83: 4d 39 e6 cmpq %r12, %r14 | |
// 86: 0f 84 97 00 00 00 je 0x123 <_JIT_ENTRY+0x123> | |
// 8c: 85 db testl %ebx, %ebx | |
// 8e: 74 10 je 0xa0 <_JIT_ENTRY+0xa0> | |
// 90: 4a 8b 0c e6 movq (%rsi,%r12,8), %rcx | |
// 94: 48 8b 01 movq (%rcx), %rax | |
// 97: 85 c0 testl %eax, %eax | |
// 99: 78 e5 js 0x80 <_JIT_ENTRY+0x80> | |
// 9b: eb 2a jmp 0xc7 <_JIT_ENTRY+0xc7> | |
// 9d: 0f 1f 00 nopl (%rax) | |
// a0: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// a4: 4a 8b 14 e6 movq (%rsi,%r12,8), %rdx | |
// a8: 48 89 f9 movq %rdi, %rcx | |
// ab: 41 ff d7 callq *%r15 | |
// ae: 89 c3 movl %eax, %ebx | |
// b0: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// b4: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// bc: 4a 8b 0c e6 movq (%rsi,%r12,8), %rcx | |
// c0: 48 8b 01 movq (%rcx), %rax | |
// c3: 85 c0 testl %eax, %eax | |
// c5: 78 b9 js 0x80 <_JIT_ENTRY+0x80> | |
// c7: 48 ff c8 decq %rax | |
// ca: 48 89 01 movq %rax, (%rcx) | |
// cd: 75 b1 jne 0x80 <_JIT_ENTRY+0x80> | |
// cf: ff 15 00 00 00 00 callq *(%rip) # 0xd5 <_JIT_ENTRY+0xd5> | |
// 00000000000000d1: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// d5: eb a9 jmp 0x80 <_JIT_ENTRY+0x80> | |
// d7: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0xde <_JIT_ENTRY+0xde> | |
// 00000000000000da: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// de: 66 85 c0 testw %ax, %ax | |
// e1: 74 58 je 0x13b <_JIT_ENTRY+0x13b> | |
// e3: 0f b7 3d 00 00 00 00 movzwl (%rip), %edi # 0xea <_JIT_ENTRY+0xea> | |
// 00000000000000e6: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// ea: 48 ff c7 incq %rdi | |
// ed: 48 83 c6 f8 addq $-0x8, %rsi | |
// f1: 48 8b 1d 00 00 00 00 movq (%rip), %rbx # 0xf8 <_JIT_ENTRY+0xf8> | |
// 00000000000000f4: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// f8: eb 13 jmp 0x10d <_JIT_ENTRY+0x10d> | |
// fa: 66 0f 1f 44 00 00 nopw (%rax,%rax) | |
// 100: 48 ff cf decq %rdi | |
// 103: 48 83 c6 f8 addq $-0x8, %rsi | |
// 107: 48 83 ff 01 cmpq $0x1, %rdi | |
// 10b: 76 2e jbe 0x13b <_JIT_ENTRY+0x13b> | |
// 10d: 48 8b 0e movq (%rsi), %rcx | |
// 110: 48 8b 01 movq (%rcx), %rax | |
// 113: 85 c0 testl %eax, %eax | |
// 115: 78 e9 js 0x100 <_JIT_ENTRY+0x100> | |
// 117: 48 ff c8 decq %rax | |
// 11a: 48 89 01 movq %rax, (%rcx) | |
// 11d: 75 e1 jne 0x100 <_JIT_ENTRY+0x100> | |
// 11f: ff d3 callq *%rbx | |
// 121: eb dd jmp 0x100 <_JIT_ENTRY+0x100> | |
// 123: 85 db testl %ebx, %ebx | |
// 125: 4c 8b 64 24 30 movq 0x30(%rsp), %r12 | |
// 12a: 74 1a je 0x146 <_JIT_ENTRY+0x146> | |
// 12c: 48 8b 07 movq (%rdi), %rax | |
// 12f: 85 c0 testl %eax, %eax | |
// 131: 78 08 js 0x13b <_JIT_ENTRY+0x13b> | |
// 133: 48 ff c8 decq %rax | |
// 136: 48 89 07 movq %rax, (%rdi) | |
// 139: 74 35 je 0x170 <_JIT_ENTRY+0x170> | |
// 13b: 48 83 c4 38 addq $0x38, %rsp | |
// 13f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x146 <_JIT_ENTRY+0x146> | |
// 0000000000000142: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 146: 8b 4c 24 24 movl 0x24(%rsp), %ecx | |
// 14a: 48 8b 54 24 28 movq 0x28(%rsp), %rdx | |
// 14f: 48 f7 da negq %rdx | |
// 152: 48 89 7c d5 00 movq %rdi, (%rbp,%rdx,8) | |
// 157: b8 01 00 00 00 movl $0x1, %eax | |
// 15c: 29 c8 subl %ecx, %eax | |
// 15e: 48 98 cltq | |
// 160: 48 8d 6c c5 00 leaq (%rbp,%rax,8), %rbp | |
// 165: 48 83 c4 38 addq $0x38, %rsp | |
// 169: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x170 <_JIT_ENTRY+0x170> | |
// 000000000000016c: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 170: 48 89 f9 movq %rdi, %rcx | |
// 173: ff 15 00 00 00 00 callq *(%rip) # 0x179 <_JIT_ENTRY+0x179> | |
// 0000000000000175: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 179: 48 83 c4 38 addq $0x38, %rsp | |
// 17d: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x184 <_JIT_ENTRY+0x184> | |
// 0000000000000180: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 184: | |
const unsigned char code_body[388] = { | |
0x48, 0x83, 0xec, 0x38, 0x48, 0x89, 0xee, 0x49, | |
0x89, 0x6d, 0x40, 0x31, 0xc9, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, | |
0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x85, 0xc0, 0x0f, 0x84, 0xaf, 0x00, 0x00, 0x00, | |
0x48, 0x89, 0xc7, 0x48, 0x8b, 0x05, 0x00, 0x00, | |
0x00, 0x00, 0x0f, 0xb7, 0xc8, 0x0f, 0xb7, 0xd0, | |
0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x66, | |
0x85, 0xc0, 0x0f, 0x84, 0x07, 0x01, 0x00, 0x00, | |
0x4c, 0x89, 0x64, 0x24, 0x30, 0x48, 0x89, 0x54, | |
0x24, 0x28, 0x8d, 0x04, 0xd5, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x29, 0xc6, 0x83, 0xf9, 0x01, 0x89, | |
0x4c, 0x24, 0x24, 0x41, 0x89, 0xce, 0x41, 0x83, | |
0xd6, 0x00, 0x45, 0x31, 0xe4, 0x4c, 0x8b, 0x3d, | |
0x00, 0x00, 0x00, 0x00, 0x31, 0xdb, 0xeb, 0x14, | |
0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x49, 0xff, 0xc4, 0x4d, 0x39, 0xe6, 0x0f, 0x84, | |
0x97, 0x00, 0x00, 0x00, 0x85, 0xdb, 0x74, 0x10, | |
0x4a, 0x8b, 0x0c, 0xe6, 0x48, 0x8b, 0x01, 0x85, | |
0xc0, 0x78, 0xe5, 0xeb, 0x2a, 0x0f, 0x1f, 0x00, | |
0x49, 0x89, 0x6d, 0x40, 0x4a, 0x8b, 0x14, 0xe6, | |
0x48, 0x89, 0xf9, 0x41, 0xff, 0xd7, 0x89, 0xc3, | |
0x49, 0x8b, 0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, | |
0x00, 0x00, 0x00, 0x00, 0x4a, 0x8b, 0x0c, 0xe6, | |
0x48, 0x8b, 0x01, 0x85, 0xc0, 0x78, 0xb9, 0x48, | |
0xff, 0xc8, 0x48, 0x89, 0x01, 0x75, 0xb1, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0xeb, 0xa9, 0x48, | |
0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x66, 0x85, | |
0xc0, 0x74, 0x58, 0x0f, 0xb7, 0x3d, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0xff, 0xc7, 0x48, 0x83, 0xc6, | |
0xf8, 0x48, 0x8b, 0x1d, 0x00, 0x00, 0x00, 0x00, | |
0xeb, 0x13, 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00, | |
0x48, 0xff, 0xcf, 0x48, 0x83, 0xc6, 0xf8, 0x48, | |
0x83, 0xff, 0x01, 0x76, 0x2e, 0x48, 0x8b, 0x0e, | |
0x48, 0x8b, 0x01, 0x85, 0xc0, 0x78, 0xe9, 0x48, | |
0xff, 0xc8, 0x48, 0x89, 0x01, 0x75, 0xe1, 0xff, | |
0xd3, 0xeb, 0xdd, 0x85, 0xdb, 0x4c, 0x8b, 0x64, | |
0x24, 0x30, 0x74, 0x1a, 0x48, 0x8b, 0x07, 0x85, | |
0xc0, 0x78, 0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, | |
0x07, 0x74, 0x35, 0x48, 0x83, 0xc4, 0x38, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x8b, 0x4c, | |
0x24, 0x24, 0x48, 0x8b, 0x54, 0x24, 0x28, 0x48, | |
0xf7, 0xda, 0x48, 0x89, 0x7c, 0xd5, 0x00, 0xb8, | |
0x01, 0x00, 0x00, 0x00, 0x29, 0xc8, 0x48, 0x98, | |
0x48, 0x8d, 0x6c, 0xc5, 0x00, 0x48, 0x83, 0xc4, | |
0x38, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x89, 0xf9, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x83, 0xc4, 0x38, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PySet_New+0x0 | |
// 8: OPARG | |
// 10: &PySet_Add+0x0 | |
// 18: &_Py_Dealloc+0x0 | |
// 20: ERROR_TARGET | |
// 28: CONTINUE | |
const unsigned char data_body[48] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PySet_New); | |
patch_64(data + 0x8, instruction->oparg); | |
patch_64(data + 0x10, (uintptr_t)&PySet_Add); | |
patch_64(data + 0x18, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x20, state->instruction_starts[instruction->error_target]); | |
patch_64(data + 0x28, (uintptr_t)code + sizeof(code_body)); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xf, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x2e, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x3b, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x70, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xd1, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xda, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0xe6, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0xf4, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x142, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0x16c, (uintptr_t)data + 0x24); | |
patch_x86_64_32rx(code + 0x175, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x180, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__BUILD_SLICE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BUILD_SLICE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 4c 89 64 24 20 movq %r12, 0x20(%rsp) | |
// 9: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x10 <_JIT_ENTRY+0x10> | |
// 000000000000000c: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 10: 66 83 f8 03 cmpw $0x3, %ax | |
// 14: 75 0d jne 0x23 <_JIT_ENTRY+0x23> | |
// 16: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// 1a: 49 c7 c4 fd ff ff ff movq $-0x3, %r12 | |
// 21: eb 09 jmp 0x2c <_JIT_ENTRY+0x2c> | |
// 23: 49 c7 c4 fe ff ff ff movq $-0x2, %r12 | |
// 2a: 31 f6 xorl %esi, %esi | |
// 2c: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x33 <_JIT_ENTRY+0x33> | |
// 000000000000002f: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 33: 45 31 ff xorl %r15d, %r15d | |
// 36: 66 83 f8 03 cmpw $0x3, %ax | |
// 3a: 41 0f 94 c7 sete %r15b | |
// 3e: 49 f7 d7 notq %r15 | |
// 41: 4a 8b 5c fd 00 movq (%rbp,%r15,8), %rbx | |
// 46: 4e 8b 74 e5 00 movq (%rbp,%r12,8), %r14 | |
// 4b: 4c 89 f1 movq %r14, %rcx | |
// 4e: 48 89 da movq %rbx, %rdx | |
// 51: 49 89 f0 movq %rsi, %r8 | |
// 54: ff 15 00 00 00 00 callq *(%rip) # 0x5a <_JIT_ENTRY+0x5a> | |
// 0000000000000056: IMAGE_REL_AMD64_REL32 __imp_PySlice_New | |
// 5a: 48 89 c7 movq %rax, %rdi | |
// 5d: 49 8b 06 movq (%r14), %rax | |
// 60: 85 c0 testl %eax, %eax | |
// 62: 78 08 js 0x6c <_JIT_ENTRY+0x6c> | |
// 64: 48 ff c8 decq %rax | |
// 67: 49 89 06 movq %rax, (%r14) | |
// 6a: 74 1a je 0x86 <_JIT_ENTRY+0x86> | |
// 6c: 48 8b 03 movq (%rbx), %rax | |
// 6f: 85 c0 testl %eax, %eax | |
// 71: 78 23 js 0x96 <_JIT_ENTRY+0x96> | |
// 73: 48 ff c8 decq %rax | |
// 76: 48 89 03 movq %rax, (%rbx) | |
// 79: 75 1b jne 0x96 <_JIT_ENTRY+0x96> | |
// 7b: 48 89 d9 movq %rbx, %rcx | |
// 7e: ff 15 00 00 00 00 callq *(%rip) # 0x84 <_JIT_ENTRY+0x84> | |
// 0000000000000080: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 84: eb 10 jmp 0x96 <_JIT_ENTRY+0x96> | |
// 86: 4c 89 f1 movq %r14, %rcx | |
// 89: ff 15 00 00 00 00 callq *(%rip) # 0x8f <_JIT_ENTRY+0x8f> | |
// 000000000000008b: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 8f: 48 8b 03 movq (%rbx), %rax | |
// 92: 85 c0 testl %eax, %eax | |
// 94: 79 dd jns 0x73 <_JIT_ENTRY+0x73> | |
// 96: 48 85 f6 testq %rsi, %rsi | |
// 99: 74 0f je 0xaa <_JIT_ENTRY+0xaa> | |
// 9b: 48 8b 06 movq (%rsi), %rax | |
// 9e: 85 c0 testl %eax, %eax | |
// a0: 78 08 js 0xaa <_JIT_ENTRY+0xaa> | |
// a2: 48 ff c8 decq %rax | |
// a5: 48 89 06 movq %rax, (%rsi) | |
// a8: 74 28 je 0xd2 <_JIT_ENTRY+0xd2> | |
// aa: 48 85 ff testq %rdi, %rdi | |
// ad: 74 31 je 0xe0 <_JIT_ENTRY+0xe0> | |
// af: 4a 8d 04 fd 00 00 00 00 leaq (,%r15,8), %rax | |
// b7: 48 01 e8 addq %rbp, %rax | |
// ba: 4a 89 7c e5 00 movq %rdi, (%rbp,%r12,8) | |
// bf: 48 89 c5 movq %rax, %rbp | |
// c2: 4c 8b 64 24 20 movq 0x20(%rsp), %r12 | |
// c7: 48 83 c4 28 addq $0x28, %rsp | |
// cb: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xd2 <_JIT_ENTRY+0xd2> | |
// 00000000000000ce: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// d2: 48 89 f1 movq %rsi, %rcx | |
// d5: ff 15 00 00 00 00 callq *(%rip) # 0xdb <_JIT_ENTRY+0xdb> | |
// 00000000000000d7: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// db: 48 85 ff testq %rdi, %rdi | |
// de: 75 cf jne 0xaf <_JIT_ENTRY+0xaf> | |
// e0: 4c 8b 64 24 20 movq 0x20(%rsp), %r12 | |
// e5: 48 83 c4 28 addq $0x28, %rsp | |
// e9: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xf0 <_JIT_ENTRY+0xf0> | |
// 00000000000000ec: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// f0: | |
const unsigned char code_body[240] = { | |
0x48, 0x83, 0xec, 0x28, 0x4c, 0x89, 0x64, 0x24, | |
0x20, 0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, | |
0x66, 0x83, 0xf8, 0x03, 0x75, 0x0d, 0x48, 0x8b, | |
0x75, 0xf8, 0x49, 0xc7, 0xc4, 0xfd, 0xff, 0xff, | |
0xff, 0xeb, 0x09, 0x49, 0xc7, 0xc4, 0xfe, 0xff, | |
0xff, 0xff, 0x31, 0xf6, 0x48, 0x8b, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x45, 0x31, 0xff, 0x66, 0x83, | |
0xf8, 0x03, 0x41, 0x0f, 0x94, 0xc7, 0x49, 0xf7, | |
0xd7, 0x4a, 0x8b, 0x5c, 0xfd, 0x00, 0x4e, 0x8b, | |
0x74, 0xe5, 0x00, 0x4c, 0x89, 0xf1, 0x48, 0x89, | |
0xda, 0x49, 0x89, 0xf0, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x89, 0xc7, 0x49, 0x8b, 0x06, | |
0x85, 0xc0, 0x78, 0x08, 0x48, 0xff, 0xc8, 0x49, | |
0x89, 0x06, 0x74, 0x1a, 0x48, 0x8b, 0x03, 0x85, | |
0xc0, 0x78, 0x23, 0x48, 0xff, 0xc8, 0x48, 0x89, | |
0x03, 0x75, 0x1b, 0x48, 0x89, 0xd9, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0xeb, 0x10, 0x4c, 0x89, | |
0xf1, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x03, 0x85, 0xc0, 0x79, 0xdd, 0x48, 0x85, | |
0xf6, 0x74, 0x0f, 0x48, 0x8b, 0x06, 0x85, 0xc0, | |
0x78, 0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x06, | |
0x74, 0x28, 0x48, 0x85, 0xff, 0x74, 0x31, 0x4a, | |
0x8d, 0x04, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x01, 0xe8, 0x4a, 0x89, 0x7c, 0xe5, 0x00, 0x48, | |
0x89, 0xc5, 0x4c, 0x8b, 0x64, 0x24, 0x20, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x89, 0xf1, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x85, 0xff, 0x75, 0xcf, | |
0x4c, 0x8b, 0x64, 0x24, 0x20, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &PySlice_New+0x0 | |
// 10: &_Py_Dealloc+0x0 | |
// 18: CONTINUE | |
// 20: ERROR_TARGET | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&PySlice_New); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x18, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x20, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xc, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x2f, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x56, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x80, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x8b, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xce, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xd7, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xec, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__BUILD_STRING( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BUILD_STRING.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: 0f b7 d8 movzwl %ax, %ebx | |
// e: 8d 04 dd 00 00 00 00 leal (,%rbx,8), %eax | |
// 15: 48 89 ee movq %rbp, %rsi | |
// 18: 48 29 c6 subq %rax, %rsi | |
// 1b: b9 c0 86 00 00 movl $0x86c0, %ecx # imm = 0x86C0 | |
// 20: 48 03 0d 00 00 00 00 addq (%rip), %rcx # 0x27 <_JIT_ENTRY+0x27> | |
// 0000000000000023: IMAGE_REL_AMD64_REL32 __imp__PyRuntime | |
// 27: 48 89 f2 movq %rsi, %rdx | |
// 2a: 49 89 d8 movq %rbx, %r8 | |
// 2d: ff 15 00 00 00 00 callq *(%rip) # 0x33 <_JIT_ENTRY+0x33> | |
// 000000000000002f: IMAGE_REL_AMD64_REL32 __imp__PyUnicode_JoinArray | |
// 33: 48 89 c7 movq %rax, %rdi | |
// 36: 66 85 db testw %bx, %bx | |
// 39: 74 39 je 0x74 <_JIT_ENTRY+0x74> | |
// 3b: 48 ff c3 incq %rbx | |
// 3e: 4c 8d 7d f8 leaq -0x8(%rbp), %r15 | |
// 42: 4c 8b 35 00 00 00 00 movq (%rip), %r14 # 0x49 <_JIT_ENTRY+0x49> | |
// 0000000000000045: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 49: eb 12 jmp 0x5d <_JIT_ENTRY+0x5d> | |
// 4b: 0f 1f 44 00 00 nopl (%rax,%rax) | |
// 50: 48 ff cb decq %rbx | |
// 53: 49 83 c7 f8 addq $-0x8, %r15 | |
// 57: 48 83 fb 01 cmpq $0x1, %rbx | |
// 5b: 76 17 jbe 0x74 <_JIT_ENTRY+0x74> | |
// 5d: 49 8b 0f movq (%r15), %rcx | |
// 60: 48 8b 01 movq (%rcx), %rax | |
// 63: 85 c0 testl %eax, %eax | |
// 65: 78 e9 js 0x50 <_JIT_ENTRY+0x50> | |
// 67: 48 ff c8 decq %rax | |
// 6a: 48 89 01 movq %rax, (%rcx) | |
// 6d: 75 e1 jne 0x50 <_JIT_ENTRY+0x50> | |
// 6f: 41 ff d6 callq *%r14 | |
// 72: eb dc jmp 0x50 <_JIT_ENTRY+0x50> | |
// 74: 48 85 ff testq %rdi, %rdi | |
// 77: 74 27 je 0xa0 <_JIT_ENTRY+0xa0> | |
// 79: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x80 <_JIT_ENTRY+0x80> | |
// 000000000000007c: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 80: 0f b7 c0 movzwl %ax, %eax | |
// 83: 48 89 3e movq %rdi, (%rsi) | |
// 86: b9 01 00 00 00 movl $0x1, %ecx | |
// 8b: 29 c1 subl %eax, %ecx | |
// 8d: 48 63 c1 movslq %ecx, %rax | |
// 90: 48 8d 6c c5 00 leaq (%rbp,%rax,8), %rbp | |
// 95: 48 83 c4 28 addq $0x28, %rsp | |
// 99: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xa0 <_JIT_ENTRY+0xa0> | |
// 000000000000009c: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// a0: 48 83 c4 28 addq $0x28, %rsp | |
// a4: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xab <_JIT_ENTRY+0xab> | |
// 00000000000000a7: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// ab: | |
const unsigned char code_body[171] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x0f, 0xb7, 0xd8, 0x8d, 0x04, | |
0xdd, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0xee, | |
0x48, 0x29, 0xc6, 0xb9, 0xc0, 0x86, 0x00, 0x00, | |
0x48, 0x03, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x89, 0xf2, 0x49, 0x89, 0xd8, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x89, 0xc7, 0x66, 0x85, | |
0xdb, 0x74, 0x39, 0x48, 0xff, 0xc3, 0x4c, 0x8d, | |
0x7d, 0xf8, 0x4c, 0x8b, 0x35, 0x00, 0x00, 0x00, | |
0x00, 0xeb, 0x12, 0x0f, 0x1f, 0x44, 0x00, 0x00, | |
0x48, 0xff, 0xcb, 0x49, 0x83, 0xc7, 0xf8, 0x48, | |
0x83, 0xfb, 0x01, 0x76, 0x17, 0x49, 0x8b, 0x0f, | |
0x48, 0x8b, 0x01, 0x85, 0xc0, 0x78, 0xe9, 0x48, | |
0xff, 0xc8, 0x48, 0x89, 0x01, 0x75, 0xe1, 0x41, | |
0xff, 0xd6, 0xeb, 0xdc, 0x48, 0x85, 0xff, 0x74, | |
0x27, 0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, | |
0x0f, 0xb7, 0xc0, 0x48, 0x89, 0x3e, 0xb9, 0x01, | |
0x00, 0x00, 0x00, 0x29, 0xc1, 0x48, 0x63, 0xc1, | |
0x48, 0x8d, 0x6c, 0xc5, 0x00, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &_PyRuntime+0x0 | |
// 10: &_PyUnicode_JoinArray+0x0 | |
// 18: &_Py_Dealloc+0x0 | |
// 20: CONTINUE | |
// 28: ERROR_TARGET | |
const unsigned char data_body[48] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&_PyRuntime); | |
patch_64(data + 0x10, (uintptr_t)&_PyUnicode_JoinArray); | |
patch_64(data + 0x18, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x20, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x28, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x23, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x2f, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x45, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x7c, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x9c, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0xa7, (uintptr_t)data + 0x24); | |
} | |
void | |
emit__BUILD_TUPLE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_BUILD_TUPLE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 3d 00 00 00 00 movq (%rip), %rdi # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: 0f b7 d7 movzwl %di, %edx | |
// e: 8d 04 d5 00 00 00 00 leal (,%rdx,8), %eax | |
// 15: 48 89 ee movq %rbp, %rsi | |
// 18: 48 29 c6 subq %rax, %rsi | |
// 1b: 48 89 f1 movq %rsi, %rcx | |
// 1e: ff 15 00 00 00 00 callq *(%rip) # 0x24 <_JIT_ENTRY+0x24> | |
// 0000000000000020: IMAGE_REL_AMD64_REL32 __imp__PyTuple_FromStackRefSteal | |
// 24: 48 85 c0 testq %rax, %rax | |
// 27: 74 1f je 0x48 <_JIT_ENTRY+0x48> | |
// 29: 0f b7 cf movzwl %di, %ecx | |
// 2c: 48 89 06 movq %rax, (%rsi) | |
// 2f: b8 01 00 00 00 movl $0x1, %eax | |
// 34: 29 c8 subl %ecx, %eax | |
// 36: 48 98 cltq | |
// 38: 48 8d 6c c5 00 leaq (%rbp,%rax,8), %rbp | |
// 3d: 48 83 c4 28 addq $0x28, %rsp | |
// 41: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x48 <_JIT_ENTRY+0x48> | |
// 0000000000000044: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 48: 48 83 c4 28 addq $0x28, %rsp | |
// 4c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x53 <_JIT_ENTRY+0x53> | |
// 000000000000004f: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 53: | |
const unsigned char code_body[83] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x3d, 0x00, | |
0x00, 0x00, 0x00, 0x0f, 0xb7, 0xd7, 0x8d, 0x04, | |
0xd5, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0xee, | |
0x48, 0x29, 0xc6, 0x48, 0x89, 0xf1, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x85, 0xc0, 0x74, | |
0x1f, 0x0f, 0xb7, 0xcf, 0x48, 0x89, 0x06, 0xb8, | |
0x01, 0x00, 0x00, 0x00, 0x29, 0xc8, 0x48, 0x98, | |
0x48, 0x8d, 0x6c, 0xc5, 0x00, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &_PyTuple_FromStackRefSteal+0x0 | |
// 10: CONTINUE | |
// 18: ERROR_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&_PyTuple_FromStackRefSteal); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x20, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x44, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x4f, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__CALL_BUILTIN_CLASS( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CALL_BUILTIN_CLASS.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 38 subq $0x38, %rsp | |
// 4: 0f b7 3d 00 00 00 00 movzwl (%rip), %edi # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: 89 f8 movl %edi, %eax | |
// d: f7 d0 notl %eax | |
// f: 4c 63 f8 movslq %eax, %r15 | |
// 12: b8 fe ff ff ff movl $0xfffffffe, %eax # imm = 0xFFFFFFFE | |
// 17: 29 f8 subl %edi, %eax | |
// 19: 48 63 f0 movslq %eax, %rsi | |
// 1c: 48 8b 4c f5 00 movq (%rbp,%rsi,8), %rcx | |
// 21: 31 d2 xorl %edx, %edx | |
// 23: 4a 83 7c fd 00 00 cmpq $0x0, (%rbp,%r15,8) | |
// 29: 41 0f 95 c0 setne %r8b | |
// 2d: 48 8b 41 08 movq 0x8(%rcx), %rax | |
// 31: 83 b8 a8 00 00 00 00 cmpl $0x0, 0xa8(%rax) | |
// 38: 78 0b js 0x45 <_JIT_ENTRY+0x45> | |
// 3a: 48 83 c4 38 addq $0x38, %rsp | |
// 3e: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x45 <_JIT_ENTRY+0x45> | |
// 0000000000000041: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 45: 48 8b 81 90 01 00 00 movq 0x190(%rcx), %rax | |
// 4c: 48 85 c0 testq %rax, %rax | |
// 4f: 74 e9 je 0x3a <_JIT_ENTRY+0x3a> | |
// 51: 44 8d 0c fd 00 00 00 00 leal (,%rdi,8), %r9d | |
// 59: 48 89 eb movq %rbp, %rbx | |
// 5c: 4c 29 cb subq %r9, %rbx | |
// 5f: 44 88 c2 movb %r8b, %dl | |
// 62: 01 d7 addl %edx, %edi | |
// 64: c1 e2 03 shll $0x3, %edx | |
// 67: 48 29 d3 subq %rdx, %rbx | |
// 6a: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 6e: 41 89 fe movl %edi, %r14d | |
// 71: 48 89 da movq %rbx, %rdx | |
// 74: 4d 89 f0 movq %r14, %r8 | |
// 77: 45 31 c9 xorl %r9d, %r9d | |
// 7a: ff d0 callq *%rax | |
// 7c: 48 89 44 24 30 movq %rax, 0x30(%rsp) | |
// 81: 49 8b 45 40 movq 0x40(%r13), %rax | |
// 85: 48 89 44 24 28 movq %rax, 0x28(%rsp) | |
// 8a: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 92: 85 ff testl %edi, %edi | |
// 94: 74 2d je 0xc3 <_JIT_ENTRY+0xc3> | |
// 96: 31 ff xorl %edi, %edi | |
// 98: eb 0e jmp 0xa8 <_JIT_ENTRY+0xa8> | |
// 9a: 66 0f 1f 44 00 00 nopw (%rax,%rax) | |
// a0: 48 ff c7 incq %rdi | |
// a3: 49 39 fe cmpq %rdi, %r14 | |
// a6: 74 1b je 0xc3 <_JIT_ENTRY+0xc3> | |
// a8: 48 8b 0c fb movq (%rbx,%rdi,8), %rcx | |
// ac: 48 8b 01 movq (%rcx), %rax | |
// af: 85 c0 testl %eax, %eax | |
// b1: 78 ed js 0xa0 <_JIT_ENTRY+0xa0> | |
// b3: 48 ff c8 decq %rax | |
// b6: 48 89 01 movq %rax, (%rcx) | |
// b9: 75 e5 jne 0xa0 <_JIT_ENTRY+0xa0> | |
// bb: ff 15 00 00 00 00 callq *(%rip) # 0xc1 <_JIT_ENTRY+0xc1> | |
// 00000000000000bd: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// c1: eb dd jmp 0xa0 <_JIT_ENTRY+0xa0> | |
// c3: 48 8b 4c f5 00 movq (%rbp,%rsi,8), %rcx | |
// c8: 48 8b 01 movq (%rcx), %rax | |
// cb: 85 c0 testl %eax, %eax | |
// cd: 78 0e js 0xdd <_JIT_ENTRY+0xdd> | |
// cf: 48 ff c8 decq %rax | |
// d2: 48 89 01 movq %rax, (%rcx) | |
// d5: 75 06 jne 0xdd <_JIT_ENTRY+0xdd> | |
// d7: ff 15 00 00 00 00 callq *(%rip) # 0xdd <_JIT_ENTRY+0xdd> | |
// 00000000000000d9: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// dd: 48 8b 4c 24 30 movq 0x30(%rsp), %rcx | |
// e2: 48 85 c9 testq %rcx, %rcx | |
// e5: 74 18 je 0xff <_JIT_ENTRY+0xff> | |
// e7: 48 8b 44 24 28 movq 0x28(%rsp), %rax | |
// ec: 48 89 0c f0 movq %rcx, (%rax,%rsi,8) | |
// f0: 4a 8d 2c f8 leaq (%rax,%r15,8), %rbp | |
// f4: 48 83 c4 38 addq $0x38, %rsp | |
// f8: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xff <_JIT_ENTRY+0xff> | |
// 00000000000000fb: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// ff: 48 8b 6c 24 28 movq 0x28(%rsp), %rbp | |
// 104: 48 83 c4 38 addq $0x38, %rsp | |
// 108: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x10f <_JIT_ENTRY+0x10f> | |
// 000000000000010b: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 10f: | |
const unsigned char code_body[271] = { | |
0x48, 0x83, 0xec, 0x38, 0x0f, 0xb7, 0x3d, 0x00, | |
0x00, 0x00, 0x00, 0x89, 0xf8, 0xf7, 0xd0, 0x4c, | |
0x63, 0xf8, 0xb8, 0xfe, 0xff, 0xff, 0xff, 0x29, | |
0xf8, 0x48, 0x63, 0xf0, 0x48, 0x8b, 0x4c, 0xf5, | |
0x00, 0x31, 0xd2, 0x4a, 0x83, 0x7c, 0xfd, 0x00, | |
0x00, 0x41, 0x0f, 0x95, 0xc0, 0x48, 0x8b, 0x41, | |
0x08, 0x83, 0xb8, 0xa8, 0x00, 0x00, 0x00, 0x00, | |
0x78, 0x0b, 0x48, 0x83, 0xc4, 0x38, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x81, | |
0x90, 0x01, 0x00, 0x00, 0x48, 0x85, 0xc0, 0x74, | |
0xe9, 0x44, 0x8d, 0x0c, 0xfd, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x89, 0xeb, 0x4c, 0x29, 0xcb, 0x44, | |
0x88, 0xc2, 0x01, 0xd7, 0xc1, 0xe2, 0x03, 0x48, | |
0x29, 0xd3, 0x49, 0x89, 0x6d, 0x40, 0x41, 0x89, | |
0xfe, 0x48, 0x89, 0xda, 0x4d, 0x89, 0xf0, 0x45, | |
0x31, 0xc9, 0xff, 0xd0, 0x48, 0x89, 0x44, 0x24, | |
0x30, 0x49, 0x8b, 0x45, 0x40, 0x48, 0x89, 0x44, | |
0x24, 0x28, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, | |
0x00, 0x00, 0x85, 0xff, 0x74, 0x2d, 0x31, 0xff, | |
0xeb, 0x0e, 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00, | |
0x48, 0xff, 0xc7, 0x49, 0x39, 0xfe, 0x74, 0x1b, | |
0x48, 0x8b, 0x0c, 0xfb, 0x48, 0x8b, 0x01, 0x85, | |
0xc0, 0x78, 0xed, 0x48, 0xff, 0xc8, 0x48, 0x89, | |
0x01, 0x75, 0xe5, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0xeb, 0xdd, 0x48, 0x8b, 0x4c, 0xf5, 0x00, | |
0x48, 0x8b, 0x01, 0x85, 0xc0, 0x78, 0x0e, 0x48, | |
0xff, 0xc8, 0x48, 0x89, 0x01, 0x75, 0x06, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x4c, | |
0x24, 0x30, 0x48, 0x85, 0xc9, 0x74, 0x18, 0x48, | |
0x8b, 0x44, 0x24, 0x28, 0x48, 0x89, 0x0c, 0xf0, | |
0x4a, 0x8d, 0x2c, 0xf8, 0x48, 0x83, 0xc4, 0x38, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x6c, 0x24, 0x28, 0x48, 0x83, 0xc4, 0x38, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: JUMP_TARGET | |
// 10: &_Py_Dealloc+0x0 | |
// 18: CONTINUE | |
// 20: ERROR_TARGET | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x18, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x20, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x41, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0xbd, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xd9, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xfb, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x10b, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__CALL_BUILTIN_FAST( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CALL_BUILTIN_FAST.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 38 subq $0x38, %rsp | |
// 4: 0f b7 3d 00 00 00 00 movzwl (%rip), %edi # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: 89 f8 movl %edi, %eax | |
// d: f7 d0 notl %eax | |
// f: 4c 63 f8 movslq %eax, %r15 | |
// 12: b8 fe ff ff ff movl $0xfffffffe, %eax # imm = 0xFFFFFFFE | |
// 17: 29 f8 subl %edi, %eax | |
// 19: 48 63 f0 movslq %eax, %rsi | |
// 1c: 48 8b 44 f5 00 movq (%rbp,%rsi,8), %rax | |
// 21: 31 c9 xorl %ecx, %ecx | |
// 23: 4a 83 7c fd 00 00 cmpq $0x0, (%rbp,%r15,8) | |
// 29: 41 0f 95 c0 setne %r8b | |
// 2d: 48 8b 50 08 movq 0x8(%rax), %rdx | |
// 31: 48 3b 15 00 00 00 00 cmpq (%rip), %rdx # 0x38 <_JIT_ENTRY+0x38> | |
// 0000000000000034: IMAGE_REL_AMD64_REL32 __imp_PyCFunction_Type | |
// 38: 0f 85 85 00 00 00 jne 0xc3 <_JIT_ENTRY+0xc3> | |
// 3e: 48 8b 50 10 movq 0x10(%rax), %rdx | |
// 42: 81 7a 10 80 00 00 00 cmpl $0x80, 0x10(%rdx) | |
// 49: 75 78 jne 0xc3 <_JIT_ENTRY+0xc3> | |
// 4b: 44 8d 0c fd 00 00 00 00 leal (,%rdi,8), %r9d | |
// 53: 48 89 eb movq %rbp, %rbx | |
// 56: 4c 29 cb subq %r9, %rbx | |
// 59: 44 88 c1 movb %r8b, %cl | |
// 5c: 01 cf addl %ecx, %edi | |
// 5e: c1 e1 03 shll $0x3, %ecx | |
// 61: 48 29 cb subq %rcx, %rbx | |
// 64: 4c 8b 4a 08 movq 0x8(%rdx), %r9 | |
// 68: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 6c: 41 89 fe movl %edi, %r14d | |
// 6f: 48 8b 48 18 movq 0x18(%rax), %rcx | |
// 73: 48 89 da movq %rbx, %rdx | |
// 76: 4d 89 f0 movq %r14, %r8 | |
// 79: 41 ff d1 callq *%r9 | |
// 7c: 48 89 44 24 30 movq %rax, 0x30(%rsp) | |
// 81: 49 8b 45 40 movq 0x40(%r13), %rax | |
// 85: 48 89 44 24 28 movq %rax, 0x28(%rsp) | |
// 8a: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 92: 85 ff testl %edi, %edi | |
// 94: 74 38 je 0xce <_JIT_ENTRY+0xce> | |
// 96: 31 ff xorl %edi, %edi | |
// 98: eb 0e jmp 0xa8 <_JIT_ENTRY+0xa8> | |
// 9a: 66 0f 1f 44 00 00 nopw (%rax,%rax) | |
// a0: 48 ff c7 incq %rdi | |
// a3: 49 39 fe cmpq %rdi, %r14 | |
// a6: 74 26 je 0xce <_JIT_ENTRY+0xce> | |
// a8: 48 8b 0c fb movq (%rbx,%rdi,8), %rcx | |
// ac: 48 8b 01 movq (%rcx), %rax | |
// af: 85 c0 testl %eax, %eax | |
// b1: 78 ed js 0xa0 <_JIT_ENTRY+0xa0> | |
// b3: 48 ff c8 decq %rax | |
// b6: 48 89 01 movq %rax, (%rcx) | |
// b9: 75 e5 jne 0xa0 <_JIT_ENTRY+0xa0> | |
// bb: ff 15 00 00 00 00 callq *(%rip) # 0xc1 <_JIT_ENTRY+0xc1> | |
// 00000000000000bd: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// c1: eb dd jmp 0xa0 <_JIT_ENTRY+0xa0> | |
// c3: 48 83 c4 38 addq $0x38, %rsp | |
// c7: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xce <_JIT_ENTRY+0xce> | |
// 00000000000000ca: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// ce: 48 8b 4c f5 00 movq (%rbp,%rsi,8), %rcx | |
// d3: 48 8b 01 movq (%rcx), %rax | |
// d6: 85 c0 testl %eax, %eax | |
// d8: 78 0e js 0xe8 <_JIT_ENTRY+0xe8> | |
// da: 48 ff c8 decq %rax | |
// dd: 48 89 01 movq %rax, (%rcx) | |
// e0: 75 06 jne 0xe8 <_JIT_ENTRY+0xe8> | |
// e2: ff 15 00 00 00 00 callq *(%rip) # 0xe8 <_JIT_ENTRY+0xe8> | |
// 00000000000000e4: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// e8: 48 8b 4c 24 30 movq 0x30(%rsp), %rcx | |
// ed: 48 85 c9 testq %rcx, %rcx | |
// f0: 74 18 je 0x10a <_JIT_ENTRY+0x10a> | |
// f2: 48 8b 44 24 28 movq 0x28(%rsp), %rax | |
// f7: 48 89 0c f0 movq %rcx, (%rax,%rsi,8) | |
// fb: 4a 8d 2c f8 leaq (%rax,%r15,8), %rbp | |
// ff: 48 83 c4 38 addq $0x38, %rsp | |
// 103: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x10a <_JIT_ENTRY+0x10a> | |
// 0000000000000106: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 10a: 48 8b 6c 24 28 movq 0x28(%rsp), %rbp | |
// 10f: 48 83 c4 38 addq $0x38, %rsp | |
// 113: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x11a <_JIT_ENTRY+0x11a> | |
// 0000000000000116: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 11a: | |
const unsigned char code_body[282] = { | |
0x48, 0x83, 0xec, 0x38, 0x0f, 0xb7, 0x3d, 0x00, | |
0x00, 0x00, 0x00, 0x89, 0xf8, 0xf7, 0xd0, 0x4c, | |
0x63, 0xf8, 0xb8, 0xfe, 0xff, 0xff, 0xff, 0x29, | |
0xf8, 0x48, 0x63, 0xf0, 0x48, 0x8b, 0x44, 0xf5, | |
0x00, 0x31, 0xc9, 0x4a, 0x83, 0x7c, 0xfd, 0x00, | |
0x00, 0x41, 0x0f, 0x95, 0xc0, 0x48, 0x8b, 0x50, | |
0x08, 0x48, 0x3b, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x0f, 0x85, 0x85, 0x00, 0x00, 0x00, 0x48, 0x8b, | |
0x50, 0x10, 0x81, 0x7a, 0x10, 0x80, 0x00, 0x00, | |
0x00, 0x75, 0x78, 0x44, 0x8d, 0x0c, 0xfd, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x89, 0xeb, 0x4c, 0x29, | |
0xcb, 0x44, 0x88, 0xc1, 0x01, 0xcf, 0xc1, 0xe1, | |
0x03, 0x48, 0x29, 0xcb, 0x4c, 0x8b, 0x4a, 0x08, | |
0x49, 0x89, 0x6d, 0x40, 0x41, 0x89, 0xfe, 0x48, | |
0x8b, 0x48, 0x18, 0x48, 0x89, 0xda, 0x4d, 0x89, | |
0xf0, 0x41, 0xff, 0xd1, 0x48, 0x89, 0x44, 0x24, | |
0x30, 0x49, 0x8b, 0x45, 0x40, 0x48, 0x89, 0x44, | |
0x24, 0x28, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, | |
0x00, 0x00, 0x85, 0xff, 0x74, 0x38, 0x31, 0xff, | |
0xeb, 0x0e, 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00, | |
0x48, 0xff, 0xc7, 0x49, 0x39, 0xfe, 0x74, 0x26, | |
0x48, 0x8b, 0x0c, 0xfb, 0x48, 0x8b, 0x01, 0x85, | |
0xc0, 0x78, 0xed, 0x48, 0xff, 0xc8, 0x48, 0x89, | |
0x01, 0x75, 0xe5, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0xeb, 0xdd, 0x48, 0x83, 0xc4, 0x38, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, | |
0x4c, 0xf5, 0x00, 0x48, 0x8b, 0x01, 0x85, 0xc0, | |
0x78, 0x0e, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x01, | |
0x75, 0x06, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8b, 0x4c, 0x24, 0x30, 0x48, 0x85, 0xc9, | |
0x74, 0x18, 0x48, 0x8b, 0x44, 0x24, 0x28, 0x48, | |
0x89, 0x0c, 0xf0, 0x4a, 0x8d, 0x2c, 0xf8, 0x48, | |
0x83, 0xc4, 0x38, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x8b, 0x6c, 0x24, 0x28, 0x48, | |
0x83, 0xc4, 0x38, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &PyCFunction_Type+0x0 | |
// 10: &_Py_Dealloc+0x0 | |
// 18: JUMP_TARGET | |
// 20: CONTINUE | |
// 28: ERROR_TARGET | |
const unsigned char data_body[48] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&PyCFunction_Type); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x18, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x20, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x28, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x34, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0xbd, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xca, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xe4, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x106, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0x116, (uintptr_t)data + 0x24); | |
} | |
void | |
emit__CALL_BUILTIN_FAST_WITH_KEYWORDS( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CALL_BUILTIN_FAST_WITH_KEYWORDS.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 38 subq $0x38, %rsp | |
// 4: 0f b7 1d 00 00 00 00 movzwl (%rip), %ebx # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: 89 d8 movl %ebx, %eax | |
// d: f7 d0 notl %eax | |
// f: 4c 63 f8 movslq %eax, %r15 | |
// 12: b8 fe ff ff ff movl $0xfffffffe, %eax # imm = 0xFFFFFFFE | |
// 17: 29 d8 subl %ebx, %eax | |
// 19: 48 63 f0 movslq %eax, %rsi | |
// 1c: 48 8b 44 f5 00 movq (%rbp,%rsi,8), %rax | |
// 21: 31 c9 xorl %ecx, %ecx | |
// 23: 4a 83 7c fd 00 00 cmpq $0x0, (%rbp,%r15,8) | |
// 29: 41 0f 95 c0 setne %r8b | |
// 2d: 48 8b 50 08 movq 0x8(%rax), %rdx | |
// 31: 48 3b 15 00 00 00 00 cmpq (%rip), %rdx # 0x38 <_JIT_ENTRY+0x38> | |
// 0000000000000034: IMAGE_REL_AMD64_REL32 __imp_PyCFunction_Type | |
// 38: 0f 85 85 00 00 00 jne 0xc3 <_JIT_ENTRY+0xc3> | |
// 3e: 48 8b 50 10 movq 0x10(%rax), %rdx | |
// 42: 81 7a 10 82 00 00 00 cmpl $0x82, 0x10(%rdx) | |
// 49: 75 78 jne 0xc3 <_JIT_ENTRY+0xc3> | |
// 4b: 44 8d 0c dd 00 00 00 00 leal (,%rbx,8), %r9d | |
// 53: 48 89 ef movq %rbp, %rdi | |
// 56: 4c 29 cf subq %r9, %rdi | |
// 59: 44 88 c1 movb %r8b, %cl | |
// 5c: 01 cb addl %ecx, %ebx | |
// 5e: c1 e1 03 shll $0x3, %ecx | |
// 61: 48 29 cf subq %rcx, %rdi | |
// 64: 4c 8b 52 08 movq 0x8(%rdx), %r10 | |
// 68: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 6c: 41 89 de movl %ebx, %r14d | |
// 6f: 48 8b 48 18 movq 0x18(%rax), %rcx | |
// 73: 48 89 fa movq %rdi, %rdx | |
// 76: 4d 89 f0 movq %r14, %r8 | |
// 79: 45 31 c9 xorl %r9d, %r9d | |
// 7c: 41 ff d2 callq *%r10 | |
// 7f: 48 89 44 24 30 movq %rax, 0x30(%rsp) | |
// 84: 49 8b 45 40 movq 0x40(%r13), %rax | |
// 88: 48 89 44 24 28 movq %rax, 0x28(%rsp) | |
// 8d: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 95: 85 db testl %ebx, %ebx | |
// 97: 74 35 je 0xce <_JIT_ENTRY+0xce> | |
// 99: 31 db xorl %ebx, %ebx | |
// 9b: eb 0b jmp 0xa8 <_JIT_ENTRY+0xa8> | |
// 9d: 0f 1f 00 nopl (%rax) | |
// a0: 48 ff c3 incq %rbx | |
// a3: 49 39 de cmpq %rbx, %r14 | |
// a6: 74 26 je 0xce <_JIT_ENTRY+0xce> | |
// a8: 48 8b 0c df movq (%rdi,%rbx,8), %rcx | |
// ac: 48 8b 01 movq (%rcx), %rax | |
// af: 85 c0 testl %eax, %eax | |
// b1: 78 ed js 0xa0 <_JIT_ENTRY+0xa0> | |
// b3: 48 ff c8 decq %rax | |
// b6: 48 89 01 movq %rax, (%rcx) | |
// b9: 75 e5 jne 0xa0 <_JIT_ENTRY+0xa0> | |
// bb: ff 15 00 00 00 00 callq *(%rip) # 0xc1 <_JIT_ENTRY+0xc1> | |
// 00000000000000bd: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// c1: eb dd jmp 0xa0 <_JIT_ENTRY+0xa0> | |
// c3: 48 83 c4 38 addq $0x38, %rsp | |
// c7: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xce <_JIT_ENTRY+0xce> | |
// 00000000000000ca: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// ce: 48 8b 4c f5 00 movq (%rbp,%rsi,8), %rcx | |
// d3: 48 8b 01 movq (%rcx), %rax | |
// d6: 85 c0 testl %eax, %eax | |
// d8: 78 0e js 0xe8 <_JIT_ENTRY+0xe8> | |
// da: 48 ff c8 decq %rax | |
// dd: 48 89 01 movq %rax, (%rcx) | |
// e0: 75 06 jne 0xe8 <_JIT_ENTRY+0xe8> | |
// e2: ff 15 00 00 00 00 callq *(%rip) # 0xe8 <_JIT_ENTRY+0xe8> | |
// 00000000000000e4: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// e8: 48 8b 4c 24 30 movq 0x30(%rsp), %rcx | |
// ed: 48 85 c9 testq %rcx, %rcx | |
// f0: 74 18 je 0x10a <_JIT_ENTRY+0x10a> | |
// f2: 48 8b 44 24 28 movq 0x28(%rsp), %rax | |
// f7: 48 89 0c f0 movq %rcx, (%rax,%rsi,8) | |
// fb: 4a 8d 2c f8 leaq (%rax,%r15,8), %rbp | |
// ff: 48 83 c4 38 addq $0x38, %rsp | |
// 103: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x10a <_JIT_ENTRY+0x10a> | |
// 0000000000000106: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 10a: 48 8b 6c 24 28 movq 0x28(%rsp), %rbp | |
// 10f: 48 83 c4 38 addq $0x38, %rsp | |
// 113: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x11a <_JIT_ENTRY+0x11a> | |
// 0000000000000116: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 11a: | |
const unsigned char code_body[282] = { | |
0x48, 0x83, 0xec, 0x38, 0x0f, 0xb7, 0x1d, 0x00, | |
0x00, 0x00, 0x00, 0x89, 0xd8, 0xf7, 0xd0, 0x4c, | |
0x63, 0xf8, 0xb8, 0xfe, 0xff, 0xff, 0xff, 0x29, | |
0xd8, 0x48, 0x63, 0xf0, 0x48, 0x8b, 0x44, 0xf5, | |
0x00, 0x31, 0xc9, 0x4a, 0x83, 0x7c, 0xfd, 0x00, | |
0x00, 0x41, 0x0f, 0x95, 0xc0, 0x48, 0x8b, 0x50, | |
0x08, 0x48, 0x3b, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x0f, 0x85, 0x85, 0x00, 0x00, 0x00, 0x48, 0x8b, | |
0x50, 0x10, 0x81, 0x7a, 0x10, 0x82, 0x00, 0x00, | |
0x00, 0x75, 0x78, 0x44, 0x8d, 0x0c, 0xdd, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x89, 0xef, 0x4c, 0x29, | |
0xcf, 0x44, 0x88, 0xc1, 0x01, 0xcb, 0xc1, 0xe1, | |
0x03, 0x48, 0x29, 0xcf, 0x4c, 0x8b, 0x52, 0x08, | |
0x49, 0x89, 0x6d, 0x40, 0x41, 0x89, 0xde, 0x48, | |
0x8b, 0x48, 0x18, 0x48, 0x89, 0xfa, 0x4d, 0x89, | |
0xf0, 0x45, 0x31, 0xc9, 0x41, 0xff, 0xd2, 0x48, | |
0x89, 0x44, 0x24, 0x30, 0x49, 0x8b, 0x45, 0x40, | |
0x48, 0x89, 0x44, 0x24, 0x28, 0x49, 0xc7, 0x45, | |
0x40, 0x00, 0x00, 0x00, 0x00, 0x85, 0xdb, 0x74, | |
0x35, 0x31, 0xdb, 0xeb, 0x0b, 0x0f, 0x1f, 0x00, | |
0x48, 0xff, 0xc3, 0x49, 0x39, 0xde, 0x74, 0x26, | |
0x48, 0x8b, 0x0c, 0xdf, 0x48, 0x8b, 0x01, 0x85, | |
0xc0, 0x78, 0xed, 0x48, 0xff, 0xc8, 0x48, 0x89, | |
0x01, 0x75, 0xe5, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0xeb, 0xdd, 0x48, 0x83, 0xc4, 0x38, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, | |
0x4c, 0xf5, 0x00, 0x48, 0x8b, 0x01, 0x85, 0xc0, | |
0x78, 0x0e, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x01, | |
0x75, 0x06, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8b, 0x4c, 0x24, 0x30, 0x48, 0x85, 0xc9, | |
0x74, 0x18, 0x48, 0x8b, 0x44, 0x24, 0x28, 0x48, | |
0x89, 0x0c, 0xf0, 0x4a, 0x8d, 0x2c, 0xf8, 0x48, | |
0x83, 0xc4, 0x38, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x8b, 0x6c, 0x24, 0x28, 0x48, | |
0x83, 0xc4, 0x38, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &PyCFunction_Type+0x0 | |
// 10: &_Py_Dealloc+0x0 | |
// 18: JUMP_TARGET | |
// 20: CONTINUE | |
// 28: ERROR_TARGET | |
const unsigned char data_body[48] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&PyCFunction_Type); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x18, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x20, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x28, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x34, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0xbd, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xca, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xe4, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x106, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0x116, (uintptr_t)data + 0x24); | |
} | |
void | |
emit__CALL_BUILTIN_O( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CALL_BUILTIN_O.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 0f b7 0d 00 00 00 00 movzwl (%rip), %ecx # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: 89 c8 movl %ecx, %eax | |
// d: f7 d0 notl %eax | |
// f: 4c 63 f0 movslq %eax, %r14 | |
// 12: 31 c0 xorl %eax, %eax | |
// 14: 4a 83 7c f5 00 00 cmpq $0x0, (%rbp,%r14,8) | |
// 1a: 0f 95 c0 setne %al | |
// 1d: 8d 14 08 leal (%rax,%rcx), %edx | |
// 20: 83 fa 01 cmpl $0x1, %edx | |
// 23: 0f 85 c1 00 00 00 jne 0xea <_JIT_ENTRY+0xea> | |
// 29: ba fe ff ff ff movl $0xfffffffe, %edx # imm = 0xFFFFFFFE | |
// 2e: 29 ca subl %ecx, %edx | |
// 30: 4c 63 fa movslq %edx, %r15 | |
// 33: 4a 8b 54 fd 00 movq (%rbp,%r15,8), %rdx | |
// 38: 48 8b 72 08 movq 0x8(%rdx), %rsi | |
// 3c: 48 3b 35 00 00 00 00 cmpq (%rip), %rsi # 0x43 <_JIT_ENTRY+0x43> | |
// 000000000000003f: IMAGE_REL_AMD64_REL32 __imp_PyCFunction_Type | |
// 43: 0f 85 a1 00 00 00 jne 0xea <_JIT_ENTRY+0xea> | |
// 49: 48 8b 72 10 movq 0x10(%rdx), %rsi | |
// 4d: 83 7e 10 08 cmpl $0x8, 0x10(%rsi) | |
// 51: 0f 85 93 00 00 00 jne 0xea <_JIT_ENTRY+0xea> | |
// 57: 41 8b 7c 24 34 movl 0x34(%r12), %edi | |
// 5c: 85 ff testl %edi, %edi | |
// 5e: 0f 8e 86 00 00 00 jle 0xea <_JIT_ENTRY+0xea> | |
// 64: c1 e1 03 shll $0x3, %ecx | |
// 67: 49 89 e8 movq %rbp, %r8 | |
// 6a: 49 29 c8 subq %rcx, %r8 | |
// 6d: 48 f7 d8 negq %rax | |
// 70: 48 8b 76 08 movq 0x8(%rsi), %rsi | |
// 74: 49 8b 1c c0 movq (%r8,%rax,8), %rbx | |
// 78: ff cf decl %edi | |
// 7a: 41 89 7c 24 34 movl %edi, 0x34(%r12) | |
// 7f: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 83: 48 8b 4a 18 movq 0x18(%rdx), %rcx | |
// 87: 48 89 da movq %rbx, %rdx | |
// 8a: ff d6 callq *%rsi | |
// 8c: 49 8b 75 40 movq 0x40(%r13), %rsi | |
// 90: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 98: 41 ff 44 24 34 incl 0x34(%r12) | |
// 9d: 48 89 c7 movq %rax, %rdi | |
// a0: 48 8b 03 movq (%rbx), %rax | |
// a3: 85 c0 testl %eax, %eax | |
// a5: 78 11 js 0xb8 <_JIT_ENTRY+0xb8> | |
// a7: 48 ff c8 decq %rax | |
// aa: 48 89 03 movq %rax, (%rbx) | |
// ad: 75 09 jne 0xb8 <_JIT_ENTRY+0xb8> | |
// af: 48 89 d9 movq %rbx, %rcx | |
// b2: ff 15 00 00 00 00 callq *(%rip) # 0xb8 <_JIT_ENTRY+0xb8> | |
// 00000000000000b4: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// b8: 4a 8b 4c fd 00 movq (%rbp,%r15,8), %rcx | |
// bd: 48 8b 01 movq (%rcx), %rax | |
// c0: 85 c0 testl %eax, %eax | |
// c2: 78 0e js 0xd2 <_JIT_ENTRY+0xd2> | |
// c4: 48 ff c8 decq %rax | |
// c7: 48 89 01 movq %rax, (%rcx) | |
// ca: 75 06 jne 0xd2 <_JIT_ENTRY+0xd2> | |
// cc: ff 15 00 00 00 00 callq *(%rip) # 0xd2 <_JIT_ENTRY+0xd2> | |
// 00000000000000ce: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// d2: 48 85 ff testq %rdi, %rdi | |
// d5: 74 1e je 0xf5 <_JIT_ENTRY+0xf5> | |
// d7: 4a 89 3c fe movq %rdi, (%rsi,%r15,8) | |
// db: 4a 8d 2c f6 leaq (%rsi,%r14,8), %rbp | |
// df: 48 83 c4 28 addq $0x28, %rsp | |
// e3: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xea <_JIT_ENTRY+0xea> | |
// 00000000000000e6: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// ea: 48 83 c4 28 addq $0x28, %rsp | |
// ee: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xf5 <_JIT_ENTRY+0xf5> | |
// 00000000000000f1: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// f5: 48 89 f5 movq %rsi, %rbp | |
// f8: 48 83 c4 28 addq $0x28, %rsp | |
// fc: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x103 <_JIT_ENTRY+0x103> | |
// 00000000000000ff: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 103: | |
const unsigned char code_body[259] = { | |
0x48, 0x83, 0xec, 0x28, 0x0f, 0xb7, 0x0d, 0x00, | |
0x00, 0x00, 0x00, 0x89, 0xc8, 0xf7, 0xd0, 0x4c, | |
0x63, 0xf0, 0x31, 0xc0, 0x4a, 0x83, 0x7c, 0xf5, | |
0x00, 0x00, 0x0f, 0x95, 0xc0, 0x8d, 0x14, 0x08, | |
0x83, 0xfa, 0x01, 0x0f, 0x85, 0xc1, 0x00, 0x00, | |
0x00, 0xba, 0xfe, 0xff, 0xff, 0xff, 0x29, 0xca, | |
0x4c, 0x63, 0xfa, 0x4a, 0x8b, 0x54, 0xfd, 0x00, | |
0x48, 0x8b, 0x72, 0x08, 0x48, 0x3b, 0x35, 0x00, | |
0x00, 0x00, 0x00, 0x0f, 0x85, 0xa1, 0x00, 0x00, | |
0x00, 0x48, 0x8b, 0x72, 0x10, 0x83, 0x7e, 0x10, | |
0x08, 0x0f, 0x85, 0x93, 0x00, 0x00, 0x00, 0x41, | |
0x8b, 0x7c, 0x24, 0x34, 0x85, 0xff, 0x0f, 0x8e, | |
0x86, 0x00, 0x00, 0x00, 0xc1, 0xe1, 0x03, 0x49, | |
0x89, 0xe8, 0x49, 0x29, 0xc8, 0x48, 0xf7, 0xd8, | |
0x48, 0x8b, 0x76, 0x08, 0x49, 0x8b, 0x1c, 0xc0, | |
0xff, 0xcf, 0x41, 0x89, 0x7c, 0x24, 0x34, 0x49, | |
0x89, 0x6d, 0x40, 0x48, 0x8b, 0x4a, 0x18, 0x48, | |
0x89, 0xda, 0xff, 0xd6, 0x49, 0x8b, 0x75, 0x40, | |
0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, | |
0x41, 0xff, 0x44, 0x24, 0x34, 0x48, 0x89, 0xc7, | |
0x48, 0x8b, 0x03, 0x85, 0xc0, 0x78, 0x11, 0x48, | |
0xff, 0xc8, 0x48, 0x89, 0x03, 0x75, 0x09, 0x48, | |
0x89, 0xd9, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x4a, 0x8b, 0x4c, 0xfd, 0x00, 0x48, 0x8b, 0x01, | |
0x85, 0xc0, 0x78, 0x0e, 0x48, 0xff, 0xc8, 0x48, | |
0x89, 0x01, 0x75, 0x06, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x85, 0xff, 0x74, 0x1e, 0x4a, | |
0x89, 0x3c, 0xfe, 0x4a, 0x8d, 0x2c, 0xf6, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0xf5, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &PyCFunction_Type+0x0 | |
// 10: &_Py_Dealloc+0x0 | |
// 18: CONTINUE | |
// 20: JUMP_TARGET | |
// 28: ERROR_TARGET | |
const unsigned char data_body[48] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&PyCFunction_Type); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x18, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x20, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x28, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x3f, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0xb4, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xce, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xe6, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xf1, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0xff, (uintptr_t)data + 0x24); | |
} | |
void | |
emit__CALL_INTRINSIC_1( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CALL_INTRINSIC_1.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// 8: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// c: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0x13 <_JIT_ENTRY+0x13> | |
// 000000000000000f: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 13: c1 e0 04 shll $0x4, %eax | |
// 16: 48 8b 3d 00 00 00 00 movq (%rip), %rdi # 0x1d <_JIT_ENTRY+0x1d> | |
// 0000000000000019: IMAGE_REL_AMD64_REL32 __imp__PyIntrinsics_UnaryFunctions | |
// 1d: 4c 89 e1 movq %r12, %rcx | |
// 20: 48 89 f2 movq %rsi, %rdx | |
// 23: ff 14 07 callq *(%rdi,%rax) | |
// 26: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 2a: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 32: 48 8b 0e movq (%rsi), %rcx | |
// 35: 85 c9 testl %ecx, %ecx | |
// 37: 78 08 js 0x41 <_JIT_ENTRY+0x41> | |
// 39: 48 ff c9 decq %rcx | |
// 3c: 48 89 0e movq %rcx, (%rsi) | |
// 3f: 74 14 je 0x55 <_JIT_ENTRY+0x55> | |
// 41: 48 85 c0 testq %rax, %rax | |
// 44: 74 23 je 0x69 <_JIT_ENTRY+0x69> | |
// 46: 48 89 45 f8 movq %rax, -0x8(%rbp) | |
// 4a: 48 83 c4 28 addq $0x28, %rsp | |
// 4e: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x55 <_JIT_ENTRY+0x55> | |
// 0000000000000051: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 55: 48 89 f1 movq %rsi, %rcx | |
// 58: 48 89 c6 movq %rax, %rsi | |
// 5b: ff 15 00 00 00 00 callq *(%rip) # 0x61 <_JIT_ENTRY+0x61> | |
// 000000000000005d: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 61: 48 89 f0 movq %rsi, %rax | |
// 64: 48 85 c0 testq %rax, %rax | |
// 67: 75 dd jne 0x46 <_JIT_ENTRY+0x46> | |
// 69: 48 83 c4 28 addq $0x28, %rsp | |
// 6d: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x74 <_JIT_ENTRY+0x74> | |
// 0000000000000070: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 74: | |
const unsigned char code_body[116] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x75, 0xf8, | |
0x49, 0x89, 0x6d, 0x40, 0x0f, 0xb7, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0xc1, 0xe0, 0x04, 0x48, 0x8b, | |
0x3d, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x89, 0xe1, | |
0x48, 0x89, 0xf2, 0xff, 0x14, 0x07, 0x49, 0x8b, | |
0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x8b, 0x0e, 0x85, 0xc9, 0x78, | |
0x08, 0x48, 0xff, 0xc9, 0x48, 0x89, 0x0e, 0x74, | |
0x14, 0x48, 0x85, 0xc0, 0x74, 0x23, 0x48, 0x89, | |
0x45, 0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0xf1, | |
0x48, 0x89, 0xc6, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x89, 0xf0, 0x48, 0x85, 0xc0, 0x75, | |
0xdd, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &_PyIntrinsics_UnaryFunctions+0x0 | |
// 10: CONTINUE | |
// 18: &_Py_Dealloc+0x0 | |
// 20: ERROR_TARGET | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&_PyIntrinsics_UnaryFunctions); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x20, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xf, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x19, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x51, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x5d, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x70, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__CALL_INTRINSIC_2( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CALL_INTRINSIC_2.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 5d f0 movq -0x10(%rbp), %rbx | |
// 8: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// c: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 10: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0x17 <_JIT_ENTRY+0x17> | |
// 0000000000000013: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 17: c1 e0 04 shll $0x4, %eax | |
// 1a: 48 8b 3d 00 00 00 00 movq (%rip), %rdi # 0x21 <_JIT_ENTRY+0x21> | |
// 000000000000001d: IMAGE_REL_AMD64_REL32 __imp__PyIntrinsics_BinaryFunctions | |
// 21: 4c 89 e1 movq %r12, %rcx | |
// 24: 48 89 da movq %rbx, %rdx | |
// 27: 49 89 f0 movq %rsi, %r8 | |
// 2a: ff 14 07 callq *(%rdi,%rax) | |
// 2d: 48 89 c7 movq %rax, %rdi | |
// 30: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 34: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 3c: 48 8b 03 movq (%rbx), %rax | |
// 3f: 85 c0 testl %eax, %eax | |
// 41: 78 08 js 0x4b <_JIT_ENTRY+0x4b> | |
// 43: 48 ff c8 decq %rax | |
// 46: 48 89 03 movq %rax, (%rbx) | |
// 49: 74 1a je 0x65 <_JIT_ENTRY+0x65> | |
// 4b: 48 8b 06 movq (%rsi), %rax | |
// 4e: 85 c0 testl %eax, %eax | |
// 50: 78 23 js 0x75 <_JIT_ENTRY+0x75> | |
// 52: 48 ff c8 decq %rax | |
// 55: 48 89 06 movq %rax, (%rsi) | |
// 58: 75 1b jne 0x75 <_JIT_ENTRY+0x75> | |
// 5a: 48 89 f1 movq %rsi, %rcx | |
// 5d: ff 15 00 00 00 00 callq *(%rip) # 0x63 <_JIT_ENTRY+0x63> | |
// 000000000000005f: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 63: eb 10 jmp 0x75 <_JIT_ENTRY+0x75> | |
// 65: 48 89 d9 movq %rbx, %rcx | |
// 68: ff 15 00 00 00 00 callq *(%rip) # 0x6e <_JIT_ENTRY+0x6e> | |
// 000000000000006a: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 6e: 48 8b 06 movq (%rsi), %rax | |
// 71: 85 c0 testl %eax, %eax | |
// 73: 79 dd jns 0x52 <_JIT_ENTRY+0x52> | |
// 75: 48 85 ff testq %rdi, %rdi | |
// 78: 74 13 je 0x8d <_JIT_ENTRY+0x8d> | |
// 7a: 48 89 7d f0 movq %rdi, -0x10(%rbp) | |
// 7e: 48 83 c5 f8 addq $-0x8, %rbp | |
// 82: 48 83 c4 28 addq $0x28, %rsp | |
// 86: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x8d <_JIT_ENTRY+0x8d> | |
// 0000000000000089: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 8d: 48 83 c4 28 addq $0x28, %rsp | |
// 91: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x98 <_JIT_ENTRY+0x98> | |
// 0000000000000094: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 98: | |
const unsigned char code_body[152] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x5d, 0xf0, | |
0x48, 0x8b, 0x75, 0xf8, 0x49, 0x89, 0x6d, 0x40, | |
0x0f, 0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0xc1, | |
0xe0, 0x04, 0x48, 0x8b, 0x3d, 0x00, 0x00, 0x00, | |
0x00, 0x4c, 0x89, 0xe1, 0x48, 0x89, 0xda, 0x49, | |
0x89, 0xf0, 0xff, 0x14, 0x07, 0x48, 0x89, 0xc7, | |
0x49, 0x8b, 0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x03, 0x85, | |
0xc0, 0x78, 0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, | |
0x03, 0x74, 0x1a, 0x48, 0x8b, 0x06, 0x85, 0xc0, | |
0x78, 0x23, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x06, | |
0x75, 0x1b, 0x48, 0x89, 0xf1, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0xeb, 0x10, 0x48, 0x89, 0xd9, | |
0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, | |
0x06, 0x85, 0xc0, 0x79, 0xdd, 0x48, 0x85, 0xff, | |
0x74, 0x13, 0x48, 0x89, 0x7d, 0xf0, 0x48, 0x83, | |
0xc5, 0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &_PyIntrinsics_BinaryFunctions+0x0 | |
// 10: &_Py_Dealloc+0x0 | |
// 18: CONTINUE | |
// 20: ERROR_TARGET | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&_PyIntrinsics_BinaryFunctions); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x18, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x20, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x13, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1d, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x5f, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x6a, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x89, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x94, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__CALL_ISINSTANCE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CALL_ISINSTANCE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 0f b7 0d 00 00 00 00 movzwl (%rip), %ecx # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: 89 c8 movl %ecx, %eax | |
// d: f7 d0 notl %eax | |
// f: 4c 63 f0 movslq %eax, %r14 | |
// 12: 31 c0 xorl %eax, %eax | |
// 14: 4a 83 7c f5 00 00 cmpq $0x0, (%rbp,%r14,8) | |
// 1a: 0f 95 c0 setne %al | |
// 1d: 8d 14 08 leal (%rax,%rcx), %edx | |
// 20: 83 fa 02 cmpl $0x2, %edx | |
// 23: 75 1d jne 0x42 <_JIT_ENTRY+0x42> | |
// 25: ba fe ff ff ff movl $0xfffffffe, %edx # imm = 0xFFFFFFFE | |
// 2a: 29 ca subl %ecx, %edx | |
// 2c: 4c 63 fa movslq %edx, %r15 | |
// 2f: 49 8b 54 24 10 movq 0x10(%r12), %rdx | |
// 34: 48 8b 92 b0 65 03 00 movq 0x365b0(%rdx), %rdx | |
// 3b: 4a 3b 54 fd 00 cmpq (%rbp,%r15,8), %rdx | |
// 40: 74 0b je 0x4d <_JIT_ENTRY+0x4d> | |
// 42: 48 83 c4 28 addq $0x28, %rsp | |
// 46: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x4d <_JIT_ENTRY+0x4d> | |
// 0000000000000049: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 4d: c1 e1 03 shll $0x3, %ecx | |
// 50: 48 89 ea movq %rbp, %rdx | |
// 53: 48 29 ca subq %rcx, %rdx | |
// 56: 48 f7 d8 negq %rax | |
// 59: 48 8b 1c c2 movq (%rdx,%rax,8), %rbx | |
// 5d: 48 8b 7c c2 08 movq 0x8(%rdx,%rax,8), %rdi | |
// 62: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 66: 48 89 d9 movq %rbx, %rcx | |
// 69: 48 89 fa movq %rdi, %rdx | |
// 6c: ff 15 00 00 00 00 callq *(%rip) # 0x72 <_JIT_ENTRY+0x72> | |
// 000000000000006e: IMAGE_REL_AMD64_REL32 __imp_PyObject_IsInstance | |
// 72: 49 8b 75 40 movq 0x40(%r13), %rsi | |
// 76: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 7e: 85 c0 testl %eax, %eax | |
// 80: 78 74 js 0xf6 <_JIT_ENTRY+0xf6> | |
// 82: 48 8b 0b movq (%rbx), %rcx | |
// 85: 85 c9 testl %ecx, %ecx | |
// 87: 78 15 js 0x9e <_JIT_ENTRY+0x9e> | |
// 89: 48 ff c9 decq %rcx | |
// 8c: 48 89 0b movq %rcx, (%rbx) | |
// 8f: 75 0d jne 0x9e <_JIT_ENTRY+0x9e> | |
// 91: 48 89 d9 movq %rbx, %rcx | |
// 94: 89 c3 movl %eax, %ebx | |
// 96: ff 15 00 00 00 00 callq *(%rip) # 0x9c <_JIT_ENTRY+0x9c> | |
// 0000000000000098: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 9c: 89 d8 movl %ebx, %eax | |
// 9e: 48 8b 0f movq (%rdi), %rcx | |
// a1: 85 c9 testl %ecx, %ecx | |
// a3: 78 15 js 0xba <_JIT_ENTRY+0xba> | |
// a5: 48 ff c9 decq %rcx | |
// a8: 48 89 0f movq %rcx, (%rdi) | |
// ab: 75 0d jne 0xba <_JIT_ENTRY+0xba> | |
// ad: 48 89 f9 movq %rdi, %rcx | |
// b0: 89 c7 movl %eax, %edi | |
// b2: ff 15 00 00 00 00 callq *(%rip) # 0xb8 <_JIT_ENTRY+0xb8> | |
// 00000000000000b4: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// b8: 89 f8 movl %edi, %eax | |
// ba: 4a 8b 4c fd 00 movq (%rbp,%r15,8), %rcx | |
// bf: 48 8b 11 movq (%rcx), %rdx | |
// c2: 85 d2 testl %edx, %edx | |
// c4: 78 12 js 0xd8 <_JIT_ENTRY+0xd8> | |
// c6: 48 ff ca decq %rdx | |
// c9: 48 89 11 movq %rdx, (%rcx) | |
// cc: 75 0a jne 0xd8 <_JIT_ENTRY+0xd8> | |
// ce: 89 c7 movl %eax, %edi | |
// d0: ff 15 00 00 00 00 callq *(%rip) # 0xd6 <_JIT_ENTRY+0xd6> | |
// 00000000000000d2: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// d6: 89 f8 movl %edi, %eax | |
// d8: 85 c0 testl %eax, %eax | |
// da: 75 28 jne 0x104 <_JIT_ENTRY+0x104> | |
// dc: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0xe3 <_JIT_ENTRY+0xe3> | |
// 00000000000000df: IMAGE_REL_AMD64_REL32 __imp__Py_FalseStruct | |
// e3: 4a 89 04 fe movq %rax, (%rsi,%r15,8) | |
// e7: 4a 8d 2c f6 leaq (%rsi,%r14,8), %rbp | |
// eb: 48 83 c4 28 addq $0x28, %rsp | |
// ef: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xf6 <_JIT_ENTRY+0xf6> | |
// 00000000000000f2: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// f6: 48 89 f5 movq %rsi, %rbp | |
// f9: 48 83 c4 28 addq $0x28, %rsp | |
// fd: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x104 <_JIT_ENTRY+0x104> | |
// 0000000000000100: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 104: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x10b <_JIT_ENTRY+0x10b> | |
// 0000000000000107: IMAGE_REL_AMD64_REL32 __imp__Py_TrueStruct | |
// 10b: 4a 89 04 fe movq %rax, (%rsi,%r15,8) | |
// 10f: 4a 8d 2c f6 leaq (%rsi,%r14,8), %rbp | |
// 113: 48 83 c4 28 addq $0x28, %rsp | |
// 117: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x11e <_JIT_ENTRY+0x11e> | |
// 000000000000011a: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 117: | |
const unsigned char code_body[279] = { | |
0x48, 0x83, 0xec, 0x28, 0x0f, 0xb7, 0x0d, 0x00, | |
0x00, 0x00, 0x00, 0x89, 0xc8, 0xf7, 0xd0, 0x4c, | |
0x63, 0xf0, 0x31, 0xc0, 0x4a, 0x83, 0x7c, 0xf5, | |
0x00, 0x00, 0x0f, 0x95, 0xc0, 0x8d, 0x14, 0x08, | |
0x83, 0xfa, 0x02, 0x75, 0x1d, 0xba, 0xfe, 0xff, | |
0xff, 0xff, 0x29, 0xca, 0x4c, 0x63, 0xfa, 0x49, | |
0x8b, 0x54, 0x24, 0x10, 0x48, 0x8b, 0x92, 0xb0, | |
0x65, 0x03, 0x00, 0x4a, 0x3b, 0x54, 0xfd, 0x00, | |
0x74, 0x0b, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, 0xc1, 0xe1, 0x03, | |
0x48, 0x89, 0xea, 0x48, 0x29, 0xca, 0x48, 0xf7, | |
0xd8, 0x48, 0x8b, 0x1c, 0xc2, 0x48, 0x8b, 0x7c, | |
0xc2, 0x08, 0x49, 0x89, 0x6d, 0x40, 0x48, 0x89, | |
0xd9, 0x48, 0x89, 0xfa, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x49, 0x8b, 0x75, 0x40, 0x49, 0xc7, | |
0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x85, 0xc0, | |
0x78, 0x74, 0x48, 0x8b, 0x0b, 0x85, 0xc9, 0x78, | |
0x15, 0x48, 0xff, 0xc9, 0x48, 0x89, 0x0b, 0x75, | |
0x0d, 0x48, 0x89, 0xd9, 0x89, 0xc3, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x89, 0xd8, 0x48, 0x8b, | |
0x0f, 0x85, 0xc9, 0x78, 0x15, 0x48, 0xff, 0xc9, | |
0x48, 0x89, 0x0f, 0x75, 0x0d, 0x48, 0x89, 0xf9, | |
0x89, 0xc7, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x89, 0xf8, 0x4a, 0x8b, 0x4c, 0xfd, 0x00, 0x48, | |
0x8b, 0x11, 0x85, 0xd2, 0x78, 0x12, 0x48, 0xff, | |
0xca, 0x48, 0x89, 0x11, 0x75, 0x0a, 0x89, 0xc7, | |
0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x89, 0xf8, | |
0x85, 0xc0, 0x75, 0x28, 0x48, 0x8b, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x4a, 0x89, 0x04, 0xfe, 0x4a, | |
0x8d, 0x2c, 0xf6, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, | |
0xf5, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x4a, 0x89, 0x04, 0xfe, 0x4a, | |
0x8d, 0x2c, 0xf6, 0x48, 0x83, 0xc4, 0x28, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: JUMP_TARGET | |
// 10: &PyObject_IsInstance+0x0 | |
// 18: &_Py_Dealloc+0x0 | |
// 20: &_Py_FalseStruct+0x0 | |
// 28: CONTINUE | |
// 30: ERROR_TARGET | |
// 38: &_Py_TrueStruct+0x0 | |
const unsigned char data_body[64] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x10, (uintptr_t)&PyObject_IsInstance); | |
patch_64(data + 0x18, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x20, (uintptr_t)&_Py_FalseStruct); | |
patch_64(data + 0x28, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x30, state->instruction_starts[instruction->error_target]); | |
patch_64(data + 0x38, (uintptr_t)&_Py_TrueStruct); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x49, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x6e, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x98, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xb4, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xd2, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xdf, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0xf2, (uintptr_t)data + 0x24); | |
patch_x86_64_32rx(code + 0x100, (uintptr_t)data + 0x2c); | |
patch_x86_64_32rx(code + 0x107, (uintptr_t)data + 0x34); | |
} | |
void | |
emit__CALL_KW_NON_PY( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CALL_KW_NON_PY.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 38 subq $0x38, %rsp | |
// 4: 4c 89 64 24 28 movq %r12, 0x28(%rsp) | |
// 9: 44 0f b7 25 00 00 00 00 movzwl (%rip), %r12d # 0x11 <_JIT_ENTRY+0x11> | |
// 000000000000000d: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 11: 4c 8b 75 f8 movq -0x8(%rbp), %r14 | |
// 15: 44 89 e0 movl %r12d, %eax | |
// 18: f7 d0 notl %eax | |
// 1a: 48 98 cltq | |
// 1c: 48 8d 34 c5 00 00 00 00 leaq (,%rax,8), %rsi | |
// 24: 48 01 ee addq %rbp, %rsi | |
// 27: b8 fe ff ff ff movl $0xfffffffe, %eax # imm = 0xFFFFFFFE | |
// 2c: 44 29 e0 subl %r12d, %eax | |
// 2f: 48 63 c8 movslq %eax, %rcx | |
// 32: b8 fd ff ff ff movl $0xfffffffd, %eax # imm = 0xFFFFFFFD | |
// 37: 44 29 e0 subl %r12d, %eax | |
// 3a: 4c 63 f8 movslq %eax, %r15 | |
// 3d: 31 c0 xorl %eax, %eax | |
// 3f: 48 89 4c 24 30 movq %rcx, 0x30(%rsp) | |
// 44: 48 83 7c cd 00 00 cmpq $0x0, (%rbp,%rcx,8) | |
// 4a: 4a 8b 4c fd 00 movq (%rbp,%r15,8), %rcx | |
// 4f: 0f 95 c0 setne %al | |
// 52: 41 01 c4 addl %eax, %r12d | |
// 55: c1 e0 03 shll $0x3, %eax | |
// 58: 48 29 c6 subq %rax, %rsi | |
// 5b: 44 89 e0 movl %r12d, %eax | |
// 5e: 41 2b 46 10 subl 0x10(%r14), %eax | |
// 62: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 66: 48 98 cltq | |
// 68: 49 b8 00 00 00 00 00 00 00 80 movabsq $-0x8000000000000000, %r8 # imm = 0x8000000000000000 | |
// 72: 49 09 c0 orq %rax, %r8 | |
// 75: 48 89 f2 movq %rsi, %rdx | |
// 78: 4d 89 f1 movq %r14, %r9 | |
// 7b: ff 15 00 00 00 00 callq *(%rip) # 0x81 <_JIT_ENTRY+0x81> | |
// 000000000000007d: IMAGE_REL_AMD64_REL32 __imp_PyObject_Vectorcall | |
// 81: 48 89 c3 movq %rax, %rbx | |
// 84: 49 8b 45 40 movq 0x40(%r13), %rax | |
// 88: 48 89 44 24 20 movq %rax, 0x20(%rsp) | |
// 8d: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 95: 49 8b 06 movq (%r14), %rax | |
// 98: 85 c0 testl %eax, %eax | |
// 9a: 78 11 js 0xad <_JIT_ENTRY+0xad> | |
// 9c: 48 ff c8 decq %rax | |
// 9f: 49 89 06 movq %rax, (%r14) | |
// a2: 75 09 jne 0xad <_JIT_ENTRY+0xad> | |
// a4: 4c 89 f1 movq %r14, %rcx | |
// a7: ff 15 00 00 00 00 callq *(%rip) # 0xad <_JIT_ENTRY+0xad> | |
// 00000000000000a9: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// ad: 45 85 e4 testl %r12d, %r12d | |
// b0: 74 3d je 0xef <_JIT_ENTRY+0xef> | |
// b2: 45 89 e6 movl %r12d, %r14d | |
// b5: 45 31 e4 xorl %r12d, %r12d | |
// b8: 48 8b 3d 00 00 00 00 movq (%rip), %rdi # 0xbf <_JIT_ENTRY+0xbf> | |
// 00000000000000bb: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// bf: eb 17 jmp 0xd8 <_JIT_ENTRY+0xd8> | |
// c1: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:(%rax,%rax) | |
// d0: 49 ff c4 incq %r12 | |
// d3: 4d 39 e6 cmpq %r12, %r14 | |
// d6: 74 17 je 0xef <_JIT_ENTRY+0xef> | |
// d8: 4a 8b 0c e6 movq (%rsi,%r12,8), %rcx | |
// dc: 48 8b 01 movq (%rcx), %rax | |
// df: 85 c0 testl %eax, %eax | |
// e1: 78 ed js 0xd0 <_JIT_ENTRY+0xd0> | |
// e3: 48 ff c8 decq %rax | |
// e6: 48 89 01 movq %rax, (%rcx) | |
// e9: 75 e5 jne 0xd0 <_JIT_ENTRY+0xd0> | |
// eb: ff d7 callq *%rdi | |
// ed: eb e1 jmp 0xd0 <_JIT_ENTRY+0xd0> | |
// ef: 4a 8b 4c fd 00 movq (%rbp,%r15,8), %rcx | |
// f4: 48 8b 01 movq (%rcx), %rax | |
// f7: 85 c0 testl %eax, %eax | |
// f9: 78 08 js 0x103 <_JIT_ENTRY+0x103> | |
// fb: 48 ff c8 decq %rax | |
// fe: 48 89 01 movq %rax, (%rcx) | |
// 101: 74 27 je 0x12a <_JIT_ENTRY+0x12a> | |
// 103: 48 85 db testq %rbx, %rbx | |
// 106: 74 2d je 0x135 <_JIT_ENTRY+0x135> | |
// 108: 48 8b 4c 24 20 movq 0x20(%rsp), %rcx | |
// 10d: 4a 89 1c f9 movq %rbx, (%rcx,%r15,8) | |
// 111: 48 8b 44 24 30 movq 0x30(%rsp), %rax | |
// 116: 48 8d 2c c1 leaq (%rcx,%rax,8), %rbp | |
// 11a: 4c 8b 64 24 28 movq 0x28(%rsp), %r12 | |
// 11f: 48 83 c4 38 addq $0x38, %rsp | |
// 123: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x12a <_JIT_ENTRY+0x12a> | |
// 0000000000000126: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 12a: ff 15 00 00 00 00 callq *(%rip) # 0x130 <_JIT_ENTRY+0x130> | |
// 000000000000012c: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 130: 48 85 db testq %rbx, %rbx | |
// 133: 75 d3 jne 0x108 <_JIT_ENTRY+0x108> | |
// 135: 48 8b 6c 24 20 movq 0x20(%rsp), %rbp | |
// 13a: 4c 8b 64 24 28 movq 0x28(%rsp), %r12 | |
// 13f: 48 83 c4 38 addq $0x38, %rsp | |
// 143: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x14a <_JIT_ENTRY+0x14a> | |
// 0000000000000146: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 14a: | |
const unsigned char code_body[330] = { | |
0x48, 0x83, 0xec, 0x38, 0x4c, 0x89, 0x64, 0x24, | |
0x28, 0x44, 0x0f, 0xb7, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0x4c, 0x8b, 0x75, 0xf8, 0x44, 0x89, 0xe0, | |
0xf7, 0xd0, 0x48, 0x98, 0x48, 0x8d, 0x34, 0xc5, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x01, 0xee, 0xb8, | |
0xfe, 0xff, 0xff, 0xff, 0x44, 0x29, 0xe0, 0x48, | |
0x63, 0xc8, 0xb8, 0xfd, 0xff, 0xff, 0xff, 0x44, | |
0x29, 0xe0, 0x4c, 0x63, 0xf8, 0x31, 0xc0, 0x48, | |
0x89, 0x4c, 0x24, 0x30, 0x48, 0x83, 0x7c, 0xcd, | |
0x00, 0x00, 0x4a, 0x8b, 0x4c, 0xfd, 0x00, 0x0f, | |
0x95, 0xc0, 0x41, 0x01, 0xc4, 0xc1, 0xe0, 0x03, | |
0x48, 0x29, 0xc6, 0x44, 0x89, 0xe0, 0x41, 0x2b, | |
0x46, 0x10, 0x49, 0x89, 0x6d, 0x40, 0x48, 0x98, | |
0x49, 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x80, 0x49, 0x09, 0xc0, 0x48, 0x89, 0xf2, | |
0x4d, 0x89, 0xf1, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x89, 0xc3, 0x49, 0x8b, 0x45, 0x40, | |
0x48, 0x89, 0x44, 0x24, 0x20, 0x49, 0xc7, 0x45, | |
0x40, 0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x06, | |
0x85, 0xc0, 0x78, 0x11, 0x48, 0xff, 0xc8, 0x49, | |
0x89, 0x06, 0x75, 0x09, 0x4c, 0x89, 0xf1, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x45, 0x85, 0xe4, | |
0x74, 0x3d, 0x45, 0x89, 0xe6, 0x45, 0x31, 0xe4, | |
0x48, 0x8b, 0x3d, 0x00, 0x00, 0x00, 0x00, 0xeb, | |
0x17, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x2e, | |
0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x49, 0xff, 0xc4, 0x4d, 0x39, 0xe6, 0x74, 0x17, | |
0x4a, 0x8b, 0x0c, 0xe6, 0x48, 0x8b, 0x01, 0x85, | |
0xc0, 0x78, 0xed, 0x48, 0xff, 0xc8, 0x48, 0x89, | |
0x01, 0x75, 0xe5, 0xff, 0xd7, 0xeb, 0xe1, 0x4a, | |
0x8b, 0x4c, 0xfd, 0x00, 0x48, 0x8b, 0x01, 0x85, | |
0xc0, 0x78, 0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, | |
0x01, 0x74, 0x27, 0x48, 0x85, 0xdb, 0x74, 0x2d, | |
0x48, 0x8b, 0x4c, 0x24, 0x20, 0x4a, 0x89, 0x1c, | |
0xf9, 0x48, 0x8b, 0x44, 0x24, 0x30, 0x48, 0x8d, | |
0x2c, 0xc1, 0x4c, 0x8b, 0x64, 0x24, 0x28, 0x48, | |
0x83, 0xc4, 0x38, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x85, 0xdb, 0x75, 0xd3, 0x48, 0x8b, 0x6c, | |
0x24, 0x20, 0x4c, 0x8b, 0x64, 0x24, 0x28, 0x48, | |
0x83, 0xc4, 0x38, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &PyObject_Vectorcall+0x0 | |
// 10: &_Py_Dealloc+0x0 | |
// 18: CONTINUE | |
// 20: ERROR_TARGET | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&PyObject_Vectorcall); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x18, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x20, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xd, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x7d, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0xa9, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xbb, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x126, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x12c, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x146, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__CALL_LEN( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CALL_LEN.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: 89 c1 movl %eax, %ecx | |
// d: f7 d1 notl %ecx | |
// f: 48 63 d9 movslq %ecx, %rbx | |
// 12: 31 c9 xorl %ecx, %ecx | |
// 14: 48 83 7c dd 00 00 cmpq $0x0, (%rbp,%rbx,8) | |
// 1a: 0f 95 c1 setne %cl | |
// 1d: 8d 14 01 leal (%rcx,%rax), %edx | |
// 20: 83 fa 01 cmpl $0x1, %edx | |
// 23: 75 1d jne 0x42 <_JIT_ENTRY+0x42> | |
// 25: ba fe ff ff ff movl $0xfffffffe, %edx # imm = 0xFFFFFFFE | |
// 2a: 29 c2 subl %eax, %edx | |
// 2c: 4c 63 f2 movslq %edx, %r14 | |
// 2f: 49 8b 54 24 10 movq 0x10(%r12), %rdx | |
// 34: 48 8b 92 b8 65 03 00 movq 0x365b8(%rdx), %rdx | |
// 3b: 4a 3b 54 f5 00 cmpq (%rbp,%r14,8), %rdx | |
// 40: 74 0b je 0x4d <_JIT_ENTRY+0x4d> | |
// 42: 48 83 c4 28 addq $0x28, %rsp | |
// 46: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x4d <_JIT_ENTRY+0x4d> | |
// 0000000000000049: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 4d: c1 e0 03 shll $0x3, %eax | |
// 50: 48 89 ea movq %rbp, %rdx | |
// 53: 48 29 c2 subq %rax, %rdx | |
// 56: 48 f7 d9 negq %rcx | |
// 59: 48 8b 3c ca movq (%rdx,%rcx,8), %rdi | |
// 5d: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 61: 48 89 f9 movq %rdi, %rcx | |
// 64: ff 15 00 00 00 00 callq *(%rip) # 0x6a <_JIT_ENTRY+0x6a> | |
// 0000000000000066: IMAGE_REL_AMD64_REL32 __imp_PyObject_Size | |
// 6a: 49 8b 75 40 movq 0x40(%r13), %rsi | |
// 6e: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 76: 48 85 c0 testq %rax, %rax | |
// 79: 78 5f js 0xda <_JIT_ENTRY+0xda> | |
// 7b: 48 89 c1 movq %rax, %rcx | |
// 7e: ff 15 00 00 00 00 callq *(%rip) # 0x84 <_JIT_ENTRY+0x84> | |
// 0000000000000080: IMAGE_REL_AMD64_REL32 __imp_PyLong_FromSsize_t | |
// 84: 48 85 c0 testq %rax, %rax | |
// 87: 74 5f je 0xe8 <_JIT_ENTRY+0xe8> | |
// 89: 4a 8b 4c f5 00 movq (%rbp,%r14,8), %rcx | |
// 8e: 48 8b 11 movq (%rcx), %rdx | |
// 91: 85 d2 testl %edx, %edx | |
// 93: 78 14 js 0xa9 <_JIT_ENTRY+0xa9> | |
// 95: 48 ff ca decq %rdx | |
// 98: 48 89 11 movq %rdx, (%rcx) | |
// 9b: 75 0c jne 0xa9 <_JIT_ENTRY+0xa9> | |
// 9d: 49 89 c7 movq %rax, %r15 | |
// a0: ff 15 00 00 00 00 callq *(%rip) # 0xa6 <_JIT_ENTRY+0xa6> | |
// 00000000000000a2: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// a6: 4c 89 f8 movq %r15, %rax | |
// a9: 48 8b 0f movq (%rdi), %rcx | |
// ac: 85 c9 testl %ecx, %ecx | |
// ae: 78 17 js 0xc7 <_JIT_ENTRY+0xc7> | |
// b0: 48 ff c9 decq %rcx | |
// b3: 48 89 0f movq %rcx, (%rdi) | |
// b6: 75 0f jne 0xc7 <_JIT_ENTRY+0xc7> | |
// b8: 48 89 f9 movq %rdi, %rcx | |
// bb: 48 89 c7 movq %rax, %rdi | |
// be: ff 15 00 00 00 00 callq *(%rip) # 0xc4 <_JIT_ENTRY+0xc4> | |
// 00000000000000c0: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// c4: 48 89 f8 movq %rdi, %rax | |
// c7: 4a 89 04 f6 movq %rax, (%rsi,%r14,8) | |
// cb: 48 8d 2c de leaq (%rsi,%rbx,8), %rbp | |
// cf: 48 83 c4 28 addq $0x28, %rsp | |
// d3: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xda <_JIT_ENTRY+0xda> | |
// 00000000000000d6: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// da: 48 89 f5 movq %rsi, %rbp | |
// dd: 48 83 c4 28 addq $0x28, %rsp | |
// e1: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xe8 <_JIT_ENTRY+0xe8> | |
// 00000000000000e4: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// e8: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0xef <_JIT_ENTRY+0xef> | |
// 00000000000000eb: IMAGE_REL_AMD64_REL32 __imp__JIT_EXECUTOR | |
// ef: 49 89 84 24 08 01 00 00 movq %rax, 0x108(%r12) | |
// f7: 49 89 75 40 movq %rsi, 0x40(%r13) | |
// fb: 31 c0 xorl %eax, %eax | |
// fd: 48 83 c4 28 addq $0x28, %rsp | |
// 101: c3 retq | |
// 102: | |
const unsigned char code_body[258] = { | |
0x48, 0x83, 0xec, 0x28, 0x0f, 0xb7, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x89, 0xc1, 0xf7, 0xd1, 0x48, | |
0x63, 0xd9, 0x31, 0xc9, 0x48, 0x83, 0x7c, 0xdd, | |
0x00, 0x00, 0x0f, 0x95, 0xc1, 0x8d, 0x14, 0x01, | |
0x83, 0xfa, 0x01, 0x75, 0x1d, 0xba, 0xfe, 0xff, | |
0xff, 0xff, 0x29, 0xc2, 0x4c, 0x63, 0xf2, 0x49, | |
0x8b, 0x54, 0x24, 0x10, 0x48, 0x8b, 0x92, 0xb8, | |
0x65, 0x03, 0x00, 0x4a, 0x3b, 0x54, 0xf5, 0x00, | |
0x74, 0x0b, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, 0xc1, 0xe0, 0x03, | |
0x48, 0x89, 0xea, 0x48, 0x29, 0xc2, 0x48, 0xf7, | |
0xd9, 0x48, 0x8b, 0x3c, 0xca, 0x49, 0x89, 0x6d, | |
0x40, 0x48, 0x89, 0xf9, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x49, 0x8b, 0x75, 0x40, 0x49, 0xc7, | |
0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x48, 0x85, | |
0xc0, 0x78, 0x5f, 0x48, 0x89, 0xc1, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x85, 0xc0, 0x74, | |
0x5f, 0x4a, 0x8b, 0x4c, 0xf5, 0x00, 0x48, 0x8b, | |
0x11, 0x85, 0xd2, 0x78, 0x14, 0x48, 0xff, 0xca, | |
0x48, 0x89, 0x11, 0x75, 0x0c, 0x49, 0x89, 0xc7, | |
0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x89, | |
0xf8, 0x48, 0x8b, 0x0f, 0x85, 0xc9, 0x78, 0x17, | |
0x48, 0xff, 0xc9, 0x48, 0x89, 0x0f, 0x75, 0x0f, | |
0x48, 0x89, 0xf9, 0x48, 0x89, 0xc7, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0xf8, 0x4a, | |
0x89, 0x04, 0xf6, 0x48, 0x8d, 0x2c, 0xde, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x89, 0xf5, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x49, | |
0x89, 0x84, 0x24, 0x08, 0x01, 0x00, 0x00, 0x49, | |
0x89, 0x75, 0x40, 0x31, 0xc0, 0x48, 0x83, 0xc4, | |
0x28, 0xc3, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: JUMP_TARGET | |
// 10: &PyObject_Size+0x0 | |
// 18: &PyLong_FromSsize_t+0x0 | |
// 20: &_Py_Dealloc+0x0 | |
// 28: CONTINUE | |
// 30: ERROR_TARGET | |
// 38: EXECUTOR | |
const unsigned char data_body[64] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x10, (uintptr_t)&PyObject_Size); | |
patch_64(data + 0x18, (uintptr_t)&PyLong_FromSsize_t); | |
patch_64(data + 0x20, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x28, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x30, state->instruction_starts[instruction->error_target]); | |
patch_64(data + 0x38, (uintptr_t)executor); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x49, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x66, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x80, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xa2, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0xc0, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0xd6, (uintptr_t)data + 0x24); | |
patch_x86_64_32rx(code + 0xe4, (uintptr_t)data + 0x2c); | |
patch_x86_64_32rx(code + 0xeb, (uintptr_t)data + 0x34); | |
} | |
void | |
emit__CALL_LIST_APPEND( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CALL_LIST_APPEND.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 75 e8 movq -0x18(%rbp), %rsi | |
// 8: 49 8b 44 24 10 movq 0x10(%r12), %rax | |
// d: 48 39 b0 c0 65 03 00 cmpq %rsi, 0x365c0(%rax) | |
// 14: 75 11 jne 0x27 <_JIT_ENTRY+0x27> | |
// 16: 48 8b 7d f0 movq -0x10(%rbp), %rdi | |
// 1a: 48 8b 47 08 movq 0x8(%rdi), %rax | |
// 1e: f6 80 ab 00 00 00 02 testb $0x2, 0xab(%rax) | |
// 25: 75 0b jne 0x32 <_JIT_ENTRY+0x32> | |
// 27: 48 83 c4 28 addq $0x28, %rsp | |
// 2b: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x32 <_JIT_ENTRY+0x32> | |
// 000000000000002e: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 32: 48 8b 55 f8 movq -0x8(%rbp), %rdx | |
// 36: 48 8b 47 10 movq 0x10(%rdi), %rax | |
// 3a: 48 39 47 20 cmpq %rax, 0x20(%rdi) | |
// 3e: 7e 1a jle 0x5a <_JIT_ENTRY+0x5a> | |
// 40: 48 8b 4f 18 movq 0x18(%rdi), %rcx | |
// 44: 48 89 14 c1 movq %rdx, (%rcx,%rax,8) | |
// 48: 48 ff c0 incq %rax | |
// 4b: 48 89 47 10 movq %rax, 0x10(%rdi) | |
// 4f: b3 01 movb $0x1, %bl | |
// 51: 48 8b 07 movq (%rdi), %rax | |
// 54: 85 c0 testl %eax, %eax | |
// 56: 79 17 jns 0x6f <_JIT_ENTRY+0x6f> | |
// 58: eb 26 jmp 0x80 <_JIT_ENTRY+0x80> | |
// 5a: 48 89 f9 movq %rdi, %rcx | |
// 5d: ff 15 00 00 00 00 callq *(%rip) # 0x63 <_JIT_ENTRY+0x63> | |
// 000000000000005f: IMAGE_REL_AMD64_REL32 __imp__PyList_AppendTakeRefListResize | |
// 63: 85 c0 testl %eax, %eax | |
// 65: 0f 94 c3 sete %bl | |
// 68: 48 8b 07 movq (%rdi), %rax | |
// 6b: 85 c0 testl %eax, %eax | |
// 6d: 78 11 js 0x80 <_JIT_ENTRY+0x80> | |
// 6f: 48 ff c8 decq %rax | |
// 72: 48 89 07 movq %rax, (%rdi) | |
// 75: 75 09 jne 0x80 <_JIT_ENTRY+0x80> | |
// 77: 48 89 f9 movq %rdi, %rcx | |
// 7a: ff 15 00 00 00 00 callq *(%rip) # 0x80 <_JIT_ENTRY+0x80> | |
// 000000000000007c: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 80: 48 8b 06 movq (%rsi), %rax | |
// 83: 85 c0 testl %eax, %eax | |
// 85: 78 08 js 0x8f <_JIT_ENTRY+0x8f> | |
// 87: 48 ff c8 decq %rax | |
// 8a: 48 89 06 movq %rax, (%rsi) | |
// 8d: 74 13 je 0xa2 <_JIT_ENTRY+0xa2> | |
// 8f: 84 db testb %bl, %bl | |
// 91: 74 1c je 0xaf <_JIT_ENTRY+0xaf> | |
// 93: 48 83 c5 e8 addq $-0x18, %rbp | |
// 97: 48 83 c4 28 addq $0x28, %rsp | |
// 9b: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xa2 <_JIT_ENTRY+0xa2> | |
// 000000000000009e: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// a2: 48 89 f1 movq %rsi, %rcx | |
// a5: ff 15 00 00 00 00 callq *(%rip) # 0xab <_JIT_ENTRY+0xab> | |
// 00000000000000a7: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// ab: 84 db testb %bl, %bl | |
// ad: 75 e4 jne 0x93 <_JIT_ENTRY+0x93> | |
// af: 48 83 c4 28 addq $0x28, %rsp | |
// b3: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xba <_JIT_ENTRY+0xba> | |
// 00000000000000b6: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// ba: | |
const unsigned char code_body[186] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x75, 0xe8, | |
0x49, 0x8b, 0x44, 0x24, 0x10, 0x48, 0x39, 0xb0, | |
0xc0, 0x65, 0x03, 0x00, 0x75, 0x11, 0x48, 0x8b, | |
0x7d, 0xf0, 0x48, 0x8b, 0x47, 0x08, 0xf6, 0x80, | |
0xab, 0x00, 0x00, 0x00, 0x02, 0x75, 0x0b, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x8b, 0x55, 0xf8, 0x48, 0x8b, | |
0x47, 0x10, 0x48, 0x39, 0x47, 0x20, 0x7e, 0x1a, | |
0x48, 0x8b, 0x4f, 0x18, 0x48, 0x89, 0x14, 0xc1, | |
0x48, 0xff, 0xc0, 0x48, 0x89, 0x47, 0x10, 0xb3, | |
0x01, 0x48, 0x8b, 0x07, 0x85, 0xc0, 0x79, 0x17, | |
0xeb, 0x26, 0x48, 0x89, 0xf9, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x85, 0xc0, 0x0f, 0x94, 0xc3, | |
0x48, 0x8b, 0x07, 0x85, 0xc0, 0x78, 0x11, 0x48, | |
0xff, 0xc8, 0x48, 0x89, 0x07, 0x75, 0x09, 0x48, | |
0x89, 0xf9, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8b, 0x06, 0x85, 0xc0, 0x78, 0x08, 0x48, | |
0xff, 0xc8, 0x48, 0x89, 0x06, 0x74, 0x13, 0x84, | |
0xdb, 0x74, 0x1c, 0x48, 0x83, 0xc5, 0xe8, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x89, 0xf1, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x84, 0xdb, 0x75, 0xe4, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, | |
}; | |
// 0: | |
// 0: JUMP_TARGET | |
// 8: &_PyList_AppendTakeRefListResize+0x0 | |
// 10: &_Py_Dealloc+0x0 | |
// 18: CONTINUE | |
// 20: ERROR_TARGET | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x8, (uintptr_t)&_PyList_AppendTakeRefListResize); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x18, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x20, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x2e, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x5f, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x7c, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x9e, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xa7, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xb6, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__CALL_METHOD_DESCRIPTOR_FAST( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CALL_METHOD_DESCRIPTOR_FAST.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 38 subq $0x38, %rsp | |
// 4: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: 89 c1 movl %eax, %ecx | |
// d: f7 d1 notl %ecx | |
// f: 48 63 d9 movslq %ecx, %rbx | |
// 12: b9 fe ff ff ff movl $0xfffffffe, %ecx # imm = 0xFFFFFFFE | |
// 17: 29 c1 subl %eax, %ecx | |
// 19: 4c 63 f1 movslq %ecx, %r14 | |
// 1c: 4a 8b 54 f5 00 movq (%rbp,%r14,8), %rdx | |
// 21: 31 f6 xorl %esi, %esi | |
// 23: 48 83 7c dd 00 00 cmpq $0x0, (%rbp,%rbx,8) | |
// 29: 0f 95 c1 setne %cl | |
// 2c: 48 8b 7a 08 movq 0x8(%rdx), %rdi | |
// 30: 48 3b 3d 00 00 00 00 cmpq (%rip), %rdi # 0x37 <_JIT_ENTRY+0x37> | |
// 0000000000000033: IMAGE_REL_AMD64_REL32 __imp_PyMethodDescr_Type | |
// 37: 75 35 jne 0x6e <_JIT_ENTRY+0x6e> | |
// 39: 48 8b 7a 28 movq 0x28(%rdx), %rdi | |
// 3d: 81 7f 10 80 00 00 00 cmpl $0x80, 0x10(%rdi) | |
// 44: 75 28 jne 0x6e <_JIT_ENTRY+0x6e> | |
// 46: 44 8d 04 c5 00 00 00 00 leal (,%rax,8), %r8d | |
// 4e: 49 89 ef movq %rbp, %r15 | |
// 51: 4d 29 c7 subq %r8, %r15 | |
// 54: 40 88 ce movb %cl, %sil | |
// 57: 8d 0c f5 00 00 00 00 leal (,%rsi,8), %ecx | |
// 5e: 49 29 cf subq %rcx, %r15 | |
// 61: 49 8b 0f movq (%r15), %rcx | |
// 64: 4c 8b 41 08 movq 0x8(%rcx), %r8 | |
// 68: 4c 3b 42 10 cmpq 0x10(%rdx), %r8 | |
// 6c: 74 0b je 0x79 <_JIT_ENTRY+0x79> | |
// 6e: 48 83 c4 38 addq $0x38, %rsp | |
// 72: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x79 <_JIT_ENTRY+0x79> | |
// 0000000000000075: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 79: 01 c6 addl %eax, %esi | |
// 7b: 8d 46 ff leal -0x1(%rsi), %eax | |
// 7e: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 82: 4c 63 c0 movslq %eax, %r8 | |
// 85: 49 8d 57 08 leaq 0x8(%r15), %rdx | |
// 89: ff 57 08 callq *0x8(%rdi) | |
// 8c: 48 89 44 24 30 movq %rax, 0x30(%rsp) | |
// 91: 49 8b 45 40 movq 0x40(%r13), %rax | |
// 95: 48 89 44 24 28 movq %rax, 0x28(%rsp) | |
// 9a: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// a2: 83 fe 01 cmpl $0x1, %esi | |
// a5: 73 3c jae 0xe3 <_JIT_ENTRY+0xe3> | |
// a7: 4a 8b 4c f5 00 movq (%rbp,%r14,8), %rcx | |
// ac: 48 8b 01 movq (%rcx), %rax | |
// af: 85 c0 testl %eax, %eax | |
// b1: 78 0e js 0xc1 <_JIT_ENTRY+0xc1> | |
// b3: 48 ff c8 decq %rax | |
// b6: 48 89 01 movq %rax, (%rcx) | |
// b9: 75 06 jne 0xc1 <_JIT_ENTRY+0xc1> | |
// bb: ff 15 00 00 00 00 callq *(%rip) # 0xc1 <_JIT_ENTRY+0xc1> | |
// 00000000000000bd: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// c1: 48 8b 4c 24 30 movq 0x30(%rsp), %rcx | |
// c6: 48 85 c9 testq %rcx, %rcx | |
// c9: 74 48 je 0x113 <_JIT_ENTRY+0x113> | |
// cb: 48 8b 44 24 28 movq 0x28(%rsp), %rax | |
// d0: 4a 89 0c f0 movq %rcx, (%rax,%r14,8) | |
// d4: 48 8d 2c d8 leaq (%rax,%rbx,8), %rbp | |
// d8: 48 83 c4 38 addq $0x38, %rsp | |
// dc: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xe3 <_JIT_ENTRY+0xe3> | |
// 00000000000000df: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// e3: 89 f6 movl %esi, %esi | |
// e5: 31 ff xorl %edi, %edi | |
// e7: eb 0f jmp 0xf8 <_JIT_ENTRY+0xf8> | |
// e9: 0f 1f 80 00 00 00 00 nopl (%rax) | |
// f0: 48 ff c7 incq %rdi | |
// f3: 48 39 fe cmpq %rdi, %rsi | |
// f6: 74 af je 0xa7 <_JIT_ENTRY+0xa7> | |
// f8: 49 8b 0c ff movq (%r15,%rdi,8), %rcx | |
// fc: 48 8b 01 movq (%rcx), %rax | |
// ff: 85 c0 testl %eax, %eax | |
// 101: 78 ed js 0xf0 <_JIT_ENTRY+0xf0> | |
// 103: 48 ff c8 decq %rax | |
// 106: 48 89 01 movq %rax, (%rcx) | |
// 109: 75 e5 jne 0xf0 <_JIT_ENTRY+0xf0> | |
// 10b: ff 15 00 00 00 00 callq *(%rip) # 0x111 <_JIT_ENTRY+0x111> | |
// 000000000000010d: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 111: eb dd jmp 0xf0 <_JIT_ENTRY+0xf0> | |
// 113: 48 8b 6c 24 28 movq 0x28(%rsp), %rbp | |
// 118: 48 83 c4 38 addq $0x38, %rsp | |
// 11c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x123 <_JIT_ENTRY+0x123> | |
// 000000000000011f: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 123: | |
const unsigned char code_body[291] = { | |
0x48, 0x83, 0xec, 0x38, 0x0f, 0xb7, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x89, 0xc1, 0xf7, 0xd1, 0x48, | |
0x63, 0xd9, 0xb9, 0xfe, 0xff, 0xff, 0xff, 0x29, | |
0xc1, 0x4c, 0x63, 0xf1, 0x4a, 0x8b, 0x54, 0xf5, | |
0x00, 0x31, 0xf6, 0x48, 0x83, 0x7c, 0xdd, 0x00, | |
0x00, 0x0f, 0x95, 0xc1, 0x48, 0x8b, 0x7a, 0x08, | |
0x48, 0x3b, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x75, | |
0x35, 0x48, 0x8b, 0x7a, 0x28, 0x81, 0x7f, 0x10, | |
0x80, 0x00, 0x00, 0x00, 0x75, 0x28, 0x44, 0x8d, | |
0x04, 0xc5, 0x00, 0x00, 0x00, 0x00, 0x49, 0x89, | |
0xef, 0x4d, 0x29, 0xc7, 0x40, 0x88, 0xce, 0x8d, | |
0x0c, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x49, 0x29, | |
0xcf, 0x49, 0x8b, 0x0f, 0x4c, 0x8b, 0x41, 0x08, | |
0x4c, 0x3b, 0x42, 0x10, 0x74, 0x0b, 0x48, 0x83, | |
0xc4, 0x38, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0x01, 0xc6, 0x8d, 0x46, 0xff, 0x49, 0x89, | |
0x6d, 0x40, 0x4c, 0x63, 0xc0, 0x49, 0x8d, 0x57, | |
0x08, 0xff, 0x57, 0x08, 0x48, 0x89, 0x44, 0x24, | |
0x30, 0x49, 0x8b, 0x45, 0x40, 0x48, 0x89, 0x44, | |
0x24, 0x28, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, | |
0x00, 0x00, 0x83, 0xfe, 0x01, 0x73, 0x3c, 0x4a, | |
0x8b, 0x4c, 0xf5, 0x00, 0x48, 0x8b, 0x01, 0x85, | |
0xc0, 0x78, 0x0e, 0x48, 0xff, 0xc8, 0x48, 0x89, | |
0x01, 0x75, 0x06, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x8b, 0x4c, 0x24, 0x30, 0x48, 0x85, | |
0xc9, 0x74, 0x48, 0x48, 0x8b, 0x44, 0x24, 0x28, | |
0x4a, 0x89, 0x0c, 0xf0, 0x48, 0x8d, 0x2c, 0xd8, | |
0x48, 0x83, 0xc4, 0x38, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x89, 0xf6, 0x31, 0xff, 0xeb, | |
0x0f, 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0xff, 0xc7, 0x48, 0x39, 0xfe, 0x74, 0xaf, | |
0x49, 0x8b, 0x0c, 0xff, 0x48, 0x8b, 0x01, 0x85, | |
0xc0, 0x78, 0xed, 0x48, 0xff, 0xc8, 0x48, 0x89, | |
0x01, 0x75, 0xe5, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0xeb, 0xdd, 0x48, 0x8b, 0x6c, 0x24, 0x28, | |
0x48, 0x83, 0xc4, 0x38, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &PyMethodDescr_Type+0x0 | |
// 10: JUMP_TARGET | |
// 18: &_Py_Dealloc+0x0 | |
// 20: CONTINUE | |
// 28: ERROR_TARGET | |
const unsigned char data_body[48] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&PyMethodDescr_Type); | |
patch_64(data + 0x10, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x18, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x20, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x28, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x33, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x75, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xbd, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xdf, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0x10d, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x11f, (uintptr_t)data + 0x24); | |
} | |
void | |
emit__CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 38 subq $0x38, %rsp | |
// 4: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: 89 c1 movl %eax, %ecx | |
// d: f7 d1 notl %ecx | |
// f: 48 63 d9 movslq %ecx, %rbx | |
// 12: b9 fe ff ff ff movl $0xfffffffe, %ecx # imm = 0xFFFFFFFE | |
// 17: 29 c1 subl %eax, %ecx | |
// 19: 4c 63 f1 movslq %ecx, %r14 | |
// 1c: 4a 8b 54 f5 00 movq (%rbp,%r14,8), %rdx | |
// 21: 31 f6 xorl %esi, %esi | |
// 23: 48 83 7c dd 00 00 cmpq $0x0, (%rbp,%rbx,8) | |
// 29: 0f 95 c1 setne %cl | |
// 2c: 48 8b 7a 08 movq 0x8(%rdx), %rdi | |
// 30: 48 3b 3d 00 00 00 00 cmpq (%rip), %rdi # 0x37 <_JIT_ENTRY+0x37> | |
// 0000000000000033: IMAGE_REL_AMD64_REL32 __imp_PyMethodDescr_Type | |
// 37: 75 35 jne 0x6e <_JIT_ENTRY+0x6e> | |
// 39: 48 8b 7a 28 movq 0x28(%rdx), %rdi | |
// 3d: 81 7f 10 82 00 00 00 cmpl $0x82, 0x10(%rdi) | |
// 44: 75 28 jne 0x6e <_JIT_ENTRY+0x6e> | |
// 46: 44 8d 04 c5 00 00 00 00 leal (,%rax,8), %r8d | |
// 4e: 49 89 ef movq %rbp, %r15 | |
// 51: 4d 29 c7 subq %r8, %r15 | |
// 54: 40 88 ce movb %cl, %sil | |
// 57: 8d 0c f5 00 00 00 00 leal (,%rsi,8), %ecx | |
// 5e: 49 29 cf subq %rcx, %r15 | |
// 61: 49 8b 0f movq (%r15), %rcx | |
// 64: 4c 8b 41 08 movq 0x8(%rcx), %r8 | |
// 68: 4c 3b 42 10 cmpq 0x10(%rdx), %r8 | |
// 6c: 74 0b je 0x79 <_JIT_ENTRY+0x79> | |
// 6e: 48 83 c4 38 addq $0x38, %rsp | |
// 72: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x79 <_JIT_ENTRY+0x79> | |
// 0000000000000075: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 79: 01 c6 addl %eax, %esi | |
// 7b: 8d 46 ff leal -0x1(%rsi), %eax | |
// 7e: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 82: 4c 63 c0 movslq %eax, %r8 | |
// 85: 49 8d 57 08 leaq 0x8(%r15), %rdx | |
// 89: 45 31 c9 xorl %r9d, %r9d | |
// 8c: ff 57 08 callq *0x8(%rdi) | |
// 8f: 48 89 44 24 30 movq %rax, 0x30(%rsp) | |
// 94: 49 8b 45 40 movq 0x40(%r13), %rax | |
// 98: 48 89 44 24 28 movq %rax, 0x28(%rsp) | |
// 9d: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// a5: 83 fe 01 cmpl $0x1, %esi | |
// a8: 73 3c jae 0xe6 <_JIT_ENTRY+0xe6> | |
// aa: 4a 8b 4c f5 00 movq (%rbp,%r14,8), %rcx | |
// af: 48 8b 01 movq (%rcx), %rax | |
// b2: 85 c0 testl %eax, %eax | |
// b4: 78 0e js 0xc4 <_JIT_ENTRY+0xc4> | |
// b6: 48 ff c8 decq %rax | |
// b9: 48 89 01 movq %rax, (%rcx) | |
// bc: 75 06 jne 0xc4 <_JIT_ENTRY+0xc4> | |
// be: ff 15 00 00 00 00 callq *(%rip) # 0xc4 <_JIT_ENTRY+0xc4> | |
// 00000000000000c0: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// c4: 48 8b 4c 24 30 movq 0x30(%rsp), %rcx | |
// c9: 48 85 c9 testq %rcx, %rcx | |
// cc: 74 45 je 0x113 <_JIT_ENTRY+0x113> | |
// ce: 48 8b 44 24 28 movq 0x28(%rsp), %rax | |
// d3: 4a 89 0c f0 movq %rcx, (%rax,%r14,8) | |
// d7: 48 8d 2c d8 leaq (%rax,%rbx,8), %rbp | |
// db: 48 83 c4 38 addq $0x38, %rsp | |
// df: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xe6 <_JIT_ENTRY+0xe6> | |
// 00000000000000e2: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// e6: 89 f6 movl %esi, %esi | |
// e8: 31 ff xorl %edi, %edi | |
// ea: eb 0c jmp 0xf8 <_JIT_ENTRY+0xf8> | |
// ec: 0f 1f 40 00 nopl (%rax) | |
// f0: 48 ff c7 incq %rdi | |
// f3: 48 39 fe cmpq %rdi, %rsi | |
// f6: 74 b2 je 0xaa <_JIT_ENTRY+0xaa> | |
// f8: 49 8b 0c ff movq (%r15,%rdi,8), %rcx | |
// fc: 48 8b 01 movq (%rcx), %rax | |
// ff: 85 c0 testl %eax, %eax | |
// 101: 78 ed js 0xf0 <_JIT_ENTRY+0xf0> | |
// 103: 48 ff c8 decq %rax | |
// 106: 48 89 01 movq %rax, (%rcx) | |
// 109: 75 e5 jne 0xf0 <_JIT_ENTRY+0xf0> | |
// 10b: ff 15 00 00 00 00 callq *(%rip) # 0x111 <_JIT_ENTRY+0x111> | |
// 000000000000010d: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 111: eb dd jmp 0xf0 <_JIT_ENTRY+0xf0> | |
// 113: 48 8b 6c 24 28 movq 0x28(%rsp), %rbp | |
// 118: 48 83 c4 38 addq $0x38, %rsp | |
// 11c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x123 <_JIT_ENTRY+0x123> | |
// 000000000000011f: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 123: | |
const unsigned char code_body[291] = { | |
0x48, 0x83, 0xec, 0x38, 0x0f, 0xb7, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x89, 0xc1, 0xf7, 0xd1, 0x48, | |
0x63, 0xd9, 0xb9, 0xfe, 0xff, 0xff, 0xff, 0x29, | |
0xc1, 0x4c, 0x63, 0xf1, 0x4a, 0x8b, 0x54, 0xf5, | |
0x00, 0x31, 0xf6, 0x48, 0x83, 0x7c, 0xdd, 0x00, | |
0x00, 0x0f, 0x95, 0xc1, 0x48, 0x8b, 0x7a, 0x08, | |
0x48, 0x3b, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x75, | |
0x35, 0x48, 0x8b, 0x7a, 0x28, 0x81, 0x7f, 0x10, | |
0x82, 0x00, 0x00, 0x00, 0x75, 0x28, 0x44, 0x8d, | |
0x04, 0xc5, 0x00, 0x00, 0x00, 0x00, 0x49, 0x89, | |
0xef, 0x4d, 0x29, 0xc7, 0x40, 0x88, 0xce, 0x8d, | |
0x0c, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x49, 0x29, | |
0xcf, 0x49, 0x8b, 0x0f, 0x4c, 0x8b, 0x41, 0x08, | |
0x4c, 0x3b, 0x42, 0x10, 0x74, 0x0b, 0x48, 0x83, | |
0xc4, 0x38, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0x01, 0xc6, 0x8d, 0x46, 0xff, 0x49, 0x89, | |
0x6d, 0x40, 0x4c, 0x63, 0xc0, 0x49, 0x8d, 0x57, | |
0x08, 0x45, 0x31, 0xc9, 0xff, 0x57, 0x08, 0x48, | |
0x89, 0x44, 0x24, 0x30, 0x49, 0x8b, 0x45, 0x40, | |
0x48, 0x89, 0x44, 0x24, 0x28, 0x49, 0xc7, 0x45, | |
0x40, 0x00, 0x00, 0x00, 0x00, 0x83, 0xfe, 0x01, | |
0x73, 0x3c, 0x4a, 0x8b, 0x4c, 0xf5, 0x00, 0x48, | |
0x8b, 0x01, 0x85, 0xc0, 0x78, 0x0e, 0x48, 0xff, | |
0xc8, 0x48, 0x89, 0x01, 0x75, 0x06, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x4c, 0x24, | |
0x30, 0x48, 0x85, 0xc9, 0x74, 0x45, 0x48, 0x8b, | |
0x44, 0x24, 0x28, 0x4a, 0x89, 0x0c, 0xf0, 0x48, | |
0x8d, 0x2c, 0xd8, 0x48, 0x83, 0xc4, 0x38, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x89, 0xf6, | |
0x31, 0xff, 0xeb, 0x0c, 0x0f, 0x1f, 0x40, 0x00, | |
0x48, 0xff, 0xc7, 0x48, 0x39, 0xfe, 0x74, 0xb2, | |
0x49, 0x8b, 0x0c, 0xff, 0x48, 0x8b, 0x01, 0x85, | |
0xc0, 0x78, 0xed, 0x48, 0xff, 0xc8, 0x48, 0x89, | |
0x01, 0x75, 0xe5, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0xeb, 0xdd, 0x48, 0x8b, 0x6c, 0x24, 0x28, | |
0x48, 0x83, 0xc4, 0x38, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &PyMethodDescr_Type+0x0 | |
// 10: JUMP_TARGET | |
// 18: &_Py_Dealloc+0x0 | |
// 20: CONTINUE | |
// 28: ERROR_TARGET | |
const unsigned char data_body[48] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&PyMethodDescr_Type); | |
patch_64(data + 0x10, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x18, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x20, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x28, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x33, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x75, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xc0, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xe2, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0x10d, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x11f, (uintptr_t)data + 0x24); | |
} | |
void | |
emit__CALL_METHOD_DESCRIPTOR_NOARGS( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CALL_METHOD_DESCRIPTOR_NOARGS.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: 89 c1 movl %eax, %ecx | |
// d: f7 d1 notl %ecx | |
// f: 4c 63 f1 movslq %ecx, %r14 | |
// 12: 31 c9 xorl %ecx, %ecx | |
// 14: 4a 83 7c f5 00 00 cmpq $0x0, (%rbp,%r14,8) | |
// 1a: 0f 95 c1 setne %cl | |
// 1d: 8d 14 01 leal (%rcx,%rax), %edx | |
// 20: 83 fa 01 cmpl $0x1, %edx | |
// 23: 0f 85 c5 00 00 00 jne 0xee <_JIT_ENTRY+0xee> | |
// 29: ba fe ff ff ff movl $0xfffffffe, %edx # imm = 0xFFFFFFFE | |
// 2e: 29 c2 subl %eax, %edx | |
// 30: 4c 63 fa movslq %edx, %r15 | |
// 33: 4a 8b 54 fd 00 movq (%rbp,%r15,8), %rdx | |
// 38: 48 8b 72 08 movq 0x8(%rdx), %rsi | |
// 3c: 48 3b 35 00 00 00 00 cmpq (%rip), %rsi # 0x43 <_JIT_ENTRY+0x43> | |
// 000000000000003f: IMAGE_REL_AMD64_REL32 __imp_PyMethodDescr_Type | |
// 43: 0f 85 a5 00 00 00 jne 0xee <_JIT_ENTRY+0xee> | |
// 49: c1 e0 03 shll $0x3, %eax | |
// 4c: 48 89 ee movq %rbp, %rsi | |
// 4f: 48 29 c6 subq %rax, %rsi | |
// 52: 48 f7 d9 negq %rcx | |
// 55: 48 8b 3c ce movq (%rsi,%rcx,8), %rdi | |
// 59: 48 8b 47 08 movq 0x8(%rdi), %rax | |
// 5d: 48 3b 42 10 cmpq 0x10(%rdx), %rax | |
// 61: 0f 85 87 00 00 00 jne 0xee <_JIT_ENTRY+0xee> | |
// 67: 48 8b 42 28 movq 0x28(%rdx), %rax | |
// 6b: 83 78 10 04 cmpl $0x4, 0x10(%rax) | |
// 6f: 75 7d jne 0xee <_JIT_ENTRY+0xee> | |
// 71: 41 8b 4c 24 34 movl 0x34(%r12), %ecx | |
// 76: 85 c9 testl %ecx, %ecx | |
// 78: 7e 74 jle 0xee <_JIT_ENTRY+0xee> | |
// 7a: 48 8b 40 08 movq 0x8(%rax), %rax | |
// 7e: ff c9 decl %ecx | |
// 80: 41 89 4c 24 34 movl %ecx, 0x34(%r12) | |
// 85: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 89: 48 89 f9 movq %rdi, %rcx | |
// 8c: 31 d2 xorl %edx, %edx | |
// 8e: ff d0 callq *%rax | |
// 90: 49 8b 75 40 movq 0x40(%r13), %rsi | |
// 94: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 9c: 41 ff 44 24 34 incl 0x34(%r12) | |
// a1: 48 89 c3 movq %rax, %rbx | |
// a4: 48 8b 07 movq (%rdi), %rax | |
// a7: 85 c0 testl %eax, %eax | |
// a9: 78 11 js 0xbc <_JIT_ENTRY+0xbc> | |
// ab: 48 ff c8 decq %rax | |
// ae: 48 89 07 movq %rax, (%rdi) | |
// b1: 75 09 jne 0xbc <_JIT_ENTRY+0xbc> | |
// b3: 48 89 f9 movq %rdi, %rcx | |
// b6: ff 15 00 00 00 00 callq *(%rip) # 0xbc <_JIT_ENTRY+0xbc> | |
// 00000000000000b8: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// bc: 4a 8b 4c fd 00 movq (%rbp,%r15,8), %rcx | |
// c1: 48 8b 01 movq (%rcx), %rax | |
// c4: 85 c0 testl %eax, %eax | |
// c6: 78 0e js 0xd6 <_JIT_ENTRY+0xd6> | |
// c8: 48 ff c8 decq %rax | |
// cb: 48 89 01 movq %rax, (%rcx) | |
// ce: 75 06 jne 0xd6 <_JIT_ENTRY+0xd6> | |
// d0: ff 15 00 00 00 00 callq *(%rip) # 0xd6 <_JIT_ENTRY+0xd6> | |
// 00000000000000d2: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// d6: 48 85 db testq %rbx, %rbx | |
// d9: 74 1e je 0xf9 <_JIT_ENTRY+0xf9> | |
// db: 4a 89 1c fe movq %rbx, (%rsi,%r15,8) | |
// df: 4a 8d 2c f6 leaq (%rsi,%r14,8), %rbp | |
// e3: 48 83 c4 28 addq $0x28, %rsp | |
// e7: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xee <_JIT_ENTRY+0xee> | |
// 00000000000000ea: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// ee: 48 83 c4 28 addq $0x28, %rsp | |
// f2: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xf9 <_JIT_ENTRY+0xf9> | |
// 00000000000000f5: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// f9: 48 89 f5 movq %rsi, %rbp | |
// fc: 48 83 c4 28 addq $0x28, %rsp | |
// 100: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x107 <_JIT_ENTRY+0x107> | |
// 0000000000000103: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 107: | |
const unsigned char code_body[263] = { | |
0x48, 0x83, 0xec, 0x28, 0x0f, 0xb7, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x89, 0xc1, 0xf7, 0xd1, 0x4c, | |
0x63, 0xf1, 0x31, 0xc9, 0x4a, 0x83, 0x7c, 0xf5, | |
0x00, 0x00, 0x0f, 0x95, 0xc1, 0x8d, 0x14, 0x01, | |
0x83, 0xfa, 0x01, 0x0f, 0x85, 0xc5, 0x00, 0x00, | |
0x00, 0xba, 0xfe, 0xff, 0xff, 0xff, 0x29, 0xc2, | |
0x4c, 0x63, 0xfa, 0x4a, 0x8b, 0x54, 0xfd, 0x00, | |
0x48, 0x8b, 0x72, 0x08, 0x48, 0x3b, 0x35, 0x00, | |
0x00, 0x00, 0x00, 0x0f, 0x85, 0xa5, 0x00, 0x00, | |
0x00, 0xc1, 0xe0, 0x03, 0x48, 0x89, 0xee, 0x48, | |
0x29, 0xc6, 0x48, 0xf7, 0xd9, 0x48, 0x8b, 0x3c, | |
0xce, 0x48, 0x8b, 0x47, 0x08, 0x48, 0x3b, 0x42, | |
0x10, 0x0f, 0x85, 0x87, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x42, 0x28, 0x83, 0x78, 0x10, 0x04, 0x75, | |
0x7d, 0x41, 0x8b, 0x4c, 0x24, 0x34, 0x85, 0xc9, | |
0x7e, 0x74, 0x48, 0x8b, 0x40, 0x08, 0xff, 0xc9, | |
0x41, 0x89, 0x4c, 0x24, 0x34, 0x49, 0x89, 0x6d, | |
0x40, 0x48, 0x89, 0xf9, 0x31, 0xd2, 0xff, 0xd0, | |
0x49, 0x8b, 0x75, 0x40, 0x49, 0xc7, 0x45, 0x40, | |
0x00, 0x00, 0x00, 0x00, 0x41, 0xff, 0x44, 0x24, | |
0x34, 0x48, 0x89, 0xc3, 0x48, 0x8b, 0x07, 0x85, | |
0xc0, 0x78, 0x11, 0x48, 0xff, 0xc8, 0x48, 0x89, | |
0x07, 0x75, 0x09, 0x48, 0x89, 0xf9, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x4a, 0x8b, 0x4c, 0xfd, | |
0x00, 0x48, 0x8b, 0x01, 0x85, 0xc0, 0x78, 0x0e, | |
0x48, 0xff, 0xc8, 0x48, 0x89, 0x01, 0x75, 0x06, | |
0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x85, | |
0xdb, 0x74, 0x1e, 0x4a, 0x89, 0x1c, 0xfe, 0x4a, | |
0x8d, 0x2c, 0xf6, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x83, | |
0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x89, 0xf5, 0x48, 0x83, 0xc4, 0x28, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &PyMethodDescr_Type+0x0 | |
// 10: &_Py_Dealloc+0x0 | |
// 18: CONTINUE | |
// 20: JUMP_TARGET | |
// 28: ERROR_TARGET | |
const unsigned char data_body[48] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&PyMethodDescr_Type); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x18, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x20, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x28, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x3f, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0xb8, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xd2, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xea, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xf5, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0x103, (uintptr_t)data + 0x24); | |
} | |
void | |
emit__CALL_METHOD_DESCRIPTOR_O( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CALL_METHOD_DESCRIPTOR_O.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 0f b7 0d 00 00 00 00 movzwl (%rip), %ecx # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: 89 c8 movl %ecx, %eax | |
// d: f7 d0 notl %eax | |
// f: 4c 63 f8 movslq %eax, %r15 | |
// 12: 31 c0 xorl %eax, %eax | |
// 14: 4a 83 7c fd 00 00 cmpq $0x0, (%rbp,%r15,8) | |
// 1a: 0f 95 c0 setne %al | |
// 1d: 8d 14 08 leal (%rax,%rcx), %edx | |
// 20: 83 fa 02 cmpl $0x2, %edx | |
// 23: 75 4a jne 0x6f <_JIT_ENTRY+0x6f> | |
// 25: ba fe ff ff ff movl $0xfffffffe, %edx # imm = 0xFFFFFFFE | |
// 2a: 29 ca subl %ecx, %edx | |
// 2c: 48 63 f2 movslq %edx, %rsi | |
// 2f: 48 8b 54 f5 00 movq (%rbp,%rsi,8), %rdx | |
// 34: 48 8b 7a 08 movq 0x8(%rdx), %rdi | |
// 38: 48 3b 3d 00 00 00 00 cmpq (%rip), %rdi # 0x3f <_JIT_ENTRY+0x3f> | |
// 000000000000003b: IMAGE_REL_AMD64_REL32 __imp_PyMethodDescr_Type | |
// 3f: 75 2e jne 0x6f <_JIT_ENTRY+0x6f> | |
// 41: 48 8b 7a 28 movq 0x28(%rdx), %rdi | |
// 45: 83 7f 10 08 cmpl $0x8, 0x10(%rdi) | |
// 49: 75 24 jne 0x6f <_JIT_ENTRY+0x6f> | |
// 4b: 45 8b 44 24 34 movl 0x34(%r12), %r8d | |
// 50: 45 85 c0 testl %r8d, %r8d | |
// 53: 7e 1a jle 0x6f <_JIT_ENTRY+0x6f> | |
// 55: c1 e1 03 shll $0x3, %ecx | |
// 58: 49 89 e9 movq %rbp, %r9 | |
// 5b: 49 29 c9 subq %rcx, %r9 | |
// 5e: 48 f7 d8 negq %rax | |
// 61: 4d 8b 34 c1 movq (%r9,%rax,8), %r14 | |
// 65: 49 8b 4e 08 movq 0x8(%r14), %rcx | |
// 69: 48 3b 4a 10 cmpq 0x10(%rdx), %rcx | |
// 6d: 74 0b je 0x7a <_JIT_ENTRY+0x7a> | |
// 6f: 48 83 c4 28 addq $0x28, %rsp | |
// 73: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x7a <_JIT_ENTRY+0x7a> | |
// 0000000000000076: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 7a: 49 8b 5c c1 08 movq 0x8(%r9,%rax,8), %rbx | |
// 7f: 48 8b 47 08 movq 0x8(%rdi), %rax | |
// 83: 41 ff c8 decl %r8d | |
// 86: 45 89 44 24 34 movl %r8d, 0x34(%r12) | |
// 8b: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 8f: 4c 89 f1 movq %r14, %rcx | |
// 92: 48 89 da movq %rbx, %rdx | |
// 95: ff d0 callq *%rax | |
// 97: 49 8b 55 40 movq 0x40(%r13), %rdx | |
// 9b: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// a3: 41 ff 44 24 34 incl 0x34(%r12) | |
// a8: 48 89 c7 movq %rax, %rdi | |
// ab: 49 8b 06 movq (%r14), %rax | |
// ae: 85 c0 testl %eax, %eax | |
// b0: 78 17 js 0xc9 <_JIT_ENTRY+0xc9> | |
// b2: 48 ff c8 decq %rax | |
// b5: 49 89 06 movq %rax, (%r14) | |
// b8: 75 0f jne 0xc9 <_JIT_ENTRY+0xc9> | |
// ba: 4c 89 f1 movq %r14, %rcx | |
// bd: 49 89 d6 movq %rdx, %r14 | |
// c0: ff 15 00 00 00 00 callq *(%rip) # 0xc6 <_JIT_ENTRY+0xc6> | |
// 00000000000000c2: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// c6: 4c 89 f2 movq %r14, %rdx | |
// c9: 48 8b 03 movq (%rbx), %rax | |
// cc: 85 c0 testl %eax, %eax | |
// ce: 78 17 js 0xe7 <_JIT_ENTRY+0xe7> | |
// d0: 48 ff c8 decq %rax | |
// d3: 48 89 03 movq %rax, (%rbx) | |
// d6: 75 0f jne 0xe7 <_JIT_ENTRY+0xe7> | |
// d8: 48 89 d9 movq %rbx, %rcx | |
// db: 48 89 d3 movq %rdx, %rbx | |
// de: ff 15 00 00 00 00 callq *(%rip) # 0xe4 <_JIT_ENTRY+0xe4> | |
// 00000000000000e0: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// e4: 48 89 da movq %rbx, %rdx | |
// e7: 48 8b 4c f5 00 movq (%rbp,%rsi,8), %rcx | |
// ec: 48 8b 01 movq (%rcx), %rax | |
// ef: 85 c0 testl %eax, %eax | |
// f1: 78 14 js 0x107 <_JIT_ENTRY+0x107> | |
// f3: 48 ff c8 decq %rax | |
// f6: 48 89 01 movq %rax, (%rcx) | |
// f9: 75 0c jne 0x107 <_JIT_ENTRY+0x107> | |
// fb: 48 89 d3 movq %rdx, %rbx | |
// fe: ff 15 00 00 00 00 callq *(%rip) # 0x104 <_JIT_ENTRY+0x104> | |
// 0000000000000100: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 104: 48 89 da movq %rbx, %rdx | |
// 107: 48 85 ff testq %rdi, %rdi | |
// 10a: 74 13 je 0x11f <_JIT_ENTRY+0x11f> | |
// 10c: 48 89 3c f2 movq %rdi, (%rdx,%rsi,8) | |
// 110: 4a 8d 2c fa leaq (%rdx,%r15,8), %rbp | |
// 114: 48 83 c4 28 addq $0x28, %rsp | |
// 118: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x11f <_JIT_ENTRY+0x11f> | |
// 000000000000011b: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 11f: 48 89 d5 movq %rdx, %rbp | |
// 122: 48 83 c4 28 addq $0x28, %rsp | |
// 126: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x12d <_JIT_ENTRY+0x12d> | |
// 0000000000000129: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 12d: | |
const unsigned char code_body[301] = { | |
0x48, 0x83, 0xec, 0x28, 0x0f, 0xb7, 0x0d, 0x00, | |
0x00, 0x00, 0x00, 0x89, 0xc8, 0xf7, 0xd0, 0x4c, | |
0x63, 0xf8, 0x31, 0xc0, 0x4a, 0x83, 0x7c, 0xfd, | |
0x00, 0x00, 0x0f, 0x95, 0xc0, 0x8d, 0x14, 0x08, | |
0x83, 0xfa, 0x02, 0x75, 0x4a, 0xba, 0xfe, 0xff, | |
0xff, 0xff, 0x29, 0xca, 0x48, 0x63, 0xf2, 0x48, | |
0x8b, 0x54, 0xf5, 0x00, 0x48, 0x8b, 0x7a, 0x08, | |
0x48, 0x3b, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x75, | |
0x2e, 0x48, 0x8b, 0x7a, 0x28, 0x83, 0x7f, 0x10, | |
0x08, 0x75, 0x24, 0x45, 0x8b, 0x44, 0x24, 0x34, | |
0x45, 0x85, 0xc0, 0x7e, 0x1a, 0xc1, 0xe1, 0x03, | |
0x49, 0x89, 0xe9, 0x49, 0x29, 0xc9, 0x48, 0xf7, | |
0xd8, 0x4d, 0x8b, 0x34, 0xc1, 0x49, 0x8b, 0x4e, | |
0x08, 0x48, 0x3b, 0x4a, 0x10, 0x74, 0x0b, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x49, 0x8b, 0x5c, 0xc1, 0x08, 0x48, | |
0x8b, 0x47, 0x08, 0x41, 0xff, 0xc8, 0x45, 0x89, | |
0x44, 0x24, 0x34, 0x49, 0x89, 0x6d, 0x40, 0x4c, | |
0x89, 0xf1, 0x48, 0x89, 0xda, 0xff, 0xd0, 0x49, | |
0x8b, 0x55, 0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, | |
0x00, 0x00, 0x00, 0x41, 0xff, 0x44, 0x24, 0x34, | |
0x48, 0x89, 0xc7, 0x49, 0x8b, 0x06, 0x85, 0xc0, | |
0x78, 0x17, 0x48, 0xff, 0xc8, 0x49, 0x89, 0x06, | |
0x75, 0x0f, 0x4c, 0x89, 0xf1, 0x49, 0x89, 0xd6, | |
0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x89, | |
0xf2, 0x48, 0x8b, 0x03, 0x85, 0xc0, 0x78, 0x17, | |
0x48, 0xff, 0xc8, 0x48, 0x89, 0x03, 0x75, 0x0f, | |
0x48, 0x89, 0xd9, 0x48, 0x89, 0xd3, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0xda, 0x48, | |
0x8b, 0x4c, 0xf5, 0x00, 0x48, 0x8b, 0x01, 0x85, | |
0xc0, 0x78, 0x14, 0x48, 0xff, 0xc8, 0x48, 0x89, | |
0x01, 0x75, 0x0c, 0x48, 0x89, 0xd3, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0xda, 0x48, | |
0x85, 0xff, 0x74, 0x13, 0x48, 0x89, 0x3c, 0xf2, | |
0x4a, 0x8d, 0x2c, 0xfa, 0x48, 0x83, 0xc4, 0x28, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x89, 0xd5, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &PyMethodDescr_Type+0x0 | |
// 10: JUMP_TARGET | |
// 18: &_Py_Dealloc+0x0 | |
// 20: CONTINUE | |
// 28: ERROR_TARGET | |
const unsigned char data_body[48] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&PyMethodDescr_Type); | |
patch_64(data + 0x10, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x18, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x20, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x28, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x3b, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x76, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xc2, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xe0, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x100, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x11b, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0x129, (uintptr_t)data + 0x24); | |
} | |
void | |
emit__CALL_NON_PY_GENERAL( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CALL_NON_PY_GENERAL.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 38 subq $0x38, %rsp | |
// 4: 4c 89 64 24 28 movq %r12, 0x28(%rsp) | |
// 9: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x10 <_JIT_ENTRY+0x10> | |
// 000000000000000c: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 10: 44 0f b7 f0 movzwl %ax, %r14d | |
// 14: 0f b7 d8 movzwl %ax, %ebx | |
// 17: 8d 04 dd 00 00 00 00 leal (,%rbx,8), %eax | |
// 1e: 48 89 ea movq %rbp, %rdx | |
// 21: 48 29 c2 subq %rax, %rdx | |
// 24: 44 89 f0 movl %r14d, %eax | |
// 27: f7 d0 notl %eax | |
// 29: 48 63 f0 movslq %eax, %rsi | |
// 2c: b8 fe ff ff ff movl $0xfffffffe, %eax # imm = 0xFFFFFFFE | |
// 31: 44 29 f0 subl %r14d, %eax | |
// 34: 4c 63 f8 movslq %eax, %r15 | |
// 37: 4a 8b 4c fd 00 movq (%rbp,%r15,8), %rcx | |
// 3c: 48 89 74 24 30 movq %rsi, 0x30(%rsp) | |
// 41: 48 8b 74 f5 00 movq (%rbp,%rsi,8), %rsi | |
// 46: 45 31 e4 xorl %r12d, %r12d | |
// 49: 48 85 f6 testq %rsi, %rsi | |
// 4c: 41 0f 95 c4 setne %r12b | |
// 50: 45 01 e6 addl %r12d, %r14d | |
// 53: 42 8d 04 e5 00 00 00 00 leal (,%r12,8), %eax | |
// 5b: 48 29 c2 subq %rax, %rdx | |
// 5e: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 62: 49 b8 00 00 00 00 00 00 00 80 movabsq $-0x8000000000000000, %r8 # imm = 0x8000000000000000 | |
// 6c: 4d 09 f0 orq %r14, %r8 | |
// 6f: 45 31 c9 xorl %r9d, %r9d | |
// 72: ff 15 00 00 00 00 callq *(%rip) # 0x78 <_JIT_ENTRY+0x78> | |
// 0000000000000074: IMAGE_REL_AMD64_REL32 __imp_PyObject_Vectorcall | |
// 78: 48 89 c7 movq %rax, %rdi | |
// 7b: 49 8b 45 40 movq 0x40(%r13), %rax | |
// 7f: 48 89 44 24 20 movq %rax, 0x20(%rsp) | |
// 84: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 8c: 4a 8b 4c fd 00 movq (%rbp,%r15,8), %rcx | |
// 91: 48 8b 01 movq (%rcx), %rax | |
// 94: 85 c0 testl %eax, %eax | |
// 96: 78 0e js 0xa6 <_JIT_ENTRY+0xa6> | |
// 98: 48 ff c8 decq %rax | |
// 9b: 48 89 01 movq %rax, (%rcx) | |
// 9e: 75 06 jne 0xa6 <_JIT_ENTRY+0xa6> | |
// a0: ff 15 00 00 00 00 callq *(%rip) # 0xa6 <_JIT_ENTRY+0xa6> | |
// 00000000000000a2: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// a6: 45 85 f6 testl %r14d, %r14d | |
// a9: 74 45 je 0xf0 <_JIT_ENTRY+0xf0> | |
// ab: 48 f7 db negq %rbx | |
// ae: 49 f7 dc negq %r12 | |
// b1: 45 31 f6 xorl %r14d, %r14d | |
// b4: 48 85 f6 testq %rsi, %rsi | |
// b7: 41 0f 95 c6 setne %r14b | |
// bb: 4a 8d 34 e5 00 00 00 00 leaq (,%r12,8), %rsi | |
// c3: 48 01 ee addq %rbp, %rsi | |
// c6: 4c 8b 25 00 00 00 00 movq (%rip), %r12 # 0xcd <_JIT_ENTRY+0xcd> | |
// 00000000000000c9: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// cd: eb 09 jmp 0xd8 <_JIT_ENTRY+0xd8> | |
// cf: 90 nop | |
// d0: 48 ff c3 incq %rbx | |
// d3: 49 39 de cmpq %rbx, %r14 | |
// d6: 74 18 je 0xf0 <_JIT_ENTRY+0xf0> | |
// d8: 48 8b 0c de movq (%rsi,%rbx,8), %rcx | |
// dc: 48 8b 01 movq (%rcx), %rax | |
// df: 85 c0 testl %eax, %eax | |
// e1: 78 ed js 0xd0 <_JIT_ENTRY+0xd0> | |
// e3: 48 ff c8 decq %rax | |
// e6: 48 89 01 movq %rax, (%rcx) | |
// e9: 75 e5 jne 0xd0 <_JIT_ENTRY+0xd0> | |
// eb: 41 ff d4 callq *%r12 | |
// ee: eb e0 jmp 0xd0 <_JIT_ENTRY+0xd0> | |
// f0: 48 85 ff testq %rdi, %rdi | |
// f3: 74 22 je 0x117 <_JIT_ENTRY+0x117> | |
// f5: 48 8b 4c 24 20 movq 0x20(%rsp), %rcx | |
// fa: 4a 89 3c f9 movq %rdi, (%rcx,%r15,8) | |
// fe: 48 8b 44 24 30 movq 0x30(%rsp), %rax | |
// 103: 48 8d 2c c1 leaq (%rcx,%rax,8), %rbp | |
// 107: 4c 8b 64 24 28 movq 0x28(%rsp), %r12 | |
// 10c: 48 83 c4 38 addq $0x38, %rsp | |
// 110: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x117 <_JIT_ENTRY+0x117> | |
// 0000000000000113: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 117: 48 8b 6c 24 20 movq 0x20(%rsp), %rbp | |
// 11c: 4c 8b 64 24 28 movq 0x28(%rsp), %r12 | |
// 121: 48 83 c4 38 addq $0x38, %rsp | |
// 125: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x12c <_JIT_ENTRY+0x12c> | |
// 0000000000000128: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 12c: | |
const unsigned char code_body[300] = { | |
0x48, 0x83, 0xec, 0x38, 0x4c, 0x89, 0x64, 0x24, | |
0x28, 0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, | |
0x44, 0x0f, 0xb7, 0xf0, 0x0f, 0xb7, 0xd8, 0x8d, | |
0x04, 0xdd, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, | |
0xea, 0x48, 0x29, 0xc2, 0x44, 0x89, 0xf0, 0xf7, | |
0xd0, 0x48, 0x63, 0xf0, 0xb8, 0xfe, 0xff, 0xff, | |
0xff, 0x44, 0x29, 0xf0, 0x4c, 0x63, 0xf8, 0x4a, | |
0x8b, 0x4c, 0xfd, 0x00, 0x48, 0x89, 0x74, 0x24, | |
0x30, 0x48, 0x8b, 0x74, 0xf5, 0x00, 0x45, 0x31, | |
0xe4, 0x48, 0x85, 0xf6, 0x41, 0x0f, 0x95, 0xc4, | |
0x45, 0x01, 0xe6, 0x42, 0x8d, 0x04, 0xe5, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x29, 0xc2, 0x49, 0x89, | |
0x6d, 0x40, 0x49, 0xb8, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x80, 0x4d, 0x09, 0xf0, 0x45, | |
0x31, 0xc9, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x89, 0xc7, 0x49, 0x8b, 0x45, 0x40, 0x48, | |
0x89, 0x44, 0x24, 0x20, 0x49, 0xc7, 0x45, 0x40, | |
0x00, 0x00, 0x00, 0x00, 0x4a, 0x8b, 0x4c, 0xfd, | |
0x00, 0x48, 0x8b, 0x01, 0x85, 0xc0, 0x78, 0x0e, | |
0x48, 0xff, 0xc8, 0x48, 0x89, 0x01, 0x75, 0x06, | |
0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x45, 0x85, | |
0xf6, 0x74, 0x45, 0x48, 0xf7, 0xdb, 0x49, 0xf7, | |
0xdc, 0x45, 0x31, 0xf6, 0x48, 0x85, 0xf6, 0x41, | |
0x0f, 0x95, 0xc6, 0x4a, 0x8d, 0x34, 0xe5, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x01, 0xee, 0x4c, 0x8b, | |
0x25, 0x00, 0x00, 0x00, 0x00, 0xeb, 0x09, 0x90, | |
0x48, 0xff, 0xc3, 0x49, 0x39, 0xde, 0x74, 0x18, | |
0x48, 0x8b, 0x0c, 0xde, 0x48, 0x8b, 0x01, 0x85, | |
0xc0, 0x78, 0xed, 0x48, 0xff, 0xc8, 0x48, 0x89, | |
0x01, 0x75, 0xe5, 0x41, 0xff, 0xd4, 0xeb, 0xe0, | |
0x48, 0x85, 0xff, 0x74, 0x22, 0x48, 0x8b, 0x4c, | |
0x24, 0x20, 0x4a, 0x89, 0x3c, 0xf9, 0x48, 0x8b, | |
0x44, 0x24, 0x30, 0x48, 0x8d, 0x2c, 0xc1, 0x4c, | |
0x8b, 0x64, 0x24, 0x28, 0x48, 0x83, 0xc4, 0x38, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x6c, 0x24, 0x20, 0x4c, 0x8b, 0x64, 0x24, | |
0x28, 0x48, 0x83, 0xc4, 0x38, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &PyObject_Vectorcall+0x0 | |
// 10: &_Py_Dealloc+0x0 | |
// 18: CONTINUE | |
// 20: ERROR_TARGET | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&PyObject_Vectorcall); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x18, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x20, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xc, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x74, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0xa2, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xc9, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x113, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x128, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__CALL_STR_1( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CALL_STR_1.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 83 7d f0 00 cmpq $0x0, -0x10(%rbp) | |
// 9: 75 0d jne 0x18 <_JIT_ENTRY+0x18> | |
// b: 48 8b 45 e8 movq -0x18(%rbp), %rax | |
// f: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x16 <_JIT_ENTRY+0x16> | |
// 0000000000000012: IMAGE_REL_AMD64_REL32 __imp_PyUnicode_Type | |
// 16: 74 0b je 0x23 <_JIT_ENTRY+0x23> | |
// 18: 48 83 c4 28 addq $0x28, %rsp | |
// 1c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x23 <_JIT_ENTRY+0x23> | |
// 000000000000001f: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 23: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// 27: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 2b: 48 89 f1 movq %rsi, %rcx | |
// 2e: ff 15 00 00 00 00 callq *(%rip) # 0x34 <_JIT_ENTRY+0x34> | |
// 0000000000000030: IMAGE_REL_AMD64_REL32 __imp_PyObject_Str | |
// 34: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 38: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 40: 48 8b 0e movq (%rsi), %rcx | |
// 43: 85 c9 testl %ecx, %ecx | |
// 45: 78 17 js 0x5e <_JIT_ENTRY+0x5e> | |
// 47: 48 ff c9 decq %rcx | |
// 4a: 48 89 0e movq %rcx, (%rsi) | |
// 4d: 75 0f jne 0x5e <_JIT_ENTRY+0x5e> | |
// 4f: 48 89 f1 movq %rsi, %rcx | |
// 52: 48 89 c6 movq %rax, %rsi | |
// 55: ff 15 00 00 00 00 callq *(%rip) # 0x5b <_JIT_ENTRY+0x5b> | |
// 0000000000000057: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 5b: 48 89 f0 movq %rsi, %rax | |
// 5e: 48 85 c0 testq %rax, %rax | |
// 61: 74 13 je 0x76 <_JIT_ENTRY+0x76> | |
// 63: 48 89 45 e8 movq %rax, -0x18(%rbp) | |
// 67: 48 83 c5 f0 addq $-0x10, %rbp | |
// 6b: 48 83 c4 28 addq $0x28, %rsp | |
// 6f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x76 <_JIT_ENTRY+0x76> | |
// 0000000000000072: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 76: 48 83 c4 28 addq $0x28, %rsp | |
// 7a: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x81 <_JIT_ENTRY+0x81> | |
// 000000000000007d: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 81: | |
const unsigned char code_body[129] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x83, 0x7d, 0xf0, | |
0x00, 0x75, 0x0d, 0x48, 0x8b, 0x45, 0xe8, 0x48, | |
0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x74, 0x0b, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x8b, 0x75, 0xf8, 0x49, | |
0x89, 0x6d, 0x40, 0x48, 0x89, 0xf1, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, | |
0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8b, 0x0e, 0x85, 0xc9, 0x78, 0x17, 0x48, | |
0xff, 0xc9, 0x48, 0x89, 0x0e, 0x75, 0x0f, 0x48, | |
0x89, 0xf1, 0x48, 0x89, 0xc6, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x89, 0xf0, 0x48, 0x85, | |
0xc0, 0x74, 0x13, 0x48, 0x89, 0x45, 0xe8, 0x48, | |
0x83, 0xc5, 0xf0, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x83, | |
0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, | |
}; | |
// 0: | |
// 0: &PyUnicode_Type+0x0 | |
// 8: JUMP_TARGET | |
// 10: &PyObject_Str+0x0 | |
// 18: &_Py_Dealloc+0x0 | |
// 20: CONTINUE | |
// 28: ERROR_TARGET | |
const unsigned char data_body[48] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyUnicode_Type); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x10, (uintptr_t)&PyObject_Str); | |
patch_64(data + 0x18, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x20, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x28, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x12, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1f, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x30, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x57, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x72, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0x7d, (uintptr_t)data + 0x24); | |
} | |
void | |
emit__CALL_TUPLE_1( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CALL_TUPLE_1.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 83 7d f0 00 cmpq $0x0, -0x10(%rbp) | |
// 9: 75 0d jne 0x18 <_JIT_ENTRY+0x18> | |
// b: 48 8b 45 e8 movq -0x18(%rbp), %rax | |
// f: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x16 <_JIT_ENTRY+0x16> | |
// 0000000000000012: IMAGE_REL_AMD64_REL32 __imp_PyTuple_Type | |
// 16: 74 0b je 0x23 <_JIT_ENTRY+0x23> | |
// 18: 48 83 c4 28 addq $0x28, %rsp | |
// 1c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x23 <_JIT_ENTRY+0x23> | |
// 000000000000001f: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 23: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// 27: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 2b: 48 89 f1 movq %rsi, %rcx | |
// 2e: ff 15 00 00 00 00 callq *(%rip) # 0x34 <_JIT_ENTRY+0x34> | |
// 0000000000000030: IMAGE_REL_AMD64_REL32 __imp_PySequence_Tuple | |
// 34: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 38: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 40: 48 8b 0e movq (%rsi), %rcx | |
// 43: 85 c9 testl %ecx, %ecx | |
// 45: 78 17 js 0x5e <_JIT_ENTRY+0x5e> | |
// 47: 48 ff c9 decq %rcx | |
// 4a: 48 89 0e movq %rcx, (%rsi) | |
// 4d: 75 0f jne 0x5e <_JIT_ENTRY+0x5e> | |
// 4f: 48 89 f1 movq %rsi, %rcx | |
// 52: 48 89 c6 movq %rax, %rsi | |
// 55: ff 15 00 00 00 00 callq *(%rip) # 0x5b <_JIT_ENTRY+0x5b> | |
// 0000000000000057: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 5b: 48 89 f0 movq %rsi, %rax | |
// 5e: 48 85 c0 testq %rax, %rax | |
// 61: 74 13 je 0x76 <_JIT_ENTRY+0x76> | |
// 63: 48 89 45 e8 movq %rax, -0x18(%rbp) | |
// 67: 48 83 c5 f0 addq $-0x10, %rbp | |
// 6b: 48 83 c4 28 addq $0x28, %rsp | |
// 6f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x76 <_JIT_ENTRY+0x76> | |
// 0000000000000072: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 76: 48 83 c4 28 addq $0x28, %rsp | |
// 7a: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x81 <_JIT_ENTRY+0x81> | |
// 000000000000007d: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 81: | |
const unsigned char code_body[129] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x83, 0x7d, 0xf0, | |
0x00, 0x75, 0x0d, 0x48, 0x8b, 0x45, 0xe8, 0x48, | |
0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x74, 0x0b, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x8b, 0x75, 0xf8, 0x49, | |
0x89, 0x6d, 0x40, 0x48, 0x89, 0xf1, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, | |
0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8b, 0x0e, 0x85, 0xc9, 0x78, 0x17, 0x48, | |
0xff, 0xc9, 0x48, 0x89, 0x0e, 0x75, 0x0f, 0x48, | |
0x89, 0xf1, 0x48, 0x89, 0xc6, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x89, 0xf0, 0x48, 0x85, | |
0xc0, 0x74, 0x13, 0x48, 0x89, 0x45, 0xe8, 0x48, | |
0x83, 0xc5, 0xf0, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x83, | |
0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, | |
}; | |
// 0: | |
// 0: &PyTuple_Type+0x0 | |
// 8: JUMP_TARGET | |
// 10: &PySequence_Tuple+0x0 | |
// 18: &_Py_Dealloc+0x0 | |
// 20: CONTINUE | |
// 28: ERROR_TARGET | |
const unsigned char data_body[48] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyTuple_Type); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x10, (uintptr_t)&PySequence_Tuple); | |
patch_64(data + 0x18, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x20, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x28, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x12, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1f, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x30, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x57, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x72, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0x7d, (uintptr_t)data + 0x24); | |
} | |
void | |
emit__CALL_TYPE_1( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CALL_TYPE_1.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 83 7d f0 00 cmpq $0x0, -0x10(%rbp) | |
// 9: 75 0d jne 0x18 <_JIT_ENTRY+0x18> | |
// b: 48 8b 45 e8 movq -0x18(%rbp), %rax | |
// f: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x16 <_JIT_ENTRY+0x16> | |
// 0000000000000012: IMAGE_REL_AMD64_REL32 __imp_PyType_Type | |
// 16: 74 0b je 0x23 <_JIT_ENTRY+0x23> | |
// 18: 48 83 c4 28 addq $0x28, %rsp | |
// 1c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x23 <_JIT_ENTRY+0x23> | |
// 000000000000001f: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 23: 48 8b 4d f8 movq -0x8(%rbp), %rcx | |
// 27: 48 8b 79 08 movq 0x8(%rcx), %rdi | |
// 2b: 8b 07 movl (%rdi), %eax | |
// 2d: ff c0 incl %eax | |
// 2f: 74 02 je 0x33 <_JIT_ENTRY+0x33> | |
// 31: 89 07 movl %eax, (%rdi) | |
// 33: 48 8d 75 f0 leaq -0x10(%rbp), %rsi | |
// 37: 48 8b 01 movq (%rcx), %rax | |
// 3a: 85 c0 testl %eax, %eax | |
// 3c: 78 0e js 0x4c <_JIT_ENTRY+0x4c> | |
// 3e: 48 ff c8 decq %rax | |
// 41: 48 89 01 movq %rax, (%rcx) | |
// 44: 75 06 jne 0x4c <_JIT_ENTRY+0x4c> | |
// 46: ff 15 00 00 00 00 callq *(%rip) # 0x4c <_JIT_ENTRY+0x4c> | |
// 0000000000000048: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 4c: 48 89 7d e8 movq %rdi, -0x18(%rbp) | |
// 50: 48 89 f5 movq %rsi, %rbp | |
// 53: 48 83 c4 28 addq $0x28, %rsp | |
// 57: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x5e <_JIT_ENTRY+0x5e> | |
// 000000000000005a: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 57: | |
const unsigned char code_body[87] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x83, 0x7d, 0xf0, | |
0x00, 0x75, 0x0d, 0x48, 0x8b, 0x45, 0xe8, 0x48, | |
0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x74, 0x0b, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x8b, 0x4d, 0xf8, 0x48, | |
0x8b, 0x79, 0x08, 0x8b, 0x07, 0xff, 0xc0, 0x74, | |
0x02, 0x89, 0x07, 0x48, 0x8d, 0x75, 0xf0, 0x48, | |
0x8b, 0x01, 0x85, 0xc0, 0x78, 0x0e, 0x48, 0xff, | |
0xc8, 0x48, 0x89, 0x01, 0x75, 0x06, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0x7d, 0xe8, | |
0x48, 0x89, 0xf5, 0x48, 0x83, 0xc4, 0x28, | |
}; | |
// 0: | |
// 0: &PyType_Type+0x0 | |
// 8: JUMP_TARGET | |
// 10: &_Py_Dealloc+0x0 | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyType_Type); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x12, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1f, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x48, (uintptr_t)data + 0xc); | |
} | |
void | |
emit__CHECK_AND_ALLOCATE_OBJECT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_AND_ALLOCATE_OBJECT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: 89 c1 movl %eax, %ecx | |
// d: f7 d1 notl %ecx | |
// f: 48 63 f9 movslq %ecx, %rdi | |
// 12: 48 83 7c fd 00 00 cmpq $0x0, (%rbp,%rdi,8) | |
// 18: 0f 85 b2 00 00 00 jne 0xd0 <_JIT_ENTRY+0xd0> | |
// 1e: b9 fe ff ff ff movl $0xfffffffe, %ecx # imm = 0xFFFFFFFE | |
// 23: 29 c1 subl %eax, %ecx | |
// 25: 48 63 f1 movslq %ecx, %rsi | |
// 28: 48 8b 4c f5 00 movq (%rbp,%rsi,8), %rcx | |
// 2d: 48 8b 41 08 movq 0x8(%rcx), %rax | |
// 31: 83 b8 a8 00 00 00 00 cmpl $0x0, 0xa8(%rax) | |
// 38: 0f 89 92 00 00 00 jns 0xd0 <_JIT_ENTRY+0xd0> | |
// 3e: 8b 81 80 01 00 00 movl 0x180(%rcx), %eax | |
// 44: 3b 05 00 00 00 00 cmpl (%rip), %eax # 0x4a <_JIT_ENTRY+0x4a> | |
// 0000000000000046: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 4a: 0f 85 80 00 00 00 jne 0xd0 <_JIT_ENTRY+0xd0> | |
// 50: 49 8b 84 24 e8 00 00 00 movq 0xe8(%r12), %rax | |
// 58: 48 85 c0 testq %rax, %rax | |
// 5b: 74 73 je 0xd0 <_JIT_ENTRY+0xd0> | |
// 5d: 48 8b 99 a0 03 00 00 movq 0x3a0(%rcx), %rbx | |
// 64: 48 8b 53 30 movq 0x30(%rbx), %rdx | |
// 68: 48 63 52 4c movslq 0x4c(%rdx), %rdx | |
// 6c: 4c 8b 05 00 00 00 00 movq (%rip), %r8 # 0x73 <_JIT_ENTRY+0x73> | |
// 000000000000006f: IMAGE_REL_AMD64_REL32 __imp__Py_InitCleanup | |
// 73: 4d 63 40 4c movslq 0x4c(%r8), %r8 | |
// 77: 49 01 d0 addq %rdx, %r8 | |
// 7a: 49 8b 94 24 f0 00 00 00 movq 0xf0(%r12), %rdx | |
// 82: 48 29 c2 subq %rax, %rdx | |
// 85: 48 c1 fa 03 sarq $0x3, %rdx | |
// 89: 4c 39 c2 cmpq %r8, %rdx | |
// 8c: 7e 42 jle 0xd0 <_JIT_ENTRY+0xd0> | |
// 8e: ff 15 00 00 00 00 callq *(%rip) # 0x94 <_JIT_ENTRY+0x94> | |
// 0000000000000090: IMAGE_REL_AMD64_REL32 __imp__PyType_NewManagedObject | |
// 94: 48 85 c0 testq %rax, %rax | |
// 97: 74 42 je 0xdb <_JIT_ENTRY+0xdb> | |
// 99: 48 89 44 fd 00 movq %rax, (%rbp,%rdi,8) | |
// 9e: 48 8b 4c f5 00 movq (%rbp,%rsi,8), %rcx | |
// a3: 8b 03 movl (%rbx), %eax | |
// a5: ff c0 incl %eax | |
// a7: 74 02 je 0xab <_JIT_ENTRY+0xab> | |
// a9: 89 03 movl %eax, (%rbx) | |
// ab: 48 89 5c f5 00 movq %rbx, (%rbp,%rsi,8) | |
// b0: 48 8b 01 movq (%rcx), %rax | |
// b3: 85 c0 testl %eax, %eax | |
// b5: 78 0e js 0xc5 <_JIT_ENTRY+0xc5> | |
// b7: 48 ff c8 decq %rax | |
// ba: 48 89 01 movq %rax, (%rcx) | |
// bd: 75 06 jne 0xc5 <_JIT_ENTRY+0xc5> | |
// bf: ff 15 00 00 00 00 callq *(%rip) # 0xc5 <_JIT_ENTRY+0xc5> | |
// 00000000000000c1: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// c5: 48 83 c4 28 addq $0x28, %rsp | |
// c9: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xd0 <_JIT_ENTRY+0xd0> | |
// 00000000000000cc: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// d0: 48 83 c4 28 addq $0x28, %rsp | |
// d4: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xdb <_JIT_ENTRY+0xdb> | |
// 00000000000000d7: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// db: 48 83 c4 28 addq $0x28, %rsp | |
// df: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xe6 <_JIT_ENTRY+0xe6> | |
// 00000000000000e2: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// e6: | |
const unsigned char code_body[230] = { | |
0x48, 0x83, 0xec, 0x28, 0x0f, 0xb7, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x89, 0xc1, 0xf7, 0xd1, 0x48, | |
0x63, 0xf9, 0x48, 0x83, 0x7c, 0xfd, 0x00, 0x00, | |
0x0f, 0x85, 0xb2, 0x00, 0x00, 0x00, 0xb9, 0xfe, | |
0xff, 0xff, 0xff, 0x29, 0xc1, 0x48, 0x63, 0xf1, | |
0x48, 0x8b, 0x4c, 0xf5, 0x00, 0x48, 0x8b, 0x41, | |
0x08, 0x83, 0xb8, 0xa8, 0x00, 0x00, 0x00, 0x00, | |
0x0f, 0x89, 0x92, 0x00, 0x00, 0x00, 0x8b, 0x81, | |
0x80, 0x01, 0x00, 0x00, 0x3b, 0x05, 0x00, 0x00, | |
0x00, 0x00, 0x0f, 0x85, 0x80, 0x00, 0x00, 0x00, | |
0x49, 0x8b, 0x84, 0x24, 0xe8, 0x00, 0x00, 0x00, | |
0x48, 0x85, 0xc0, 0x74, 0x73, 0x48, 0x8b, 0x99, | |
0xa0, 0x03, 0x00, 0x00, 0x48, 0x8b, 0x53, 0x30, | |
0x48, 0x63, 0x52, 0x4c, 0x4c, 0x8b, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x4d, 0x63, 0x40, 0x4c, 0x49, | |
0x01, 0xd0, 0x49, 0x8b, 0x94, 0x24, 0xf0, 0x00, | |
0x00, 0x00, 0x48, 0x29, 0xc2, 0x48, 0xc1, 0xfa, | |
0x03, 0x4c, 0x39, 0xc2, 0x7e, 0x42, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x85, 0xc0, 0x74, | |
0x42, 0x48, 0x89, 0x44, 0xfd, 0x00, 0x48, 0x8b, | |
0x4c, 0xf5, 0x00, 0x8b, 0x03, 0xff, 0xc0, 0x74, | |
0x02, 0x89, 0x03, 0x48, 0x89, 0x5c, 0xf5, 0x00, | |
0x48, 0x8b, 0x01, 0x85, 0xc0, 0x78, 0x0e, 0x48, | |
0xff, 0xc8, 0x48, 0x89, 0x01, 0x75, 0x06, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: OPERAND | |
// 10: &_Py_InitCleanup+0x0 | |
// 18: &_PyType_NewManagedObject+0x0 | |
// 20: &_Py_Dealloc+0x0 | |
// 28: CONTINUE | |
// 30: JUMP_TARGET | |
// 38: ERROR_TARGET | |
const unsigned char data_body[64] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, instruction->operand); | |
patch_64(data + 0x10, (uintptr_t)&_Py_InitCleanup); | |
patch_64(data + 0x18, (uintptr_t)&_PyType_NewManagedObject); | |
patch_64(data + 0x20, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x28, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x30, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x38, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x46, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x6f, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x90, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xc1, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0xcc, (uintptr_t)data + 0x24); | |
patch_x86_64_32rx(code + 0xd7, (uintptr_t)data + 0x2c); | |
patch_x86_64_32rx(code + 0xe2, (uintptr_t)data + 0x34); | |
} | |
void | |
emit__CHECK_ATTR_CLASS( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_ATTR_CLASS.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 8b 48 08 movq 0x8(%rax), %rcx | |
// 8: 83 b9 a8 00 00 00 00 cmpl $0x0, 0xa8(%rcx) | |
// f: 79 15 jns 0x26 <_JIT_ENTRY+0x26> | |
// 11: 8b 80 80 01 00 00 movl 0x180(%rax), %eax | |
// 17: 3b 05 00 00 00 00 cmpl (%rip), %eax # 0x1d <_JIT_ENTRY+0x1d> | |
// 0000000000000019: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 1d: 75 07 jne 0x26 <_JIT_ENTRY+0x26> | |
// 1f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x26 <_JIT_ENTRY+0x26> | |
// 0000000000000022: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 26: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x2d <_JIT_ENTRY+0x2d> | |
// 0000000000000029: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 2d: | |
const unsigned char code_body[45] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x8b, 0x48, 0x08, | |
0x83, 0xb9, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x79, | |
0x15, 0x8b, 0x80, 0x80, 0x01, 0x00, 0x00, 0x3b, | |
0x05, 0x00, 0x00, 0x00, 0x00, 0x75, 0x07, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: CONTINUE | |
// 10: JUMP_TARGET | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x19, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x22, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x29, (uintptr_t)data + 0xc); | |
} | |
void | |
emit__CHECK_ATTR_METHOD_LAZY_DICT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_ATTR_METHOD_LAZY_DICT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 0f b7 0d 00 00 00 00 movzwl (%rip), %ecx # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// b: 48 83 7c 08 e8 00 cmpq $0x0, -0x18(%rax,%rcx) | |
// 11: 74 07 je 0x1a <_JIT_ENTRY+0x1a> | |
// 13: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1a <_JIT_ENTRY+0x1a> | |
// 0000000000000016: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 1a: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x21 <_JIT_ENTRY+0x21> | |
// 000000000000001d: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 1a: | |
const unsigned char code_body[26] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x0f, 0xb7, 0x0d, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x83, 0x7c, 0x08, 0xe8, | |
0x00, 0x74, 0x07, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: JUMP_TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x16, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__CHECK_ATTR_MODULE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_ATTR_MODULE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 8b 48 08 movq 0x8(%rax), %rcx | |
// 8: 48 3b 0d 00 00 00 00 cmpq (%rip), %rcx # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp_PyModule_Type | |
// f: 75 1a jne 0x2b <_JIT_ENTRY+0x2b> | |
// 11: 48 8b 40 10 movq 0x10(%rax), %rax | |
// 15: 48 8b 40 20 movq 0x20(%rax), %rax | |
// 19: 8b 40 0c movl 0xc(%rax), %eax | |
// 1c: 3b 05 00 00 00 00 cmpl (%rip), %eax # 0x22 <_JIT_ENTRY+0x22> | |
// 000000000000001e: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 22: 75 07 jne 0x2b <_JIT_ENTRY+0x2b> | |
// 24: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x2b <_JIT_ENTRY+0x2b> | |
// 0000000000000027: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 2b: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x32 <_JIT_ENTRY+0x32> | |
// 000000000000002e: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 32: | |
const unsigned char code_body[50] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x8b, 0x48, 0x08, | |
0x48, 0x3b, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x75, | |
0x1a, 0x48, 0x8b, 0x40, 0x10, 0x48, 0x8b, 0x40, | |
0x20, 0x8b, 0x40, 0x0c, 0x3b, 0x05, 0x00, 0x00, | |
0x00, 0x00, 0x75, 0x07, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PyModule_Type+0x0 | |
// 8: OPERAND | |
// 10: CONTINUE | |
// 18: JUMP_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyModule_Type); | |
patch_64(data + 0x8, instruction->operand); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1e, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x27, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x2e, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__CHECK_ATTR_WITH_HINT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_ATTR_WITH_HINT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 83 78 e8 00 cmpq $0x0, -0x18(%rax) | |
// 9: 74 07 je 0x12 <_JIT_ENTRY+0x12> | |
// b: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x12 <_JIT_ENTRY+0x12> | |
// 000000000000000e: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 12: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x19 <_JIT_ENTRY+0x19> | |
// 0000000000000015: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 19: | |
const unsigned char code_body[25] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x83, 0x78, 0xe8, | |
0x00, 0x74, 0x07, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, | |
}; | |
// 0: | |
// 0: CONTINUE | |
// 8: JUMP_TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xe, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x15, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__CHECK_CALL_BOUND_METHOD_EXACT_ARGS( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_CALL_BOUND_METHOD_EXACT_ARGS.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 7: 89 c1 movl %eax, %ecx | |
// 9: f7 d1 notl %ecx | |
// b: 48 63 c9 movslq %ecx, %rcx | |
// e: 48 83 7c cd 00 00 cmpq $0x0, (%rbp,%rcx,8) | |
// 14: 75 1c jne 0x32 <_JIT_ENTRY+0x32> | |
// 16: b9 fe ff ff ff movl $0xfffffffe, %ecx # imm = 0xFFFFFFFE | |
// 1b: 29 c1 subl %eax, %ecx | |
// 1d: 48 63 c1 movslq %ecx, %rax | |
// 20: 48 8b 44 c5 00 movq (%rbp,%rax,8), %rax | |
// 25: 48 8b 40 08 movq 0x8(%rax), %rax | |
// 29: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x30 <_JIT_ENTRY+0x30> | |
// 000000000000002c: IMAGE_REL_AMD64_REL32 __imp_PyMethod_Type | |
// 30: 74 07 je 0x39 <_JIT_ENTRY+0x39> | |
// 32: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x39 <_JIT_ENTRY+0x39> | |
// 0000000000000035: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 39: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x40 <_JIT_ENTRY+0x40> | |
// 000000000000003c: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 39: | |
const unsigned char code_body[57] = { | |
0x0f, 0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0x89, | |
0xc1, 0xf7, 0xd1, 0x48, 0x63, 0xc9, 0x48, 0x83, | |
0x7c, 0xcd, 0x00, 0x00, 0x75, 0x1c, 0xb9, 0xfe, | |
0xff, 0xff, 0xff, 0x29, 0xc1, 0x48, 0x63, 0xc1, | |
0x48, 0x8b, 0x44, 0xc5, 0x00, 0x48, 0x8b, 0x40, | |
0x08, 0x48, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, | |
0x74, 0x07, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &PyMethod_Type+0x0 | |
// 10: JUMP_TARGET | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&PyMethod_Type); | |
patch_64(data + 0x10, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x2c, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x35, (uintptr_t)data + 0xc); | |
} | |
void | |
emit__CHECK_EG_MATCH( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_EG_MATCH.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 38 subq $0x38, %rsp | |
// 4: 48 8b 7d f0 movq -0x10(%rbp), %rdi | |
// 8: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// c: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 10: 4c 89 e1 movq %r12, %rcx | |
// 13: 48 89 f2 movq %rsi, %rdx | |
// 16: ff 15 00 00 00 00 callq *(%rip) # 0x1c <_JIT_ENTRY+0x1c> | |
// 0000000000000018: IMAGE_REL_AMD64_REL32 __imp__PyEval_CheckExceptStarTypeValid | |
// 1c: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 20: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 28: 85 c0 testl %eax, %eax | |
// 2a: 0f 88 c2 00 00 00 js 0xf2 <_JIT_ENTRY+0xf2> | |
// 30: 48 c7 44 24 28 00 00 00 00 movq $0x0, 0x28(%rsp) | |
// 39: 48 c7 44 24 30 00 00 00 00 movq $0x0, 0x30(%rsp) | |
// 42: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 46: 4c 8d 44 24 28 leaq 0x28(%rsp), %r8 | |
// 4b: 4c 8d 4c 24 30 leaq 0x30(%rsp), %r9 | |
// 50: 48 89 f9 movq %rdi, %rcx | |
// 53: 48 89 f2 movq %rsi, %rdx | |
// 56: ff 15 00 00 00 00 callq *(%rip) # 0x5c <_JIT_ENTRY+0x5c> | |
// 0000000000000058: IMAGE_REL_AMD64_REL32 __imp__PyEval_ExceptionGroupMatch | |
// 5c: 89 c3 movl %eax, %ebx | |
// 5e: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 62: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 6a: 48 8b 07 movq (%rdi), %rax | |
// 6d: 85 c0 testl %eax, %eax | |
// 6f: 78 11 js 0x82 <_JIT_ENTRY+0x82> | |
// 71: 48 ff c8 decq %rax | |
// 74: 48 89 07 movq %rax, (%rdi) | |
// 77: 75 09 jne 0x82 <_JIT_ENTRY+0x82> | |
// 79: 48 89 f9 movq %rdi, %rcx | |
// 7c: ff 15 00 00 00 00 callq *(%rip) # 0x82 <_JIT_ENTRY+0x82> | |
// 000000000000007e: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 82: 48 8b 06 movq (%rsi), %rax | |
// 85: 85 c0 testl %eax, %eax | |
// 87: 78 0c js 0x95 <_JIT_ENTRY+0x95> | |
// 89: 48 ff c8 decq %rax | |
// 8c: 48 89 06 movq %rax, (%rsi) | |
// 8f: 0f 84 8f 00 00 00 je 0x124 <_JIT_ENTRY+0x124> | |
// 95: 85 db testl %ebx, %ebx | |
// 97: 0f 88 98 00 00 00 js 0x135 <_JIT_ENTRY+0x135> | |
// 9d: 48 8b 4c 24 28 movq 0x28(%rsp), %rcx | |
// a2: 48 85 c9 testq %rcx, %rcx | |
// a5: 0f 84 8a 00 00 00 je 0x135 <_JIT_ENTRY+0x135> | |
// ab: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0xb2 <_JIT_ENTRY+0xb2> | |
// 00000000000000ae: IMAGE_REL_AMD64_REL32 __imp__Py_NoneStruct | |
// b2: 48 39 c1 cmpq %rax, %rcx | |
// b5: 74 23 je 0xda <_JIT_ENTRY+0xda> | |
// b7: 48 83 c5 f0 addq $-0x10, %rbp | |
// bb: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// bf: ff 15 00 00 00 00 callq *(%rip) # 0xc5 <_JIT_ENTRY+0xc5> | |
// 00000000000000c1: IMAGE_REL_AMD64_REL32 __imp_PyErr_SetHandledException | |
// c5: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// c9: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// d1: 48 83 c5 10 addq $0x10, %rbp | |
// d5: 48 8b 44 24 28 movq 0x28(%rsp), %rax | |
// da: 48 8b 4c 24 30 movq 0x30(%rsp), %rcx | |
// df: 48 89 4d f0 movq %rcx, -0x10(%rbp) | |
// e3: 48 89 45 f8 movq %rax, -0x8(%rbp) | |
// e7: 48 83 c4 38 addq $0x38, %rsp | |
// eb: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xf2 <_JIT_ENTRY+0xf2> | |
// 00000000000000ee: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// f2: 48 8b 07 movq (%rdi), %rax | |
// f5: 85 c0 testl %eax, %eax | |
// f7: 78 11 js 0x10a <_JIT_ENTRY+0x10a> | |
// f9: 48 ff c8 decq %rax | |
// fc: 48 89 07 movq %rax, (%rdi) | |
// ff: 75 09 jne 0x10a <_JIT_ENTRY+0x10a> | |
// 101: 48 89 f9 movq %rdi, %rcx | |
// 104: ff 15 00 00 00 00 callq *(%rip) # 0x10a <_JIT_ENTRY+0x10a> | |
// 0000000000000106: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 10a: 48 8b 06 movq (%rsi), %rax | |
// 10d: 85 c0 testl %eax, %eax | |
// 10f: 78 08 js 0x119 <_JIT_ENTRY+0x119> | |
// 111: 48 ff c8 decq %rax | |
// 114: 48 89 06 movq %rax, (%rsi) | |
// 117: 74 27 je 0x140 <_JIT_ENTRY+0x140> | |
// 119: 48 83 c4 38 addq $0x38, %rsp | |
// 11d: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x124 <_JIT_ENTRY+0x124> | |
// 0000000000000120: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 124: 48 89 f1 movq %rsi, %rcx | |
// 127: ff 15 00 00 00 00 callq *(%rip) # 0x12d <_JIT_ENTRY+0x12d> | |
// 0000000000000129: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 12d: 85 db testl %ebx, %ebx | |
// 12f: 0f 89 68 ff ff ff jns 0x9d <_JIT_ENTRY+0x9d> | |
// 135: 48 83 c4 38 addq $0x38, %rsp | |
// 139: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x140 <_JIT_ENTRY+0x140> | |
// 000000000000013c: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 140: 48 89 f1 movq %rsi, %rcx | |
// 143: ff 15 00 00 00 00 callq *(%rip) # 0x149 <_JIT_ENTRY+0x149> | |
// 0000000000000145: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 149: 48 83 c4 38 addq $0x38, %rsp | |
// 14d: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x154 <_JIT_ENTRY+0x154> | |
// 0000000000000150: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 154: | |
const unsigned char code_body[340] = { | |
0x48, 0x83, 0xec, 0x38, 0x48, 0x8b, 0x7d, 0xf0, | |
0x48, 0x8b, 0x75, 0xf8, 0x49, 0x89, 0x6d, 0x40, | |
0x4c, 0x89, 0xe1, 0x48, 0x89, 0xf2, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, | |
0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, | |
0x85, 0xc0, 0x0f, 0x88, 0xc2, 0x00, 0x00, 0x00, | |
0x48, 0xc7, 0x44, 0x24, 0x28, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0xc7, 0x44, 0x24, 0x30, 0x00, 0x00, | |
0x00, 0x00, 0x49, 0x89, 0x6d, 0x40, 0x4c, 0x8d, | |
0x44, 0x24, 0x28, 0x4c, 0x8d, 0x4c, 0x24, 0x30, | |
0x48, 0x89, 0xf9, 0x48, 0x89, 0xf2, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x89, 0xc3, 0x49, 0x8b, | |
0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x8b, 0x07, 0x85, 0xc0, 0x78, | |
0x11, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x07, 0x75, | |
0x09, 0x48, 0x89, 0xf9, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x8b, 0x06, 0x85, 0xc0, 0x78, | |
0x0c, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x06, 0x0f, | |
0x84, 0x8f, 0x00, 0x00, 0x00, 0x85, 0xdb, 0x0f, | |
0x88, 0x98, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x4c, | |
0x24, 0x28, 0x48, 0x85, 0xc9, 0x0f, 0x84, 0x8a, | |
0x00, 0x00, 0x00, 0x48, 0x8b, 0x05, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x39, 0xc1, 0x74, 0x23, 0x48, | |
0x83, 0xc5, 0xf0, 0x49, 0x89, 0x6d, 0x40, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, | |
0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x83, 0xc5, 0x10, 0x48, 0x8b, 0x44, | |
0x24, 0x28, 0x48, 0x8b, 0x4c, 0x24, 0x30, 0x48, | |
0x89, 0x4d, 0xf0, 0x48, 0x89, 0x45, 0xf8, 0x48, | |
0x83, 0xc4, 0x38, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x8b, 0x07, 0x85, 0xc0, 0x78, | |
0x11, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x07, 0x75, | |
0x09, 0x48, 0x89, 0xf9, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x8b, 0x06, 0x85, 0xc0, 0x78, | |
0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x06, 0x74, | |
0x27, 0x48, 0x83, 0xc4, 0x38, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0xf1, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x85, 0xdb, 0x0f, | |
0x89, 0x68, 0xff, 0xff, 0xff, 0x48, 0x83, 0xc4, | |
0x38, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x89, 0xf1, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x83, 0xc4, 0x38, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &_PyEval_CheckExceptStarTypeValid+0x0 | |
// 8: &_PyEval_ExceptionGroupMatch+0x0 | |
// 10: &_Py_Dealloc+0x0 | |
// 18: &_Py_NoneStruct+0x0 | |
// 20: &PyErr_SetHandledException+0x0 | |
// 28: CONTINUE | |
// 30: ERROR_TARGET | |
const unsigned char data_body[56] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&_PyEval_CheckExceptStarTypeValid); | |
patch_64(data + 0x8, (uintptr_t)&_PyEval_ExceptionGroupMatch); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x18, (uintptr_t)&_Py_NoneStruct); | |
patch_64(data + 0x20, (uintptr_t)&PyErr_SetHandledException); | |
patch_64(data + 0x28, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x30, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x18, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x58, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x7e, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xae, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xc1, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0xee, (uintptr_t)data + 0x24); | |
patch_x86_64_32rx(code + 0x106, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x120, (uintptr_t)data + 0x2c); | |
patch_x86_64_32rx(code + 0x129, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x13c, (uintptr_t)data + 0x2c); | |
patch_x86_64_32rx(code + 0x145, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x150, (uintptr_t)data + 0x2c); | |
} | |
void | |
emit__CHECK_EXC_MATCH( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_EXC_MATCH.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 7d f0 movq -0x10(%rbp), %rdi | |
// 8: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// c: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 10: 4c 89 e1 movq %r12, %rcx | |
// 13: 48 89 f2 movq %rsi, %rdx | |
// 16: ff 15 00 00 00 00 callq *(%rip) # 0x1c <_JIT_ENTRY+0x1c> | |
// 0000000000000018: IMAGE_REL_AMD64_REL32 __imp__PyEval_CheckExceptTypeValid | |
// 1c: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 20: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 28: 85 c0 testl %eax, %eax | |
// 2a: 78 45 js 0x71 <_JIT_ENTRY+0x71> | |
// 2c: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 30: 48 89 f9 movq %rdi, %rcx | |
// 33: 48 89 f2 movq %rsi, %rdx | |
// 36: ff 15 00 00 00 00 callq *(%rip) # 0x3c <_JIT_ENTRY+0x3c> | |
// 0000000000000038: IMAGE_REL_AMD64_REL32 __imp_PyErr_GivenExceptionMatches | |
// 3c: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 40: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 48: 48 8b 0e movq (%rsi), %rcx | |
// 4b: 85 c9 testl %ecx, %ecx | |
// 4d: 78 08 js 0x57 <_JIT_ENTRY+0x57> | |
// 4f: 48 ff c9 decq %rcx | |
// 52: 48 89 0e movq %rcx, (%rsi) | |
// 55: 74 34 je 0x8b <_JIT_ENTRY+0x8b> | |
// 57: 85 c0 testl %eax, %eax | |
// 59: 75 41 jne 0x9c <_JIT_ENTRY+0x9c> | |
// 5b: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x62 <_JIT_ENTRY+0x62> | |
// 000000000000005e: IMAGE_REL_AMD64_REL32 __imp__Py_FalseStruct | |
// 62: 48 89 45 f8 movq %rax, -0x8(%rbp) | |
// 66: 48 83 c4 28 addq $0x28, %rsp | |
// 6a: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x71 <_JIT_ENTRY+0x71> | |
// 000000000000006d: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 71: 48 8b 06 movq (%rsi), %rax | |
// 74: 85 c0 testl %eax, %eax | |
// 76: 78 08 js 0x80 <_JIT_ENTRY+0x80> | |
// 78: 48 ff c8 decq %rax | |
// 7b: 48 89 06 movq %rax, (%rsi) | |
// 7e: 74 32 je 0xb2 <_JIT_ENTRY+0xb2> | |
// 80: 48 83 c4 28 addq $0x28, %rsp | |
// 84: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x8b <_JIT_ENTRY+0x8b> | |
// 0000000000000087: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 8b: 48 89 f1 movq %rsi, %rcx | |
// 8e: 89 c6 movl %eax, %esi | |
// 90: ff 15 00 00 00 00 callq *(%rip) # 0x96 <_JIT_ENTRY+0x96> | |
// 0000000000000092: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 96: 89 f0 movl %esi, %eax | |
// 98: 85 c0 testl %eax, %eax | |
// 9a: 74 bf je 0x5b <_JIT_ENTRY+0x5b> | |
// 9c: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0xa3 <_JIT_ENTRY+0xa3> | |
// 000000000000009f: IMAGE_REL_AMD64_REL32 __imp__Py_TrueStruct | |
// a3: 48 89 45 f8 movq %rax, -0x8(%rbp) | |
// a7: 48 83 c4 28 addq $0x28, %rsp | |
// ab: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xb2 <_JIT_ENTRY+0xb2> | |
// 00000000000000ae: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// b2: 48 89 f1 movq %rsi, %rcx | |
// b5: ff 15 00 00 00 00 callq *(%rip) # 0xbb <_JIT_ENTRY+0xbb> | |
// 00000000000000b7: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// bb: 48 83 c4 28 addq $0x28, %rsp | |
// bf: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xc6 <_JIT_ENTRY+0xc6> | |
// 00000000000000c2: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// c6: | |
const unsigned char code_body[198] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x7d, 0xf0, | |
0x48, 0x8b, 0x75, 0xf8, 0x49, 0x89, 0x6d, 0x40, | |
0x4c, 0x89, 0xe1, 0x48, 0x89, 0xf2, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, | |
0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, | |
0x85, 0xc0, 0x78, 0x45, 0x49, 0x89, 0x6d, 0x40, | |
0x48, 0x89, 0xf9, 0x48, 0x89, 0xf2, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, | |
0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8b, 0x0e, 0x85, 0xc9, 0x78, 0x08, 0x48, | |
0xff, 0xc9, 0x48, 0x89, 0x0e, 0x74, 0x34, 0x85, | |
0xc0, 0x75, 0x41, 0x48, 0x8b, 0x05, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x89, 0x45, 0xf8, 0x48, 0x83, | |
0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x8b, 0x06, 0x85, 0xc0, 0x78, 0x08, | |
0x48, 0xff, 0xc8, 0x48, 0x89, 0x06, 0x74, 0x32, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x89, 0xf1, 0x89, 0xc6, | |
0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x89, 0xf0, | |
0x85, 0xc0, 0x74, 0xbf, 0x48, 0x8b, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x89, 0x45, 0xf8, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x89, 0xf1, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &_PyEval_CheckExceptTypeValid+0x0 | |
// 8: &PyErr_GivenExceptionMatches+0x0 | |
// 10: &_Py_FalseStruct+0x0 | |
// 18: CONTINUE | |
// 20: ERROR_TARGET | |
// 28: &_Py_Dealloc+0x0 | |
// 30: &_Py_TrueStruct+0x0 | |
const unsigned char data_body[56] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&_PyEval_CheckExceptTypeValid); | |
patch_64(data + 0x8, (uintptr_t)&PyErr_GivenExceptionMatches); | |
patch_64(data + 0x10, (uintptr_t)&_Py_FalseStruct); | |
patch_64(data + 0x18, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x20, state->instruction_starts[instruction->error_target]); | |
patch_64(data + 0x28, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x30, (uintptr_t)&_Py_TrueStruct); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x18, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x38, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x5e, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x6d, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x87, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0x92, (uintptr_t)data + 0x24); | |
patch_x86_64_32rx(code + 0x9f, (uintptr_t)data + 0x2c); | |
patch_x86_64_32rx(code + 0xae, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xb7, (uintptr_t)data + 0x24); | |
patch_x86_64_32rx(code + 0xc2, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__CHECK_FUNCTION( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_FUNCTION.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 49 8b 45 10 movq 0x10(%r13), %rax | |
// 4: 8b 80 90 00 00 00 movl 0x90(%rax), %eax | |
// a: 3b 05 00 00 00 00 cmpl (%rip), %eax # 0x10 <_JIT_ENTRY+0x10> | |
// 000000000000000c: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 10: 75 07 jne 0x19 <_JIT_ENTRY+0x19> | |
// 12: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x19 <_JIT_ENTRY+0x19> | |
// 0000000000000015: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 19: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x20 <_JIT_ENTRY+0x20> | |
// 000000000000001c: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 20: | |
const unsigned char code_body[32] = { | |
0x49, 0x8b, 0x45, 0x10, 0x8b, 0x80, 0x90, 0x00, | |
0x00, 0x00, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, | |
0x75, 0x07, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: CONTINUE | |
// 10: JUMP_TARGET | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xc, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x15, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x1c, (uintptr_t)data + 0xc); | |
} | |
void | |
emit__CHECK_FUNCTION_EXACT_ARGS( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_FUNCTION_EXACT_ARGS.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 7: 89 c1 movl %eax, %ecx | |
// 9: f7 d1 notl %ecx | |
// b: 48 63 c9 movslq %ecx, %rcx | |
// e: ba fe ff ff ff movl $0xfffffffe, %edx # imm = 0xFFFFFFFE | |
// 13: 29 c2 subl %eax, %edx | |
// 15: 48 63 d2 movslq %edx, %rdx | |
// 18: 48 8b 54 d5 00 movq (%rbp,%rdx,8), %rdx | |
// 1d: 48 8b 52 30 movq 0x30(%rdx), %rdx | |
// 21: 48 83 7c cd 00 01 cmpq $0x1, (%rbp,%rcx,8) | |
// 27: 83 d8 ff sbbl $-0x1, %eax | |
// 2a: 39 42 34 cmpl %eax, 0x34(%rdx) | |
// 2d: 75 07 jne 0x36 <_JIT_ENTRY+0x36> | |
// 2f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x36 <_JIT_ENTRY+0x36> | |
// 0000000000000032: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 36: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x3d <_JIT_ENTRY+0x3d> | |
// 0000000000000039: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 3d: | |
const unsigned char code_body[61] = { | |
0x0f, 0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0x89, | |
0xc1, 0xf7, 0xd1, 0x48, 0x63, 0xc9, 0xba, 0xfe, | |
0xff, 0xff, 0xff, 0x29, 0xc2, 0x48, 0x63, 0xd2, | |
0x48, 0x8b, 0x54, 0xd5, 0x00, 0x48, 0x8b, 0x52, | |
0x30, 0x48, 0x83, 0x7c, 0xcd, 0x00, 0x01, 0x83, | |
0xd8, 0xff, 0x39, 0x42, 0x34, 0x75, 0x07, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: CONTINUE | |
// 10: JUMP_TARGET | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x32, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x39, (uintptr_t)data + 0xc); | |
} | |
void | |
emit__CHECK_FUNCTION_VERSION( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_FUNCTION_VERSION.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 7: 48 c7 c1 fe ff ff ff movq $-0x2, %rcx | |
// e: 48 29 c1 subq %rax, %rcx | |
// 11: 48 8b 44 cd 00 movq (%rbp,%rcx,8), %rax | |
// 16: 48 8b 48 08 movq 0x8(%rax), %rcx | |
// 1a: 48 3b 0d 00 00 00 00 cmpq (%rip), %rcx # 0x21 <_JIT_ENTRY+0x21> | |
// 000000000000001d: IMAGE_REL_AMD64_REL32 __imp_PyFunction_Type | |
// 21: 75 15 jne 0x38 <_JIT_ENTRY+0x38> | |
// 23: 8b 80 90 00 00 00 movl 0x90(%rax), %eax | |
// 29: 3b 05 00 00 00 00 cmpl (%rip), %eax # 0x2f <_JIT_ENTRY+0x2f> | |
// 000000000000002b: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 2f: 75 07 jne 0x38 <_JIT_ENTRY+0x38> | |
// 31: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x38 <_JIT_ENTRY+0x38> | |
// 0000000000000034: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 38: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x3f <_JIT_ENTRY+0x3f> | |
// 000000000000003b: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 3f: | |
const unsigned char code_body[63] = { | |
0x0f, 0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0xc7, 0xc1, 0xfe, 0xff, 0xff, 0xff, 0x48, 0x29, | |
0xc1, 0x48, 0x8b, 0x44, 0xcd, 0x00, 0x48, 0x8b, | |
0x48, 0x08, 0x48, 0x3b, 0x0d, 0x00, 0x00, 0x00, | |
0x00, 0x75, 0x15, 0x8b, 0x80, 0x90, 0x00, 0x00, | |
0x00, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x75, | |
0x07, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &PyFunction_Type+0x0 | |
// 10: OPERAND | |
// 18: CONTINUE | |
// 20: JUMP_TARGET | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&PyFunction_Type); | |
patch_64(data + 0x10, instruction->operand); | |
patch_64(data + 0x18, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x20, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1d, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x2b, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x34, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x3b, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__CHECK_FUNCTION_VERSION_KW( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_FUNCTION_VERSION_KW.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 7: 48 c7 c1 fd ff ff ff movq $-0x3, %rcx | |
// e: 48 29 c1 subq %rax, %rcx | |
// 11: 48 8b 44 cd 00 movq (%rbp,%rcx,8), %rax | |
// 16: 48 8b 48 08 movq 0x8(%rax), %rcx | |
// 1a: 48 3b 0d 00 00 00 00 cmpq (%rip), %rcx # 0x21 <_JIT_ENTRY+0x21> | |
// 000000000000001d: IMAGE_REL_AMD64_REL32 __imp_PyFunction_Type | |
// 21: 75 15 jne 0x38 <_JIT_ENTRY+0x38> | |
// 23: 8b 80 90 00 00 00 movl 0x90(%rax), %eax | |
// 29: 3b 05 00 00 00 00 cmpl (%rip), %eax # 0x2f <_JIT_ENTRY+0x2f> | |
// 000000000000002b: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 2f: 75 07 jne 0x38 <_JIT_ENTRY+0x38> | |
// 31: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x38 <_JIT_ENTRY+0x38> | |
// 0000000000000034: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 38: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x3f <_JIT_ENTRY+0x3f> | |
// 000000000000003b: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 3f: | |
const unsigned char code_body[63] = { | |
0x0f, 0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0xc7, 0xc1, 0xfd, 0xff, 0xff, 0xff, 0x48, 0x29, | |
0xc1, 0x48, 0x8b, 0x44, 0xcd, 0x00, 0x48, 0x8b, | |
0x48, 0x08, 0x48, 0x3b, 0x0d, 0x00, 0x00, 0x00, | |
0x00, 0x75, 0x15, 0x8b, 0x80, 0x90, 0x00, 0x00, | |
0x00, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x75, | |
0x07, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &PyFunction_Type+0x0 | |
// 10: OPERAND | |
// 18: CONTINUE | |
// 20: JUMP_TARGET | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&PyFunction_Type); | |
patch_64(data + 0x10, instruction->operand); | |
patch_64(data + 0x18, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x20, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1d, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x2b, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x34, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x3b, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__CHECK_IS_NOT_PY_CALLABLE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_IS_NOT_PY_CALLABLE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 7: 48 c7 c1 fe ff ff ff movq $-0x2, %rcx | |
// e: 48 29 c1 subq %rax, %rcx | |
// 11: 48 8b 44 cd 00 movq (%rbp,%rcx,8), %rax | |
// 16: 48 8b 40 08 movq 0x8(%rax), %rax | |
// 1a: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x21 <_JIT_ENTRY+0x21> | |
// 000000000000001d: IMAGE_REL_AMD64_REL32 __imp_PyFunction_Type | |
// 21: 74 10 je 0x33 <_JIT_ENTRY+0x33> | |
// 23: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x2a <_JIT_ENTRY+0x2a> | |
// 0000000000000026: IMAGE_REL_AMD64_REL32 __imp_PyMethod_Type | |
// 2a: 74 07 je 0x33 <_JIT_ENTRY+0x33> | |
// 2c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x33 <_JIT_ENTRY+0x33> | |
// 000000000000002f: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 33: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x3a <_JIT_ENTRY+0x3a> | |
// 0000000000000036: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 3a: | |
const unsigned char code_body[58] = { | |
0x0f, 0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0xc7, 0xc1, 0xfe, 0xff, 0xff, 0xff, 0x48, 0x29, | |
0xc1, 0x48, 0x8b, 0x44, 0xcd, 0x00, 0x48, 0x8b, | |
0x40, 0x08, 0x48, 0x3b, 0x05, 0x00, 0x00, 0x00, | |
0x00, 0x74, 0x10, 0x48, 0x3b, 0x05, 0x00, 0x00, | |
0x00, 0x00, 0x74, 0x07, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &PyFunction_Type+0x0 | |
// 10: &PyMethod_Type+0x0 | |
// 18: CONTINUE | |
// 20: JUMP_TARGET | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&PyFunction_Type); | |
patch_64(data + 0x10, (uintptr_t)&PyMethod_Type); | |
patch_64(data + 0x18, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x20, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1d, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x26, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x2f, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x36, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__CHECK_IS_NOT_PY_CALLABLE_KW( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_IS_NOT_PY_CALLABLE_KW.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 7: 48 c7 c1 fd ff ff ff movq $-0x3, %rcx | |
// e: 48 29 c1 subq %rax, %rcx | |
// 11: 48 8b 44 cd 00 movq (%rbp,%rcx,8), %rax | |
// 16: 48 8b 40 08 movq 0x8(%rax), %rax | |
// 1a: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x21 <_JIT_ENTRY+0x21> | |
// 000000000000001d: IMAGE_REL_AMD64_REL32 __imp_PyFunction_Type | |
// 21: 74 10 je 0x33 <_JIT_ENTRY+0x33> | |
// 23: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x2a <_JIT_ENTRY+0x2a> | |
// 0000000000000026: IMAGE_REL_AMD64_REL32 __imp_PyMethod_Type | |
// 2a: 74 07 je 0x33 <_JIT_ENTRY+0x33> | |
// 2c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x33 <_JIT_ENTRY+0x33> | |
// 000000000000002f: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 33: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x3a <_JIT_ENTRY+0x3a> | |
// 0000000000000036: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 3a: | |
const unsigned char code_body[58] = { | |
0x0f, 0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0xc7, 0xc1, 0xfd, 0xff, 0xff, 0xff, 0x48, 0x29, | |
0xc1, 0x48, 0x8b, 0x44, 0xcd, 0x00, 0x48, 0x8b, | |
0x40, 0x08, 0x48, 0x3b, 0x05, 0x00, 0x00, 0x00, | |
0x00, 0x74, 0x10, 0x48, 0x3b, 0x05, 0x00, 0x00, | |
0x00, 0x00, 0x74, 0x07, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &PyFunction_Type+0x0 | |
// 10: &PyMethod_Type+0x0 | |
// 18: CONTINUE | |
// 20: JUMP_TARGET | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&PyFunction_Type); | |
patch_64(data + 0x10, (uintptr_t)&PyMethod_Type); | |
patch_64(data + 0x18, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x20, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1d, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x26, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x2f, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x36, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__CHECK_MANAGED_OBJECT_HAS_VALUES( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_MANAGED_OBJECT_HAS_VALUES.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 8b 48 08 movq 0x8(%rax), %rcx | |
// 8: 48 8b 49 20 movq 0x20(%rcx), %rcx | |
// c: 80 7c 08 03 00 cmpb $0x0, 0x3(%rax,%rcx) | |
// 11: 74 07 je 0x1a <_JIT_ENTRY+0x1a> | |
// 13: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1a <_JIT_ENTRY+0x1a> | |
// 0000000000000016: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 1a: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x21 <_JIT_ENTRY+0x21> | |
// 000000000000001d: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 21: | |
const unsigned char code_body[33] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x8b, 0x48, 0x08, | |
0x48, 0x8b, 0x49, 0x20, 0x80, 0x7c, 0x08, 0x03, | |
0x00, 0x74, 0x07, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, | |
}; | |
// 0: | |
// 0: CONTINUE | |
// 8: JUMP_TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x16, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1d, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__CHECK_METHOD_VERSION( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_METHOD_VERSION.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 7: b9 fe ff ff ff movl $0xfffffffe, %ecx # imm = 0xFFFFFFFE | |
// c: 29 c1 subl %eax, %ecx | |
// e: 48 63 c9 movslq %ecx, %rcx | |
// 11: 48 8b 4c cd 00 movq (%rbp,%rcx,8), %rcx | |
// 16: 48 8b 51 08 movq 0x8(%rcx), %rdx | |
// 1a: 48 3b 15 00 00 00 00 cmpq (%rip), %rdx # 0x21 <_JIT_ENTRY+0x21> | |
// 000000000000001d: IMAGE_REL_AMD64_REL32 __imp_PyMethod_Type | |
// 21: 75 2b jne 0x4e <_JIT_ENTRY+0x4e> | |
// 23: 48 8b 49 10 movq 0x10(%rcx), %rcx | |
// 27: 48 8b 51 08 movq 0x8(%rcx), %rdx | |
// 2b: 48 3b 15 00 00 00 00 cmpq (%rip), %rdx # 0x32 <_JIT_ENTRY+0x32> | |
// 000000000000002e: IMAGE_REL_AMD64_REL32 __imp_PyFunction_Type | |
// 32: 75 1a jne 0x4e <_JIT_ENTRY+0x4e> | |
// 34: 8b 89 90 00 00 00 movl 0x90(%rcx), %ecx | |
// 3a: 3b 0d 00 00 00 00 cmpl (%rip), %ecx # 0x40 <_JIT_ENTRY+0x40> | |
// 000000000000003c: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 40: 75 0c jne 0x4e <_JIT_ENTRY+0x4e> | |
// 42: f7 d0 notl %eax | |
// 44: 48 98 cltq | |
// 46: 48 83 7c c5 00 00 cmpq $0x0, (%rbp,%rax,8) | |
// 4c: 74 07 je 0x55 <_JIT_ENTRY+0x55> | |
// 4e: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x55 <_JIT_ENTRY+0x55> | |
// 0000000000000051: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 55: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x5c <_JIT_ENTRY+0x5c> | |
// 0000000000000058: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 55: | |
const unsigned char code_body[85] = { | |
0x0f, 0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0xb9, | |
0xfe, 0xff, 0xff, 0xff, 0x29, 0xc1, 0x48, 0x63, | |
0xc9, 0x48, 0x8b, 0x4c, 0xcd, 0x00, 0x48, 0x8b, | |
0x51, 0x08, 0x48, 0x3b, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0x75, 0x2b, 0x48, 0x8b, 0x49, 0x10, 0x48, | |
0x8b, 0x51, 0x08, 0x48, 0x3b, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x75, 0x1a, 0x8b, 0x89, 0x90, 0x00, | |
0x00, 0x00, 0x3b, 0x0d, 0x00, 0x00, 0x00, 0x00, | |
0x75, 0x0c, 0xf7, 0xd0, 0x48, 0x98, 0x48, 0x83, | |
0x7c, 0xc5, 0x00, 0x00, 0x74, 0x07, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &PyMethod_Type+0x0 | |
// 10: &PyFunction_Type+0x0 | |
// 18: OPERAND | |
// 20: JUMP_TARGET | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&PyMethod_Type); | |
patch_64(data + 0x10, (uintptr_t)&PyFunction_Type); | |
patch_64(data + 0x18, instruction->operand); | |
patch_64(data + 0x20, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1d, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x2e, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x3c, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x51, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__CHECK_METHOD_VERSION_KW( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_METHOD_VERSION_KW.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 7: b9 fd ff ff ff movl $0xfffffffd, %ecx # imm = 0xFFFFFFFD | |
// c: 29 c1 subl %eax, %ecx | |
// e: 48 63 c9 movslq %ecx, %rcx | |
// 11: 48 8b 4c cd 00 movq (%rbp,%rcx,8), %rcx | |
// 16: 48 8b 51 08 movq 0x8(%rcx), %rdx | |
// 1a: 48 3b 15 00 00 00 00 cmpq (%rip), %rdx # 0x21 <_JIT_ENTRY+0x21> | |
// 000000000000001d: IMAGE_REL_AMD64_REL32 __imp_PyMethod_Type | |
// 21: 75 31 jne 0x54 <_JIT_ENTRY+0x54> | |
// 23: 48 8b 49 10 movq 0x10(%rcx), %rcx | |
// 27: 48 8b 51 08 movq 0x8(%rcx), %rdx | |
// 2b: 48 3b 15 00 00 00 00 cmpq (%rip), %rdx # 0x32 <_JIT_ENTRY+0x32> | |
// 000000000000002e: IMAGE_REL_AMD64_REL32 __imp_PyFunction_Type | |
// 32: 75 20 jne 0x54 <_JIT_ENTRY+0x54> | |
// 34: 8b 89 90 00 00 00 movl 0x90(%rcx), %ecx | |
// 3a: 3b 0d 00 00 00 00 cmpl (%rip), %ecx # 0x40 <_JIT_ENTRY+0x40> | |
// 000000000000003c: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 40: 75 12 jne 0x54 <_JIT_ENTRY+0x54> | |
// 42: b9 fe ff ff ff movl $0xfffffffe, %ecx # imm = 0xFFFFFFFE | |
// 47: 29 c1 subl %eax, %ecx | |
// 49: 48 63 c1 movslq %ecx, %rax | |
// 4c: 48 83 7c c5 00 00 cmpq $0x0, (%rbp,%rax,8) | |
// 52: 74 07 je 0x5b <_JIT_ENTRY+0x5b> | |
// 54: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x5b <_JIT_ENTRY+0x5b> | |
// 0000000000000057: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 5b: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x62 <_JIT_ENTRY+0x62> | |
// 000000000000005e: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 5b: | |
const unsigned char code_body[91] = { | |
0x0f, 0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0xb9, | |
0xfd, 0xff, 0xff, 0xff, 0x29, 0xc1, 0x48, 0x63, | |
0xc9, 0x48, 0x8b, 0x4c, 0xcd, 0x00, 0x48, 0x8b, | |
0x51, 0x08, 0x48, 0x3b, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0x75, 0x31, 0x48, 0x8b, 0x49, 0x10, 0x48, | |
0x8b, 0x51, 0x08, 0x48, 0x3b, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x75, 0x20, 0x8b, 0x89, 0x90, 0x00, | |
0x00, 0x00, 0x3b, 0x0d, 0x00, 0x00, 0x00, 0x00, | |
0x75, 0x12, 0xb9, 0xfe, 0xff, 0xff, 0xff, 0x29, | |
0xc1, 0x48, 0x63, 0xc1, 0x48, 0x83, 0x7c, 0xc5, | |
0x00, 0x00, 0x74, 0x07, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &PyMethod_Type+0x0 | |
// 10: &PyFunction_Type+0x0 | |
// 18: OPERAND | |
// 20: JUMP_TARGET | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&PyMethod_Type); | |
patch_64(data + 0x10, (uintptr_t)&PyFunction_Type); | |
patch_64(data + 0x18, instruction->operand); | |
patch_64(data + 0x20, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1d, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x2e, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x3c, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x57, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__CHECK_PEP_523( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_PEP_523.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 49 8b 44 24 10 movq 0x10(%r12), %rax | |
// 5: 48 83 b8 70 20 00 00 00 cmpq $0x0, 0x2070(%rax) | |
// d: 74 07 je 0x16 <_JIT_ENTRY+0x16> | |
// f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x16 <_JIT_ENTRY+0x16> | |
// 0000000000000012: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 16: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1d <_JIT_ENTRY+0x1d> | |
// 0000000000000019: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 16: | |
const unsigned char code_body[22] = { | |
0x49, 0x8b, 0x44, 0x24, 0x10, 0x48, 0x83, 0xb8, | |
0x70, 0x20, 0x00, 0x00, 0x00, 0x74, 0x07, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: JUMP_TARGET | |
const unsigned char data_body[8] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x12, (uintptr_t)data + -0x4); | |
} | |
void | |
emit__CHECK_PERIODIC( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_PERIODIC.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 49 8b 44 24 18 movq 0x18(%r12), %rax | |
// 9: 84 c0 testb %al, %al | |
// b: 74 28 je 0x35 <_JIT_ENTRY+0x35> | |
// d: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 11: 4c 89 e1 movq %r12, %rcx | |
// 14: ff 15 00 00 00 00 callq *(%rip) # 0x1a <_JIT_ENTRY+0x1a> | |
// 0000000000000016: IMAGE_REL_AMD64_REL32 __imp__Py_HandlePending | |
// 1a: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 1e: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 26: 85 c0 testl %eax, %eax | |
// 28: 74 0b je 0x35 <_JIT_ENTRY+0x35> | |
// 2a: 48 83 c4 28 addq $0x28, %rsp | |
// 2e: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x35 <_JIT_ENTRY+0x35> | |
// 0000000000000031: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 35: 48 83 c4 28 addq $0x28, %rsp | |
// 39: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x40 <_JIT_ENTRY+0x40> | |
// 000000000000003c: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 39: | |
const unsigned char code_body[57] = { | |
0x48, 0x83, 0xec, 0x28, 0x49, 0x8b, 0x44, 0x24, | |
0x18, 0x84, 0xc0, 0x74, 0x28, 0x49, 0x89, 0x6d, | |
0x40, 0x4c, 0x89, 0xe1, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, 0xc7, | |
0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x85, 0xc0, | |
0x74, 0x0b, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, | |
0x28, | |
}; | |
// 0: | |
// 0: &_Py_HandlePending+0x0 | |
// 8: ERROR_TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&_Py_HandlePending); | |
patch_64(data + 0x8, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x16, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x31, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__CHECK_PERIODIC_IF_NOT_YIELD_FROM( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_PERIODIC_IF_NOT_YIELD_FROM.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: a8 02 testb $0x2, %al | |
// d: 75 31 jne 0x40 <_JIT_ENTRY+0x40> | |
// f: 49 8b 44 24 18 movq 0x18(%r12), %rax | |
// 14: 84 c0 testb %al, %al | |
// 16: 74 28 je 0x40 <_JIT_ENTRY+0x40> | |
// 18: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 1c: 4c 89 e1 movq %r12, %rcx | |
// 1f: ff 15 00 00 00 00 callq *(%rip) # 0x25 <_JIT_ENTRY+0x25> | |
// 0000000000000021: IMAGE_REL_AMD64_REL32 __imp__Py_HandlePending | |
// 25: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 29: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 31: 85 c0 testl %eax, %eax | |
// 33: 74 0b je 0x40 <_JIT_ENTRY+0x40> | |
// 35: 48 83 c4 28 addq $0x28, %rsp | |
// 39: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x40 <_JIT_ENTRY+0x40> | |
// 000000000000003c: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 40: 48 83 c4 28 addq $0x28, %rsp | |
// 44: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x4b <_JIT_ENTRY+0x4b> | |
// 0000000000000047: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 44: | |
const unsigned char code_body[68] = { | |
0x48, 0x83, 0xec, 0x28, 0x0f, 0xb7, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0xa8, 0x02, 0x75, 0x31, 0x49, | |
0x8b, 0x44, 0x24, 0x18, 0x84, 0xc0, 0x74, 0x28, | |
0x49, 0x89, 0x6d, 0x40, 0x4c, 0x89, 0xe1, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, | |
0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, | |
0x00, 0x85, 0xc0, 0x74, 0x0b, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x83, 0xc4, 0x28, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &_Py_HandlePending+0x0 | |
// 10: ERROR_TARGET | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&_Py_HandlePending); | |
patch_64(data + 0x10, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x21, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x3c, (uintptr_t)data + 0xc); | |
} | |
void | |
emit__CHECK_STACK_SPACE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_STACK_SPACE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 49 8b 84 24 e8 00 00 00 movq 0xe8(%r12), %rax | |
// 8: 48 85 c0 testq %rax, %rax | |
// b: 74 3a je 0x47 <_JIT_ENTRY+0x47> | |
// d: 0f b7 0d 00 00 00 00 movzwl (%rip), %ecx # 0x14 <_JIT_ENTRY+0x14> | |
// 0000000000000010: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 14: 48 c7 c2 fe ff ff ff movq $-0x2, %rdx | |
// 1b: 48 29 ca subq %rcx, %rdx | |
// 1e: 48 8b 4c d5 00 movq (%rbp,%rdx,8), %rcx | |
// 23: 48 8b 49 30 movq 0x30(%rcx), %rcx | |
// 27: 48 63 49 4c movslq 0x4c(%rcx), %rcx | |
// 2b: 49 8b 94 24 f0 00 00 00 movq 0xf0(%r12), %rdx | |
// 33: 48 29 c2 subq %rax, %rdx | |
// 36: 48 c1 fa 03 sarq $0x3, %rdx | |
// 3a: 48 39 ca cmpq %rcx, %rdx | |
// 3d: 7e 08 jle 0x47 <_JIT_ENTRY+0x47> | |
// 3f: 41 83 7c 24 2c 01 cmpl $0x1, 0x2c(%r12) | |
// 45: 7f 07 jg 0x4e <_JIT_ENTRY+0x4e> | |
// 47: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x4e <_JIT_ENTRY+0x4e> | |
// 000000000000004a: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 4e: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x55 <_JIT_ENTRY+0x55> | |
// 0000000000000051: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 4e: | |
const unsigned char code_body[78] = { | |
0x49, 0x8b, 0x84, 0x24, 0xe8, 0x00, 0x00, 0x00, | |
0x48, 0x85, 0xc0, 0x74, 0x3a, 0x0f, 0xb7, 0x0d, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0xc7, 0xc2, 0xfe, | |
0xff, 0xff, 0xff, 0x48, 0x29, 0xca, 0x48, 0x8b, | |
0x4c, 0xd5, 0x00, 0x48, 0x8b, 0x49, 0x30, 0x48, | |
0x63, 0x49, 0x4c, 0x49, 0x8b, 0x94, 0x24, 0xf0, | |
0x00, 0x00, 0x00, 0x48, 0x29, 0xc2, 0x48, 0xc1, | |
0xfa, 0x03, 0x48, 0x39, 0xca, 0x7e, 0x08, 0x41, | |
0x83, 0x7c, 0x24, 0x2c, 0x01, 0x7f, 0x07, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: JUMP_TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x10, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x4a, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__CHECK_STACK_SPACE_OPERAND( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_STACK_SPACE_OPERAND.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 49 8b 84 24 e8 00 00 00 movq 0xe8(%r12), %rax | |
// 8: 48 85 c0 testq %rax, %rax | |
// b: 74 23 je 0x30 <_JIT_ENTRY+0x30> | |
// d: 48 63 0d 00 00 00 00 movslq (%rip), %rcx # 0x14 <_JIT_ENTRY+0x14> | |
// 0000000000000010: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 14: 49 8b 94 24 f0 00 00 00 movq 0xf0(%r12), %rdx | |
// 1c: 48 29 c2 subq %rax, %rdx | |
// 1f: 48 c1 fa 03 sarq $0x3, %rdx | |
// 23: 48 39 ca cmpq %rcx, %rdx | |
// 26: 7e 08 jle 0x30 <_JIT_ENTRY+0x30> | |
// 28: 41 83 7c 24 2c 01 cmpl $0x1, 0x2c(%r12) | |
// 2e: 7f 07 jg 0x37 <_JIT_ENTRY+0x37> | |
// 30: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x37 <_JIT_ENTRY+0x37> | |
// 0000000000000033: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 37: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x3e <_JIT_ENTRY+0x3e> | |
// 000000000000003a: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 37: | |
const unsigned char code_body[55] = { | |
0x49, 0x8b, 0x84, 0x24, 0xe8, 0x00, 0x00, 0x00, | |
0x48, 0x85, 0xc0, 0x74, 0x23, 0x48, 0x63, 0x0d, | |
0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x94, 0x24, | |
0xf0, 0x00, 0x00, 0x00, 0x48, 0x29, 0xc2, 0x48, | |
0xc1, 0xfa, 0x03, 0x48, 0x39, 0xca, 0x7e, 0x08, | |
0x41, 0x83, 0x7c, 0x24, 0x2c, 0x01, 0x7f, 0x07, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: JUMP_TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x10, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x33, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__CHECK_VALIDITY( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_VALIDITY.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_EXECUTOR | |
// 7: f6 40 22 01 testb $0x1, 0x22(%rax) | |
// b: 75 07 jne 0x14 <_JIT_ENTRY+0x14> | |
// d: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x14 <_JIT_ENTRY+0x14> | |
// 0000000000000010: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 14: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1b <_JIT_ENTRY+0x1b> | |
// 0000000000000017: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 14: | |
const unsigned char code_body[20] = { | |
0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0xf6, | |
0x40, 0x22, 0x01, 0x75, 0x07, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: EXECUTOR | |
// 8: JUMP_TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)executor); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x10, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__CHECK_VALIDITY_AND_SET_IP( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CHECK_VALIDITY_AND_SET_IP.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_EXECUTOR | |
// 7: f6 40 22 01 testb $0x1, 0x22(%rax) | |
// b: 75 07 jne 0x14 <_JIT_ENTRY+0x14> | |
// d: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x14 <_JIT_ENTRY+0x14> | |
// 0000000000000010: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 14: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x1b <_JIT_ENTRY+0x1b> | |
// 0000000000000017: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 1b: 49 89 45 38 movq %rax, 0x38(%r13) | |
// 1f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x26 <_JIT_ENTRY+0x26> | |
// 0000000000000022: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 1f: | |
const unsigned char code_body[31] = { | |
0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0xf6, | |
0x40, 0x22, 0x01, 0x75, 0x07, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x49, 0x89, 0x45, 0x38, | |
}; | |
// 0: | |
// 0: EXECUTOR | |
// 8: JUMP_TARGET | |
// 10: OPERAND | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)executor); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x10, instruction->operand); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x10, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x17, (uintptr_t)data + 0xc); | |
} | |
void | |
emit__COMPARE_OP( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_COMPARE_OP.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 44 0f b7 35 00 00 00 00 movzwl (%rip), %r14d # 0xc <_JIT_ENTRY+0xc> | |
// 0000000000000008: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// c: 48 8b 5d f0 movq -0x10(%rbp), %rbx | |
// 10: 48 8b 7d f8 movq -0x8(%rbp), %rdi | |
// 14: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 18: 45 89 f0 movl %r14d, %r8d | |
// 1b: 41 c1 e8 05 shrl $0x5, %r8d | |
// 1f: 48 89 d9 movq %rbx, %rcx | |
// 22: 48 89 fa movq %rdi, %rdx | |
// 25: ff 15 00 00 00 00 callq *(%rip) # 0x2b <_JIT_ENTRY+0x2b> | |
// 0000000000000027: IMAGE_REL_AMD64_REL32 __imp_PyObject_RichCompare | |
// 2b: 48 89 c6 movq %rax, %rsi | |
// 2e: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 32: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 3a: 48 8b 03 movq (%rbx), %rax | |
// 3d: 85 c0 testl %eax, %eax | |
// 3f: 78 08 js 0x49 <_JIT_ENTRY+0x49> | |
// 41: 48 ff c8 decq %rax | |
// 44: 48 89 03 movq %rax, (%rbx) | |
// 47: 74 1a je 0x63 <_JIT_ENTRY+0x63> | |
// 49: 48 8b 07 movq (%rdi), %rax | |
// 4c: 85 c0 testl %eax, %eax | |
// 4e: 78 23 js 0x73 <_JIT_ENTRY+0x73> | |
// 50: 48 ff c8 decq %rax | |
// 53: 48 89 07 movq %rax, (%rdi) | |
// 56: 75 1b jne 0x73 <_JIT_ENTRY+0x73> | |
// 58: 48 89 f9 movq %rdi, %rcx | |
// 5b: ff 15 00 00 00 00 callq *(%rip) # 0x61 <_JIT_ENTRY+0x61> | |
// 000000000000005d: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 61: eb 10 jmp 0x73 <_JIT_ENTRY+0x73> | |
// 63: 48 89 d9 movq %rbx, %rcx | |
// 66: ff 15 00 00 00 00 callq *(%rip) # 0x6c <_JIT_ENTRY+0x6c> | |
// 0000000000000068: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 6c: 48 8b 07 movq (%rdi), %rax | |
// 6f: 85 c0 testl %eax, %eax | |
// 71: 79 dd jns 0x50 <_JIT_ENTRY+0x50> | |
// 73: 48 85 f6 testq %rsi, %rsi | |
// 76: 74 7d je 0xf5 <_JIT_ENTRY+0xf5> | |
// 78: 48 83 c5 f0 addq $-0x10, %rbp | |
// 7c: 41 f6 c6 10 testb $0x10, %r14b | |
// 80: 74 35 je 0xb7 <_JIT_ENTRY+0xb7> | |
// 82: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 86: 48 89 f1 movq %rsi, %rcx | |
// 89: ff 15 00 00 00 00 callq *(%rip) # 0x8f <_JIT_ENTRY+0x8f> | |
// 000000000000008b: IMAGE_REL_AMD64_REL32 __imp_PyObject_IsTrue | |
// 8f: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 93: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 9b: 48 8b 0e movq (%rsi), %rcx | |
// 9e: 85 c9 testl %ecx, %ecx | |
// a0: 78 08 js 0xaa <_JIT_ENTRY+0xaa> | |
// a2: 48 ff c9 decq %rcx | |
// a5: 48 89 0e movq %rcx, (%rsi) | |
// a8: 74 3a je 0xe4 <_JIT_ENTRY+0xe4> | |
// aa: 85 c0 testl %eax, %eax | |
// ac: 78 47 js 0xf5 <_JIT_ENTRY+0xf5> | |
// ae: 75 1a jne 0xca <_JIT_ENTRY+0xca> | |
// b0: 48 8b 35 00 00 00 00 movq (%rip), %rsi # 0xb7 <_JIT_ENTRY+0xb7> | |
// 00000000000000b3: IMAGE_REL_AMD64_REL32 __imp__Py_FalseStruct | |
// b7: 48 89 75 00 movq %rsi, (%rbp) | |
// bb: 48 83 c5 08 addq $0x8, %rbp | |
// bf: 48 83 c4 28 addq $0x28, %rsp | |
// c3: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xca <_JIT_ENTRY+0xca> | |
// 00000000000000c6: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// ca: 48 8b 35 00 00 00 00 movq (%rip), %rsi # 0xd1 <_JIT_ENTRY+0xd1> | |
// 00000000000000cd: IMAGE_REL_AMD64_REL32 __imp__Py_TrueStruct | |
// d1: 48 89 75 00 movq %rsi, (%rbp) | |
// d5: 48 83 c5 08 addq $0x8, %rbp | |
// d9: 48 83 c4 28 addq $0x28, %rsp | |
// dd: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xe4 <_JIT_ENTRY+0xe4> | |
// 00000000000000e0: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// e4: 48 89 f1 movq %rsi, %rcx | |
// e7: 89 c6 movl %eax, %esi | |
// e9: ff 15 00 00 00 00 callq *(%rip) # 0xef <_JIT_ENTRY+0xef> | |
// 00000000000000eb: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// ef: 89 f0 movl %esi, %eax | |
// f1: 85 c0 testl %eax, %eax | |
// f3: 79 b9 jns 0xae <_JIT_ENTRY+0xae> | |
// f5: 48 83 c4 28 addq $0x28, %rsp | |
// f9: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x100 <_JIT_ENTRY+0x100> | |
// 00000000000000fc: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 100: | |
const unsigned char code_body[256] = { | |
0x48, 0x83, 0xec, 0x28, 0x44, 0x0f, 0xb7, 0x35, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x5d, 0xf0, | |
0x48, 0x8b, 0x7d, 0xf8, 0x49, 0x89, 0x6d, 0x40, | |
0x45, 0x89, 0xf0, 0x41, 0xc1, 0xe8, 0x05, 0x48, | |
0x89, 0xd9, 0x48, 0x89, 0xfa, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x89, 0xc6, 0x49, 0x8b, | |
0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x8b, 0x03, 0x85, 0xc0, 0x78, | |
0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x03, 0x74, | |
0x1a, 0x48, 0x8b, 0x07, 0x85, 0xc0, 0x78, 0x23, | |
0x48, 0xff, 0xc8, 0x48, 0x89, 0x07, 0x75, 0x1b, | |
0x48, 0x89, 0xf9, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0xeb, 0x10, 0x48, 0x89, 0xd9, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x07, 0x85, | |
0xc0, 0x79, 0xdd, 0x48, 0x85, 0xf6, 0x74, 0x7d, | |
0x48, 0x83, 0xc5, 0xf0, 0x41, 0xf6, 0xc6, 0x10, | |
0x74, 0x35, 0x49, 0x89, 0x6d, 0x40, 0x48, 0x89, | |
0xf1, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x49, | |
0x8b, 0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x8b, 0x0e, 0x85, 0xc9, | |
0x78, 0x08, 0x48, 0xff, 0xc9, 0x48, 0x89, 0x0e, | |
0x74, 0x3a, 0x85, 0xc0, 0x78, 0x47, 0x75, 0x1a, | |
0x48, 0x8b, 0x35, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x89, 0x75, 0x00, 0x48, 0x83, 0xc5, 0x08, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x8b, 0x35, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x89, 0x75, 0x00, 0x48, 0x83, 0xc5, | |
0x08, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0xf1, 0x89, | |
0xc6, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x89, | |
0xf0, 0x85, 0xc0, 0x79, 0xb9, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &PyObject_RichCompare+0x0 | |
// 10: &_Py_Dealloc+0x0 | |
// 18: &PyObject_IsTrue+0x0 | |
// 20: &_Py_FalseStruct+0x0 | |
// 28: CONTINUE | |
// 30: &_Py_TrueStruct+0x0 | |
// 38: ERROR_TARGET | |
const unsigned char data_body[64] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&PyObject_RichCompare); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x18, (uintptr_t)&PyObject_IsTrue); | |
patch_64(data + 0x20, (uintptr_t)&_Py_FalseStruct); | |
patch_64(data + 0x28, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x30, (uintptr_t)&_Py_TrueStruct); | |
patch_64(data + 0x38, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x8, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x27, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x5d, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x68, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x8b, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xb3, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0xc6, (uintptr_t)data + 0x24); | |
patch_x86_64_32rx(code + 0xcd, (uintptr_t)data + 0x2c); | |
patch_x86_64_32rx(code + 0xe0, (uintptr_t)data + 0x24); | |
patch_x86_64_32rx(code + 0xeb, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xfc, (uintptr_t)data + 0x34); | |
} | |
void | |
emit__COMPARE_OP_FLOAT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_COMPARE_OP_FLOAT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 4d f0 movq -0x10(%rbp), %rcx | |
// 8: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// c: f2 0f 10 71 10 movsd 0x10(%rcx), %xmm6 | |
// 11: f2 0f 10 7e 10 movsd 0x10(%rsi), %xmm7 | |
// 16: 48 8b 01 movq (%rcx), %rax | |
// 19: 85 c0 testl %eax, %eax | |
// 1b: 78 08 js 0x25 <_JIT_ENTRY+0x25> | |
// 1d: 48 ff c8 decq %rax | |
// 20: 48 89 01 movq %rax, (%rcx) | |
// 23: 74 1a je 0x3f <_JIT_ENTRY+0x3f> | |
// 25: 48 8b 06 movq (%rsi), %rax | |
// 28: 85 c0 testl %eax, %eax | |
// 2a: 78 20 js 0x4c <_JIT_ENTRY+0x4c> | |
// 2c: 48 ff c8 decq %rax | |
// 2f: 48 89 06 movq %rax, (%rsi) | |
// 32: 75 18 jne 0x4c <_JIT_ENTRY+0x4c> | |
// 34: 48 89 f1 movq %rsi, %rcx | |
// 37: ff 15 00 00 00 00 callq *(%rip) # 0x3d <_JIT_ENTRY+0x3d> | |
// 0000000000000039: IMAGE_REL_AMD64_REL32 __imp__PyFloat_ExactDealloc | |
// 3d: eb 0d jmp 0x4c <_JIT_ENTRY+0x4c> | |
// 3f: ff 15 00 00 00 00 callq *(%rip) # 0x45 <_JIT_ENTRY+0x45> | |
// 0000000000000041: IMAGE_REL_AMD64_REL32 __imp__PyFloat_ExactDealloc | |
// 45: 48 8b 06 movq (%rsi), %rax | |
// 48: 85 c0 testl %eax, %eax | |
// 4a: 79 e0 jns 0x2c <_JIT_ENTRY+0x2c> | |
// 4c: 48 8d 45 f8 leaq -0x8(%rbp), %rax | |
// 50: 31 c9 xorl %ecx, %ecx | |
// 52: 66 0f 2e f7 ucomisd %xmm7, %xmm6 | |
// 56: 0f 93 c1 setae %cl | |
// 59: 01 c9 addl %ecx, %ecx | |
// 5b: 31 d2 xorl %edx, %edx | |
// 5d: 66 0f 2e fe ucomisd %xmm6, %xmm7 | |
// 61: 0f 93 c2 setae %dl | |
// 64: 09 ca orl %ecx, %edx | |
// 66: 8b 0d 00 00 00 00 movl (%rip), %ecx # 0x6c <_JIT_ENTRY+0x6c> | |
// 0000000000000068: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 6c: 0f a3 d1 btl %edx, %ecx | |
// 6f: 72 19 jb 0x8a <_JIT_ENTRY+0x8a> | |
// 71: 48 8b 0d 00 00 00 00 movq (%rip), %rcx # 0x78 <_JIT_ENTRY+0x78> | |
// 0000000000000074: IMAGE_REL_AMD64_REL32 __imp__Py_FalseStruct | |
// 78: 48 89 4d f0 movq %rcx, -0x10(%rbp) | |
// 7c: 48 89 c5 movq %rax, %rbp | |
// 7f: 48 83 c4 28 addq $0x28, %rsp | |
// 83: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x8a <_JIT_ENTRY+0x8a> | |
// 0000000000000086: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 8a: 48 8b 0d 00 00 00 00 movq (%rip), %rcx # 0x91 <_JIT_ENTRY+0x91> | |
// 000000000000008d: IMAGE_REL_AMD64_REL32 __imp__Py_TrueStruct | |
// 91: 48 89 4d f0 movq %rcx, -0x10(%rbp) | |
// 95: 48 89 c5 movq %rax, %rbp | |
// 98: 48 83 c4 28 addq $0x28, %rsp | |
// 9c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xa3 <_JIT_ENTRY+0xa3> | |
// 000000000000009f: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 9c: | |
const unsigned char code_body[156] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x4d, 0xf0, | |
0x48, 0x8b, 0x75, 0xf8, 0xf2, 0x0f, 0x10, 0x71, | |
0x10, 0xf2, 0x0f, 0x10, 0x7e, 0x10, 0x48, 0x8b, | |
0x01, 0x85, 0xc0, 0x78, 0x08, 0x48, 0xff, 0xc8, | |
0x48, 0x89, 0x01, 0x74, 0x1a, 0x48, 0x8b, 0x06, | |
0x85, 0xc0, 0x78, 0x20, 0x48, 0xff, 0xc8, 0x48, | |
0x89, 0x06, 0x75, 0x18, 0x48, 0x89, 0xf1, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0xeb, 0x0d, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x06, | |
0x85, 0xc0, 0x79, 0xe0, 0x48, 0x8d, 0x45, 0xf8, | |
0x31, 0xc9, 0x66, 0x0f, 0x2e, 0xf7, 0x0f, 0x93, | |
0xc1, 0x01, 0xc9, 0x31, 0xd2, 0x66, 0x0f, 0x2e, | |
0xfe, 0x0f, 0x93, 0xc2, 0x09, 0xca, 0x8b, 0x0d, | |
0x00, 0x00, 0x00, 0x00, 0x0f, 0xa3, 0xd1, 0x72, | |
0x19, 0x48, 0x8b, 0x0d, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x89, 0x4d, 0xf0, 0x48, 0x89, 0xc5, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x8b, 0x0d, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x89, 0x4d, 0xf0, 0x48, 0x89, 0xc5, | |
0x48, 0x83, 0xc4, 0x28, | |
}; | |
// 0: | |
// 0: &_PyFloat_ExactDealloc+0x0 | |
// 8: OPARG | |
// 10: &_Py_FalseStruct+0x0 | |
// 18: CONTINUE | |
// 20: &_Py_TrueStruct+0x0 | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&_PyFloat_ExactDealloc); | |
patch_64(data + 0x8, instruction->oparg); | |
patch_64(data + 0x10, (uintptr_t)&_Py_FalseStruct); | |
patch_64(data + 0x18, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x20, (uintptr_t)&_Py_TrueStruct); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x39, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x41, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x68, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x74, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x86, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x8d, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__COMPARE_OP_INT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_COMPARE_OP_INT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 4d f0 movq -0x10(%rbp), %rcx | |
// 8: 48 8b 59 10 movq 0x10(%rcx), %rbx | |
// c: 48 83 fb 10 cmpq $0x10, %rbx | |
// 10: 73 0e jae 0x20 <_JIT_ENTRY+0x20> | |
// 12: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// 16: 48 8b 7e 10 movq 0x10(%rsi), %rdi | |
// 1a: 48 83 ff 10 cmpq $0x10, %rdi | |
// 1e: 72 0b jb 0x2b <_JIT_ENTRY+0x2b> | |
// 20: 48 83 c4 28 addq $0x28, %rsp | |
// 24: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x2b <_JIT_ENTRY+0x2b> | |
// 0000000000000027: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 2b: 44 8b 79 18 movl 0x18(%rcx), %r15d | |
// 2f: 44 8b 76 18 movl 0x18(%rsi), %r14d | |
// 33: 48 8b 01 movq (%rcx), %rax | |
// 36: 85 c0 testl %eax, %eax | |
// 38: 78 0e js 0x48 <_JIT_ENTRY+0x48> | |
// 3a: 48 ff c8 decq %rax | |
// 3d: 48 89 01 movq %rax, (%rcx) | |
// 40: 75 06 jne 0x48 <_JIT_ENTRY+0x48> | |
// 42: ff 15 00 00 00 00 callq *(%rip) # 0x48 <_JIT_ENTRY+0x48> | |
// 0000000000000044: IMAGE_REL_AMD64_REL32 __imp_PyObject_Free | |
// 48: 48 8b 06 movq (%rsi), %rax | |
// 4b: 85 c0 testl %eax, %eax | |
// 4d: 78 11 js 0x60 <_JIT_ENTRY+0x60> | |
// 4f: 48 ff c8 decq %rax | |
// 52: 48 89 06 movq %rax, (%rsi) | |
// 55: 75 09 jne 0x60 <_JIT_ENTRY+0x60> | |
// 57: 48 89 f1 movq %rsi, %rcx | |
// 5a: ff 15 00 00 00 00 callq *(%rip) # 0x60 <_JIT_ENTRY+0x60> | |
// 000000000000005c: IMAGE_REL_AMD64_REL32 __imp_PyObject_Free | |
// 60: 48 8d 45 f8 leaq -0x8(%rbp), %rax | |
// 64: 83 e3 03 andl $0x3, %ebx | |
// 67: b9 01 00 00 00 movl $0x1, %ecx | |
// 6c: ba 01 00 00 00 movl $0x1, %edx | |
// 71: 48 29 da subq %rbx, %rdx | |
// 74: 49 0f af d7 imulq %r15, %rdx | |
// 78: 83 e7 03 andl $0x3, %edi | |
// 7b: 48 29 f9 subq %rdi, %rcx | |
// 7e: 49 0f af ce imulq %r14, %rcx | |
// 82: 31 f6 xorl %esi, %esi | |
// 84: 31 ff xorl %edi, %edi | |
// 86: 48 39 ca cmpq %rcx, %rdx | |
// 89: 40 0f 9d c6 setge %sil | |
// 8d: 40 0f 9e c7 setle %dil | |
// 91: 01 f6 addl %esi, %esi | |
// 93: 09 f7 orl %esi, %edi | |
// 95: 8b 0d 00 00 00 00 movl (%rip), %ecx # 0x9b <_JIT_ENTRY+0x9b> | |
// 0000000000000097: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 9b: 0f a3 f9 btl %edi, %ecx | |
// 9e: 72 19 jb 0xb9 <_JIT_ENTRY+0xb9> | |
// a0: 48 8b 0d 00 00 00 00 movq (%rip), %rcx # 0xa7 <_JIT_ENTRY+0xa7> | |
// 00000000000000a3: IMAGE_REL_AMD64_REL32 __imp__Py_FalseStruct | |
// a7: 48 89 4d f0 movq %rcx, -0x10(%rbp) | |
// ab: 48 89 c5 movq %rax, %rbp | |
// ae: 48 83 c4 28 addq $0x28, %rsp | |
// b2: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xb9 <_JIT_ENTRY+0xb9> | |
// 00000000000000b5: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// b9: 48 8b 0d 00 00 00 00 movq (%rip), %rcx # 0xc0 <_JIT_ENTRY+0xc0> | |
// 00000000000000bc: IMAGE_REL_AMD64_REL32 __imp__Py_TrueStruct | |
// c0: 48 89 4d f0 movq %rcx, -0x10(%rbp) | |
// c4: 48 89 c5 movq %rax, %rbp | |
// c7: 48 83 c4 28 addq $0x28, %rsp | |
// cb: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xd2 <_JIT_ENTRY+0xd2> | |
// 00000000000000ce: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// cb: | |
const unsigned char code_body[203] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x4d, 0xf0, | |
0x48, 0x8b, 0x59, 0x10, 0x48, 0x83, 0xfb, 0x10, | |
0x73, 0x0e, 0x48, 0x8b, 0x75, 0xf8, 0x48, 0x8b, | |
0x7e, 0x10, 0x48, 0x83, 0xff, 0x10, 0x72, 0x0b, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x44, 0x8b, 0x79, 0x18, 0x44, | |
0x8b, 0x76, 0x18, 0x48, 0x8b, 0x01, 0x85, 0xc0, | |
0x78, 0x0e, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x01, | |
0x75, 0x06, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8b, 0x06, 0x85, 0xc0, 0x78, 0x11, 0x48, | |
0xff, 0xc8, 0x48, 0x89, 0x06, 0x75, 0x09, 0x48, | |
0x89, 0xf1, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8d, 0x45, 0xf8, 0x83, 0xe3, 0x03, 0xb9, | |
0x01, 0x00, 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, | |
0x00, 0x48, 0x29, 0xda, 0x49, 0x0f, 0xaf, 0xd7, | |
0x83, 0xe7, 0x03, 0x48, 0x29, 0xf9, 0x49, 0x0f, | |
0xaf, 0xce, 0x31, 0xf6, 0x31, 0xff, 0x48, 0x39, | |
0xca, 0x40, 0x0f, 0x9d, 0xc6, 0x40, 0x0f, 0x9e, | |
0xc7, 0x01, 0xf6, 0x09, 0xf7, 0x8b, 0x0d, 0x00, | |
0x00, 0x00, 0x00, 0x0f, 0xa3, 0xf9, 0x72, 0x19, | |
0x48, 0x8b, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x89, 0x4d, 0xf0, 0x48, 0x89, 0xc5, 0x48, 0x83, | |
0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x8b, 0x0d, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x89, 0x4d, 0xf0, 0x48, 0x89, 0xc5, 0x48, | |
0x83, 0xc4, 0x28, | |
}; | |
// 0: | |
// 0: JUMP_TARGET | |
// 8: &PyObject_Free+0x0 | |
// 10: OPARG | |
// 18: &_Py_FalseStruct+0x0 | |
// 20: CONTINUE | |
// 28: &_Py_TrueStruct+0x0 | |
const unsigned char data_body[48] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x8, (uintptr_t)&PyObject_Free); | |
patch_64(data + 0x10, instruction->oparg); | |
patch_64(data + 0x18, (uintptr_t)&_Py_FalseStruct); | |
patch_64(data + 0x20, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x28, (uintptr_t)&_Py_TrueStruct); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x27, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x44, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x5c, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x97, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xa3, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xb5, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0xbc, (uintptr_t)data + 0x24); | |
} | |
void | |
emit__COMPARE_OP_STR( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_COMPARE_OP_STR.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 5d f0 movq -0x10(%rbp), %rbx | |
// 8: 48 8b 7d f8 movq -0x8(%rbp), %rdi | |
// c: 48 89 d9 movq %rbx, %rcx | |
// f: 48 89 fa movq %rdi, %rdx | |
// 12: ff 15 00 00 00 00 callq *(%rip) # 0x18 <_JIT_ENTRY+0x18> | |
// 0000000000000014: IMAGE_REL_AMD64_REL32 __imp__PyUnicode_Equal | |
// 18: 89 c6 movl %eax, %esi | |
// 1a: 48 8b 03 movq (%rbx), %rax | |
// 1d: 85 c0 testl %eax, %eax | |
// 1f: 78 08 js 0x29 <_JIT_ENTRY+0x29> | |
// 21: 48 ff c8 decq %rax | |
// 24: 48 89 03 movq %rax, (%rbx) | |
// 27: 74 1a je 0x43 <_JIT_ENTRY+0x43> | |
// 29: 48 8b 07 movq (%rdi), %rax | |
// 2c: 85 c0 testl %eax, %eax | |
// 2e: 78 23 js 0x53 <_JIT_ENTRY+0x53> | |
// 30: 48 ff c8 decq %rax | |
// 33: 48 89 07 movq %rax, (%rdi) | |
// 36: 75 1b jne 0x53 <_JIT_ENTRY+0x53> | |
// 38: 48 89 f9 movq %rdi, %rcx | |
// 3b: ff 15 00 00 00 00 callq *(%rip) # 0x41 <_JIT_ENTRY+0x41> | |
// 000000000000003d: IMAGE_REL_AMD64_REL32 __imp__PyUnicode_ExactDealloc | |
// 41: eb 10 jmp 0x53 <_JIT_ENTRY+0x53> | |
// 43: 48 89 d9 movq %rbx, %rcx | |
// 46: ff 15 00 00 00 00 callq *(%rip) # 0x4c <_JIT_ENTRY+0x4c> | |
// 0000000000000048: IMAGE_REL_AMD64_REL32 __imp__PyUnicode_ExactDealloc | |
// 4c: 48 8b 07 movq (%rdi), %rax | |
// 4f: 85 c0 testl %eax, %eax | |
// 51: 79 dd jns 0x30 <_JIT_ENTRY+0x30> | |
// 53: 48 8d 45 f8 leaq -0x8(%rbp), %rax | |
// 57: 48 8b 0d 00 00 00 00 movq (%rip), %rcx # 0x5e <_JIT_ENTRY+0x5e> | |
// 000000000000005a: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 5e: 83 c6 07 addl $0x7, %esi | |
// 61: 66 85 f1 testw %si, %cx | |
// 64: 75 19 jne 0x7f <_JIT_ENTRY+0x7f> | |
// 66: 48 8b 0d 00 00 00 00 movq (%rip), %rcx # 0x6d <_JIT_ENTRY+0x6d> | |
// 0000000000000069: IMAGE_REL_AMD64_REL32 __imp__Py_FalseStruct | |
// 6d: 48 89 4d f0 movq %rcx, -0x10(%rbp) | |
// 71: 48 89 c5 movq %rax, %rbp | |
// 74: 48 83 c4 28 addq $0x28, %rsp | |
// 78: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x7f <_JIT_ENTRY+0x7f> | |
// 000000000000007b: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 7f: 48 8b 0d 00 00 00 00 movq (%rip), %rcx # 0x86 <_JIT_ENTRY+0x86> | |
// 0000000000000082: IMAGE_REL_AMD64_REL32 __imp__Py_TrueStruct | |
// 86: 48 89 4d f0 movq %rcx, -0x10(%rbp) | |
// 8a: 48 89 c5 movq %rax, %rbp | |
// 8d: 48 83 c4 28 addq $0x28, %rsp | |
// 91: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x98 <_JIT_ENTRY+0x98> | |
// 0000000000000094: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 91: | |
const unsigned char code_body[145] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x5d, 0xf0, | |
0x48, 0x8b, 0x7d, 0xf8, 0x48, 0x89, 0xd9, 0x48, | |
0x89, 0xfa, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x89, 0xc6, 0x48, 0x8b, 0x03, 0x85, 0xc0, 0x78, | |
0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x03, 0x74, | |
0x1a, 0x48, 0x8b, 0x07, 0x85, 0xc0, 0x78, 0x23, | |
0x48, 0xff, 0xc8, 0x48, 0x89, 0x07, 0x75, 0x1b, | |
0x48, 0x89, 0xf9, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0xeb, 0x10, 0x48, 0x89, 0xd9, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x07, 0x85, | |
0xc0, 0x79, 0xdd, 0x48, 0x8d, 0x45, 0xf8, 0x48, | |
0x8b, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x83, 0xc6, | |
0x07, 0x66, 0x85, 0xf1, 0x75, 0x19, 0x48, 0x8b, | |
0x0d, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0x4d, | |
0xf0, 0x48, 0x89, 0xc5, 0x48, 0x83, 0xc4, 0x28, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, | |
0x4d, 0xf0, 0x48, 0x89, 0xc5, 0x48, 0x83, 0xc4, | |
0x28, | |
}; | |
// 0: | |
// 0: &_PyUnicode_Equal+0x0 | |
// 8: &_PyUnicode_ExactDealloc+0x0 | |
// 10: OPARG | |
// 18: &_Py_FalseStruct+0x0 | |
// 20: CONTINUE | |
// 28: &_Py_TrueStruct+0x0 | |
const unsigned char data_body[48] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&_PyUnicode_Equal); | |
patch_64(data + 0x8, (uintptr_t)&_PyUnicode_ExactDealloc); | |
patch_64(data + 0x10, instruction->oparg); | |
patch_64(data + 0x18, (uintptr_t)&_Py_FalseStruct); | |
patch_64(data + 0x20, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x28, (uintptr_t)&_Py_TrueStruct); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x14, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x3d, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x48, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x5a, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x69, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x7b, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0x82, (uintptr_t)data + 0x24); | |
} | |
void | |
emit__CONTAINS_OP( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CONTAINS_OP.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 5d f0 movq -0x10(%rbp), %rbx | |
// 8: 48 8b 7d f8 movq -0x8(%rbp), %rdi | |
// c: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 10: 48 89 f9 movq %rdi, %rcx | |
// 13: 48 89 da movq %rbx, %rdx | |
// 16: ff 15 00 00 00 00 callq *(%rip) # 0x1c <_JIT_ENTRY+0x1c> | |
// 0000000000000018: IMAGE_REL_AMD64_REL32 __imp_PySequence_Contains | |
// 1c: 89 c6 movl %eax, %esi | |
// 1e: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 22: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 2a: 48 8b 03 movq (%rbx), %rax | |
// 2d: 85 c0 testl %eax, %eax | |
// 2f: 78 08 js 0x39 <_JIT_ENTRY+0x39> | |
// 31: 48 ff c8 decq %rax | |
// 34: 48 89 03 movq %rax, (%rbx) | |
// 37: 74 1a je 0x53 <_JIT_ENTRY+0x53> | |
// 39: 48 8b 07 movq (%rdi), %rax | |
// 3c: 85 c0 testl %eax, %eax | |
// 3e: 78 23 js 0x63 <_JIT_ENTRY+0x63> | |
// 40: 48 ff c8 decq %rax | |
// 43: 48 89 07 movq %rax, (%rdi) | |
// 46: 75 1b jne 0x63 <_JIT_ENTRY+0x63> | |
// 48: 48 89 f9 movq %rdi, %rcx | |
// 4b: ff 15 00 00 00 00 callq *(%rip) # 0x51 <_JIT_ENTRY+0x51> | |
// 000000000000004d: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 51: eb 10 jmp 0x63 <_JIT_ENTRY+0x63> | |
// 53: 48 89 d9 movq %rbx, %rcx | |
// 56: ff 15 00 00 00 00 callq *(%rip) # 0x5c <_JIT_ENTRY+0x5c> | |
// 0000000000000058: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 5c: 48 8b 07 movq (%rdi), %rax | |
// 5f: 85 c0 testl %eax, %eax | |
// 61: 79 dd jns 0x40 <_JIT_ENTRY+0x40> | |
// 63: 85 f6 testl %esi, %esi | |
// 65: 78 25 js 0x8c <_JIT_ENTRY+0x8c> | |
// 67: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0x6e <_JIT_ENTRY+0x6e> | |
// 000000000000006a: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 6e: 39 c6 cmpl %eax, %esi | |
// 70: 75 25 jne 0x97 <_JIT_ENTRY+0x97> | |
// 72: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x79 <_JIT_ENTRY+0x79> | |
// 0000000000000075: IMAGE_REL_AMD64_REL32 __imp__Py_FalseStruct | |
// 79: 48 89 45 f0 movq %rax, -0x10(%rbp) | |
// 7d: 48 83 c5 f8 addq $-0x8, %rbp | |
// 81: 48 83 c4 28 addq $0x28, %rsp | |
// 85: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x8c <_JIT_ENTRY+0x8c> | |
// 0000000000000088: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 8c: 48 83 c4 28 addq $0x28, %rsp | |
// 90: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x97 <_JIT_ENTRY+0x97> | |
// 0000000000000093: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 97: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x9e <_JIT_ENTRY+0x9e> | |
// 000000000000009a: IMAGE_REL_AMD64_REL32 __imp__Py_TrueStruct | |
// 9e: 48 89 45 f0 movq %rax, -0x10(%rbp) | |
// a2: 48 83 c5 f8 addq $-0x8, %rbp | |
// a6: 48 83 c4 28 addq $0x28, %rsp | |
// aa: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xb1 <_JIT_ENTRY+0xb1> | |
// 00000000000000ad: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// aa: | |
const unsigned char code_body[170] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x5d, 0xf0, | |
0x48, 0x8b, 0x7d, 0xf8, 0x49, 0x89, 0x6d, 0x40, | |
0x48, 0x89, 0xf9, 0x48, 0x89, 0xda, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x89, 0xc6, 0x49, 0x8b, | |
0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x8b, 0x03, 0x85, 0xc0, 0x78, | |
0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x03, 0x74, | |
0x1a, 0x48, 0x8b, 0x07, 0x85, 0xc0, 0x78, 0x23, | |
0x48, 0xff, 0xc8, 0x48, 0x89, 0x07, 0x75, 0x1b, | |
0x48, 0x89, 0xf9, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0xeb, 0x10, 0x48, 0x89, 0xd9, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x07, 0x85, | |
0xc0, 0x79, 0xdd, 0x85, 0xf6, 0x78, 0x25, 0x0f, | |
0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0x39, 0xc6, | |
0x75, 0x25, 0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x89, 0x45, 0xf0, 0x48, 0x83, 0xc5, | |
0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, 0x28, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, | |
0x45, 0xf0, 0x48, 0x83, 0xc5, 0xf8, 0x48, 0x83, | |
0xc4, 0x28, | |
}; | |
// 0: | |
// 0: &PySequence_Contains+0x0 | |
// 8: &_Py_Dealloc+0x0 | |
// 10: OPARG | |
// 18: &_Py_FalseStruct+0x0 | |
// 20: CONTINUE | |
// 28: ERROR_TARGET | |
// 30: &_Py_TrueStruct+0x0 | |
const unsigned char data_body[56] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PySequence_Contains); | |
patch_64(data + 0x8, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x10, instruction->oparg); | |
patch_64(data + 0x18, (uintptr_t)&_Py_FalseStruct); | |
patch_64(data + 0x20, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x28, state->instruction_starts[instruction->error_target]); | |
patch_64(data + 0x30, (uintptr_t)&_Py_TrueStruct); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x18, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x4d, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x58, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x6a, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x75, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x88, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0x93, (uintptr_t)data + 0x24); | |
patch_x86_64_32rx(code + 0x9a, (uintptr_t)data + 0x2c); | |
} | |
void | |
emit__CONTAINS_OP_DICT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CONTAINS_OP_DICT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// 8: 48 8b 46 08 movq 0x8(%rsi), %rax | |
// c: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x13 <_JIT_ENTRY+0x13> | |
// 000000000000000f: IMAGE_REL_AMD64_REL32 __imp_PyDict_Type | |
// 13: 74 0b je 0x20 <_JIT_ENTRY+0x20> | |
// 15: 48 83 c4 28 addq $0x28, %rsp | |
// 19: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x20 <_JIT_ENTRY+0x20> | |
// 000000000000001c: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 20: 48 8b 5d f0 movq -0x10(%rbp), %rbx | |
// 24: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 28: 48 89 f1 movq %rsi, %rcx | |
// 2b: 48 89 da movq %rbx, %rdx | |
// 2e: ff 15 00 00 00 00 callq *(%rip) # 0x34 <_JIT_ENTRY+0x34> | |
// 0000000000000030: IMAGE_REL_AMD64_REL32 __imp_PyDict_Contains | |
// 34: 89 c7 movl %eax, %edi | |
// 36: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 3a: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 42: 48 8b 03 movq (%rbx), %rax | |
// 45: 85 c0 testl %eax, %eax | |
// 47: 78 11 js 0x5a <_JIT_ENTRY+0x5a> | |
// 49: 48 ff c8 decq %rax | |
// 4c: 48 89 03 movq %rax, (%rbx) | |
// 4f: 75 09 jne 0x5a <_JIT_ENTRY+0x5a> | |
// 51: 48 89 d9 movq %rbx, %rcx | |
// 54: ff 15 00 00 00 00 callq *(%rip) # 0x5a <_JIT_ENTRY+0x5a> | |
// 0000000000000056: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 5a: 48 8b 06 movq (%rsi), %rax | |
// 5d: 85 c0 testl %eax, %eax | |
// 5f: 78 08 js 0x69 <_JIT_ENTRY+0x69> | |
// 61: 48 ff c8 decq %rax | |
// 64: 48 89 06 movq %rax, (%rsi) | |
// 67: 74 43 je 0xac <_JIT_ENTRY+0xac> | |
// 69: 85 ff testl %edi, %edi | |
// 6b: 78 4c js 0xb9 <_JIT_ENTRY+0xb9> | |
// 6d: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0x74 <_JIT_ENTRY+0x74> | |
// 0000000000000070: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 74: 39 c7 cmpl %eax, %edi | |
// 76: 75 1a jne 0x92 <_JIT_ENTRY+0x92> | |
// 78: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x7f <_JIT_ENTRY+0x7f> | |
// 000000000000007b: IMAGE_REL_AMD64_REL32 __imp__Py_FalseStruct | |
// 7f: 48 89 45 f0 movq %rax, -0x10(%rbp) | |
// 83: 48 83 c5 f8 addq $-0x8, %rbp | |
// 87: 48 83 c4 28 addq $0x28, %rsp | |
// 8b: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x92 <_JIT_ENTRY+0x92> | |
// 000000000000008e: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 92: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x99 <_JIT_ENTRY+0x99> | |
// 0000000000000095: IMAGE_REL_AMD64_REL32 __imp__Py_TrueStruct | |
// 99: 48 89 45 f0 movq %rax, -0x10(%rbp) | |
// 9d: 48 83 c5 f8 addq $-0x8, %rbp | |
// a1: 48 83 c4 28 addq $0x28, %rsp | |
// a5: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xac <_JIT_ENTRY+0xac> | |
// 00000000000000a8: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// ac: 48 89 f1 movq %rsi, %rcx | |
// af: ff 15 00 00 00 00 callq *(%rip) # 0xb5 <_JIT_ENTRY+0xb5> | |
// 00000000000000b1: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// b5: 85 ff testl %edi, %edi | |
// b7: 79 b4 jns 0x6d <_JIT_ENTRY+0x6d> | |
// b9: 48 83 c4 28 addq $0x28, %rsp | |
// bd: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xc4 <_JIT_ENTRY+0xc4> | |
// 00000000000000c0: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// c4: | |
const unsigned char code_body[196] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x75, 0xf8, | |
0x48, 0x8b, 0x46, 0x08, 0x48, 0x3b, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x74, 0x0b, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8b, 0x5d, 0xf0, 0x49, 0x89, 0x6d, 0x40, | |
0x48, 0x89, 0xf1, 0x48, 0x89, 0xda, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x89, 0xc7, 0x49, 0x8b, | |
0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x8b, 0x03, 0x85, 0xc0, 0x78, | |
0x11, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x03, 0x75, | |
0x09, 0x48, 0x89, 0xd9, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x8b, 0x06, 0x85, 0xc0, 0x78, | |
0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x06, 0x74, | |
0x43, 0x85, 0xff, 0x78, 0x4c, 0x0f, 0xb7, 0x05, | |
0x00, 0x00, 0x00, 0x00, 0x39, 0xc7, 0x75, 0x1a, | |
0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x89, 0x45, 0xf0, 0x48, 0x83, 0xc5, 0xf8, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x89, 0x45, 0xf0, 0x48, 0x83, 0xc5, | |
0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0xf1, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x85, 0xff, 0x79, | |
0xb4, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PyDict_Type+0x0 | |
// 8: JUMP_TARGET | |
// 10: &PyDict_Contains+0x0 | |
// 18: &_Py_Dealloc+0x0 | |
// 20: OPARG | |
// 28: &_Py_FalseStruct+0x0 | |
// 30: CONTINUE | |
// 38: &_Py_TrueStruct+0x0 | |
// 40: ERROR_TARGET | |
const unsigned char data_body[72] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyDict_Type); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x10, (uintptr_t)&PyDict_Contains); | |
patch_64(data + 0x18, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x20, instruction->oparg); | |
patch_64(data + 0x28, (uintptr_t)&_Py_FalseStruct); | |
patch_64(data + 0x30, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x38, (uintptr_t)&_Py_TrueStruct); | |
patch_64(data + 0x40, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xf, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1c, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x30, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x56, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x70, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0x7b, (uintptr_t)data + 0x24); | |
patch_x86_64_32rx(code + 0x8e, (uintptr_t)data + 0x2c); | |
patch_x86_64_32rx(code + 0x95, (uintptr_t)data + 0x34); | |
patch_x86_64_32rx(code + 0xa8, (uintptr_t)data + 0x2c); | |
patch_x86_64_32rx(code + 0xb1, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xc0, (uintptr_t)data + 0x3c); | |
} | |
void | |
emit__CONTAINS_OP_SET( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CONTAINS_OP_SET.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 5d f0 movq -0x10(%rbp), %rbx | |
// 8: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// c: 48 8b 46 08 movq 0x8(%rsi), %rax | |
// 10: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x17 <_JIT_ENTRY+0x17> | |
// 0000000000000013: IMAGE_REL_AMD64_REL32 __imp_PySet_Type | |
// 17: 74 14 je 0x2d <_JIT_ENTRY+0x2d> | |
// 19: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x20 <_JIT_ENTRY+0x20> | |
// 000000000000001c: IMAGE_REL_AMD64_REL32 __imp_PyFrozenSet_Type | |
// 20: 74 0b je 0x2d <_JIT_ENTRY+0x2d> | |
// 22: 48 83 c4 28 addq $0x28, %rsp | |
// 26: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x2d <_JIT_ENTRY+0x2d> | |
// 0000000000000029: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 2d: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 31: 48 89 f1 movq %rsi, %rcx | |
// 34: 48 89 da movq %rbx, %rdx | |
// 37: ff 15 00 00 00 00 callq *(%rip) # 0x3d <_JIT_ENTRY+0x3d> | |
// 0000000000000039: IMAGE_REL_AMD64_REL32 __imp__PySet_Contains | |
// 3d: 89 c7 movl %eax, %edi | |
// 3f: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 43: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 4b: 48 8b 03 movq (%rbx), %rax | |
// 4e: 85 c0 testl %eax, %eax | |
// 50: 78 11 js 0x63 <_JIT_ENTRY+0x63> | |
// 52: 48 ff c8 decq %rax | |
// 55: 48 89 03 movq %rax, (%rbx) | |
// 58: 75 09 jne 0x63 <_JIT_ENTRY+0x63> | |
// 5a: 48 89 d9 movq %rbx, %rcx | |
// 5d: ff 15 00 00 00 00 callq *(%rip) # 0x63 <_JIT_ENTRY+0x63> | |
// 000000000000005f: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 63: 48 8b 06 movq (%rsi), %rax | |
// 66: 85 c0 testl %eax, %eax | |
// 68: 78 08 js 0x72 <_JIT_ENTRY+0x72> | |
// 6a: 48 ff c8 decq %rax | |
// 6d: 48 89 06 movq %rax, (%rsi) | |
// 70: 74 43 je 0xb5 <_JIT_ENTRY+0xb5> | |
// 72: 85 ff testl %edi, %edi | |
// 74: 78 4c js 0xc2 <_JIT_ENTRY+0xc2> | |
// 76: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0x7d <_JIT_ENTRY+0x7d> | |
// 0000000000000079: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 7d: 39 c7 cmpl %eax, %edi | |
// 7f: 75 1a jne 0x9b <_JIT_ENTRY+0x9b> | |
// 81: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x88 <_JIT_ENTRY+0x88> | |
// 0000000000000084: IMAGE_REL_AMD64_REL32 __imp__Py_FalseStruct | |
// 88: 48 89 45 f0 movq %rax, -0x10(%rbp) | |
// 8c: 48 83 c5 f8 addq $-0x8, %rbp | |
// 90: 48 83 c4 28 addq $0x28, %rsp | |
// 94: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x9b <_JIT_ENTRY+0x9b> | |
// 0000000000000097: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 9b: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0xa2 <_JIT_ENTRY+0xa2> | |
// 000000000000009e: IMAGE_REL_AMD64_REL32 __imp__Py_TrueStruct | |
// a2: 48 89 45 f0 movq %rax, -0x10(%rbp) | |
// a6: 48 83 c5 f8 addq $-0x8, %rbp | |
// aa: 48 83 c4 28 addq $0x28, %rsp | |
// ae: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xb5 <_JIT_ENTRY+0xb5> | |
// 00000000000000b1: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// b5: 48 89 f1 movq %rsi, %rcx | |
// b8: ff 15 00 00 00 00 callq *(%rip) # 0xbe <_JIT_ENTRY+0xbe> | |
// 00000000000000ba: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// be: 85 ff testl %edi, %edi | |
// c0: 79 b4 jns 0x76 <_JIT_ENTRY+0x76> | |
// c2: 48 83 c4 28 addq $0x28, %rsp | |
// c6: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xcd <_JIT_ENTRY+0xcd> | |
// 00000000000000c9: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// cd: | |
const unsigned char code_body[205] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x5d, 0xf0, | |
0x48, 0x8b, 0x75, 0xf8, 0x48, 0x8b, 0x46, 0x08, | |
0x48, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x74, | |
0x14, 0x48, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, | |
0x74, 0x0b, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, 0x49, 0x89, 0x6d, | |
0x40, 0x48, 0x89, 0xf1, 0x48, 0x89, 0xda, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x89, 0xc7, 0x49, | |
0x8b, 0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x8b, 0x03, 0x85, 0xc0, | |
0x78, 0x11, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x03, | |
0x75, 0x09, 0x48, 0x89, 0xd9, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x8b, 0x06, 0x85, 0xc0, | |
0x78, 0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x06, | |
0x74, 0x43, 0x85, 0xff, 0x78, 0x4c, 0x0f, 0xb7, | |
0x05, 0x00, 0x00, 0x00, 0x00, 0x39, 0xc7, 0x75, | |
0x1a, 0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x89, 0x45, 0xf0, 0x48, 0x83, 0xc5, 0xf8, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x8b, 0x05, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x89, 0x45, 0xf0, 0x48, 0x83, | |
0xc5, 0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0xf1, | |
0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x85, 0xff, | |
0x79, 0xb4, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PySet_Type+0x0 | |
// 8: &PyFrozenSet_Type+0x0 | |
// 10: JUMP_TARGET | |
// 18: &_PySet_Contains+0x0 | |
// 20: &_Py_Dealloc+0x0 | |
// 28: OPARG | |
// 30: &_Py_FalseStruct+0x0 | |
// 38: CONTINUE | |
// 40: &_Py_TrueStruct+0x0 | |
// 48: ERROR_TARGET | |
const unsigned char data_body[80] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PySet_Type); | |
patch_64(data + 0x8, (uintptr_t)&PyFrozenSet_Type); | |
patch_64(data + 0x10, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x18, (uintptr_t)&_PySet_Contains); | |
patch_64(data + 0x20, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x28, instruction->oparg); | |
patch_64(data + 0x30, (uintptr_t)&_Py_FalseStruct); | |
patch_64(data + 0x38, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x40, (uintptr_t)&_Py_TrueStruct); | |
patch_64(data + 0x48, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x13, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1c, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x29, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x39, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x5f, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0x79, (uintptr_t)data + 0x24); | |
patch_x86_64_32rx(code + 0x84, (uintptr_t)data + 0x2c); | |
patch_x86_64_32rx(code + 0x97, (uintptr_t)data + 0x34); | |
patch_x86_64_32rx(code + 0x9e, (uintptr_t)data + 0x3c); | |
patch_x86_64_32rx(code + 0xb1, (uintptr_t)data + 0x34); | |
patch_x86_64_32rx(code + 0xba, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0xc9, (uintptr_t)data + 0x44); | |
} | |
void | |
emit__CONVERT_VALUE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CONVERT_VALUE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// 8: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// f: 48 8b 15 00 00 00 00 movq (%rip), %rdx # 0x16 <_JIT_ENTRY+0x16> | |
// 0000000000000012: IMAGE_REL_AMD64_REL32 __imp__PyEval_ConversionFuncs | |
// 16: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 1a: 48 89 f1 movq %rsi, %rcx | |
// 1d: ff 14 c2 callq *(%rdx,%rax,8) | |
// 20: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 24: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 2c: 48 8b 0e movq (%rsi), %rcx | |
// 2f: 85 c9 testl %ecx, %ecx | |
// 31: 78 08 js 0x3b <_JIT_ENTRY+0x3b> | |
// 33: 48 ff c9 decq %rcx | |
// 36: 48 89 0e movq %rcx, (%rsi) | |
// 39: 74 14 je 0x4f <_JIT_ENTRY+0x4f> | |
// 3b: 48 85 c0 testq %rax, %rax | |
// 3e: 74 23 je 0x63 <_JIT_ENTRY+0x63> | |
// 40: 48 89 45 f8 movq %rax, -0x8(%rbp) | |
// 44: 48 83 c4 28 addq $0x28, %rsp | |
// 48: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x4f <_JIT_ENTRY+0x4f> | |
// 000000000000004b: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 4f: 48 89 f1 movq %rsi, %rcx | |
// 52: 48 89 c6 movq %rax, %rsi | |
// 55: ff 15 00 00 00 00 callq *(%rip) # 0x5b <_JIT_ENTRY+0x5b> | |
// 0000000000000057: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 5b: 48 89 f0 movq %rsi, %rax | |
// 5e: 48 85 c0 testq %rax, %rax | |
// 61: 75 dd jne 0x40 <_JIT_ENTRY+0x40> | |
// 63: 48 83 c4 28 addq $0x28, %rsp | |
// 67: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x6e <_JIT_ENTRY+0x6e> | |
// 000000000000006a: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 6e: | |
const unsigned char code_body[110] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x75, 0xf8, | |
0x0f, 0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x15, 0x00, 0x00, 0x00, 0x00, 0x49, 0x89, | |
0x6d, 0x40, 0x48, 0x89, 0xf1, 0xff, 0x14, 0xc2, | |
0x49, 0x8b, 0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x0e, 0x85, | |
0xc9, 0x78, 0x08, 0x48, 0xff, 0xc9, 0x48, 0x89, | |
0x0e, 0x74, 0x14, 0x48, 0x85, 0xc0, 0x74, 0x23, | |
0x48, 0x89, 0x45, 0xf8, 0x48, 0x83, 0xc4, 0x28, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x89, 0xf1, 0x48, 0x89, 0xc6, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x89, 0xf0, 0x48, 0x85, | |
0xc0, 0x75, 0xdd, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &_PyEval_ConversionFuncs+0x0 | |
// 10: CONTINUE | |
// 18: &_Py_Dealloc+0x0 | |
// 20: ERROR_TARGET | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&_PyEval_ConversionFuncs); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x20, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x12, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x4b, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x57, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x6a, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__COPY( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_COPY.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 7: c1 e0 03 shll $0x3, %eax | |
// a: 48 89 e9 movq %rbp, %rcx | |
// d: 48 29 c1 subq %rax, %rcx | |
// 10: 48 8b 01 movq (%rcx), %rax | |
// 13: 8b 08 movl (%rax), %ecx | |
// 15: ff c1 incl %ecx | |
// 17: 74 02 je 0x1b <_JIT_ENTRY+0x1b> | |
// 19: 89 08 movl %ecx, (%rax) | |
// 1b: 48 89 45 00 movq %rax, (%rbp) | |
// 1f: 48 83 c5 08 addq $0x8, %rbp | |
// 23: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x2a <_JIT_ENTRY+0x2a> | |
// 0000000000000026: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 23: | |
const unsigned char code_body[35] = { | |
0x0f, 0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0xc1, | |
0xe0, 0x03, 0x48, 0x89, 0xe9, 0x48, 0x29, 0xc1, | |
0x48, 0x8b, 0x01, 0x8b, 0x08, 0xff, 0xc1, 0x74, | |
0x02, 0x89, 0x08, 0x48, 0x89, 0x45, 0x00, 0x48, | |
0x83, 0xc5, 0x08, | |
}; | |
// 0: | |
// 0: OPARG | |
const unsigned char data_body[8] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
} | |
void | |
emit__COPY_FREE_VARS( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_COPY_FREE_VARS.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 7: 66 85 c0 testw %ax, %ax | |
// a: 74 45 je 0x51 <_JIT_ENTRY+0x51> | |
// c: 49 8b 45 10 movq 0x10(%r13), %rax | |
// 10: 48 8b 48 48 movq 0x48(%rax), %rcx | |
// 14: 49 8b 45 00 movq (%r13), %rax | |
// 18: 8b 40 48 movl 0x48(%rax), %eax | |
// 1b: 48 8b 35 00 00 00 00 movq (%rip), %rsi # 0x22 <_JIT_ENTRY+0x22> | |
// 000000000000001e: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 22: 0f b7 d6 movzwl %si, %edx | |
// 25: 29 d0 subl %edx, %eax | |
// 27: 48 98 cltq | |
// 29: 83 fa 01 cmpl $0x1, %edx | |
// 2c: 83 d2 00 adcl $0x0, %edx | |
// 2f: 66 83 fe 02 cmpw $0x2, %si | |
// 33: 73 23 jae 0x58 <_JIT_ENTRY+0x58> | |
// 35: 31 f6 xorl %esi, %esi | |
// 37: f6 c2 01 testb $0x1, %dl | |
// 3a: 74 15 je 0x51 <_JIT_ENTRY+0x51> | |
// 3c: 48 8b 4c f1 18 movq 0x18(%rcx,%rsi,8), %rcx | |
// 41: 48 01 f0 addq %rsi, %rax | |
// 44: 8b 11 movl (%rcx), %edx | |
// 46: ff c2 incl %edx | |
// 48: 74 02 je 0x4c <_JIT_ENTRY+0x4c> | |
// 4a: 89 11 movl %edx, (%rcx) | |
// 4c: 49 89 4c c5 50 movq %rcx, 0x50(%r13,%rax,8) | |
// 51: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x58 <_JIT_ENTRY+0x58> | |
// 0000000000000054: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 58: 89 d6 movl %edx, %esi | |
// 5a: 81 e6 fe ff 00 00 andl $0xfffe, %esi # imm = 0xFFFE | |
// 60: 48 8d 3c c5 58 00 00 00 leaq 0x58(,%rax,8), %rdi | |
// 68: 4c 01 ef addq %r13, %rdi | |
// 6b: 45 31 c0 xorl %r8d, %r8d | |
// 6e: eb 0d jmp 0x7d <_JIT_ENTRY+0x7d> | |
// 70: 4e 89 0c c7 movq %r9, (%rdi,%r8,8) | |
// 74: 49 83 c0 02 addq $0x2, %r8 | |
// 78: 4c 39 c6 cmpq %r8, %rsi | |
// 7b: 74 ba je 0x37 <_JIT_ENTRY+0x37> | |
// 7d: 4e 8b 4c c1 18 movq 0x18(%rcx,%r8,8), %r9 | |
// 82: 41 8b 19 movl (%r9), %ebx | |
// 85: ff c3 incl %ebx | |
// 87: 74 03 je 0x8c <_JIT_ENTRY+0x8c> | |
// 89: 41 89 19 movl %ebx, (%r9) | |
// 8c: 4e 89 4c c7 f8 movq %r9, -0x8(%rdi,%r8,8) | |
// 91: 4e 8b 4c c1 20 movq 0x20(%rcx,%r8,8), %r9 | |
// 96: 41 8b 19 movl (%r9), %ebx | |
// 99: ff c3 incl %ebx | |
// 9b: 74 d3 je 0x70 <_JIT_ENTRY+0x70> | |
// 9d: 41 89 19 movl %ebx, (%r9) | |
// a0: eb ce jmp 0x70 <_JIT_ENTRY+0x70> | |
// a2: | |
const unsigned char code_body[162] = { | |
0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x66, | |
0x85, 0xc0, 0x74, 0x45, 0x49, 0x8b, 0x45, 0x10, | |
0x48, 0x8b, 0x48, 0x48, 0x49, 0x8b, 0x45, 0x00, | |
0x8b, 0x40, 0x48, 0x48, 0x8b, 0x35, 0x00, 0x00, | |
0x00, 0x00, 0x0f, 0xb7, 0xd6, 0x29, 0xd0, 0x48, | |
0x98, 0x83, 0xfa, 0x01, 0x83, 0xd2, 0x00, 0x66, | |
0x83, 0xfe, 0x02, 0x73, 0x23, 0x31, 0xf6, 0xf6, | |
0xc2, 0x01, 0x74, 0x15, 0x48, 0x8b, 0x4c, 0xf1, | |
0x18, 0x48, 0x01, 0xf0, 0x8b, 0x11, 0xff, 0xc2, | |
0x74, 0x02, 0x89, 0x11, 0x49, 0x89, 0x4c, 0xc5, | |
0x50, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x89, 0xd6, 0x81, 0xe6, 0xfe, 0xff, 0x00, 0x00, | |
0x48, 0x8d, 0x3c, 0xc5, 0x58, 0x00, 0x00, 0x00, | |
0x4c, 0x01, 0xef, 0x45, 0x31, 0xc0, 0xeb, 0x0d, | |
0x4e, 0x89, 0x0c, 0xc7, 0x49, 0x83, 0xc0, 0x02, | |
0x4c, 0x39, 0xc6, 0x74, 0xba, 0x4e, 0x8b, 0x4c, | |
0xc1, 0x18, 0x41, 0x8b, 0x19, 0xff, 0xc3, 0x74, | |
0x03, 0x41, 0x89, 0x19, 0x4e, 0x89, 0x4c, 0xc7, | |
0xf8, 0x4e, 0x8b, 0x4c, 0xc1, 0x20, 0x41, 0x8b, | |
0x19, 0xff, 0xc3, 0x74, 0xd3, 0x41, 0x89, 0x19, | |
0xeb, 0xce, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: CONTINUE | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1e, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x54, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__CREATE_INIT_FRAME( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_CREATE_INIT_FRAME.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 38 subq $0x38, %rsp | |
// 4: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: 8d 0c c5 00 00 00 00 leal (,%rax,8), %ecx | |
// 12: 49 89 e9 movq %rbp, %r9 | |
// 15: 49 29 c9 subq %rcx, %r9 | |
// 18: 89 c1 movl %eax, %ecx | |
// 1a: f7 d1 notl %ecx | |
// 1c: 48 63 f9 movslq %ecx, %rdi | |
// 1f: b9 fe ff ff ff movl $0xfffffffe, %ecx # imm = 0xFFFFFFFE | |
// 24: 29 c1 subl %eax, %ecx | |
// 26: 48 63 d9 movslq %ecx, %rbx | |
// 29: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 2d: 49 8b b4 24 e8 00 00 00 movq 0xe8(%r12), %rsi | |
// 35: 48 8b 0d 00 00 00 00 movq (%rip), %rcx # 0x3c <_JIT_ENTRY+0x3c> | |
// 0000000000000038: IMAGE_REL_AMD64_REL32 __imp__Py_InitCleanup | |
// 3c: 48 63 51 4c movslq 0x4c(%rcx), %rdx | |
// 40: 48 8d 14 d6 leaq (%rsi,%rdx,8), %rdx | |
// 44: 49 89 94 24 e8 00 00 00 movq %rdx, 0xe8(%r12) | |
// 4c: 4c 89 6e 08 movq %r13, 0x8(%rsi) | |
// 50: 48 8b 15 00 00 00 00 movq (%rip), %rdx # 0x57 <_JIT_ENTRY+0x57> | |
// 0000000000000053: IMAGE_REL_AMD64_REL32 __imp__Py_NoneStruct | |
// 57: 48 89 56 10 movq %rdx, 0x10(%rsi) | |
// 5b: 48 89 0e movq %rcx, (%rsi) | |
// 5e: 0f 57 c0 xorps %xmm0, %xmm0 | |
// 61: 0f 11 46 28 movups %xmm0, 0x28(%rsi) | |
// 65: 48 63 51 48 movslq 0x48(%rcx), %rdx | |
// 69: 48 8d 14 d6 leaq (%rsi,%rdx,8), %rdx | |
// 6d: 48 83 c2 58 addq $0x58, %rdx | |
// 71: 48 89 56 40 movq %rdx, 0x40(%rsi) | |
// 75: 48 81 c1 c8 00 00 00 addq $0xc8, %rcx | |
// 7c: 48 89 4e 38 movq %rcx, 0x38(%rsi) | |
// 80: c6 46 4a 00 movb $0x0, 0x4a(%rsi) | |
// 84: 66 c7 46 48 00 00 movw $0x0, 0x48(%rsi) | |
// 8a: 49 8b 4d 40 movq 0x40(%r13), %rcx | |
// 8e: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 96: 48 8b 54 fd 00 movq (%rbp,%rdi,8), %rdx | |
// 9b: 44 8b 02 movl (%rdx), %r8d | |
// 9e: 41 ff c0 incl %r8d | |
// a1: 74 03 je 0xa6 <_JIT_ENTRY+0xa6> | |
// a3: 44 89 02 movl %r8d, (%rdx) | |
// a6: 48 89 56 50 movq %rdx, 0x50(%rsi) | |
// aa: 49 89 4d 40 movq %rcx, 0x40(%r13) | |
// ae: ff c0 incl %eax | |
// b0: 49 83 c1 f8 addq $-0x8, %r9 | |
// b4: 48 8b 54 dd 00 movq (%rbp,%rbx,8), %rdx | |
// b9: 48 89 74 24 30 movq %rsi, 0x30(%rsp) | |
// be: 48 89 44 24 20 movq %rax, 0x20(%rsp) | |
// c3: 48 c7 44 24 28 00 00 00 00 movq $0x0, 0x28(%rsp) | |
// cc: 4c 89 e1 movq %r12, %rcx | |
// cf: 45 31 c0 xorl %r8d, %r8d | |
// d2: ff 15 00 00 00 00 callq *(%rip) # 0xd8 <_JIT_ENTRY+0xd8> | |
// 00000000000000d4: IMAGE_REL_AMD64_REL32 __imp__PyEvalFramePushAndInit | |
// d8: 49 8b 4d 40 movq 0x40(%r13), %rcx | |
// dc: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// e4: 48 89 04 d9 movq %rax, (%rcx,%rbx,8) | |
// e8: 48 8d 2c f9 leaq (%rcx,%rdi,8), %rbp | |
// ec: 48 85 c0 testq %rax, %rax | |
// ef: 74 17 je 0x108 <_JIT_ENTRY+0x108> | |
// f1: 66 41 c7 45 48 04 00 movw $0x4, 0x48(%r13) | |
// f8: 41 ff 4c 24 2c decl 0x2c(%r12) | |
// fd: 48 83 c4 38 addq $0x38, %rsp | |
// 101: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x108 <_JIT_ENTRY+0x108> | |
// 0000000000000104: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 108: 4c 89 e1 movq %r12, %rcx | |
// 10b: 48 89 f2 movq %rsi, %rdx | |
// 10e: ff 15 00 00 00 00 callq *(%rip) # 0x114 <_JIT_ENTRY+0x114> | |
// 0000000000000110: IMAGE_REL_AMD64_REL32 __imp__PyEval_FrameClearAndPop | |
// 114: 48 83 c4 38 addq $0x38, %rsp | |
// 118: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x11f <_JIT_ENTRY+0x11f> | |
// 000000000000011b: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 11f: | |
const unsigned char code_body[287] = { | |
0x48, 0x83, 0xec, 0x38, 0x0f, 0xb7, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x8d, 0x0c, 0xc5, 0x00, 0x00, | |
0x00, 0x00, 0x49, 0x89, 0xe9, 0x49, 0x29, 0xc9, | |
0x89, 0xc1, 0xf7, 0xd1, 0x48, 0x63, 0xf9, 0xb9, | |
0xfe, 0xff, 0xff, 0xff, 0x29, 0xc1, 0x48, 0x63, | |
0xd9, 0x49, 0x89, 0x6d, 0x40, 0x49, 0x8b, 0xb4, | |
0x24, 0xe8, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x0d, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x63, 0x51, 0x4c, | |
0x48, 0x8d, 0x14, 0xd6, 0x49, 0x89, 0x94, 0x24, | |
0xe8, 0x00, 0x00, 0x00, 0x4c, 0x89, 0x6e, 0x08, | |
0x48, 0x8b, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x89, 0x56, 0x10, 0x48, 0x89, 0x0e, 0x0f, 0x57, | |
0xc0, 0x0f, 0x11, 0x46, 0x28, 0x48, 0x63, 0x51, | |
0x48, 0x48, 0x8d, 0x14, 0xd6, 0x48, 0x83, 0xc2, | |
0x58, 0x48, 0x89, 0x56, 0x40, 0x48, 0x81, 0xc1, | |
0xc8, 0x00, 0x00, 0x00, 0x48, 0x89, 0x4e, 0x38, | |
0xc6, 0x46, 0x4a, 0x00, 0x66, 0xc7, 0x46, 0x48, | |
0x00, 0x00, 0x49, 0x8b, 0x4d, 0x40, 0x49, 0xc7, | |
0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, | |
0x54, 0xfd, 0x00, 0x44, 0x8b, 0x02, 0x41, 0xff, | |
0xc0, 0x74, 0x03, 0x44, 0x89, 0x02, 0x48, 0x89, | |
0x56, 0x50, 0x49, 0x89, 0x4d, 0x40, 0xff, 0xc0, | |
0x49, 0x83, 0xc1, 0xf8, 0x48, 0x8b, 0x54, 0xdd, | |
0x00, 0x48, 0x89, 0x74, 0x24, 0x30, 0x48, 0x89, | |
0x44, 0x24, 0x20, 0x48, 0xc7, 0x44, 0x24, 0x28, | |
0x00, 0x00, 0x00, 0x00, 0x4c, 0x89, 0xe1, 0x45, | |
0x31, 0xc0, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x49, 0x8b, 0x4d, 0x40, 0x49, 0xc7, 0x45, 0x40, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0x04, 0xd9, | |
0x48, 0x8d, 0x2c, 0xf9, 0x48, 0x85, 0xc0, 0x74, | |
0x17, 0x66, 0x41, 0xc7, 0x45, 0x48, 0x04, 0x00, | |
0x41, 0xff, 0x4c, 0x24, 0x2c, 0x48, 0x83, 0xc4, | |
0x38, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x4c, 0x89, 0xe1, 0x48, 0x89, 0xf2, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, 0x38, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &_Py_InitCleanup+0x0 | |
// 10: &_Py_NoneStruct+0x0 | |
// 18: &_PyEvalFramePushAndInit+0x0 | |
// 20: CONTINUE | |
// 28: &_PyEval_FrameClearAndPop+0x0 | |
// 30: ERROR_TARGET | |
const unsigned char data_body[56] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&_Py_InitCleanup); | |
patch_64(data + 0x10, (uintptr_t)&_Py_NoneStruct); | |
patch_64(data + 0x18, (uintptr_t)&_PyEvalFramePushAndInit); | |
patch_64(data + 0x20, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x28, (uintptr_t)&_PyEval_FrameClearAndPop); | |
patch_64(data + 0x30, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x38, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x53, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xd4, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x104, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0x110, (uintptr_t)data + 0x24); | |
patch_x86_64_32rx(code + 0x11b, (uintptr_t)data + 0x2c); | |
} | |
void | |
emit__DELETE_ATTR( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_DELETE_ATTR.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// 8: 49 8b 45 00 movq (%r13), %rax | |
// c: 48 8b 40 20 movq 0x20(%rax), %rax | |
// 10: 0f b7 0d 00 00 00 00 movzwl (%rip), %ecx # 0x17 <_JIT_ENTRY+0x17> | |
// 0000000000000013: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 17: 48 8b 54 c8 18 movq 0x18(%rax,%rcx,8), %rdx | |
// 1c: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 20: 48 89 f1 movq %rsi, %rcx | |
// 23: ff 15 00 00 00 00 callq *(%rip) # 0x29 <_JIT_ENTRY+0x29> | |
// 0000000000000025: IMAGE_REL_AMD64_REL32 __imp_PyObject_DelAttr | |
// 29: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 2d: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 35: 48 8b 0e movq (%rsi), %rcx | |
// 38: 85 c9 testl %ecx, %ecx | |
// 3a: 78 08 js 0x44 <_JIT_ENTRY+0x44> | |
// 3c: 48 ff c9 decq %rcx | |
// 3f: 48 89 0e movq %rcx, (%rsi) | |
// 42: 74 0f je 0x53 <_JIT_ENTRY+0x53> | |
// 44: 85 c0 testl %eax, %eax | |
// 46: 74 1c je 0x64 <_JIT_ENTRY+0x64> | |
// 48: 48 83 c4 28 addq $0x28, %rsp | |
// 4c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x53 <_JIT_ENTRY+0x53> | |
// 000000000000004f: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 53: 48 89 f1 movq %rsi, %rcx | |
// 56: 89 c6 movl %eax, %esi | |
// 58: ff 15 00 00 00 00 callq *(%rip) # 0x5e <_JIT_ENTRY+0x5e> | |
// 000000000000005a: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 5e: 89 f0 movl %esi, %eax | |
// 60: 85 c0 testl %eax, %eax | |
// 62: 75 e4 jne 0x48 <_JIT_ENTRY+0x48> | |
// 64: 48 83 c5 f8 addq $-0x8, %rbp | |
// 68: 48 83 c4 28 addq $0x28, %rsp | |
// 6c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x73 <_JIT_ENTRY+0x73> | |
// 000000000000006f: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 6c: | |
const unsigned char code_body[108] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x75, 0xf8, | |
0x49, 0x8b, 0x45, 0x00, 0x48, 0x8b, 0x40, 0x20, | |
0x0f, 0xb7, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x54, 0xc8, 0x18, 0x49, 0x89, 0x6d, 0x40, | |
0x48, 0x89, 0xf1, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, 0xc7, 0x45, | |
0x40, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x0e, | |
0x85, 0xc9, 0x78, 0x08, 0x48, 0xff, 0xc9, 0x48, | |
0x89, 0x0e, 0x74, 0x0f, 0x85, 0xc0, 0x74, 0x1c, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x89, 0xf1, 0x89, 0xc6, | |
0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x89, 0xf0, | |
0x85, 0xc0, 0x75, 0xe4, 0x48, 0x83, 0xc5, 0xf8, | |
0x48, 0x83, 0xc4, 0x28, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &PyObject_DelAttr+0x0 | |
// 10: ERROR_TARGET | |
// 18: &_Py_Dealloc+0x0 | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&PyObject_DelAttr); | |
patch_64(data + 0x10, state->instruction_starts[instruction->error_target]); | |
patch_64(data + 0x18, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x13, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x25, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x4f, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x5a, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__DELETE_DEREF( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_DELETE_DEREF.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: 49 8b 44 c5 50 movq 0x50(%r13,%rax,8), %rax | |
// 10: 48 8b 48 10 movq 0x10(%rax), %rcx | |
// 14: 48 c7 40 10 00 00 00 00 movq $0x0, 0x10(%rax) | |
// 1c: 48 85 c9 testq %rcx, %rcx | |
// 1f: 74 1a je 0x3b <_JIT_ENTRY+0x3b> | |
// 21: 48 8b 01 movq (%rcx), %rax | |
// 24: 85 c0 testl %eax, %eax | |
// 26: 78 08 js 0x30 <_JIT_ENTRY+0x30> | |
// 28: 48 ff c8 decq %rax | |
// 2b: 48 89 01 movq %rax, (%rcx) | |
// 2e: 74 3b je 0x6b <_JIT_ENTRY+0x6b> | |
// 30: 48 83 c4 28 addq $0x28, %rsp | |
// 34: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x3b <_JIT_ENTRY+0x3b> | |
// 0000000000000037: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 3b: 44 0f b7 05 00 00 00 00 movzwl (%rip), %r8d # 0x43 <_JIT_ENTRY+0x43> | |
// 000000000000003f: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 43: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 47: 49 8b 55 00 movq (%r13), %rdx | |
// 4b: 4c 89 e1 movq %r12, %rcx | |
// 4e: ff 15 00 00 00 00 callq *(%rip) # 0x54 <_JIT_ENTRY+0x54> | |
// 0000000000000050: IMAGE_REL_AMD64_REL32 __imp__PyEval_FormatExcUnbound | |
// 54: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 58: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 60: 48 83 c4 28 addq $0x28, %rsp | |
// 64: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x6b <_JIT_ENTRY+0x6b> | |
// 0000000000000067: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 6b: ff 15 00 00 00 00 callq *(%rip) # 0x71 <_JIT_ENTRY+0x71> | |
// 000000000000006d: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 71: 48 83 c4 28 addq $0x28, %rsp | |
// 75: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x7c <_JIT_ENTRY+0x7c> | |
// 0000000000000078: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 75: | |
const unsigned char code_body[117] = { | |
0x48, 0x83, 0xec, 0x28, 0x0f, 0xb7, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x49, 0x8b, 0x44, 0xc5, 0x50, | |
0x48, 0x8b, 0x48, 0x10, 0x48, 0xc7, 0x40, 0x10, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x85, 0xc9, 0x74, | |
0x1a, 0x48, 0x8b, 0x01, 0x85, 0xc0, 0x78, 0x08, | |
0x48, 0xff, 0xc8, 0x48, 0x89, 0x01, 0x74, 0x3b, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x44, 0x0f, 0xb7, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x49, 0x89, 0x6d, 0x40, 0x49, | |
0x8b, 0x55, 0x00, 0x4c, 0x89, 0xe1, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, | |
0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x83, 0xc4, 0x28, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: CONTINUE | |
// 10: &_PyEval_FormatExcUnbound+0x0 | |
// 18: ERROR_TARGET | |
// 20: &_Py_Dealloc+0x0 | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, (uintptr_t)&_PyEval_FormatExcUnbound); | |
patch_64(data + 0x18, state->instruction_starts[instruction->error_target]); | |
patch_64(data + 0x20, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x37, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x3f, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x50, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x67, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x6d, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__DELETE_FAST( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_DELETE_FAST.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: 0f b7 d0 movzwl %ax, %edx | |
// e: 0f b7 c0 movzwl %ax, %eax | |
// 11: 49 8b 4c c5 50 movq 0x50(%r13,%rax,8), %rcx | |
// 16: 48 85 c9 testq %rcx, %rcx | |
// 19: 74 23 je 0x3e <_JIT_ENTRY+0x3e> | |
// 1b: 49 c7 44 d5 50 00 00 00 00 movq $0x0, 0x50(%r13,%rdx,8) | |
// 24: 48 8b 01 movq (%rcx), %rax | |
// 27: 85 c0 testl %eax, %eax | |
// 29: 78 08 js 0x33 <_JIT_ENTRY+0x33> | |
// 2b: 48 ff c8 decq %rax | |
// 2e: 48 89 01 movq %rax, (%rcx) | |
// 31: 74 51 je 0x84 <_JIT_ENTRY+0x84> | |
// 33: 48 83 c4 28 addq $0x28, %rsp | |
// 37: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x3e <_JIT_ENTRY+0x3e> | |
// 000000000000003a: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 3e: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 42: 49 8b 45 00 movq (%r13), %rax | |
// 46: 48 8b 48 60 movq 0x60(%rax), %rcx | |
// 4a: ff 15 00 00 00 00 callq *(%rip) # 0x50 <_JIT_ENTRY+0x50> | |
// 000000000000004c: IMAGE_REL_AMD64_REL32 __imp_PyTuple_GetItem | |
// 50: 48 8b 0d 00 00 00 00 movq (%rip), %rcx # 0x57 <_JIT_ENTRY+0x57> | |
// 0000000000000053: IMAGE_REL_AMD64_REL32 __imp_PyExc_UnboundLocalError | |
// 57: 48 8b 11 movq (%rcx), %rdx | |
// 5a: 4c 8d 05 00 00 00 00 leaq (%rip), %r8 # 0x61 <_JIT_ENTRY+0x61> | |
// 000000000000005d: IMAGE_REL_AMD64_REL32 ??_C@_0EK@CHGBBAMA@cannot?5access?5local?5variable?5?8?$CFs@ | |
// 61: 4c 89 e1 movq %r12, %rcx | |
// 64: 49 89 c1 movq %rax, %r9 | |
// 67: ff 15 00 00 00 00 callq *(%rip) # 0x6d <_JIT_ENTRY+0x6d> | |
// 0000000000000069: IMAGE_REL_AMD64_REL32 __imp__PyEval_FormatExcCheckArg | |
// 6d: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 71: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 79: 48 83 c4 28 addq $0x28, %rsp | |
// 7d: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x84 <_JIT_ENTRY+0x84> | |
// 0000000000000080: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 84: ff 15 00 00 00 00 callq *(%rip) # 0x8a <_JIT_ENTRY+0x8a> | |
// 0000000000000086: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 8a: 48 83 c4 28 addq $0x28, %rsp | |
// 8e: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x95 <_JIT_ENTRY+0x95> | |
// 0000000000000091: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 8e: | |
const unsigned char code_body[142] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x0f, 0xb7, 0xd0, 0x0f, 0xb7, | |
0xc0, 0x49, 0x8b, 0x4c, 0xc5, 0x50, 0x48, 0x85, | |
0xc9, 0x74, 0x23, 0x49, 0xc7, 0x44, 0xd5, 0x50, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x01, 0x85, | |
0xc0, 0x78, 0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, | |
0x01, 0x74, 0x51, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x49, 0x89, | |
0x6d, 0x40, 0x49, 0x8b, 0x45, 0x00, 0x48, 0x8b, | |
0x48, 0x60, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8b, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x11, 0x4c, 0x8d, 0x05, 0x00, 0x00, 0x00, | |
0x00, 0x4c, 0x89, 0xe1, 0x49, 0x89, 0xc1, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, | |
0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x83, 0xc4, 0x28, | |
}; | |
// 0: "cannot access local variable '%s' where it is not associated with a value\x00" | |
// 4a: 00 00 00 00 00 00 | |
// 50: OPARG | |
// 58: CONTINUE | |
// 60: &PyTuple_GetItem+0x0 | |
// 68: &PyExc_UnboundLocalError+0x0 | |
// 70: &_PyEval_FormatExcCheckArg+0x0 | |
// 78: ERROR_TARGET | |
// 80: &_Py_Dealloc+0x0 | |
const unsigned char data_body[136] = { | |
0x63, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x20, 0x61, | |
0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x6c, 0x6f, | |
0x63, 0x61, 0x6c, 0x20, 0x76, 0x61, 0x72, 0x69, | |
0x61, 0x62, 0x6c, 0x65, 0x20, 0x27, 0x25, 0x73, | |
0x27, 0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x20, | |
0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, | |
0x74, 0x20, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, | |
0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, | |
0x68, 0x20, 0x61, 0x20, 0x76, 0x61, 0x6c, 0x75, | |
0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x50, instruction->oparg); | |
patch_64(data + 0x58, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x60, (uintptr_t)&PyTuple_GetItem); | |
patch_64(data + 0x68, (uintptr_t)&PyExc_UnboundLocalError); | |
patch_64(data + 0x70, (uintptr_t)&_PyEval_FormatExcCheckArg); | |
patch_64(data + 0x78, state->instruction_starts[instruction->error_target]); | |
patch_64(data + 0x80, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + 0x4c); | |
patch_x86_64_32rx(code + 0x3a, (uintptr_t)data + 0x54); | |
patch_x86_64_32rx(code + 0x4c, (uintptr_t)data + 0x5c); | |
patch_x86_64_32rx(code + 0x53, (uintptr_t)data + 0x64); | |
patch_x86_64_32rx(code + 0x5d, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x69, (uintptr_t)data + 0x6c); | |
patch_x86_64_32rx(code + 0x80, (uintptr_t)data + 0x74); | |
patch_x86_64_32rx(code + 0x86, (uintptr_t)data + 0x7c); | |
} | |
void | |
emit__DELETE_GLOBAL( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_DELETE_GLOBAL.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 49 8b 45 00 movq (%r13), %rax | |
// 8: 49 8b 4d 18 movq 0x18(%r13), %rcx | |
// c: 48 8b 40 20 movq 0x20(%rax), %rax | |
// 10: 0f b7 15 00 00 00 00 movzwl (%rip), %edx # 0x17 <_JIT_ENTRY+0x17> | |
// 0000000000000013: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 17: 48 8b 74 d0 18 movq 0x18(%rax,%rdx,8), %rsi | |
// 1c: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 20: 48 89 f2 movq %rsi, %rdx | |
// 23: 45 31 c0 xorl %r8d, %r8d | |
// 26: ff 15 00 00 00 00 callq *(%rip) # 0x2c <_JIT_ENTRY+0x2c> | |
// 0000000000000028: IMAGE_REL_AMD64_REL32 __imp_PyDict_Pop | |
// 2c: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 30: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 38: 85 c0 testl %eax, %eax | |
// 3a: 78 0d js 0x49 <_JIT_ENTRY+0x49> | |
// 3c: 74 16 je 0x54 <_JIT_ENTRY+0x54> | |
// 3e: 48 83 c4 28 addq $0x28, %rsp | |
// 42: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x49 <_JIT_ENTRY+0x49> | |
// 0000000000000045: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 49: 48 83 c4 28 addq $0x28, %rsp | |
// 4d: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x54 <_JIT_ENTRY+0x54> | |
// 0000000000000050: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 54: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 58: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x5f <_JIT_ENTRY+0x5f> | |
// 000000000000005b: IMAGE_REL_AMD64_REL32 __imp_PyExc_NameError | |
// 5f: 48 8b 10 movq (%rax), %rdx | |
// 62: 4c 8d 05 00 00 00 00 leaq (%rip), %r8 # 0x69 <_JIT_ENTRY+0x69> | |
// 0000000000000065: IMAGE_REL_AMD64_REL32 ??_C@_0BN@DBLGJMNF@name?5?8?$CF?4200s?8?5is?5not?5defined?$AA@ | |
// 69: 4c 89 e1 movq %r12, %rcx | |
// 6c: 49 89 f1 movq %rsi, %r9 | |
// 6f: ff 15 00 00 00 00 callq *(%rip) # 0x75 <_JIT_ENTRY+0x75> | |
// 0000000000000071: IMAGE_REL_AMD64_REL32 __imp__PyEval_FormatExcCheckArg | |
// 75: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 79: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 81: 48 83 c4 28 addq $0x28, %rsp | |
// 85: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x8c <_JIT_ENTRY+0x8c> | |
// 0000000000000088: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 8c: | |
const unsigned char code_body[140] = { | |
0x48, 0x83, 0xec, 0x28, 0x49, 0x8b, 0x45, 0x00, | |
0x49, 0x8b, 0x4d, 0x18, 0x48, 0x8b, 0x40, 0x20, | |
0x0f, 0xb7, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x74, 0xd0, 0x18, 0x49, 0x89, 0x6d, 0x40, | |
0x48, 0x89, 0xf2, 0x45, 0x31, 0xc0, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, | |
0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, | |
0x85, 0xc0, 0x78, 0x0d, 0x74, 0x16, 0x48, 0x83, | |
0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x49, 0x89, 0x6d, 0x40, | |
0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x10, 0x4c, 0x8d, 0x05, 0x00, 0x00, 0x00, | |
0x00, 0x4c, 0x89, 0xe1, 0x49, 0x89, 0xf1, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, | |
0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: "name '%.200s' is not defined\x00" | |
// 1d: 00 00 00 | |
// 20: OPARG | |
// 28: &PyDict_Pop+0x0 | |
// 30: CONTINUE | |
// 38: ERROR_TARGET | |
// 40: &PyExc_NameError+0x0 | |
// 48: &_PyEval_FormatExcCheckArg+0x0 | |
const unsigned char data_body[80] = { | |
0x6e, 0x61, 0x6d, 0x65, 0x20, 0x27, 0x25, 0x2e, | |
0x32, 0x30, 0x30, 0x73, 0x27, 0x20, 0x69, 0x73, | |
0x20, 0x6e, 0x6f, 0x74, 0x20, 0x64, 0x65, 0x66, | |
0x69, 0x6e, 0x65, 0x64, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x20, instruction->oparg); | |
patch_64(data + 0x28, (uintptr_t)&PyDict_Pop); | |
patch_64(data + 0x30, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x38, state->instruction_starts[instruction->error_target]); | |
patch_64(data + 0x40, (uintptr_t)&PyExc_NameError); | |
patch_64(data + 0x48, (uintptr_t)&_PyEval_FormatExcCheckArg); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x13, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0x28, (uintptr_t)data + 0x24); | |
patch_x86_64_32rx(code + 0x45, (uintptr_t)data + 0x2c); | |
patch_x86_64_32rx(code + 0x50, (uintptr_t)data + 0x34); | |
patch_x86_64_32rx(code + 0x5b, (uintptr_t)data + 0x3c); | |
patch_x86_64_32rx(code + 0x65, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x71, (uintptr_t)data + 0x44); | |
patch_x86_64_32rx(code + 0x88, (uintptr_t)data + 0x34); | |
} | |
void | |
emit__DELETE_NAME( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_DELETE_NAME.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 49 8b 45 00 movq (%r13), %rax | |
// 8: 49 8b 4d 28 movq 0x28(%r13), %rcx | |
// c: 48 8b 40 20 movq 0x20(%rax), %rax | |
// 10: 0f b7 15 00 00 00 00 movzwl (%rip), %edx # 0x17 <_JIT_ENTRY+0x17> | |
// 0000000000000013: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 17: 48 8b 74 d0 18 movq 0x18(%rax,%rdx,8), %rsi | |
// 1c: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 20: 48 85 c9 testq %rcx, %rcx | |
// 23: 74 51 je 0x76 <_JIT_ENTRY+0x76> | |
// 25: 48 89 f2 movq %rsi, %rdx | |
// 28: ff 15 00 00 00 00 callq *(%rip) # 0x2e <_JIT_ENTRY+0x2e> | |
// 000000000000002a: IMAGE_REL_AMD64_REL32 __imp_PyObject_DelItem | |
// 2e: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 32: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 3a: 85 c0 testl %eax, %eax | |
// 3c: 74 6c je 0xaa <_JIT_ENTRY+0xaa> | |
// 3e: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 42: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x49 <_JIT_ENTRY+0x49> | |
// 0000000000000045: IMAGE_REL_AMD64_REL32 __imp_PyExc_NameError | |
// 49: 48 8b 10 movq (%rax), %rdx | |
// 4c: 4c 8d 05 00 00 00 00 leaq (%rip), %r8 # 0x53 <_JIT_ENTRY+0x53> | |
// 000000000000004f: IMAGE_REL_AMD64_REL32 ??_C@_0BN@DBLGJMNF@name?5?8?$CF?4200s?8?5is?5not?5defined?$AA@ | |
// 53: 4c 89 e1 movq %r12, %rcx | |
// 56: 49 89 f1 movq %rsi, %r9 | |
// 59: ff 15 00 00 00 00 callq *(%rip) # 0x5f <_JIT_ENTRY+0x5f> | |
// 000000000000005b: IMAGE_REL_AMD64_REL32 __imp__PyEval_FormatExcCheckArg | |
// 5f: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 63: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 6b: 48 83 c4 28 addq $0x28, %rsp | |
// 6f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x76 <_JIT_ENTRY+0x76> | |
// 0000000000000072: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 76: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x7d <_JIT_ENTRY+0x7d> | |
// 0000000000000079: IMAGE_REL_AMD64_REL32 __imp_PyExc_SystemError | |
// 7d: 48 8b 10 movq (%rax), %rdx | |
// 80: 4c 8d 05 00 00 00 00 leaq (%rip), %r8 # 0x87 <_JIT_ENTRY+0x87> | |
// 0000000000000083: IMAGE_REL_AMD64_REL32 ??_C@_0BL@HJKLBJNK@no?5locals?5when?5deleting?5?$CFR?$AA@ | |
// 87: 4c 89 e1 movq %r12, %rcx | |
// 8a: 49 89 f1 movq %rsi, %r9 | |
// 8d: ff 15 00 00 00 00 callq *(%rip) # 0x93 <_JIT_ENTRY+0x93> | |
// 000000000000008f: IMAGE_REL_AMD64_REL32 __imp__PyErr_Format | |
// 93: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 97: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 9f: 48 83 c4 28 addq $0x28, %rsp | |
// a3: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xaa <_JIT_ENTRY+0xaa> | |
// 00000000000000a6: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// aa: 48 83 c4 28 addq $0x28, %rsp | |
// ae: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xb5 <_JIT_ENTRY+0xb5> | |
// 00000000000000b1: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// ae: | |
const unsigned char code_body[174] = { | |
0x48, 0x83, 0xec, 0x28, 0x49, 0x8b, 0x45, 0x00, | |
0x49, 0x8b, 0x4d, 0x28, 0x48, 0x8b, 0x40, 0x20, | |
0x0f, 0xb7, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x74, 0xd0, 0x18, 0x49, 0x89, 0x6d, 0x40, | |
0x48, 0x85, 0xc9, 0x74, 0x51, 0x48, 0x89, 0xf2, | |
0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, | |
0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, | |
0x00, 0x00, 0x85, 0xc0, 0x74, 0x6c, 0x49, 0x89, | |
0x6d, 0x40, 0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x8b, 0x10, 0x4c, 0x8d, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x4c, 0x89, 0xe1, 0x49, 0x89, | |
0xf1, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x49, | |
0x8b, 0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, | |
0x05, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x10, | |
0x4c, 0x8d, 0x05, 0x00, 0x00, 0x00, 0x00, 0x4c, | |
0x89, 0xe1, 0x49, 0x89, 0xf1, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, | |
0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x83, 0xc4, 0x28, | |
}; | |
// 0: "no locals when deleting %R\x00name '%.200s' is not defined\x00" | |
// 38: | |
// 38: OPARG | |
// 40: &PyObject_DelItem+0x0 | |
// 48: &PyExc_NameError+0x0 | |
// 50: &_PyEval_FormatExcCheckArg+0x0 | |
// 58: ERROR_TARGET | |
// 60: &PyExc_SystemError+0x0 | |
// 68: &_PyErr_Format+0x0 | |
const unsigned char data_body[112] = { | |
0x6e, 0x6f, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, | |
0x73, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x64, | |
0x65, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x67, 0x20, | |
0x25, 0x52, 0x00, 0x6e, 0x61, 0x6d, 0x65, 0x20, | |
0x27, 0x25, 0x2e, 0x32, 0x30, 0x30, 0x73, 0x27, | |
0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, | |
0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x38, instruction->oparg); | |
patch_64(data + 0x40, (uintptr_t)&PyObject_DelItem); | |
patch_64(data + 0x48, (uintptr_t)&PyExc_NameError); | |
patch_64(data + 0x50, (uintptr_t)&_PyEval_FormatExcCheckArg); | |
patch_64(data + 0x58, state->instruction_starts[instruction->error_target]); | |
patch_64(data + 0x60, (uintptr_t)&PyExc_SystemError); | |
patch_64(data + 0x68, (uintptr_t)&_PyErr_Format); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x13, (uintptr_t)data + 0x34); | |
patch_x86_64_32rx(code + 0x2a, (uintptr_t)data + 0x3c); | |
patch_x86_64_32rx(code + 0x45, (uintptr_t)data + 0x44); | |
patch_x86_64_32rx(code + 0x4f, (uintptr_t)data + 0x17); | |
patch_x86_64_32rx(code + 0x5b, (uintptr_t)data + 0x4c); | |
patch_x86_64_32rx(code + 0x72, (uintptr_t)data + 0x54); | |
patch_x86_64_32rx(code + 0x79, (uintptr_t)data + 0x5c); | |
patch_x86_64_32rx(code + 0x83, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x8f, (uintptr_t)data + 0x64); | |
patch_x86_64_32rx(code + 0xa6, (uintptr_t)data + 0x54); | |
} | |
void | |
emit__DELETE_SUBSCR( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_DELETE_SUBSCR.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 5d f0 movq -0x10(%rbp), %rbx | |
// 8: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// c: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 10: 48 89 d9 movq %rbx, %rcx | |
// 13: 48 89 f2 movq %rsi, %rdx | |
// 16: ff 15 00 00 00 00 callq *(%rip) # 0x1c <_JIT_ENTRY+0x1c> | |
// 0000000000000018: IMAGE_REL_AMD64_REL32 __imp_PyObject_DelItem | |
// 1c: 89 c7 movl %eax, %edi | |
// 1e: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 22: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 2a: 48 8b 03 movq (%rbx), %rax | |
// 2d: 85 c0 testl %eax, %eax | |
// 2f: 78 08 js 0x39 <_JIT_ENTRY+0x39> | |
// 31: 48 ff c8 decq %rax | |
// 34: 48 89 03 movq %rax, (%rbx) | |
// 37: 74 1a je 0x53 <_JIT_ENTRY+0x53> | |
// 39: 48 8b 06 movq (%rsi), %rax | |
// 3c: 85 c0 testl %eax, %eax | |
// 3e: 78 23 js 0x63 <_JIT_ENTRY+0x63> | |
// 40: 48 ff c8 decq %rax | |
// 43: 48 89 06 movq %rax, (%rsi) | |
// 46: 75 1b jne 0x63 <_JIT_ENTRY+0x63> | |
// 48: 48 89 f1 movq %rsi, %rcx | |
// 4b: ff 15 00 00 00 00 callq *(%rip) # 0x51 <_JIT_ENTRY+0x51> | |
// 000000000000004d: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 51: eb 10 jmp 0x63 <_JIT_ENTRY+0x63> | |
// 53: 48 89 d9 movq %rbx, %rcx | |
// 56: ff 15 00 00 00 00 callq *(%rip) # 0x5c <_JIT_ENTRY+0x5c> | |
// 0000000000000058: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 5c: 48 8b 06 movq (%rsi), %rax | |
// 5f: 85 c0 testl %eax, %eax | |
// 61: 79 dd jns 0x40 <_JIT_ENTRY+0x40> | |
// 63: 85 ff testl %edi, %edi | |
// 65: 74 0b je 0x72 <_JIT_ENTRY+0x72> | |
// 67: 48 83 c4 28 addq $0x28, %rsp | |
// 6b: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x72 <_JIT_ENTRY+0x72> | |
// 000000000000006e: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 72: 48 83 c5 f0 addq $-0x10, %rbp | |
// 76: 48 83 c4 28 addq $0x28, %rsp | |
// 7a: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x81 <_JIT_ENTRY+0x81> | |
// 000000000000007d: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 7a: | |
const unsigned char code_body[122] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x5d, 0xf0, | |
0x48, 0x8b, 0x75, 0xf8, 0x49, 0x89, 0x6d, 0x40, | |
0x48, 0x89, 0xd9, 0x48, 0x89, 0xf2, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x89, 0xc7, 0x49, 0x8b, | |
0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x8b, 0x03, 0x85, 0xc0, 0x78, | |
0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x03, 0x74, | |
0x1a, 0x48, 0x8b, 0x06, 0x85, 0xc0, 0x78, 0x23, | |
0x48, 0xff, 0xc8, 0x48, 0x89, 0x06, 0x75, 0x1b, | |
0x48, 0x89, 0xf1, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0xeb, 0x10, 0x48, 0x89, 0xd9, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x06, 0x85, | |
0xc0, 0x79, 0xdd, 0x85, 0xff, 0x74, 0x0b, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x83, 0xc5, 0xf0, 0x48, 0x83, | |
0xc4, 0x28, | |
}; | |
// 0: | |
// 0: &PyObject_DelItem+0x0 | |
// 8: &_Py_Dealloc+0x0 | |
// 10: ERROR_TARGET | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyObject_DelItem); | |
patch_64(data + 0x8, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x10, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x18, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x4d, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x58, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x6e, (uintptr_t)data + 0xc); | |
} | |
void | |
emit__DEOPT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_DEOPT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_EXECUTOR | |
// 7: 49 89 84 24 08 01 00 00 movq %rax, 0x108(%r12) | |
// f: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 13: 49 8b 45 00 movq (%r13), %rax | |
// 17: 8b 0d 00 00 00 00 movl (%rip), %ecx # 0x1d <_JIT_ENTRY+0x1d> | |
// 0000000000000019: IMAGE_REL_AMD64_REL32 __imp__JIT_TARGET | |
// 1d: 48 8d 04 48 leaq (%rax,%rcx,2), %rax | |
// 21: 48 05 c8 00 00 00 addq $0xc8, %rax | |
// 27: c3 retq | |
// 28: | |
const unsigned char code_body[40] = { | |
0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x49, | |
0x89, 0x84, 0x24, 0x08, 0x01, 0x00, 0x00, 0x49, | |
0x89, 0x6d, 0x40, 0x49, 0x8b, 0x45, 0x00, 0x8b, | |
0x0d, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8d, 0x04, | |
0x48, 0x48, 0x05, 0xc8, 0x00, 0x00, 0x00, 0xc3, | |
}; | |
// 0: | |
// 0: EXECUTOR | |
// 8: TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)executor); | |
patch_64(data + 0x8, instruction->target); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x19, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__DICT_MERGE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_DICT_MERGE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// f: ba fc ff ff ff movl $0xfffffffc, %edx # imm = 0xFFFFFFFC | |
// 14: 29 c2 subl %eax, %edx | |
// 16: f7 d0 notl %eax | |
// 18: 48 98 cltq | |
// 1a: 48 8b 4c c5 00 movq (%rbp,%rax,8), %rcx | |
// 1f: 48 63 c2 movslq %edx, %rax | |
// 22: 48 8b 7c c5 00 movq (%rbp,%rax,8), %rdi | |
// 27: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 2b: 48 89 f2 movq %rsi, %rdx | |
// 2e: 41 b8 02 00 00 00 movl $0x2, %r8d | |
// 34: ff 15 00 00 00 00 callq *(%rip) # 0x3a <_JIT_ENTRY+0x3a> | |
// 0000000000000036: IMAGE_REL_AMD64_REL32 __imp__PyDict_MergeEx | |
// 3a: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 3e: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 46: 85 c0 testl %eax, %eax | |
// 48: 78 1e js 0x68 <_JIT_ENTRY+0x68> | |
// 4a: 48 8b 06 movq (%rsi), %rax | |
// 4d: 85 c0 testl %eax, %eax | |
// 4f: 78 08 js 0x59 <_JIT_ENTRY+0x59> | |
// 51: 48 ff c8 decq %rax | |
// 54: 48 89 06 movq %rax, (%rsi) | |
// 57: 74 48 je 0xa1 <_JIT_ENTRY+0xa1> | |
// 59: 48 83 c5 f8 addq $-0x8, %rbp | |
// 5d: 48 83 c4 28 addq $0x28, %rsp | |
// 61: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x68 <_JIT_ENTRY+0x68> | |
// 0000000000000064: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 68: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 6c: 4c 89 e1 movq %r12, %rcx | |
// 6f: 48 89 fa movq %rdi, %rdx | |
// 72: 49 89 f0 movq %rsi, %r8 | |
// 75: ff 15 00 00 00 00 callq *(%rip) # 0x7b <_JIT_ENTRY+0x7b> | |
// 0000000000000077: IMAGE_REL_AMD64_REL32 __imp__PyEval_FormatKwargsError | |
// 7b: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 7f: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 87: 48 8b 06 movq (%rsi), %rax | |
// 8a: 85 c0 testl %eax, %eax | |
// 8c: 78 08 js 0x96 <_JIT_ENTRY+0x96> | |
// 8e: 48 ff c8 decq %rax | |
// 91: 48 89 06 movq %rax, (%rsi) | |
// 94: 74 23 je 0xb9 <_JIT_ENTRY+0xb9> | |
// 96: 48 83 c4 28 addq $0x28, %rsp | |
// 9a: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xa1 <_JIT_ENTRY+0xa1> | |
// 000000000000009d: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// a1: 48 89 f1 movq %rsi, %rcx | |
// a4: ff 15 00 00 00 00 callq *(%rip) # 0xaa <_JIT_ENTRY+0xaa> | |
// 00000000000000a6: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// aa: 48 83 c5 f8 addq $-0x8, %rbp | |
// ae: 48 83 c4 28 addq $0x28, %rsp | |
// b2: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xb9 <_JIT_ENTRY+0xb9> | |
// 00000000000000b5: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// b9: 48 89 f1 movq %rsi, %rcx | |
// bc: ff 15 00 00 00 00 callq *(%rip) # 0xc2 <_JIT_ENTRY+0xc2> | |
// 00000000000000be: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// c2: 48 83 c4 28 addq $0x28, %rsp | |
// c6: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xcd <_JIT_ENTRY+0xcd> | |
// 00000000000000c9: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// cd: | |
const unsigned char code_body[205] = { | |
0x48, 0x83, 0xec, 0x28, 0x0f, 0xb7, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x8b, 0x75, 0xf8, 0xba, | |
0xfc, 0xff, 0xff, 0xff, 0x29, 0xc2, 0xf7, 0xd0, | |
0x48, 0x98, 0x48, 0x8b, 0x4c, 0xc5, 0x00, 0x48, | |
0x63, 0xc2, 0x48, 0x8b, 0x7c, 0xc5, 0x00, 0x49, | |
0x89, 0x6d, 0x40, 0x48, 0x89, 0xf2, 0x41, 0xb8, | |
0x02, 0x00, 0x00, 0x00, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, 0xc7, | |
0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x85, 0xc0, | |
0x78, 0x1e, 0x48, 0x8b, 0x06, 0x85, 0xc0, 0x78, | |
0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x06, 0x74, | |
0x48, 0x48, 0x83, 0xc5, 0xf8, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x49, 0x89, 0x6d, 0x40, 0x4c, 0x89, 0xe1, 0x48, | |
0x89, 0xfa, 0x49, 0x89, 0xf0, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, | |
0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x06, 0x85, 0xc0, 0x78, 0x08, 0x48, 0xff, | |
0xc8, 0x48, 0x89, 0x06, 0x74, 0x23, 0x48, 0x83, | |
0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x89, 0xf1, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x83, 0xc5, 0xf8, 0x48, 0x83, | |
0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x89, 0xf1, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &_PyDict_MergeEx+0x0 | |
// 10: CONTINUE | |
// 18: &_PyEval_FormatKwargsError+0x0 | |
// 20: ERROR_TARGET | |
// 28: &_Py_Dealloc+0x0 | |
const unsigned char data_body[48] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&_PyDict_MergeEx); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, (uintptr_t)&_PyEval_FormatKwargsError); | |
patch_64(data + 0x20, state->instruction_starts[instruction->error_target]); | |
patch_64(data + 0x28, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x36, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x64, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x77, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x9d, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0xa6, (uintptr_t)data + 0x24); | |
patch_x86_64_32rx(code + 0xb5, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xbe, (uintptr_t)data + 0x24); | |
patch_x86_64_32rx(code + 0xc9, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__DICT_UPDATE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_DICT_UPDATE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 8b 05 00 00 00 00 movl (%rip), %eax # 0xa <_JIT_ENTRY+0xa> | |
// 0000000000000006: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// a: f7 d0 notl %eax | |
// c: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// 10: c1 e0 03 shll $0x3, %eax | |
// 13: 48 0d 00 00 f8 ff orq $-0x80000, %rax # imm = 0xFFF80000 | |
// 19: 48 8b 4c 05 00 movq (%rbp,%rax), %rcx | |
// 1e: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 22: 48 89 f2 movq %rsi, %rdx | |
// 25: ff 15 00 00 00 00 callq *(%rip) # 0x2b <_JIT_ENTRY+0x2b> | |
// 0000000000000027: IMAGE_REL_AMD64_REL32 __imp_PyDict_Update | |
// 2b: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 2f: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 37: 85 c0 testl %eax, %eax | |
// 39: 78 22 js 0x5d <_JIT_ENTRY+0x5d> | |
// 3b: 48 8b 06 movq (%rsi), %rax | |
// 3e: 85 c0 testl %eax, %eax | |
// 40: 78 0c js 0x4e <_JIT_ENTRY+0x4e> | |
// 42: 48 ff c8 decq %rax | |
// 45: 48 89 06 movq %rax, (%rsi) | |
// 48: 0f 84 82 00 00 00 je 0xd0 <_JIT_ENTRY+0xd0> | |
// 4e: 48 83 c5 f8 addq $-0x8, %rbp | |
// 52: 48 83 c4 28 addq $0x28, %rsp | |
// 56: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x5d <_JIT_ENTRY+0x5d> | |
// 0000000000000059: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 5d: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 61: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x68 <_JIT_ENTRY+0x68> | |
// 0000000000000064: IMAGE_REL_AMD64_REL32 __imp_PyExc_AttributeError | |
// 68: 48 8b 10 movq (%rax), %rdx | |
// 6b: 4c 89 e1 movq %r12, %rcx | |
// 6e: ff 15 00 00 00 00 callq *(%rip) # 0x74 <_JIT_ENTRY+0x74> | |
// 0000000000000070: IMAGE_REL_AMD64_REL32 __imp__PyErr_ExceptionMatches | |
// 74: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 78: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 80: 85 c0 testl %eax, %eax | |
// 82: 74 32 je 0xb6 <_JIT_ENTRY+0xb6> | |
// 84: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 88: 48 8b 46 08 movq 0x8(%rsi), %rax | |
// 8c: 4c 8b 48 18 movq 0x18(%rax), %r9 | |
// 90: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x97 <_JIT_ENTRY+0x97> | |
// 0000000000000093: IMAGE_REL_AMD64_REL32 __imp_PyExc_TypeError | |
// 97: 48 8b 10 movq (%rax), %rdx | |
// 9a: 4c 8d 05 00 00 00 00 leaq (%rip), %r8 # 0xa1 <_JIT_ENTRY+0xa1> | |
// 000000000000009d: IMAGE_REL_AMD64_REL32 ??_C@_0CB@CMJMJEG@?8?$CF?4200s?8?5object?5is?5not?5a?5mapping@ | |
// a1: 4c 89 e1 movq %r12, %rcx | |
// a4: ff 15 00 00 00 00 callq *(%rip) # 0xaa <_JIT_ENTRY+0xaa> | |
// 00000000000000a6: IMAGE_REL_AMD64_REL32 __imp__PyErr_Format | |
// aa: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// ae: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// b6: 48 8b 06 movq (%rsi), %rax | |
// b9: 85 c0 testl %eax, %eax | |
// bb: 78 08 js 0xc5 <_JIT_ENTRY+0xc5> | |
// bd: 48 ff c8 decq %rax | |
// c0: 48 89 06 movq %rax, (%rsi) | |
// c3: 74 23 je 0xe8 <_JIT_ENTRY+0xe8> | |
// c5: 48 83 c4 28 addq $0x28, %rsp | |
// c9: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xd0 <_JIT_ENTRY+0xd0> | |
// 00000000000000cc: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// d0: 48 89 f1 movq %rsi, %rcx | |
// d3: ff 15 00 00 00 00 callq *(%rip) # 0xd9 <_JIT_ENTRY+0xd9> | |
// 00000000000000d5: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// d9: 48 83 c5 f8 addq $-0x8, %rbp | |
// dd: 48 83 c4 28 addq $0x28, %rsp | |
// e1: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xe8 <_JIT_ENTRY+0xe8> | |
// 00000000000000e4: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// e8: 48 89 f1 movq %rsi, %rcx | |
// eb: ff 15 00 00 00 00 callq *(%rip) # 0xf1 <_JIT_ENTRY+0xf1> | |
// 00000000000000ed: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// f1: 48 83 c4 28 addq $0x28, %rsp | |
// f5: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xfc <_JIT_ENTRY+0xfc> | |
// 00000000000000f8: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// fc: | |
const unsigned char code_body[252] = { | |
0x48, 0x83, 0xec, 0x28, 0x8b, 0x05, 0x00, 0x00, | |
0x00, 0x00, 0xf7, 0xd0, 0x48, 0x8b, 0x75, 0xf8, | |
0xc1, 0xe0, 0x03, 0x48, 0x0d, 0x00, 0x00, 0xf8, | |
0xff, 0x48, 0x8b, 0x4c, 0x05, 0x00, 0x49, 0x89, | |
0x6d, 0x40, 0x48, 0x89, 0xf2, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, | |
0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x85, | |
0xc0, 0x78, 0x22, 0x48, 0x8b, 0x06, 0x85, 0xc0, | |
0x78, 0x0c, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x06, | |
0x0f, 0x84, 0x82, 0x00, 0x00, 0x00, 0x48, 0x83, | |
0xc5, 0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, 0x49, 0x89, 0x6d, | |
0x40, 0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8b, 0x10, 0x4c, 0x89, 0xe1, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, | |
0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, | |
0x85, 0xc0, 0x74, 0x32, 0x49, 0x89, 0x6d, 0x40, | |
0x48, 0x8b, 0x46, 0x08, 0x4c, 0x8b, 0x48, 0x18, | |
0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x10, 0x4c, 0x8d, 0x05, 0x00, 0x00, 0x00, | |
0x00, 0x4c, 0x89, 0xe1, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, 0xc7, | |
0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, | |
0x06, 0x85, 0xc0, 0x78, 0x08, 0x48, 0xff, 0xc8, | |
0x48, 0x89, 0x06, 0x74, 0x23, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x89, 0xf1, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x83, 0xc5, 0xf8, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x89, 0xf1, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: "'%.200s' object is not a mapping\x00" | |
// 21: 00 00 00 00 00 00 00 | |
// 28: OPARG | |
// 30: &PyDict_Update+0x0 | |
// 38: CONTINUE | |
// 40: &PyExc_AttributeError+0x0 | |
// 48: &_PyErr_ExceptionMatches+0x0 | |
// 50: &PyExc_TypeError+0x0 | |
// 58: &_PyErr_Format+0x0 | |
// 60: ERROR_TARGET | |
// 68: &_Py_Dealloc+0x0 | |
const unsigned char data_body[112] = { | |
0x27, 0x25, 0x2e, 0x32, 0x30, 0x30, 0x73, 0x27, | |
0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, | |
0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x61, | |
0x20, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x28, instruction->oparg); | |
patch_64(data + 0x30, (uintptr_t)&PyDict_Update); | |
patch_64(data + 0x38, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x40, (uintptr_t)&PyExc_AttributeError); | |
patch_64(data + 0x48, (uintptr_t)&_PyErr_ExceptionMatches); | |
patch_64(data + 0x50, (uintptr_t)&PyExc_TypeError); | |
patch_64(data + 0x58, (uintptr_t)&_PyErr_Format); | |
patch_64(data + 0x60, state->instruction_starts[instruction->error_target]); | |
patch_64(data + 0x68, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x6, (uintptr_t)data + 0x24); | |
patch_x86_64_32rx(code + 0x27, (uintptr_t)data + 0x2c); | |
patch_x86_64_32rx(code + 0x59, (uintptr_t)data + 0x34); | |
patch_x86_64_32rx(code + 0x64, (uintptr_t)data + 0x3c); | |
patch_x86_64_32rx(code + 0x70, (uintptr_t)data + 0x44); | |
patch_x86_64_32rx(code + 0x93, (uintptr_t)data + 0x4c); | |
patch_x86_64_32rx(code + 0x9d, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0xa6, (uintptr_t)data + 0x54); | |
patch_x86_64_32rx(code + 0xcc, (uintptr_t)data + 0x5c); | |
patch_x86_64_32rx(code + 0xd5, (uintptr_t)data + 0x64); | |
patch_x86_64_32rx(code + 0xe4, (uintptr_t)data + 0x34); | |
patch_x86_64_32rx(code + 0xed, (uintptr_t)data + 0x64); | |
patch_x86_64_32rx(code + 0xf8, (uintptr_t)data + 0x5c); | |
} | |
void | |
emit__DYNAMIC_EXIT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_DYNAMIC_EXIT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 38 subq $0x38, %rsp | |
// 4: 48 8b 3d 00 00 00 00 movq (%rip), %rdi # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_EXECUTOR | |
// b: 49 89 bc 24 08 01 00 00 movq %rdi, 0x108(%r12) | |
// 13: 49 8b 75 38 movq 0x38(%r13), %rsi | |
// 17: 80 3e ff cmpb $-0x1, (%rsi) | |
// 1a: 74 57 je 0x73 <_JIT_ENTRY+0x73> | |
// 1c: 48 8b 1d 00 00 00 00 movq (%rip), %rbx # 0x23 <_JIT_ENTRY+0x23> | |
// 000000000000001f: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 23: 0f b7 43 04 movzwl 0x4(%rbx), %eax | |
// 27: 66 83 f8 0f cmpw $0xf, %ax | |
// 2b: 73 6d jae 0x9a <_JIT_ENTRY+0x9a> | |
// 2d: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 31: c7 44 24 20 00 00 00 00 movl $0x0, 0x20(%rsp) | |
// 39: 4c 8d 4c 24 30 leaq 0x30(%rsp), %r9 | |
// 3e: 4c 89 e9 movq %r13, %rcx | |
// 41: 48 89 f2 movq %rsi, %rdx | |
// 44: 49 89 e8 movq %rbp, %r8 | |
// 47: ff 15 00 00 00 00 callq *(%rip) # 0x4d <_JIT_ENTRY+0x4d> | |
// 0000000000000049: IMAGE_REL_AMD64_REL32 __imp__PyOptimizer_Optimize | |
// 4d: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 51: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 59: 85 c0 testl %eax, %eax | |
// 5b: 7e 50 jle 0xad <_JIT_ENTRY+0xad> | |
// 5d: 66 c7 43 04 f6 03 movw $0x3f6, 0x4(%rbx) # imm = 0x3F6 | |
// 63: 48 8b 44 24 30 movq 0x30(%rsp), %rax | |
// 68: 48 8b 40 78 movq 0x78(%rax), %rax | |
// 6c: 48 83 c4 38 addq $0x38, %rsp | |
// 70: 48 ff e0 jmpq *%rax | |
// 73: 49 8b 45 00 movq (%r13), %rax | |
// 77: 48 8b 80 98 00 00 00 movq 0x98(%rax), %rax | |
// 7e: 0f b6 4e 01 movzbl 0x1(%rsi), %ecx | |
// 82: 48 8b 44 c8 08 movq 0x8(%rax,%rcx,8), %rax | |
// 87: 8b 08 movl (%rax), %ecx | |
// 89: ff c1 incl %ecx | |
// 8b: 74 db je 0x68 <_JIT_ENTRY+0x68> | |
// 8d: 89 08 movl %ecx, (%rax) | |
// 8f: 48 8b 40 78 movq 0x78(%rax), %rax | |
// 93: 48 83 c4 38 addq $0x38, %rsp | |
// 97: 48 ff e0 jmpq *%rax | |
// 9a: 83 c0 f0 addl $-0x10, %eax | |
// 9d: 66 89 43 04 movw %ax, 0x4(%rbx) | |
// a1: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// a5: 48 89 f0 movq %rsi, %rax | |
// a8: 48 83 c4 38 addq $0x38, %rsp | |
// ac: c3 retq | |
// ad: 0f b7 4b 04 movzwl 0x4(%rbx), %ecx | |
// b1: 83 e1 0f andl $0xf, %ecx | |
// b4: 66 ba fc ff movw $0xfffc, %dx # imm = 0xFFFC | |
// b8: 66 83 f9 0b cmpw $0xb, %cx | |
// bc: 77 10 ja 0xce <_JIT_ENTRY+0xce> | |
// be: ff c1 incl %ecx | |
// c0: ba ff ff ff ff movl $0xffffffff, %edx # imm = 0xFFFFFFFF | |
// c5: d3 e2 shll %cl, %edx | |
// c7: f7 d2 notl %edx | |
// c9: c1 e2 04 shll $0x4, %edx | |
// cc: 09 ca orl %ecx, %edx | |
// ce: 66 89 53 04 movw %dx, 0x4(%rbx) | |
// d2: 85 c0 testl %eax, %eax | |
// d4: 78 0c js 0xe2 <_JIT_ENTRY+0xe2> | |
// d6: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// da: 48 89 f0 movq %rsi, %rax | |
// dd: 48 83 c4 38 addq $0x38, %rsp | |
// e1: c3 retq | |
// e2: 49 89 bc 24 08 01 00 00 movq %rdi, 0x108(%r12) | |
// ea: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// ee: 31 f6 xorl %esi, %esi | |
// f0: 48 89 f0 movq %rsi, %rax | |
// f3: 48 83 c4 38 addq $0x38, %rsp | |
// f7: c3 retq | |
// f8: | |
const unsigned char code_body[248] = { | |
0x48, 0x83, 0xec, 0x38, 0x48, 0x8b, 0x3d, 0x00, | |
0x00, 0x00, 0x00, 0x49, 0x89, 0xbc, 0x24, 0x08, | |
0x01, 0x00, 0x00, 0x49, 0x8b, 0x75, 0x38, 0x80, | |
0x3e, 0xff, 0x74, 0x57, 0x48, 0x8b, 0x1d, 0x00, | |
0x00, 0x00, 0x00, 0x0f, 0xb7, 0x43, 0x04, 0x66, | |
0x83, 0xf8, 0x0f, 0x73, 0x6d, 0x49, 0x89, 0x6d, | |
0x40, 0xc7, 0x44, 0x24, 0x20, 0x00, 0x00, 0x00, | |
0x00, 0x4c, 0x8d, 0x4c, 0x24, 0x30, 0x4c, 0x89, | |
0xe9, 0x48, 0x89, 0xf2, 0x49, 0x89, 0xe8, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, | |
0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, | |
0x00, 0x85, 0xc0, 0x7e, 0x50, 0x66, 0xc7, 0x43, | |
0x04, 0xf6, 0x03, 0x48, 0x8b, 0x44, 0x24, 0x30, | |
0x48, 0x8b, 0x40, 0x78, 0x48, 0x83, 0xc4, 0x38, | |
0x48, 0xff, 0xe0, 0x49, 0x8b, 0x45, 0x00, 0x48, | |
0x8b, 0x80, 0x98, 0x00, 0x00, 0x00, 0x0f, 0xb6, | |
0x4e, 0x01, 0x48, 0x8b, 0x44, 0xc8, 0x08, 0x8b, | |
0x08, 0xff, 0xc1, 0x74, 0xdb, 0x89, 0x08, 0x48, | |
0x8b, 0x40, 0x78, 0x48, 0x83, 0xc4, 0x38, 0x48, | |
0xff, 0xe0, 0x83, 0xc0, 0xf0, 0x66, 0x89, 0x43, | |
0x04, 0x49, 0x89, 0x6d, 0x40, 0x48, 0x89, 0xf0, | |
0x48, 0x83, 0xc4, 0x38, 0xc3, 0x0f, 0xb7, 0x4b, | |
0x04, 0x83, 0xe1, 0x0f, 0x66, 0xba, 0xfc, 0xff, | |
0x66, 0x83, 0xf9, 0x0b, 0x77, 0x10, 0xff, 0xc1, | |
0xba, 0xff, 0xff, 0xff, 0xff, 0xd3, 0xe2, 0xf7, | |
0xd2, 0xc1, 0xe2, 0x04, 0x09, 0xca, 0x66, 0x89, | |
0x53, 0x04, 0x85, 0xc0, 0x78, 0x0c, 0x49, 0x89, | |
0x6d, 0x40, 0x48, 0x89, 0xf0, 0x48, 0x83, 0xc4, | |
0x38, 0xc3, 0x49, 0x89, 0xbc, 0x24, 0x08, 0x01, | |
0x00, 0x00, 0x49, 0x89, 0x6d, 0x40, 0x31, 0xf6, | |
0x48, 0x89, 0xf0, 0x48, 0x83, 0xc4, 0x38, 0xc3, | |
}; | |
// 0: | |
// 0: EXECUTOR | |
// 8: OPERAND | |
// 10: &_PyOptimizer_Optimize+0x0 | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)executor); | |
patch_64(data + 0x8, instruction->operand); | |
patch_64(data + 0x10, (uintptr_t)&_PyOptimizer_Optimize); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1f, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x49, (uintptr_t)data + 0xc); | |
} | |
void | |
emit__END_SEND( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_END_SEND.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 89 ee movq %rbp, %rsi | |
// 7: 48 83 c5 f8 addq $-0x8, %rbp | |
// b: 48 8b 4e f0 movq -0x10(%rsi), %rcx | |
// f: 48 8b 7e f8 movq -0x8(%rsi), %rdi | |
// 13: 48 8b 01 movq (%rcx), %rax | |
// 16: 85 c0 testl %eax, %eax | |
// 18: 78 08 js 0x22 <_JIT_ENTRY+0x22> | |
// 1a: 48 ff c8 decq %rax | |
// 1d: 48 89 01 movq %rax, (%rcx) | |
// 20: 74 0f je 0x31 <_JIT_ENTRY+0x31> | |
// 22: 48 89 7e f0 movq %rdi, -0x10(%rsi) | |
// 26: 48 83 c4 28 addq $0x28, %rsp | |
// 2a: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x31 <_JIT_ENTRY+0x31> | |
// 000000000000002d: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 31: ff 15 00 00 00 00 callq *(%rip) # 0x37 <_JIT_ENTRY+0x37> | |
// 0000000000000033: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 37: 48 89 7e f0 movq %rdi, -0x10(%rsi) | |
// 3b: 48 83 c4 28 addq $0x28, %rsp | |
// 3f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x46 <_JIT_ENTRY+0x46> | |
// 0000000000000042: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 3f: | |
const unsigned char code_body[63] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x89, 0xee, 0x48, | |
0x83, 0xc5, 0xf8, 0x48, 0x8b, 0x4e, 0xf0, 0x48, | |
0x8b, 0x7e, 0xf8, 0x48, 0x8b, 0x01, 0x85, 0xc0, | |
0x78, 0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x01, | |
0x74, 0x0f, 0x48, 0x89, 0x7e, 0xf0, 0x48, 0x83, | |
0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x89, 0x7e, 0xf0, 0x48, 0x83, 0xc4, 0x28, | |
}; | |
// 0: | |
// 0: CONTINUE | |
// 8: &_Py_Dealloc+0x0 | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x8, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x2d, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x33, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__ERROR_POP_N( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_ERROR_POP_N.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 49 8b 45 00 movq (%r13), %rax | |
// 4: 8b 0d 00 00 00 00 movl (%rip), %ecx # 0xa <_JIT_ENTRY+0xa> | |
// 0000000000000006: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// a: 48 8d 04 48 leaq (%rax,%rcx,2), %rax | |
// e: 48 05 c8 00 00 00 addq $0xc8, %rax | |
// 14: 49 89 45 38 movq %rax, 0x38(%r13) | |
// 18: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0x1f <_JIT_ENTRY+0x1f> | |
// 000000000000001b: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 1f: c1 e0 03 shll $0x3, %eax | |
// 22: 48 29 c5 subq %rax, %rbp | |
// 25: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x2c <_JIT_ENTRY+0x2c> | |
// 0000000000000028: IMAGE_REL_AMD64_REL32 __imp__JIT_EXECUTOR | |
// 2c: 49 89 84 24 08 01 00 00 movq %rax, 0x108(%r12) | |
// 34: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 38: 31 c0 xorl %eax, %eax | |
// 3a: c3 retq | |
// 3b: | |
const unsigned char code_body[59] = { | |
0x49, 0x8b, 0x45, 0x00, 0x8b, 0x0d, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x8d, 0x04, 0x48, 0x48, 0x05, | |
0xc8, 0x00, 0x00, 0x00, 0x49, 0x89, 0x45, 0x38, | |
0x0f, 0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0xc1, | |
0xe0, 0x03, 0x48, 0x29, 0xc5, 0x48, 0x8b, 0x05, | |
0x00, 0x00, 0x00, 0x00, 0x49, 0x89, 0x84, 0x24, | |
0x08, 0x01, 0x00, 0x00, 0x49, 0x89, 0x6d, 0x40, | |
0x31, 0xc0, 0xc3, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: OPARG | |
// 10: EXECUTOR | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, instruction->oparg); | |
patch_64(data + 0x10, (uintptr_t)executor); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x6, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1b, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x28, (uintptr_t)data + 0xc); | |
} | |
void | |
emit__EXIT_INIT_CHECK( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_EXIT_INIT_CHECK.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 8: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp__Py_NoneStruct | |
// f: 75 0f jne 0x20 <_JIT_ENTRY+0x20> | |
// 11: 48 83 c5 f8 addq $-0x8, %rbp | |
// 15: 48 83 c4 28 addq $0x28, %rsp | |
// 19: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x20 <_JIT_ENTRY+0x20> | |
// 000000000000001c: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 20: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 24: 48 8b 40 08 movq 0x8(%rax), %rax | |
// 28: 4c 8b 40 18 movq 0x18(%rax), %r8 | |
// 2c: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x33 <_JIT_ENTRY+0x33> | |
// 000000000000002f: IMAGE_REL_AMD64_REL32 __imp_PyExc_TypeError | |
// 33: 48 8b 08 movq (%rax), %rcx | |
// 36: 48 8d 15 00 00 00 00 leaq (%rip), %rdx # 0x3d <_JIT_ENTRY+0x3d> | |
// 0000000000000039: IMAGE_REL_AMD64_REL32 ??_C@_0CM@HKPEOANK@__init__?$CI?$CJ?5should?5return?5None?0?5n@ | |
// 3d: ff 15 00 00 00 00 callq *(%rip) # 0x43 <_JIT_ENTRY+0x43> | |
// 000000000000003f: IMAGE_REL_AMD64_REL32 __imp_PyErr_Format | |
// 43: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 47: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 4f: 48 83 c4 28 addq $0x28, %rsp | |
// 53: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x5a <_JIT_ENTRY+0x5a> | |
// 0000000000000056: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 5a: | |
const unsigned char code_body[90] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x45, 0xf8, | |
0x48, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x75, | |
0x0f, 0x48, 0x83, 0xc5, 0xf8, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x49, 0x89, 0x6d, 0x40, 0x48, 0x8b, 0x40, 0x08, | |
0x4c, 0x8b, 0x40, 0x18, 0x48, 0x8b, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x8b, 0x08, 0x48, 0x8d, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, | |
0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, | |
}; | |
// 0: "__init__() should return None, not '%.200s'\x00" | |
// 2c: 00 00 00 00 | |
// 30: &_Py_NoneStruct+0x0 | |
// 38: CONTINUE | |
// 40: &PyExc_TypeError+0x0 | |
// 48: &PyErr_Format+0x0 | |
// 50: ERROR_TARGET | |
const unsigned char data_body[88] = { | |
0x5f, 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x5f, | |
0x28, 0x29, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, | |
0x64, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, | |
0x20, 0x4e, 0x6f, 0x6e, 0x65, 0x2c, 0x20, 0x6e, | |
0x6f, 0x74, 0x20, 0x27, 0x25, 0x2e, 0x32, 0x30, | |
0x30, 0x73, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x30, (uintptr_t)&_Py_NoneStruct); | |
patch_64(data + 0x38, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x40, (uintptr_t)&PyExc_TypeError); | |
patch_64(data + 0x48, (uintptr_t)&PyErr_Format); | |
patch_64(data + 0x50, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + 0x2c); | |
patch_x86_64_32rx(code + 0x1c, (uintptr_t)data + 0x34); | |
patch_x86_64_32rx(code + 0x2f, (uintptr_t)data + 0x3c); | |
patch_x86_64_32rx(code + 0x39, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x3f, (uintptr_t)data + 0x44); | |
patch_x86_64_32rx(code + 0x56, (uintptr_t)data + 0x4c); | |
} | |
void | |
emit__EXIT_TRACE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_EXIT_TRACE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 38 subq $0x38, %rsp | |
// 4: 49 8b 5d 00 movq (%r13), %rbx | |
// 8: 48 8b 3d 00 00 00 00 movq (%rip), %rdi # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// f: 8b 07 movl (%rdi), %eax | |
// 11: 48 8d 04 43 leaq (%rbx,%rax,2), %rax | |
// 15: 48 05 c8 00 00 00 addq $0xc8, %rax | |
// 1b: 48 8b 4f 08 movq 0x8(%rdi), %rcx | |
// 1f: 48 85 c9 testq %rcx, %rcx | |
// 22: 74 38 je 0x5c <_JIT_ENTRY+0x5c> | |
// 24: f6 41 22 01 testb $0x1, 0x22(%rcx) | |
// 28: 75 25 jne 0x4f <_JIT_ENTRY+0x4f> | |
// 2a: 66 c7 47 04 f6 03 movw $0x3f6, 0x4(%rdi) # imm = 0x3F6 | |
// 30: 48 c7 47 08 00 00 00 00 movq $0x0, 0x8(%rdi) | |
// 38: 48 8b 11 movq (%rcx), %rdx | |
// 3b: 66 be f6 03 movw $0x3f6, %si # imm = 0x3F6 | |
// 3f: 85 d2 testl %edx, %edx | |
// 41: 78 6d js 0xb0 <_JIT_ENTRY+0xb0> | |
// 43: 48 ff ca decq %rdx | |
// 46: 48 89 11 movq %rdx, (%rcx) | |
// 49: 0f 84 fa 00 00 00 je 0x149 <_JIT_ENTRY+0x149> | |
// 4f: 48 8b 4f 08 movq 0x8(%rdi), %rcx | |
// 53: 48 85 c9 testq %rcx, %rcx | |
// 56: 0f 85 8f 00 00 00 jne 0xeb <_JIT_ENTRY+0xeb> | |
// 5c: 0f b7 77 04 movzwl 0x4(%rdi), %esi | |
// 60: 83 fe 0f cmpl $0xf, %esi | |
// 63: 73 4b jae 0xb0 <_JIT_ENTRY+0xb0> | |
// 65: 80 38 ff cmpb $-0x1, (%rax) | |
// 68: 74 65 je 0xcf <_JIT_ENTRY+0xcf> | |
// 6a: 48 8b 1d 00 00 00 00 movq (%rip), %rbx # 0x71 <_JIT_ENTRY+0x71> | |
// 000000000000006d: IMAGE_REL_AMD64_REL32 __imp__JIT_EXECUTOR | |
// 71: 0f b6 4b 22 movzbl 0x22(%rbx), %ecx | |
// 75: c1 e9 02 shrl $0x2, %ecx | |
// 78: ff c1 incl %ecx | |
// 7a: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 7e: 89 4c 24 20 movl %ecx, 0x20(%rsp) | |
// 82: 4c 8d 4c 24 30 leaq 0x30(%rsp), %r9 | |
// 87: 4c 89 e9 movq %r13, %rcx | |
// 8a: 49 89 c6 movq %rax, %r14 | |
// 8d: 48 89 c2 movq %rax, %rdx | |
// 90: 49 89 e8 movq %rbp, %r8 | |
// 93: ff 15 00 00 00 00 callq *(%rip) # 0x99 <_JIT_ENTRY+0x99> | |
// 0000000000000095: IMAGE_REL_AMD64_REL32 __imp__PyOptimizer_Optimize | |
// 99: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 9d: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// a5: 85 c0 testl %eax, %eax | |
// a7: 7e 68 jle 0x111 <_JIT_ENTRY+0x111> | |
// a9: 48 8b 4c 24 30 movq 0x30(%rsp), %rcx | |
// ae: eb 37 jmp 0xe7 <_JIT_ENTRY+0xe7> | |
// b0: 83 c6 f0 addl $-0x10, %esi | |
// b3: 66 89 77 04 movw %si, 0x4(%rdi) | |
// b7: 48 8b 0d 00 00 00 00 movq (%rip), %rcx # 0xbe <_JIT_ENTRY+0xbe> | |
// 00000000000000ba: IMAGE_REL_AMD64_REL32 __imp__JIT_EXECUTOR | |
// be: 49 89 8c 24 08 01 00 00 movq %rcx, 0x108(%r12) | |
// c6: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// ca: 48 83 c4 38 addq $0x38, %rsp | |
// ce: c3 retq | |
// cf: 48 8b 8b 98 00 00 00 movq 0x98(%rbx), %rcx | |
// d6: 0f b6 40 01 movzbl 0x1(%rax), %eax | |
// da: 48 8b 4c c1 08 movq 0x8(%rcx,%rax,8), %rcx | |
// df: 8b 01 movl (%rcx), %eax | |
// e1: ff c0 incl %eax | |
// e3: 74 02 je 0xe7 <_JIT_ENTRY+0xe7> | |
// e5: 89 01 movl %eax, (%rcx) | |
// e7: 48 89 4f 08 movq %rcx, 0x8(%rdi) | |
// eb: 8b 01 movl (%rcx), %eax | |
// ed: ff c0 incl %eax | |
// ef: 74 06 je 0xf7 <_JIT_ENTRY+0xf7> | |
// f1: 89 01 movl %eax, (%rcx) | |
// f3: 48 8b 4f 08 movq 0x8(%rdi), %rcx | |
// f7: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0xfe <_JIT_ENTRY+0xfe> | |
// 00000000000000fa: IMAGE_REL_AMD64_REL32 __imp__JIT_EXECUTOR | |
// fe: 49 89 84 24 08 01 00 00 movq %rax, 0x108(%r12) | |
// 106: 48 8b 41 78 movq 0x78(%rcx), %rax | |
// 10a: 48 83 c4 38 addq $0x38, %rsp | |
// 10e: 48 ff e0 jmpq *%rax | |
// 111: 66 ba fc ff movw $0xfffc, %dx # imm = 0xFFFC | |
// 115: 66 83 fe 0b cmpw $0xb, %si | |
// 119: 77 12 ja 0x12d <_JIT_ENTRY+0x12d> | |
// 11b: ff c6 incl %esi | |
// 11d: ba ff ff ff ff movl $0xffffffff, %edx # imm = 0xFFFFFFFF | |
// 122: 89 f1 movl %esi, %ecx | |
// 124: d3 e2 shll %cl, %edx | |
// 126: f7 d2 notl %edx | |
// 128: c1 e2 04 shll $0x4, %edx | |
// 12b: 09 f2 orl %esi, %edx | |
// 12d: 66 89 57 04 movw %dx, 0x4(%rdi) | |
// 131: 85 c0 testl %eax, %eax | |
// 133: 78 2e js 0x163 <_JIT_ENTRY+0x163> | |
// 135: 4c 89 f0 movq %r14, %rax | |
// 138: 49 89 9c 24 08 01 00 00 movq %rbx, 0x108(%r12) | |
// 140: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 144: 48 83 c4 38 addq $0x38, %rsp | |
// 148: c3 retq | |
// 149: 48 89 c6 movq %rax, %rsi | |
// 14c: ff 15 00 00 00 00 callq *(%rip) # 0x152 <_JIT_ENTRY+0x152> | |
// 000000000000014e: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 152: 48 89 f0 movq %rsi, %rax | |
// 155: 48 8b 4f 08 movq 0x8(%rdi), %rcx | |
// 159: 48 85 c9 testq %rcx, %rcx | |
// 15c: 75 8d jne 0xeb <_JIT_ENTRY+0xeb> | |
// 15e: e9 f9 fe ff ff jmp 0x5c <_JIT_ENTRY+0x5c> | |
// 163: 49 89 9c 24 08 01 00 00 movq %rbx, 0x108(%r12) | |
// 16b: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 16f: 31 c0 xorl %eax, %eax | |
// 171: 48 83 c4 38 addq $0x38, %rsp | |
// 175: c3 retq | |
// 176: | |
const unsigned char code_body[374] = { | |
0x48, 0x83, 0xec, 0x38, 0x49, 0x8b, 0x5d, 0x00, | |
0x48, 0x8b, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x8b, | |
0x07, 0x48, 0x8d, 0x04, 0x43, 0x48, 0x05, 0xc8, | |
0x00, 0x00, 0x00, 0x48, 0x8b, 0x4f, 0x08, 0x48, | |
0x85, 0xc9, 0x74, 0x38, 0xf6, 0x41, 0x22, 0x01, | |
0x75, 0x25, 0x66, 0xc7, 0x47, 0x04, 0xf6, 0x03, | |
0x48, 0xc7, 0x47, 0x08, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8b, 0x11, 0x66, 0xbe, 0xf6, 0x03, 0x85, | |
0xd2, 0x78, 0x6d, 0x48, 0xff, 0xca, 0x48, 0x89, | |
0x11, 0x0f, 0x84, 0xfa, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x4f, 0x08, 0x48, 0x85, 0xc9, 0x0f, 0x85, | |
0x8f, 0x00, 0x00, 0x00, 0x0f, 0xb7, 0x77, 0x04, | |
0x83, 0xfe, 0x0f, 0x73, 0x4b, 0x80, 0x38, 0xff, | |
0x74, 0x65, 0x48, 0x8b, 0x1d, 0x00, 0x00, 0x00, | |
0x00, 0x0f, 0xb6, 0x4b, 0x22, 0xc1, 0xe9, 0x02, | |
0xff, 0xc1, 0x49, 0x89, 0x6d, 0x40, 0x89, 0x4c, | |
0x24, 0x20, 0x4c, 0x8d, 0x4c, 0x24, 0x30, 0x4c, | |
0x89, 0xe9, 0x49, 0x89, 0xc6, 0x48, 0x89, 0xc2, | |
0x49, 0x89, 0xe8, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, 0xc7, 0x45, | |
0x40, 0x00, 0x00, 0x00, 0x00, 0x85, 0xc0, 0x7e, | |
0x68, 0x48, 0x8b, 0x4c, 0x24, 0x30, 0xeb, 0x37, | |
0x83, 0xc6, 0xf0, 0x66, 0x89, 0x77, 0x04, 0x48, | |
0x8b, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x49, 0x89, | |
0x8c, 0x24, 0x08, 0x01, 0x00, 0x00, 0x49, 0x89, | |
0x6d, 0x40, 0x48, 0x83, 0xc4, 0x38, 0xc3, 0x48, | |
0x8b, 0x8b, 0x98, 0x00, 0x00, 0x00, 0x0f, 0xb6, | |
0x40, 0x01, 0x48, 0x8b, 0x4c, 0xc1, 0x08, 0x8b, | |
0x01, 0xff, 0xc0, 0x74, 0x02, 0x89, 0x01, 0x48, | |
0x89, 0x4f, 0x08, 0x8b, 0x01, 0xff, 0xc0, 0x74, | |
0x06, 0x89, 0x01, 0x48, 0x8b, 0x4f, 0x08, 0x48, | |
0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x49, 0x89, | |
0x84, 0x24, 0x08, 0x01, 0x00, 0x00, 0x48, 0x8b, | |
0x41, 0x78, 0x48, 0x83, 0xc4, 0x38, 0x48, 0xff, | |
0xe0, 0x66, 0xba, 0xfc, 0xff, 0x66, 0x83, 0xfe, | |
0x0b, 0x77, 0x12, 0xff, 0xc6, 0xba, 0xff, 0xff, | |
0xff, 0xff, 0x89, 0xf1, 0xd3, 0xe2, 0xf7, 0xd2, | |
0xc1, 0xe2, 0x04, 0x09, 0xf2, 0x66, 0x89, 0x57, | |
0x04, 0x85, 0xc0, 0x78, 0x2e, 0x4c, 0x89, 0xf0, | |
0x49, 0x89, 0x9c, 0x24, 0x08, 0x01, 0x00, 0x00, | |
0x49, 0x89, 0x6d, 0x40, 0x48, 0x83, 0xc4, 0x38, | |
0xc3, 0x48, 0x89, 0xc6, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x89, 0xf0, 0x48, 0x8b, 0x4f, | |
0x08, 0x48, 0x85, 0xc9, 0x75, 0x8d, 0xe9, 0xf9, | |
0xfe, 0xff, 0xff, 0x49, 0x89, 0x9c, 0x24, 0x08, | |
0x01, 0x00, 0x00, 0x49, 0x89, 0x6d, 0x40, 0x31, | |
0xc0, 0x48, 0x83, 0xc4, 0x38, 0xc3, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: EXECUTOR | |
// 10: &_PyOptimizer_Optimize+0x0 | |
// 18: &_Py_Dealloc+0x0 | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, (uintptr_t)executor); | |
patch_64(data + 0x10, (uintptr_t)&_PyOptimizer_Optimize); | |
patch_64(data + 0x18, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x6d, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x95, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xba, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0xfa, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x14e, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__EXPAND_METHOD( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_EXPAND_METHOD.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: ba fe ff ff ff movl $0xfffffffe, %edx # imm = 0xFFFFFFFE | |
// 10: 29 c2 subl %eax, %edx | |
// 12: f7 d0 notl %eax | |
// 14: 48 63 c8 movslq %eax, %rcx | |
// 17: 48 63 c2 movslq %edx, %rax | |
// 1a: 48 8b 54 c5 00 movq (%rbp,%rax,8), %rdx | |
// 1f: 48 8b 72 18 movq 0x18(%rdx), %rsi | |
// 23: 8b 3e movl (%rsi), %edi | |
// 25: ff c7 incl %edi | |
// 27: 74 02 je 0x2b <_JIT_ENTRY+0x2b> | |
// 29: 89 3e movl %edi, (%rsi) | |
// 2b: 48 89 74 cd 00 movq %rsi, (%rbp,%rcx,8) | |
// 30: 48 8b 4c c5 00 movq (%rbp,%rax,8), %rcx | |
// 35: 48 8b 52 10 movq 0x10(%rdx), %rdx | |
// 39: 8b 32 movl (%rdx), %esi | |
// 3b: ff c6 incl %esi | |
// 3d: 74 02 je 0x41 <_JIT_ENTRY+0x41> | |
// 3f: 89 32 movl %esi, (%rdx) | |
// 41: 48 89 54 c5 00 movq %rdx, (%rbp,%rax,8) | |
// 46: 48 8b 01 movq (%rcx), %rax | |
// 49: 85 c0 testl %eax, %eax | |
// 4b: 78 08 js 0x55 <_JIT_ENTRY+0x55> | |
// 4d: 48 ff c8 decq %rax | |
// 50: 48 89 01 movq %rax, (%rcx) | |
// 53: 74 0b je 0x60 <_JIT_ENTRY+0x60> | |
// 55: 48 83 c4 28 addq $0x28, %rsp | |
// 59: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x60 <_JIT_ENTRY+0x60> | |
// 000000000000005c: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 60: ff 15 00 00 00 00 callq *(%rip) # 0x66 <_JIT_ENTRY+0x66> | |
// 0000000000000062: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 66: 48 83 c4 28 addq $0x28, %rsp | |
// 6a: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x71 <_JIT_ENTRY+0x71> | |
// 000000000000006d: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 6a: | |
const unsigned char code_body[106] = { | |
0x48, 0x83, 0xec, 0x28, 0x0f, 0xb7, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0xba, 0xfe, 0xff, 0xff, 0xff, | |
0x29, 0xc2, 0xf7, 0xd0, 0x48, 0x63, 0xc8, 0x48, | |
0x63, 0xc2, 0x48, 0x8b, 0x54, 0xc5, 0x00, 0x48, | |
0x8b, 0x72, 0x18, 0x8b, 0x3e, 0xff, 0xc7, 0x74, | |
0x02, 0x89, 0x3e, 0x48, 0x89, 0x74, 0xcd, 0x00, | |
0x48, 0x8b, 0x4c, 0xc5, 0x00, 0x48, 0x8b, 0x52, | |
0x10, 0x8b, 0x32, 0xff, 0xc6, 0x74, 0x02, 0x89, | |
0x32, 0x48, 0x89, 0x54, 0xc5, 0x00, 0x48, 0x8b, | |
0x01, 0x85, 0xc0, 0x78, 0x08, 0x48, 0xff, 0xc8, | |
0x48, 0x89, 0x01, 0x74, 0x0b, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x83, | |
0xc4, 0x28, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: CONTINUE | |
// 10: &_Py_Dealloc+0x0 | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x5c, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x62, (uintptr_t)data + 0xc); | |
} | |
void | |
emit__EXPAND_METHOD_KW( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_EXPAND_METHOD_KW.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: b9 fe ff ff ff movl $0xfffffffe, %ecx # imm = 0xFFFFFFFE | |
// 10: 29 c1 subl %eax, %ecx | |
// 12: 48 63 d1 movslq %ecx, %rdx | |
// 15: b9 fd ff ff ff movl $0xfffffffd, %ecx # imm = 0xFFFFFFFD | |
// 1a: 29 c1 subl %eax, %ecx | |
// 1c: 48 63 c1 movslq %ecx, %rax | |
// 1f: 48 8b 4c c5 00 movq (%rbp,%rax,8), %rcx | |
// 24: 48 8b 71 18 movq 0x18(%rcx), %rsi | |
// 28: 8b 3e movl (%rsi), %edi | |
// 2a: ff c7 incl %edi | |
// 2c: 74 02 je 0x30 <_JIT_ENTRY+0x30> | |
// 2e: 89 3e movl %edi, (%rsi) | |
// 30: 48 89 74 d5 00 movq %rsi, (%rbp,%rdx,8) | |
// 35: 48 8b 51 10 movq 0x10(%rcx), %rdx | |
// 39: 8b 32 movl (%rdx), %esi | |
// 3b: ff c6 incl %esi | |
// 3d: 74 02 je 0x41 <_JIT_ENTRY+0x41> | |
// 3f: 89 32 movl %esi, (%rdx) | |
// 41: 48 89 54 c5 00 movq %rdx, (%rbp,%rax,8) | |
// 46: 48 8b 01 movq (%rcx), %rax | |
// 49: 85 c0 testl %eax, %eax | |
// 4b: 78 08 js 0x55 <_JIT_ENTRY+0x55> | |
// 4d: 48 ff c8 decq %rax | |
// 50: 48 89 01 movq %rax, (%rcx) | |
// 53: 74 0b je 0x60 <_JIT_ENTRY+0x60> | |
// 55: 48 83 c4 28 addq $0x28, %rsp | |
// 59: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x60 <_JIT_ENTRY+0x60> | |
// 000000000000005c: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 60: ff 15 00 00 00 00 callq *(%rip) # 0x66 <_JIT_ENTRY+0x66> | |
// 0000000000000062: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 66: 48 83 c4 28 addq $0x28, %rsp | |
// 6a: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x71 <_JIT_ENTRY+0x71> | |
// 000000000000006d: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 6a: | |
const unsigned char code_body[106] = { | |
0x48, 0x83, 0xec, 0x28, 0x0f, 0xb7, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0xb9, 0xfe, 0xff, 0xff, 0xff, | |
0x29, 0xc1, 0x48, 0x63, 0xd1, 0xb9, 0xfd, 0xff, | |
0xff, 0xff, 0x29, 0xc1, 0x48, 0x63, 0xc1, 0x48, | |
0x8b, 0x4c, 0xc5, 0x00, 0x48, 0x8b, 0x71, 0x18, | |
0x8b, 0x3e, 0xff, 0xc7, 0x74, 0x02, 0x89, 0x3e, | |
0x48, 0x89, 0x74, 0xd5, 0x00, 0x48, 0x8b, 0x51, | |
0x10, 0x8b, 0x32, 0xff, 0xc6, 0x74, 0x02, 0x89, | |
0x32, 0x48, 0x89, 0x54, 0xc5, 0x00, 0x48, 0x8b, | |
0x01, 0x85, 0xc0, 0x78, 0x08, 0x48, 0xff, 0xc8, | |
0x48, 0x89, 0x01, 0x74, 0x0b, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x83, | |
0xc4, 0x28, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: CONTINUE | |
// 10: &_Py_Dealloc+0x0 | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x5c, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x62, (uintptr_t)data + 0xc); | |
} | |
void | |
emit__FATAL_ERROR( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_FATAL_ERROR.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8d 0d 00 00 00 00 leaq (%rip), %rcx # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 ??_C@_0L@HIBONIGH@_JIT_ENTRY?$AA@ | |
// b: 48 8d 15 00 00 00 00 leaq (%rip), %rdx # 0x12 <_JIT_ENTRY+0x12> | |
// 000000000000000e: IMAGE_REL_AMD64_REL32 ??_C@_0BK@GCJGAMOK@Fatal?5error?5uop?5executed?4?$AA@ | |
// 12: ff 15 00 00 00 00 callq *(%rip) # 0x18 <_JIT_ENTRY+0x18> | |
// 0000000000000014: IMAGE_REL_AMD64_REL32 __imp__Py_FatalErrorFunc | |
// 18: | |
const unsigned char code_body[24] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8d, 0x0d, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x8d, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: 'Fatal error uop executed.\x00_JIT_ENTRY\x00' | |
// 25: 00 00 00 | |
// 28: &_Py_FatalErrorFunc+0x0 | |
const unsigned char data_body[48] = { | |
0x46, 0x61, 0x74, 0x61, 0x6c, 0x20, 0x65, 0x72, | |
0x72, 0x6f, 0x72, 0x20, 0x75, 0x6f, 0x70, 0x20, | |
0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x64, | |
0x2e, 0x00, 0x5f, 0x4a, 0x49, 0x54, 0x5f, 0x45, | |
0x4e, 0x54, 0x52, 0x59, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x28, (uintptr_t)&_Py_FatalErrorFunc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + 0x16); | |
patch_x86_64_32rx(code + 0xe, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x14, (uintptr_t)data + 0x24); | |
} | |
void | |
emit__FORMAT_SIMPLE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_FORMAT_SIMPLE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// 8: 48 8b 46 08 movq 0x8(%rsi), %rax | |
// c: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x13 <_JIT_ENTRY+0x13> | |
// 000000000000000f: IMAGE_REL_AMD64_REL32 __imp_PyUnicode_Type | |
// 13: 74 32 je 0x47 <_JIT_ENTRY+0x47> | |
// 15: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 19: 48 89 f1 movq %rsi, %rcx | |
// 1c: 31 d2 xorl %edx, %edx | |
// 1e: ff 15 00 00 00 00 callq *(%rip) # 0x24 <_JIT_ENTRY+0x24> | |
// 0000000000000020: IMAGE_REL_AMD64_REL32 __imp_PyObject_Format | |
// 24: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 28: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 30: 48 8b 0e movq (%rsi), %rcx | |
// 33: 85 c9 testl %ecx, %ecx | |
// 35: 78 08 js 0x3f <_JIT_ENTRY+0x3f> | |
// 37: 48 ff c9 decq %rcx | |
// 3a: 48 89 0e movq %rcx, (%rsi) | |
// 3d: 74 17 je 0x56 <_JIT_ENTRY+0x56> | |
// 3f: 48 85 c0 testq %rax, %rax | |
// 42: 74 26 je 0x6a <_JIT_ENTRY+0x6a> | |
// 44: 48 89 c6 movq %rax, %rsi | |
// 47: 48 89 75 f8 movq %rsi, -0x8(%rbp) | |
// 4b: 48 83 c4 28 addq $0x28, %rsp | |
// 4f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x56 <_JIT_ENTRY+0x56> | |
// 0000000000000052: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 56: 48 89 f1 movq %rsi, %rcx | |
// 59: 48 89 c6 movq %rax, %rsi | |
// 5c: ff 15 00 00 00 00 callq *(%rip) # 0x62 <_JIT_ENTRY+0x62> | |
// 000000000000005e: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 62: 48 89 f0 movq %rsi, %rax | |
// 65: 48 85 c0 testq %rax, %rax | |
// 68: 75 da jne 0x44 <_JIT_ENTRY+0x44> | |
// 6a: 48 83 c4 28 addq $0x28, %rsp | |
// 6e: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x75 <_JIT_ENTRY+0x75> | |
// 0000000000000071: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 75: | |
const unsigned char code_body[117] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x75, 0xf8, | |
0x48, 0x8b, 0x46, 0x08, 0x48, 0x3b, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x74, 0x32, 0x49, 0x89, 0x6d, | |
0x40, 0x48, 0x89, 0xf1, 0x31, 0xd2, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, | |
0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8b, 0x0e, 0x85, 0xc9, 0x78, 0x08, 0x48, | |
0xff, 0xc9, 0x48, 0x89, 0x0e, 0x74, 0x17, 0x48, | |
0x85, 0xc0, 0x74, 0x26, 0x48, 0x89, 0xc6, 0x48, | |
0x89, 0x75, 0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, | |
0xf1, 0x48, 0x89, 0xc6, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x89, 0xf0, 0x48, 0x85, 0xc0, | |
0x75, 0xda, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PyUnicode_Type+0x0 | |
// 8: &PyObject_Format+0x0 | |
// 10: CONTINUE | |
// 18: &_Py_Dealloc+0x0 | |
// 20: ERROR_TARGET | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyUnicode_Type); | |
patch_64(data + 0x8, (uintptr_t)&PyObject_Format); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x20, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xf, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x20, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x52, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x5e, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x71, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__FORMAT_WITH_SPEC( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_FORMAT_WITH_SPEC.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 5d f0 movq -0x10(%rbp), %rbx | |
// 8: 48 8b 7d f8 movq -0x8(%rbp), %rdi | |
// c: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 10: 48 89 d9 movq %rbx, %rcx | |
// 13: 48 89 fa movq %rdi, %rdx | |
// 16: ff 15 00 00 00 00 callq *(%rip) # 0x1c <_JIT_ENTRY+0x1c> | |
// 0000000000000018: IMAGE_REL_AMD64_REL32 __imp_PyObject_Format | |
// 1c: 48 89 c6 movq %rax, %rsi | |
// 1f: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 23: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 2b: 48 8b 03 movq (%rbx), %rax | |
// 2e: 85 c0 testl %eax, %eax | |
// 30: 78 08 js 0x3a <_JIT_ENTRY+0x3a> | |
// 32: 48 ff c8 decq %rax | |
// 35: 48 89 03 movq %rax, (%rbx) | |
// 38: 74 1a je 0x54 <_JIT_ENTRY+0x54> | |
// 3a: 48 8b 07 movq (%rdi), %rax | |
// 3d: 85 c0 testl %eax, %eax | |
// 3f: 78 23 js 0x64 <_JIT_ENTRY+0x64> | |
// 41: 48 ff c8 decq %rax | |
// 44: 48 89 07 movq %rax, (%rdi) | |
// 47: 75 1b jne 0x64 <_JIT_ENTRY+0x64> | |
// 49: 48 89 f9 movq %rdi, %rcx | |
// 4c: ff 15 00 00 00 00 callq *(%rip) # 0x52 <_JIT_ENTRY+0x52> | |
// 000000000000004e: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 52: eb 10 jmp 0x64 <_JIT_ENTRY+0x64> | |
// 54: 48 89 d9 movq %rbx, %rcx | |
// 57: ff 15 00 00 00 00 callq *(%rip) # 0x5d <_JIT_ENTRY+0x5d> | |
// 0000000000000059: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 5d: 48 8b 07 movq (%rdi), %rax | |
// 60: 85 c0 testl %eax, %eax | |
// 62: 79 dd jns 0x41 <_JIT_ENTRY+0x41> | |
// 64: 48 85 f6 testq %rsi, %rsi | |
// 67: 74 13 je 0x7c <_JIT_ENTRY+0x7c> | |
// 69: 48 89 75 f0 movq %rsi, -0x10(%rbp) | |
// 6d: 48 83 c5 f8 addq $-0x8, %rbp | |
// 71: 48 83 c4 28 addq $0x28, %rsp | |
// 75: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x7c <_JIT_ENTRY+0x7c> | |
// 0000000000000078: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 7c: 48 83 c4 28 addq $0x28, %rsp | |
// 80: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x87 <_JIT_ENTRY+0x87> | |
// 0000000000000083: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 87: | |
const unsigned char code_body[135] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x5d, 0xf0, | |
0x48, 0x8b, 0x7d, 0xf8, 0x49, 0x89, 0x6d, 0x40, | |
0x48, 0x89, 0xd9, 0x48, 0x89, 0xfa, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0xc6, 0x49, | |
0x8b, 0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x8b, 0x03, 0x85, 0xc0, | |
0x78, 0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x03, | |
0x74, 0x1a, 0x48, 0x8b, 0x07, 0x85, 0xc0, 0x78, | |
0x23, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x07, 0x75, | |
0x1b, 0x48, 0x89, 0xf9, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0xeb, 0x10, 0x48, 0x89, 0xd9, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x07, | |
0x85, 0xc0, 0x79, 0xdd, 0x48, 0x85, 0xf6, 0x74, | |
0x13, 0x48, 0x89, 0x75, 0xf0, 0x48, 0x83, 0xc5, | |
0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, 0x28, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PyObject_Format+0x0 | |
// 8: &_Py_Dealloc+0x0 | |
// 10: CONTINUE | |
// 18: ERROR_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyObject_Format); | |
patch_64(data + 0x8, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x18, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x4e, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x59, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x78, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x83, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__FOR_ITER_GEN_FRAME( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_FOR_ITER_GEN_FRAME.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 8b 48 08 movq 0x8(%rax), %rcx | |
// 8: 48 3b 0d 00 00 00 00 cmpq (%rip), %rcx # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp_PyGen_Type | |
// f: 75 06 jne 0x17 <_JIT_ENTRY+0x17> | |
// 11: 80 78 43 00 cmpb $0x0, 0x43(%rax) | |
// 15: 78 07 js 0x1e <_JIT_ENTRY+0x1e> | |
// 17: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1e <_JIT_ENTRY+0x1e> | |
// 000000000000001a: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 1e: 48 8b 88 88 00 00 00 movq 0x88(%rax), %rcx | |
// 25: 48 8b 15 00 00 00 00 movq (%rip), %rdx # 0x2c <_JIT_ENTRY+0x2c> | |
// 0000000000000028: IMAGE_REL_AMD64_REL32 __imp__Py_NoneStruct | |
// 2c: 48 89 11 movq %rdx, (%rcx) | |
// 2f: 48 83 80 88 00 00 00 08 addq $0x8, 0x88(%rax) | |
// 37: 48 8d 48 48 leaq 0x48(%rax), %rcx | |
// 3b: c6 40 43 00 movb $0x0, 0x43(%rax) | |
// 3f: 49 8b 54 24 78 movq 0x78(%r12), %rdx | |
// 44: 48 8d 70 28 leaq 0x28(%rax), %rsi | |
// 48: 48 89 50 30 movq %rdx, 0x30(%rax) | |
// 4c: 49 89 74 24 78 movq %rsi, 0x78(%r12) | |
// 51: 4c 89 68 50 movq %r13, 0x50(%rax) | |
// 55: 8b 05 00 00 00 00 movl (%rip), %eax # 0x5b <_JIT_ENTRY+0x5b> | |
// 0000000000000057: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 5b: 83 c0 02 addl $0x2, %eax | |
// 5e: 66 41 89 45 48 movw %ax, 0x48(%r13) | |
// 63: 48 89 4d 00 movq %rcx, (%rbp) | |
// 67: 48 83 c5 08 addq $0x8, %rbp | |
// 6b: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x72 <_JIT_ENTRY+0x72> | |
// 000000000000006e: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 6b: | |
const unsigned char code_body[107] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x8b, 0x48, 0x08, | |
0x48, 0x3b, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x75, | |
0x06, 0x80, 0x78, 0x43, 0x00, 0x78, 0x07, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, | |
0x88, 0x88, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0x11, 0x48, | |
0x83, 0x80, 0x88, 0x00, 0x00, 0x00, 0x08, 0x48, | |
0x8d, 0x48, 0x48, 0xc6, 0x40, 0x43, 0x00, 0x49, | |
0x8b, 0x54, 0x24, 0x78, 0x48, 0x8d, 0x70, 0x28, | |
0x48, 0x89, 0x50, 0x30, 0x49, 0x89, 0x74, 0x24, | |
0x78, 0x4c, 0x89, 0x68, 0x50, 0x8b, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x83, 0xc0, 0x02, 0x66, 0x41, | |
0x89, 0x45, 0x48, 0x48, 0x89, 0x4d, 0x00, 0x48, | |
0x83, 0xc5, 0x08, | |
}; | |
// 0: | |
// 0: &PyGen_Type+0x0 | |
// 8: JUMP_TARGET | |
// 10: &_Py_NoneStruct+0x0 | |
// 18: OPARG | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyGen_Type); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x10, (uintptr_t)&_Py_NoneStruct); | |
patch_64(data + 0x18, instruction->oparg); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1a, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x28, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x57, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__FOR_ITER_TIER_TWO( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_FOR_ITER_TIER_TWO.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 4d f8 movq -0x8(%rbp), %rcx | |
// 8: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// c: 48 8b 41 08 movq 0x8(%rcx), %rax | |
// 10: ff 90 e0 00 00 00 callq *0xe0(%rax) | |
// 16: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 1a: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 22: 48 85 c0 testq %rax, %rax | |
// 25: 74 13 je 0x3a <_JIT_ENTRY+0x3a> | |
// 27: 48 89 45 00 movq %rax, (%rbp) | |
// 2b: 48 83 c5 08 addq $0x8, %rbp | |
// 2f: 48 83 c4 28 addq $0x28, %rsp | |
// 33: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x3a <_JIT_ENTRY+0x3a> | |
// 0000000000000036: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 3a: 49 8b 44 24 70 movq 0x70(%r12), %rax | |
// 3f: 48 85 c0 testq %rax, %rax | |
// 42: 74 57 je 0x9b <_JIT_ENTRY+0x9b> | |
// 44: 48 83 78 08 00 cmpq $0x0, 0x8(%rax) | |
// 49: 74 50 je 0x9b <_JIT_ENTRY+0x9b> | |
// 4b: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 4f: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x56 <_JIT_ENTRY+0x56> | |
// 0000000000000052: IMAGE_REL_AMD64_REL32 __imp_PyExc_StopIteration | |
// 56: 48 8b 10 movq (%rax), %rdx | |
// 59: 4c 89 e1 movq %r12, %rcx | |
// 5c: ff 15 00 00 00 00 callq *(%rip) # 0x62 <_JIT_ENTRY+0x62> | |
// 000000000000005e: IMAGE_REL_AMD64_REL32 __imp__PyErr_ExceptionMatches | |
// 62: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 66: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 6e: 85 c0 testl %eax, %eax | |
// 70: 74 34 je 0xa6 <_JIT_ENTRY+0xa6> | |
// 72: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 76: 4d 8b 45 38 movq 0x38(%r13), %r8 | |
// 7a: 4c 89 e1 movq %r12, %rcx | |
// 7d: 4c 89 ea movq %r13, %rdx | |
// 80: ff 15 00 00 00 00 callq *(%rip) # 0x86 <_JIT_ENTRY+0x86> | |
// 0000000000000082: IMAGE_REL_AMD64_REL32 __imp__PyEval_MonitorRaise | |
// 86: 4c 89 e1 movq %r12, %rcx | |
// 89: ff 15 00 00 00 00 callq *(%rip) # 0x8f <_JIT_ENTRY+0x8f> | |
// 000000000000008b: IMAGE_REL_AMD64_REL32 __imp__PyErr_Clear | |
// 8f: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 93: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 9b: 48 83 c4 28 addq $0x28, %rsp | |
// 9f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xa6 <_JIT_ENTRY+0xa6> | |
// 00000000000000a2: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// a6: 48 83 c4 28 addq $0x28, %rsp | |
// aa: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xb1 <_JIT_ENTRY+0xb1> | |
// 00000000000000ad: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// b1: | |
const unsigned char code_body[177] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x4d, 0xf8, | |
0x49, 0x89, 0x6d, 0x40, 0x48, 0x8b, 0x41, 0x08, | |
0xff, 0x90, 0xe0, 0x00, 0x00, 0x00, 0x49, 0x8b, | |
0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x85, 0xc0, 0x74, 0x13, 0x48, | |
0x89, 0x45, 0x00, 0x48, 0x83, 0xc5, 0x08, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x49, 0x8b, 0x44, 0x24, 0x70, 0x48, | |
0x85, 0xc0, 0x74, 0x57, 0x48, 0x83, 0x78, 0x08, | |
0x00, 0x74, 0x50, 0x49, 0x89, 0x6d, 0x40, 0x48, | |
0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, | |
0x10, 0x4c, 0x89, 0xe1, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, 0xc7, | |
0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x85, 0xc0, | |
0x74, 0x34, 0x49, 0x89, 0x6d, 0x40, 0x4d, 0x8b, | |
0x45, 0x38, 0x4c, 0x89, 0xe1, 0x4c, 0x89, 0xea, | |
0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x89, | |
0xe1, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x49, | |
0x8b, 0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x83, | |
0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, | |
}; | |
// 0: | |
// 0: CONTINUE | |
// 8: &PyExc_StopIteration+0x0 | |
// 10: &_PyErr_ExceptionMatches+0x0 | |
// 18: &_PyEval_MonitorRaise+0x0 | |
// 20: &_PyErr_Clear+0x0 | |
// 28: JUMP_TARGET | |
// 30: ERROR_TARGET | |
const unsigned char data_body[56] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x8, (uintptr_t)&PyExc_StopIteration); | |
patch_64(data + 0x10, (uintptr_t)&_PyErr_ExceptionMatches); | |
patch_64(data + 0x18, (uintptr_t)&_PyEval_MonitorRaise); | |
patch_64(data + 0x20, (uintptr_t)&_PyErr_Clear); | |
patch_64(data + 0x28, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x30, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x36, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x52, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x5e, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x82, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x8b, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0xa2, (uintptr_t)data + 0x24); | |
patch_x86_64_32rx(code + 0xad, (uintptr_t)data + 0x2c); | |
} | |
void | |
emit__GET_AITER( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GET_AITER.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 7d f8 movq -0x8(%rbp), %rdi | |
// 8: 48 8b 47 08 movq 0x8(%rdi), %rax | |
// c: 48 8b 48 50 movq 0x50(%rax), %rcx | |
// 10: 48 85 c9 testq %rcx, %rcx | |
// 13: 74 60 je 0x75 <_JIT_ENTRY+0x75> | |
// 15: 48 8b 51 08 movq 0x8(%rcx), %rdx | |
// 19: 48 85 d2 testq %rdx, %rdx | |
// 1c: 74 57 je 0x75 <_JIT_ENTRY+0x75> | |
// 1e: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 22: 48 89 f9 movq %rdi, %rcx | |
// 25: ff d2 callq *%rdx | |
// 27: 48 89 c6 movq %rax, %rsi | |
// 2a: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 2e: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 36: 48 8b 07 movq (%rdi), %rax | |
// 39: 85 c0 testl %eax, %eax | |
// 3b: 78 0c js 0x49 <_JIT_ENTRY+0x49> | |
// 3d: 48 ff c8 decq %rax | |
// 40: 48 89 07 movq %rax, (%rdi) | |
// 43: 0f 84 dd 00 00 00 je 0x126 <_JIT_ENTRY+0x126> | |
// 49: 48 85 f6 testq %rsi, %rsi | |
// 4c: 0f 84 e6 00 00 00 je 0x138 <_JIT_ENTRY+0x138> | |
// 52: 48 8b 46 08 movq 0x8(%rsi), %rax | |
// 56: 48 8b 48 50 movq 0x50(%rax), %rcx | |
// 5a: 48 85 c9 testq %rcx, %rcx | |
// 5d: 74 5e je 0xbd <_JIT_ENTRY+0xbd> | |
// 5f: 48 83 79 10 00 cmpq $0x0, 0x10(%rcx) | |
// 64: 74 57 je 0xbd <_JIT_ENTRY+0xbd> | |
// 66: 48 89 75 f8 movq %rsi, -0x8(%rbp) | |
// 6a: 48 83 c4 28 addq $0x28, %rsp | |
// 6e: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x75 <_JIT_ENTRY+0x75> | |
// 0000000000000071: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 75: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 79: 4c 8b 48 18 movq 0x18(%rax), %r9 | |
// 7d: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x84 <_JIT_ENTRY+0x84> | |
// 0000000000000080: IMAGE_REL_AMD64_REL32 __imp_PyExc_TypeError | |
// 84: 48 8b 10 movq (%rax), %rdx | |
// 87: 4c 8d 05 00 00 00 00 leaq (%rip), %r8 # 0x8e <_JIT_ENTRY+0x8e> | |
// 000000000000008a: IMAGE_REL_AMD64_REL32 ??_C@_0EB@HAIFCLCF@?8async?5for?8?5requires?5an?5object?5w@ | |
// 8e: 4c 89 e1 movq %r12, %rcx | |
// 91: ff 15 00 00 00 00 callq *(%rip) # 0x97 <_JIT_ENTRY+0x97> | |
// 0000000000000093: IMAGE_REL_AMD64_REL32 __imp__PyErr_Format | |
// 97: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 9b: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// a3: 48 8b 07 movq (%rdi), %rax | |
// a6: 85 c0 testl %eax, %eax | |
// a8: 78 08 js 0xb2 <_JIT_ENTRY+0xb2> | |
// aa: 48 ff c8 decq %rax | |
// ad: 48 89 07 movq %rax, (%rdi) | |
// b0: 74 60 je 0x112 <_JIT_ENTRY+0x112> | |
// b2: 48 83 c4 28 addq $0x28, %rsp | |
// b6: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xbd <_JIT_ENTRY+0xbd> | |
// 00000000000000b9: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// bd: 48 83 c5 f8 addq $-0x8, %rbp | |
// c1: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// c5: 4c 8b 48 18 movq 0x18(%rax), %r9 | |
// c9: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0xd0 <_JIT_ENTRY+0xd0> | |
// 00000000000000cc: IMAGE_REL_AMD64_REL32 __imp_PyExc_TypeError | |
// d0: 48 8b 10 movq (%rax), %rdx | |
// d3: 4c 8d 05 00 00 00 00 leaq (%rip), %r8 # 0xda <_JIT_ENTRY+0xda> | |
// 00000000000000d6: IMAGE_REL_AMD64_REL32 ??_C@_0FI@MHPMLJOA@?8async?5for?8?5received?5an?5object?5f@ | |
// da: 4c 89 e1 movq %r12, %rcx | |
// dd: ff 15 00 00 00 00 callq *(%rip) # 0xe3 <_JIT_ENTRY+0xe3> | |
// 00000000000000df: IMAGE_REL_AMD64_REL32 __imp__PyErr_Format | |
// e3: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// e7: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// ef: 48 8b 06 movq (%rsi), %rax | |
// f2: 85 c0 testl %eax, %eax | |
// f4: 78 11 js 0x107 <_JIT_ENTRY+0x107> | |
// f6: 48 ff c8 decq %rax | |
// f9: 48 89 06 movq %rax, (%rsi) | |
// fc: 75 09 jne 0x107 <_JIT_ENTRY+0x107> | |
// fe: 48 89 f1 movq %rsi, %rcx | |
// 101: ff 15 00 00 00 00 callq *(%rip) # 0x107 <_JIT_ENTRY+0x107> | |
// 0000000000000103: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 107: 48 83 c4 28 addq $0x28, %rsp | |
// 10b: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x112 <_JIT_ENTRY+0x112> | |
// 000000000000010e: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 112: 48 89 f9 movq %rdi, %rcx | |
// 115: ff 15 00 00 00 00 callq *(%rip) # 0x11b <_JIT_ENTRY+0x11b> | |
// 0000000000000117: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 11b: 48 83 c4 28 addq $0x28, %rsp | |
// 11f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x126 <_JIT_ENTRY+0x126> | |
// 0000000000000122: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 126: 48 89 f9 movq %rdi, %rcx | |
// 129: ff 15 00 00 00 00 callq *(%rip) # 0x12f <_JIT_ENTRY+0x12f> | |
// 000000000000012b: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 12f: 48 85 f6 testq %rsi, %rsi | |
// 132: 0f 85 1a ff ff ff jne 0x52 <_JIT_ENTRY+0x52> | |
// 138: 48 83 c4 28 addq $0x28, %rsp | |
// 13c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x143 <_JIT_ENTRY+0x143> | |
// 000000000000013f: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 143: | |
const unsigned char code_body[323] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x7d, 0xf8, | |
0x48, 0x8b, 0x47, 0x08, 0x48, 0x8b, 0x48, 0x50, | |
0x48, 0x85, 0xc9, 0x74, 0x60, 0x48, 0x8b, 0x51, | |
0x08, 0x48, 0x85, 0xd2, 0x74, 0x57, 0x49, 0x89, | |
0x6d, 0x40, 0x48, 0x89, 0xf9, 0xff, 0xd2, 0x48, | |
0x89, 0xc6, 0x49, 0x8b, 0x6d, 0x40, 0x49, 0xc7, | |
0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, | |
0x07, 0x85, 0xc0, 0x78, 0x0c, 0x48, 0xff, 0xc8, | |
0x48, 0x89, 0x07, 0x0f, 0x84, 0xdd, 0x00, 0x00, | |
0x00, 0x48, 0x85, 0xf6, 0x0f, 0x84, 0xe6, 0x00, | |
0x00, 0x00, 0x48, 0x8b, 0x46, 0x08, 0x48, 0x8b, | |
0x48, 0x50, 0x48, 0x85, 0xc9, 0x74, 0x5e, 0x48, | |
0x83, 0x79, 0x10, 0x00, 0x74, 0x57, 0x48, 0x89, | |
0x75, 0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, 0x49, 0x89, 0x6d, | |
0x40, 0x4c, 0x8b, 0x48, 0x18, 0x48, 0x8b, 0x05, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x10, 0x4c, | |
0x8d, 0x05, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x89, | |
0xe1, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x49, | |
0x8b, 0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x8b, 0x07, 0x85, 0xc0, | |
0x78, 0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x07, | |
0x74, 0x60, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x83, 0xc5, | |
0xf8, 0x49, 0x89, 0x6d, 0x40, 0x4c, 0x8b, 0x48, | |
0x18, 0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8b, 0x10, 0x4c, 0x8d, 0x05, 0x00, 0x00, | |
0x00, 0x00, 0x4c, 0x89, 0xe1, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, | |
0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x06, 0x85, 0xc0, 0x78, 0x11, 0x48, 0xff, | |
0xc8, 0x48, 0x89, 0x06, 0x75, 0x09, 0x48, 0x89, | |
0xf1, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x89, 0xf9, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, | |
0xf9, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x85, 0xf6, 0x0f, 0x85, 0x1a, 0xff, 0xff, 0xff, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, | |
}; | |
// 0: "'async for' requires an object with __aiter__ method, got %.100s\x00'async for' received an object from __aiter__ that does not implement __anext__: %.100s\x00" | |
// 99: 00 00 00 00 00 00 00 | |
// a0: CONTINUE | |
// a8: &PyExc_TypeError+0x0 | |
// b0: &_PyErr_Format+0x0 | |
// b8: ERROR_TARGET | |
// c0: &_Py_Dealloc+0x0 | |
const unsigned char data_body[200] = { | |
0x27, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x20, 0x66, | |
0x6f, 0x72, 0x27, 0x20, 0x72, 0x65, 0x71, 0x75, | |
0x69, 0x72, 0x65, 0x73, 0x20, 0x61, 0x6e, 0x20, | |
0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x77, | |
0x69, 0x74, 0x68, 0x20, 0x5f, 0x5f, 0x61, 0x69, | |
0x74, 0x65, 0x72, 0x5f, 0x5f, 0x20, 0x6d, 0x65, | |
0x74, 0x68, 0x6f, 0x64, 0x2c, 0x20, 0x67, 0x6f, | |
0x74, 0x20, 0x25, 0x2e, 0x31, 0x30, 0x30, 0x73, | |
0x00, 0x27, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x20, | |
0x66, 0x6f, 0x72, 0x27, 0x20, 0x72, 0x65, 0x63, | |
0x65, 0x69, 0x76, 0x65, 0x64, 0x20, 0x61, 0x6e, | |
0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, | |
0x66, 0x72, 0x6f, 0x6d, 0x20, 0x5f, 0x5f, 0x61, | |
0x69, 0x74, 0x65, 0x72, 0x5f, 0x5f, 0x20, 0x74, | |
0x68, 0x61, 0x74, 0x20, 0x64, 0x6f, 0x65, 0x73, | |
0x20, 0x6e, 0x6f, 0x74, 0x20, 0x69, 0x6d, 0x70, | |
0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x5f, | |
0x5f, 0x61, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x5f, | |
0x3a, 0x20, 0x25, 0x2e, 0x31, 0x30, 0x30, 0x73, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0xa0, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0xa8, (uintptr_t)&PyExc_TypeError); | |
patch_64(data + 0xb0, (uintptr_t)&_PyErr_Format); | |
patch_64(data + 0xb8, state->instruction_starts[instruction->error_target]); | |
patch_64(data + 0xc0, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x71, (uintptr_t)data + 0x9c); | |
patch_x86_64_32rx(code + 0x80, (uintptr_t)data + 0xa4); | |
patch_x86_64_32rx(code + 0x8a, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x93, (uintptr_t)data + 0xac); | |
patch_x86_64_32rx(code + 0xb9, (uintptr_t)data + 0xb4); | |
patch_x86_64_32rx(code + 0xcc, (uintptr_t)data + 0xa4); | |
patch_x86_64_32rx(code + 0xd6, (uintptr_t)data + 0x3d); | |
patch_x86_64_32rx(code + 0xdf, (uintptr_t)data + 0xac); | |
patch_x86_64_32rx(code + 0x103, (uintptr_t)data + 0xbc); | |
patch_x86_64_32rx(code + 0x10e, (uintptr_t)data + 0xb4); | |
patch_x86_64_32rx(code + 0x117, (uintptr_t)data + 0xbc); | |
patch_x86_64_32rx(code + 0x122, (uintptr_t)data + 0xb4); | |
patch_x86_64_32rx(code + 0x12b, (uintptr_t)data + 0xbc); | |
patch_x86_64_32rx(code + 0x13f, (uintptr_t)data + 0xb4); | |
} | |
void | |
emit__GET_ANEXT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GET_ANEXT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 4d f8 movq -0x8(%rbp), %rcx | |
// 8: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// c: ff 15 00 00 00 00 callq *(%rip) # 0x12 <_JIT_ENTRY+0x12> | |
// 000000000000000e: IMAGE_REL_AMD64_REL32 __imp__PyEval_GetANext | |
// 12: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 16: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 1e: 48 85 c0 testq %rax, %rax | |
// 21: 74 13 je 0x36 <_JIT_ENTRY+0x36> | |
// 23: 48 89 45 00 movq %rax, (%rbp) | |
// 27: 48 83 c5 08 addq $0x8, %rbp | |
// 2b: 48 83 c4 28 addq $0x28, %rsp | |
// 2f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x36 <_JIT_ENTRY+0x36> | |
// 0000000000000032: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 36: 48 83 c4 28 addq $0x28, %rsp | |
// 3a: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x41 <_JIT_ENTRY+0x41> | |
// 000000000000003d: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 41: | |
const unsigned char code_body[65] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x4d, 0xf8, | |
0x49, 0x89, 0x6d, 0x40, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, 0xc7, | |
0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x48, 0x85, | |
0xc0, 0x74, 0x13, 0x48, 0x89, 0x45, 0x00, 0x48, | |
0x83, 0xc5, 0x08, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x83, | |
0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, | |
}; | |
// 0: | |
// 0: &_PyEval_GetANext+0x0 | |
// 8: CONTINUE | |
// 10: ERROR_TARGET | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&_PyEval_GetANext); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xe, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x32, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x3d, (uintptr_t)data + 0xc); | |
} | |
void | |
emit__GET_AWAITABLE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GET_AWAITABLE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 0f b7 15 00 00 00 00 movzwl (%rip), %edx # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// f: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 13: 48 89 f1 movq %rsi, %rcx | |
// 16: ff 15 00 00 00 00 callq *(%rip) # 0x1c <_JIT_ENTRY+0x1c> | |
// 0000000000000018: IMAGE_REL_AMD64_REL32 __imp__PyEval_GetAwaitable | |
// 1c: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 20: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 28: 48 8b 0e movq (%rsi), %rcx | |
// 2b: 85 c9 testl %ecx, %ecx | |
// 2d: 78 08 js 0x37 <_JIT_ENTRY+0x37> | |
// 2f: 48 ff c9 decq %rcx | |
// 32: 48 89 0e movq %rcx, (%rsi) | |
// 35: 74 14 je 0x4b <_JIT_ENTRY+0x4b> | |
// 37: 48 85 c0 testq %rax, %rax | |
// 3a: 74 23 je 0x5f <_JIT_ENTRY+0x5f> | |
// 3c: 48 89 45 f8 movq %rax, -0x8(%rbp) | |
// 40: 48 83 c4 28 addq $0x28, %rsp | |
// 44: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x4b <_JIT_ENTRY+0x4b> | |
// 0000000000000047: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 4b: 48 89 f1 movq %rsi, %rcx | |
// 4e: 48 89 c6 movq %rax, %rsi | |
// 51: ff 15 00 00 00 00 callq *(%rip) # 0x57 <_JIT_ENTRY+0x57> | |
// 0000000000000053: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 57: 48 89 f0 movq %rsi, %rax | |
// 5a: 48 85 c0 testq %rax, %rax | |
// 5d: 75 dd jne 0x3c <_JIT_ENTRY+0x3c> | |
// 5f: 48 83 c4 28 addq $0x28, %rsp | |
// 63: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x6a <_JIT_ENTRY+0x6a> | |
// 0000000000000066: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 6a: | |
const unsigned char code_body[106] = { | |
0x48, 0x83, 0xec, 0x28, 0x0f, 0xb7, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x8b, 0x75, 0xf8, 0x49, | |
0x89, 0x6d, 0x40, 0x48, 0x89, 0xf1, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, | |
0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8b, 0x0e, 0x85, 0xc9, 0x78, 0x08, 0x48, | |
0xff, 0xc9, 0x48, 0x89, 0x0e, 0x74, 0x14, 0x48, | |
0x85, 0xc0, 0x74, 0x23, 0x48, 0x89, 0x45, 0xf8, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x89, 0xf1, 0x48, 0x89, | |
0xc6, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x89, 0xf0, 0x48, 0x85, 0xc0, 0x75, 0xdd, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &_PyEval_GetAwaitable+0x0 | |
// 10: CONTINUE | |
// 18: &_Py_Dealloc+0x0 | |
// 20: ERROR_TARGET | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&_PyEval_GetAwaitable); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x20, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x18, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x47, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x53, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x66, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__GET_ITER( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GET_ITER.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// 8: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// c: 48 89 f1 movq %rsi, %rcx | |
// f: ff 15 00 00 00 00 callq *(%rip) # 0x15 <_JIT_ENTRY+0x15> | |
// 0000000000000011: IMAGE_REL_AMD64_REL32 __imp_PyObject_GetIter | |
// 15: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 19: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 21: 48 8b 0e movq (%rsi), %rcx | |
// 24: 85 c9 testl %ecx, %ecx | |
// 26: 78 08 js 0x30 <_JIT_ENTRY+0x30> | |
// 28: 48 ff c9 decq %rcx | |
// 2b: 48 89 0e movq %rcx, (%rsi) | |
// 2e: 74 14 je 0x44 <_JIT_ENTRY+0x44> | |
// 30: 48 85 c0 testq %rax, %rax | |
// 33: 74 23 je 0x58 <_JIT_ENTRY+0x58> | |
// 35: 48 89 45 f8 movq %rax, -0x8(%rbp) | |
// 39: 48 83 c4 28 addq $0x28, %rsp | |
// 3d: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x44 <_JIT_ENTRY+0x44> | |
// 0000000000000040: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 44: 48 89 f1 movq %rsi, %rcx | |
// 47: 48 89 c6 movq %rax, %rsi | |
// 4a: ff 15 00 00 00 00 callq *(%rip) # 0x50 <_JIT_ENTRY+0x50> | |
// 000000000000004c: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 50: 48 89 f0 movq %rsi, %rax | |
// 53: 48 85 c0 testq %rax, %rax | |
// 56: 75 dd jne 0x35 <_JIT_ENTRY+0x35> | |
// 58: 48 83 c4 28 addq $0x28, %rsp | |
// 5c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x63 <_JIT_ENTRY+0x63> | |
// 000000000000005f: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 63: | |
const unsigned char code_body[99] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x75, 0xf8, | |
0x49, 0x89, 0x6d, 0x40, 0x48, 0x89, 0xf1, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, | |
0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x8b, 0x0e, 0x85, 0xc9, 0x78, 0x08, | |
0x48, 0xff, 0xc9, 0x48, 0x89, 0x0e, 0x74, 0x14, | |
0x48, 0x85, 0xc0, 0x74, 0x23, 0x48, 0x89, 0x45, | |
0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0xf1, 0x48, | |
0x89, 0xc6, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x89, 0xf0, 0x48, 0x85, 0xc0, 0x75, 0xdd, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PyObject_GetIter+0x0 | |
// 8: CONTINUE | |
// 10: &_Py_Dealloc+0x0 | |
// 18: ERROR_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyObject_GetIter); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x18, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x11, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x40, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x4c, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x5f, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__GET_LEN( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GET_LEN.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 4d f8 movq -0x8(%rbp), %rcx | |
// 8: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// c: ff 15 00 00 00 00 callq *(%rip) # 0x12 <_JIT_ENTRY+0x12> | |
// 000000000000000e: IMAGE_REL_AMD64_REL32 __imp_PyObject_Size | |
// 12: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 16: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 1e: 48 85 c0 testq %rax, %rax | |
// 21: 78 21 js 0x44 <_JIT_ENTRY+0x44> | |
// 23: 48 89 c1 movq %rax, %rcx | |
// 26: ff 15 00 00 00 00 callq *(%rip) # 0x2c <_JIT_ENTRY+0x2c> | |
// 0000000000000028: IMAGE_REL_AMD64_REL32 __imp_PyLong_FromSsize_t | |
// 2c: 48 85 c0 testq %rax, %rax | |
// 2f: 74 13 je 0x44 <_JIT_ENTRY+0x44> | |
// 31: 48 89 45 00 movq %rax, (%rbp) | |
// 35: 48 83 c5 08 addq $0x8, %rbp | |
// 39: 48 83 c4 28 addq $0x28, %rsp | |
// 3d: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x44 <_JIT_ENTRY+0x44> | |
// 0000000000000040: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 44: 48 83 c4 28 addq $0x28, %rsp | |
// 48: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x4f <_JIT_ENTRY+0x4f> | |
// 000000000000004b: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 4f: | |
const unsigned char code_body[79] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x4d, 0xf8, | |
0x49, 0x89, 0x6d, 0x40, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, 0xc7, | |
0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x48, 0x85, | |
0xc0, 0x78, 0x21, 0x48, 0x89, 0xc1, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x85, 0xc0, 0x74, | |
0x13, 0x48, 0x89, 0x45, 0x00, 0x48, 0x83, 0xc5, | |
0x08, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, 0x28, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PyObject_Size+0x0 | |
// 8: &PyLong_FromSsize_t+0x0 | |
// 10: CONTINUE | |
// 18: ERROR_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyObject_Size); | |
patch_64(data + 0x8, (uintptr_t)&PyLong_FromSsize_t); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xe, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x28, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x40, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x4b, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__GET_YIELD_FROM_ITER( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GET_YIELD_FROM_ITER.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// 8: 48 8b 46 08 movq 0x8(%rsi), %rax | |
// c: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x13 <_JIT_ENTRY+0x13> | |
// 000000000000000f: IMAGE_REL_AMD64_REL32 __imp_PyCoro_Type | |
// 13: 74 48 je 0x5d <_JIT_ENTRY+0x5d> | |
// 15: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x1c <_JIT_ENTRY+0x1c> | |
// 0000000000000018: IMAGE_REL_AMD64_REL32 __imp_PyGen_Type | |
// 1c: 74 4e je 0x6c <_JIT_ENTRY+0x6c> | |
// 1e: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 22: 48 89 f1 movq %rsi, %rcx | |
// 25: ff 15 00 00 00 00 callq *(%rip) # 0x2b <_JIT_ENTRY+0x2b> | |
// 0000000000000027: IMAGE_REL_AMD64_REL32 __imp_PyObject_GetIter | |
// 2b: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 2f: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 37: 48 85 c0 testq %rax, %rax | |
// 3a: 74 69 je 0xa5 <_JIT_ENTRY+0xa5> | |
// 3c: 48 8b 0e movq (%rsi), %rcx | |
// 3f: 85 c9 testl %ecx, %ecx | |
// 41: 78 6d js 0xb0 <_JIT_ENTRY+0xb0> | |
// 43: 48 ff c9 decq %rcx | |
// 46: 48 89 0e movq %rcx, (%rsi) | |
// 49: 74 77 je 0xc2 <_JIT_ENTRY+0xc2> | |
// 4b: 48 89 c6 movq %rax, %rsi | |
// 4e: 48 89 75 f8 movq %rsi, -0x8(%rbp) | |
// 52: 48 83 c4 28 addq $0x28, %rsp | |
// 56: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x5d <_JIT_ENTRY+0x5d> | |
// 0000000000000059: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 5d: 49 8b 45 00 movq (%r13), %rax | |
// 61: 0f b7 40 30 movzwl 0x30(%rax), %eax | |
// 65: a9 80 01 00 00 testl $0x180, %eax # imm = 0x180 | |
// 6a: 74 0f je 0x7b <_JIT_ENTRY+0x7b> | |
// 6c: 48 89 75 f8 movq %rsi, -0x8(%rbp) | |
// 70: 48 83 c4 28 addq $0x28, %rsp | |
// 74: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x7b <_JIT_ENTRY+0x7b> | |
// 0000000000000077: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 7b: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 7f: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x86 <_JIT_ENTRY+0x86> | |
// 0000000000000082: IMAGE_REL_AMD64_REL32 __imp_PyExc_TypeError | |
// 86: 48 8b 10 movq (%rax), %rdx | |
// 89: 4c 8d 05 00 00 00 00 leaq (%rip), %r8 # 0x90 <_JIT_ENTRY+0x90> | |
// 000000000000008c: IMAGE_REL_AMD64_REL32 ??_C@_0EE@OKAKFBDN@cannot?5?8yield?5from?8?5a?5coroutine?5@ | |
// 90: 4c 89 e1 movq %r12, %rcx | |
// 93: ff 15 00 00 00 00 callq *(%rip) # 0x99 <_JIT_ENTRY+0x99> | |
// 0000000000000095: IMAGE_REL_AMD64_REL32 __imp__PyErr_SetString | |
// 99: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 9d: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// a5: 48 83 c4 28 addq $0x28, %rsp | |
// a9: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xb0 <_JIT_ENTRY+0xb0> | |
// 00000000000000ac: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// b0: 48 89 c6 movq %rax, %rsi | |
// b3: 48 89 75 f8 movq %rsi, -0x8(%rbp) | |
// b7: 48 83 c4 28 addq $0x28, %rsp | |
// bb: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xc2 <_JIT_ENTRY+0xc2> | |
// 00000000000000be: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// c2: 48 89 f1 movq %rsi, %rcx | |
// c5: 48 89 c6 movq %rax, %rsi | |
// c8: ff 15 00 00 00 00 callq *(%rip) # 0xce <_JIT_ENTRY+0xce> | |
// 00000000000000ca: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// ce: 48 89 75 f8 movq %rsi, -0x8(%rbp) | |
// d2: 48 83 c4 28 addq $0x28, %rsp | |
// d6: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xdd <_JIT_ENTRY+0xdd> | |
// 00000000000000d9: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// d6: | |
const unsigned char code_body[214] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x75, 0xf8, | |
0x48, 0x8b, 0x46, 0x08, 0x48, 0x3b, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x74, 0x48, 0x48, 0x3b, 0x05, | |
0x00, 0x00, 0x00, 0x00, 0x74, 0x4e, 0x49, 0x89, | |
0x6d, 0x40, 0x48, 0x89, 0xf1, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, | |
0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x85, 0xc0, 0x74, 0x69, 0x48, 0x8b, 0x0e, 0x85, | |
0xc9, 0x78, 0x6d, 0x48, 0xff, 0xc9, 0x48, 0x89, | |
0x0e, 0x74, 0x77, 0x48, 0x89, 0xc6, 0x48, 0x89, | |
0x75, 0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x45, | |
0x00, 0x0f, 0xb7, 0x40, 0x30, 0xa9, 0x80, 0x01, | |
0x00, 0x00, 0x74, 0x0f, 0x48, 0x89, 0x75, 0xf8, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x49, 0x89, 0x6d, 0x40, 0x48, | |
0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, | |
0x10, 0x4c, 0x8d, 0x05, 0x00, 0x00, 0x00, 0x00, | |
0x4c, 0x89, 0xe1, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, 0xc7, 0x45, | |
0x40, 0x00, 0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x89, 0xc6, 0x48, 0x89, 0x75, 0xf8, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x89, 0xf1, 0x48, 0x89, 0xc6, | |
0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, | |
0x75, 0xf8, 0x48, 0x83, 0xc4, 0x28, | |
}; | |
// 0: "cannot 'yield from' a coroutine object in a non-coroutine generator\x00" | |
// 44: 00 00 00 00 | |
// 48: &PyCoro_Type+0x0 | |
// 50: &PyGen_Type+0x0 | |
// 58: &PyObject_GetIter+0x0 | |
// 60: CONTINUE | |
// 68: &PyExc_TypeError+0x0 | |
// 70: &_PyErr_SetString+0x0 | |
// 78: ERROR_TARGET | |
// 80: &_Py_Dealloc+0x0 | |
const unsigned char data_body[136] = { | |
0x63, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x20, 0x27, | |
0x79, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x66, 0x72, | |
0x6f, 0x6d, 0x27, 0x20, 0x61, 0x20, 0x63, 0x6f, | |
0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x65, 0x20, | |
0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x69, | |
0x6e, 0x20, 0x61, 0x20, 0x6e, 0x6f, 0x6e, 0x2d, | |
0x63, 0x6f, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, | |
0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, | |
0x74, 0x6f, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x48, (uintptr_t)&PyCoro_Type); | |
patch_64(data + 0x50, (uintptr_t)&PyGen_Type); | |
patch_64(data + 0x58, (uintptr_t)&PyObject_GetIter); | |
patch_64(data + 0x60, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x68, (uintptr_t)&PyExc_TypeError); | |
patch_64(data + 0x70, (uintptr_t)&_PyErr_SetString); | |
patch_64(data + 0x78, state->instruction_starts[instruction->error_target]); | |
patch_64(data + 0x80, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xf, (uintptr_t)data + 0x44); | |
patch_x86_64_32rx(code + 0x18, (uintptr_t)data + 0x4c); | |
patch_x86_64_32rx(code + 0x27, (uintptr_t)data + 0x54); | |
patch_x86_64_32rx(code + 0x59, (uintptr_t)data + 0x5c); | |
patch_x86_64_32rx(code + 0x77, (uintptr_t)data + 0x5c); | |
patch_x86_64_32rx(code + 0x82, (uintptr_t)data + 0x64); | |
patch_x86_64_32rx(code + 0x8c, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x95, (uintptr_t)data + 0x6c); | |
patch_x86_64_32rx(code + 0xac, (uintptr_t)data + 0x74); | |
patch_x86_64_32rx(code + 0xbe, (uintptr_t)data + 0x5c); | |
patch_x86_64_32rx(code + 0xca, (uintptr_t)data + 0x7c); | |
} | |
void | |
emit__GUARD_BOTH_FLOAT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GUARD_BOTH_FLOAT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f0 movq -0x10(%rbp), %rax | |
// 4: 48 8b 40 08 movq 0x8(%rax), %rax | |
// 8: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp_PyFloat_Type | |
// f: 75 11 jne 0x22 <_JIT_ENTRY+0x22> | |
// 11: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 15: 48 8b 40 08 movq 0x8(%rax), %rax | |
// 19: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x20 <_JIT_ENTRY+0x20> | |
// 000000000000001c: IMAGE_REL_AMD64_REL32 __imp_PyFloat_Type | |
// 20: 74 07 je 0x29 <_JIT_ENTRY+0x29> | |
// 22: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x29 <_JIT_ENTRY+0x29> | |
// 0000000000000025: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 29: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x30 <_JIT_ENTRY+0x30> | |
// 000000000000002c: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 29: | |
const unsigned char code_body[41] = { | |
0x48, 0x8b, 0x45, 0xf0, 0x48, 0x8b, 0x40, 0x08, | |
0x48, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x75, | |
0x11, 0x48, 0x8b, 0x45, 0xf8, 0x48, 0x8b, 0x40, | |
0x08, 0x48, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, | |
0x74, 0x07, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, | |
}; | |
// 0: | |
// 0: &PyFloat_Type+0x0 | |
// 8: JUMP_TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyFloat_Type); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1c, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x25, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__GUARD_BOTH_INT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GUARD_BOTH_INT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f0 movq -0x10(%rbp), %rax | |
// 4: 48 8b 40 08 movq 0x8(%rax), %rax | |
// 8: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp_PyLong_Type | |
// f: 75 11 jne 0x22 <_JIT_ENTRY+0x22> | |
// 11: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 15: 48 8b 40 08 movq 0x8(%rax), %rax | |
// 19: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x20 <_JIT_ENTRY+0x20> | |
// 000000000000001c: IMAGE_REL_AMD64_REL32 __imp_PyLong_Type | |
// 20: 74 07 je 0x29 <_JIT_ENTRY+0x29> | |
// 22: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x29 <_JIT_ENTRY+0x29> | |
// 0000000000000025: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 29: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x30 <_JIT_ENTRY+0x30> | |
// 000000000000002c: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 29: | |
const unsigned char code_body[41] = { | |
0x48, 0x8b, 0x45, 0xf0, 0x48, 0x8b, 0x40, 0x08, | |
0x48, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x75, | |
0x11, 0x48, 0x8b, 0x45, 0xf8, 0x48, 0x8b, 0x40, | |
0x08, 0x48, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, | |
0x74, 0x07, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, | |
}; | |
// 0: | |
// 0: &PyLong_Type+0x0 | |
// 8: JUMP_TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyLong_Type); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1c, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x25, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__GUARD_BOTH_UNICODE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GUARD_BOTH_UNICODE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f0 movq -0x10(%rbp), %rax | |
// 4: 48 8b 40 08 movq 0x8(%rax), %rax | |
// 8: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp_PyUnicode_Type | |
// f: 75 11 jne 0x22 <_JIT_ENTRY+0x22> | |
// 11: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 15: 48 8b 40 08 movq 0x8(%rax), %rax | |
// 19: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0x20 <_JIT_ENTRY+0x20> | |
// 000000000000001c: IMAGE_REL_AMD64_REL32 __imp_PyUnicode_Type | |
// 20: 74 07 je 0x29 <_JIT_ENTRY+0x29> | |
// 22: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x29 <_JIT_ENTRY+0x29> | |
// 0000000000000025: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 29: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x30 <_JIT_ENTRY+0x30> | |
// 000000000000002c: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 29: | |
const unsigned char code_body[41] = { | |
0x48, 0x8b, 0x45, 0xf0, 0x48, 0x8b, 0x40, 0x08, | |
0x48, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x75, | |
0x11, 0x48, 0x8b, 0x45, 0xf8, 0x48, 0x8b, 0x40, | |
0x08, 0x48, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, | |
0x74, 0x07, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, | |
}; | |
// 0: | |
// 0: &PyUnicode_Type+0x0 | |
// 8: JUMP_TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyUnicode_Type); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1c, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x25, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__GUARD_BUILTINS_VERSION_PUSH_KEYS( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GUARD_BUILTINS_VERSION_PUSH_KEYS.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 49 8b 45 20 movq 0x20(%r13), %rax | |
// 4: 48 8b 48 08 movq 0x8(%rax), %rcx | |
// 8: 48 3b 0d 00 00 00 00 cmpq (%rip), %rcx # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp_PyDict_Type | |
// f: 75 1f jne 0x30 <_JIT_ENTRY+0x30> | |
// 11: 48 8b 40 20 movq 0x20(%rax), %rax | |
// 15: 0f b7 0d 00 00 00 00 movzwl (%rip), %ecx # 0x1c <_JIT_ENTRY+0x1c> | |
// 0000000000000018: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 1c: 39 48 0c cmpl %ecx, 0xc(%rax) | |
// 1f: 75 0f jne 0x30 <_JIT_ENTRY+0x30> | |
// 21: 48 89 45 00 movq %rax, (%rbp) | |
// 25: 48 83 c5 08 addq $0x8, %rbp | |
// 29: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x30 <_JIT_ENTRY+0x30> | |
// 000000000000002c: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 30: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x37 <_JIT_ENTRY+0x37> | |
// 0000000000000033: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 37: | |
const unsigned char code_body[55] = { | |
0x49, 0x8b, 0x45, 0x20, 0x48, 0x8b, 0x48, 0x08, | |
0x48, 0x3b, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x75, | |
0x1f, 0x48, 0x8b, 0x40, 0x20, 0x0f, 0xb7, 0x0d, | |
0x00, 0x00, 0x00, 0x00, 0x39, 0x48, 0x0c, 0x75, | |
0x0f, 0x48, 0x89, 0x45, 0x00, 0x48, 0x83, 0xc5, | |
0x08, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PyDict_Type+0x0 | |
// 8: OPERAND | |
// 10: CONTINUE | |
// 18: JUMP_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyDict_Type); | |
patch_64(data + 0x8, instruction->operand); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x18, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x2c, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x33, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__GUARD_DORV_NO_DICT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GUARD_DORV_NO_DICT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 83 78 e8 00 cmpq $0x0, -0x18(%rax) | |
// 9: 74 07 je 0x12 <_JIT_ENTRY+0x12> | |
// b: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x12 <_JIT_ENTRY+0x12> | |
// 000000000000000e: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 12: 48 8b 48 08 movq 0x8(%rax), %rcx | |
// 16: 48 8b 49 20 movq 0x20(%rcx), %rcx | |
// 1a: 80 7c 08 03 00 cmpb $0x0, 0x3(%rax,%rcx) | |
// 1f: 74 ea je 0xb <_JIT_ENTRY+0xb> | |
// 21: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x28 <_JIT_ENTRY+0x28> | |
// 0000000000000024: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 21: | |
const unsigned char code_body[33] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x83, 0x78, 0xe8, | |
0x00, 0x74, 0x07, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x8b, 0x48, 0x08, 0x48, 0x8b, | |
0x49, 0x20, 0x80, 0x7c, 0x08, 0x03, 0x00, 0x74, | |
0xea, | |
}; | |
// 0: | |
// 0: JUMP_TARGET | |
const unsigned char data_body[8] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xe, (uintptr_t)data + -0x4); | |
} | |
void | |
emit__GUARD_DORV_VALUES_INST_ATTR_FROM_DICT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GUARD_DORV_VALUES_INST_ATTR_FROM_DICT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 8b 48 08 movq 0x8(%rax), %rcx | |
// 8: 48 8b 49 20 movq 0x20(%rcx), %rcx | |
// c: 80 7c 08 03 00 cmpb $0x0, 0x3(%rax,%rcx) | |
// 11: 74 07 je 0x1a <_JIT_ENTRY+0x1a> | |
// 13: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1a <_JIT_ENTRY+0x1a> | |
// 0000000000000016: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 1a: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x21 <_JIT_ENTRY+0x21> | |
// 000000000000001d: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 21: | |
const unsigned char code_body[33] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x8b, 0x48, 0x08, | |
0x48, 0x8b, 0x49, 0x20, 0x80, 0x7c, 0x08, 0x03, | |
0x00, 0x74, 0x07, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, | |
}; | |
// 0: | |
// 0: CONTINUE | |
// 8: JUMP_TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x16, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1d, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__GUARD_GLOBALS_VERSION( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GUARD_GLOBALS_VERSION.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 49 8b 45 18 movq 0x18(%r13), %rax | |
// 4: 48 8b 48 08 movq 0x8(%rax), %rcx | |
// 8: 48 3b 0d 00 00 00 00 cmpq (%rip), %rcx # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp_PyDict_Type | |
// f: 75 17 jne 0x28 <_JIT_ENTRY+0x28> | |
// 11: 48 8b 40 20 movq 0x20(%rax), %rax | |
// 15: 0f b7 0d 00 00 00 00 movzwl (%rip), %ecx # 0x1c <_JIT_ENTRY+0x1c> | |
// 0000000000000018: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 1c: 39 48 0c cmpl %ecx, 0xc(%rax) | |
// 1f: 75 07 jne 0x28 <_JIT_ENTRY+0x28> | |
// 21: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x28 <_JIT_ENTRY+0x28> | |
// 0000000000000024: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 28: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x2f <_JIT_ENTRY+0x2f> | |
// 000000000000002b: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 2f: | |
const unsigned char code_body[47] = { | |
0x49, 0x8b, 0x45, 0x18, 0x48, 0x8b, 0x48, 0x08, | |
0x48, 0x3b, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x75, | |
0x17, 0x48, 0x8b, 0x40, 0x20, 0x0f, 0xb7, 0x0d, | |
0x00, 0x00, 0x00, 0x00, 0x39, 0x48, 0x0c, 0x75, | |
0x07, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PyDict_Type+0x0 | |
// 8: OPERAND | |
// 10: CONTINUE | |
// 18: JUMP_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyDict_Type); | |
patch_64(data + 0x8, instruction->operand); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x18, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x24, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x2b, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__GUARD_GLOBALS_VERSION_PUSH_KEYS( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GUARD_GLOBALS_VERSION_PUSH_KEYS.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 49 8b 45 18 movq 0x18(%r13), %rax | |
// 4: 48 8b 48 08 movq 0x8(%rax), %rcx | |
// 8: 48 3b 0d 00 00 00 00 cmpq (%rip), %rcx # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp_PyDict_Type | |
// f: 75 1f jne 0x30 <_JIT_ENTRY+0x30> | |
// 11: 48 8b 40 20 movq 0x20(%rax), %rax | |
// 15: 0f b7 0d 00 00 00 00 movzwl (%rip), %ecx # 0x1c <_JIT_ENTRY+0x1c> | |
// 0000000000000018: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 1c: 39 48 0c cmpl %ecx, 0xc(%rax) | |
// 1f: 75 0f jne 0x30 <_JIT_ENTRY+0x30> | |
// 21: 48 89 45 00 movq %rax, (%rbp) | |
// 25: 48 83 c5 08 addq $0x8, %rbp | |
// 29: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x30 <_JIT_ENTRY+0x30> | |
// 000000000000002c: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 30: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x37 <_JIT_ENTRY+0x37> | |
// 0000000000000033: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 37: | |
const unsigned char code_body[55] = { | |
0x49, 0x8b, 0x45, 0x18, 0x48, 0x8b, 0x48, 0x08, | |
0x48, 0x3b, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x75, | |
0x1f, 0x48, 0x8b, 0x40, 0x20, 0x0f, 0xb7, 0x0d, | |
0x00, 0x00, 0x00, 0x00, 0x39, 0x48, 0x0c, 0x75, | |
0x0f, 0x48, 0x89, 0x45, 0x00, 0x48, 0x83, 0xc5, | |
0x08, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PyDict_Type+0x0 | |
// 8: OPERAND | |
// 10: CONTINUE | |
// 18: JUMP_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyDict_Type); | |
patch_64(data + 0x8, instruction->operand); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x18, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x2c, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x33, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__GUARD_IS_FALSE_POP( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GUARD_IS_FALSE_POP.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 83 c5 f8 addq $-0x8, %rbp | |
// 8: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp__Py_FalseStruct | |
// f: 75 07 jne 0x18 <_JIT_ENTRY+0x18> | |
// 11: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x18 <_JIT_ENTRY+0x18> | |
// 0000000000000014: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 18: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1f <_JIT_ENTRY+0x1f> | |
// 000000000000001b: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 1f: | |
const unsigned char code_body[31] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x83, 0xc5, 0xf8, | |
0x48, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x75, | |
0x07, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &_Py_FalseStruct+0x0 | |
// 8: CONTINUE | |
// 10: JUMP_TARGET | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&_Py_FalseStruct); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x14, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x1b, (uintptr_t)data + 0xc); | |
} | |
void | |
emit__GUARD_IS_NONE_POP( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GUARD_IS_NONE_POP.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 4d f8 movq -0x8(%rbp), %rcx | |
// 8: 48 83 c5 f8 addq $-0x8, %rbp | |
// c: 48 3b 0d 00 00 00 00 cmpq (%rip), %rcx # 0x13 <_JIT_ENTRY+0x13> | |
// 000000000000000f: IMAGE_REL_AMD64_REL32 __imp__Py_NoneStruct | |
// 13: 75 0b jne 0x20 <_JIT_ENTRY+0x20> | |
// 15: 48 83 c4 28 addq $0x28, %rsp | |
// 19: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x20 <_JIT_ENTRY+0x20> | |
// 000000000000001c: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 20: 48 8b 01 movq (%rcx), %rax | |
// 23: 85 c0 testl %eax, %eax | |
// 25: 78 08 js 0x2f <_JIT_ENTRY+0x2f> | |
// 27: 48 ff c8 decq %rax | |
// 2a: 48 89 01 movq %rax, (%rcx) | |
// 2d: 74 0b je 0x3a <_JIT_ENTRY+0x3a> | |
// 2f: 48 83 c4 28 addq $0x28, %rsp | |
// 33: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x3a <_JIT_ENTRY+0x3a> | |
// 0000000000000036: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 3a: ff 15 00 00 00 00 callq *(%rip) # 0x40 <_JIT_ENTRY+0x40> | |
// 000000000000003c: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 40: 48 83 c4 28 addq $0x28, %rsp | |
// 44: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x4b <_JIT_ENTRY+0x4b> | |
// 0000000000000047: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 4b: | |
const unsigned char code_body[75] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x4d, 0xf8, | |
0x48, 0x83, 0xc5, 0xf8, 0x48, 0x3b, 0x0d, 0x00, | |
0x00, 0x00, 0x00, 0x75, 0x0b, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8b, 0x01, 0x85, 0xc0, 0x78, 0x08, 0x48, | |
0xff, 0xc8, 0x48, 0x89, 0x01, 0x74, 0x0b, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &_Py_NoneStruct+0x0 | |
// 8: CONTINUE | |
// 10: JUMP_TARGET | |
// 18: &_Py_Dealloc+0x0 | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&_Py_NoneStruct); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x18, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xf, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1c, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x36, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x3c, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x47, (uintptr_t)data + 0xc); | |
} | |
void | |
emit__GUARD_IS_NOT_NONE_POP( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GUARD_IS_NOT_NONE_POP.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// 8: 48 8b 06 movq (%rsi), %rax | |
// b: 85 c0 testl %eax, %eax | |
// d: 78 08 js 0x17 <_JIT_ENTRY+0x17> | |
// f: 48 ff c8 decq %rax | |
// 12: 48 89 06 movq %rax, (%rsi) | |
// 15: 74 18 je 0x2f <_JIT_ENTRY+0x2f> | |
// 17: 48 83 c5 f8 addq $-0x8, %rbp | |
// 1b: 48 83 c4 28 addq $0x28, %rsp | |
// 1f: 48 3b 35 00 00 00 00 cmpq (%rip), %rsi # 0x26 <_JIT_ENTRY+0x26> | |
// 0000000000000022: IMAGE_REL_AMD64_REL32 __imp__Py_NoneStruct | |
// 26: 75 21 jne 0x49 <_JIT_ENTRY+0x49> | |
// 28: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x2f <_JIT_ENTRY+0x2f> | |
// 000000000000002b: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 2f: 48 89 f1 movq %rsi, %rcx | |
// 32: ff 15 00 00 00 00 callq *(%rip) # 0x38 <_JIT_ENTRY+0x38> | |
// 0000000000000034: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 38: 48 83 c5 f8 addq $-0x8, %rbp | |
// 3c: 48 83 c4 28 addq $0x28, %rsp | |
// 40: 48 3b 35 00 00 00 00 cmpq (%rip), %rsi # 0x47 <_JIT_ENTRY+0x47> | |
// 0000000000000043: IMAGE_REL_AMD64_REL32 __imp__Py_NoneStruct | |
// 47: 74 df je 0x28 <_JIT_ENTRY+0x28> | |
// 49: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x50 <_JIT_ENTRY+0x50> | |
// 000000000000004c: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 49: | |
const unsigned char code_body[73] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x75, 0xf8, | |
0x48, 0x8b, 0x06, 0x85, 0xc0, 0x78, 0x08, 0x48, | |
0xff, 0xc8, 0x48, 0x89, 0x06, 0x74, 0x18, 0x48, | |
0x83, 0xc5, 0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0x3b, 0x35, 0x00, 0x00, 0x00, 0x00, 0x75, 0x21, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x89, 0xf1, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x83, 0xc5, 0xf8, 0x48, 0x83, 0xc4, 0x28, | |
0x48, 0x3b, 0x35, 0x00, 0x00, 0x00, 0x00, 0x74, | |
0xdf, | |
}; | |
// 0: | |
// 0: &_Py_NoneStruct+0x0 | |
// 8: JUMP_TARGET | |
// 10: &_Py_Dealloc+0x0 | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&_Py_NoneStruct); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x22, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x2b, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x34, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x43, (uintptr_t)data + -0x4); | |
} | |
void | |
emit__GUARD_IS_TRUE_POP( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GUARD_IS_TRUE_POP.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 83 c5 f8 addq $-0x8, %rbp | |
// 8: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp__Py_TrueStruct | |
// f: 75 07 jne 0x18 <_JIT_ENTRY+0x18> | |
// 11: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x18 <_JIT_ENTRY+0x18> | |
// 0000000000000014: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 18: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1f <_JIT_ENTRY+0x1f> | |
// 000000000000001b: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 1f: | |
const unsigned char code_body[31] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x83, 0xc5, 0xf8, | |
0x48, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x75, | |
0x07, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &_Py_TrueStruct+0x0 | |
// 8: CONTINUE | |
// 10: JUMP_TARGET | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&_Py_TrueStruct); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x14, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x1b, (uintptr_t)data + 0xc); | |
} | |
void | |
emit__GUARD_KEYS_VERSION( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GUARD_KEYS_VERSION.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 8b 40 08 movq 0x8(%rax), %rax | |
// 8: 48 8b 80 70 03 00 00 movq 0x370(%rax), %rax | |
// f: 8b 40 0c movl 0xc(%rax), %eax | |
// 12: 3b 05 00 00 00 00 cmpl (%rip), %eax # 0x18 <_JIT_ENTRY+0x18> | |
// 0000000000000014: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 18: 75 07 jne 0x21 <_JIT_ENTRY+0x21> | |
// 1a: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x21 <_JIT_ENTRY+0x21> | |
// 000000000000001d: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 21: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x28 <_JIT_ENTRY+0x28> | |
// 0000000000000024: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 28: | |
const unsigned char code_body[40] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x8b, 0x40, 0x08, | |
0x48, 0x8b, 0x80, 0x70, 0x03, 0x00, 0x00, 0x8b, | |
0x40, 0x0c, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, | |
0x75, 0x07, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: CONTINUE | |
// 10: JUMP_TARGET | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x14, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x1d, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x24, (uintptr_t)data + 0xc); | |
} | |
void | |
emit__GUARD_NOS_FLOAT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GUARD_NOS_FLOAT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f0 movq -0x10(%rbp), %rax | |
// 4: 48 8b 40 08 movq 0x8(%rax), %rax | |
// 8: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp_PyFloat_Type | |
// f: 74 07 je 0x18 <_JIT_ENTRY+0x18> | |
// 11: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x18 <_JIT_ENTRY+0x18> | |
// 0000000000000014: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 18: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1f <_JIT_ENTRY+0x1f> | |
// 000000000000001b: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 18: | |
const unsigned char code_body[24] = { | |
0x48, 0x8b, 0x45, 0xf0, 0x48, 0x8b, 0x40, 0x08, | |
0x48, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x74, | |
0x07, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PyFloat_Type+0x0 | |
// 8: JUMP_TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyFloat_Type); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x14, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__GUARD_NOS_INT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GUARD_NOS_INT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f0 movq -0x10(%rbp), %rax | |
// 4: 48 8b 40 08 movq 0x8(%rax), %rax | |
// 8: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp_PyLong_Type | |
// f: 74 07 je 0x18 <_JIT_ENTRY+0x18> | |
// 11: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x18 <_JIT_ENTRY+0x18> | |
// 0000000000000014: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 18: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1f <_JIT_ENTRY+0x1f> | |
// 000000000000001b: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 18: | |
const unsigned char code_body[24] = { | |
0x48, 0x8b, 0x45, 0xf0, 0x48, 0x8b, 0x40, 0x08, | |
0x48, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x74, | |
0x07, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PyLong_Type+0x0 | |
// 8: JUMP_TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyLong_Type); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x14, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__GUARD_NOT_EXHAUSTED_LIST( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GUARD_NOT_EXHAUSTED_LIST.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 8b 48 18 movq 0x18(%rax), %rcx | |
// 8: 48 85 c9 testq %rcx, %rcx | |
// b: 74 11 je 0x1e <_JIT_ENTRY+0x1e> | |
// d: 48 8b 50 10 movq 0x10(%rax), %rdx | |
// 11: 48 3b 51 10 cmpq 0x10(%rcx), %rdx | |
// 15: 73 0e jae 0x25 <_JIT_ENTRY+0x25> | |
// 17: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1e <_JIT_ENTRY+0x1e> | |
// 000000000000001a: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 1e: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x25 <_JIT_ENTRY+0x25> | |
// 0000000000000021: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 25: 48 c7 40 10 ff ff ff ff movq $-0x1, 0x10(%rax) | |
// 2d: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x34 <_JIT_ENTRY+0x34> | |
// 0000000000000030: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 34: | |
const unsigned char code_body[52] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x8b, 0x48, 0x18, | |
0x48, 0x85, 0xc9, 0x74, 0x11, 0x48, 0x8b, 0x50, | |
0x10, 0x48, 0x3b, 0x51, 0x10, 0x73, 0x0e, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0xc7, 0x40, | |
0x10, 0xff, 0xff, 0xff, 0xff, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: CONTINUE | |
// 8: JUMP_TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x1a, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x21, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x30, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__GUARD_NOT_EXHAUSTED_RANGE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GUARD_NOT_EXHAUSTED_RANGE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 83 78 18 00 cmpl $0x0, 0x18(%rax) | |
// 8: 7e 07 jle 0x11 <_JIT_ENTRY+0x11> | |
// a: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x11 <_JIT_ENTRY+0x11> | |
// 000000000000000d: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 11: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x18 <_JIT_ENTRY+0x18> | |
// 0000000000000014: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 18: | |
const unsigned char code_body[24] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x83, 0x78, 0x18, 0x00, | |
0x7e, 0x07, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: CONTINUE | |
// 8: JUMP_TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xd, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x14, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__GUARD_NOT_EXHAUSTED_TUPLE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GUARD_NOT_EXHAUSTED_TUPLE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 8b 48 18 movq 0x18(%rax), %rcx | |
// 8: 48 85 c9 testq %rcx, %rcx | |
// b: 74 11 je 0x1e <_JIT_ENTRY+0x1e> | |
// d: 48 8b 40 10 movq 0x10(%rax), %rax | |
// 11: 48 3b 41 10 cmpq 0x10(%rcx), %rax | |
// 15: 7d 07 jge 0x1e <_JIT_ENTRY+0x1e> | |
// 17: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1e <_JIT_ENTRY+0x1e> | |
// 000000000000001a: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 1e: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x25 <_JIT_ENTRY+0x25> | |
// 0000000000000021: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 25: | |
const unsigned char code_body[37] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x8b, 0x48, 0x18, | |
0x48, 0x85, 0xc9, 0x74, 0x11, 0x48, 0x8b, 0x40, | |
0x10, 0x48, 0x3b, 0x41, 0x10, 0x7d, 0x07, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: CONTINUE | |
// 8: JUMP_TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x1a, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x21, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__GUARD_TOS_FLOAT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GUARD_TOS_FLOAT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 8b 40 08 movq 0x8(%rax), %rax | |
// 8: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp_PyFloat_Type | |
// f: 74 07 je 0x18 <_JIT_ENTRY+0x18> | |
// 11: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x18 <_JIT_ENTRY+0x18> | |
// 0000000000000014: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 18: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1f <_JIT_ENTRY+0x1f> | |
// 000000000000001b: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 18: | |
const unsigned char code_body[24] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x8b, 0x40, 0x08, | |
0x48, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x74, | |
0x07, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PyFloat_Type+0x0 | |
// 8: JUMP_TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyFloat_Type); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x14, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__GUARD_TOS_INT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GUARD_TOS_INT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 8b 40 08 movq 0x8(%rax), %rax | |
// 8: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp_PyLong_Type | |
// f: 74 07 je 0x18 <_JIT_ENTRY+0x18> | |
// 11: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x18 <_JIT_ENTRY+0x18> | |
// 0000000000000014: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 18: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1f <_JIT_ENTRY+0x1f> | |
// 000000000000001b: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 18: | |
const unsigned char code_body[24] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x8b, 0x40, 0x08, | |
0x48, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x74, | |
0x07, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PyLong_Type+0x0 | |
// 8: JUMP_TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyLong_Type); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x14, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__GUARD_TYPE_VERSION( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_GUARD_TYPE_VERSION.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 8b 40 08 movq 0x8(%rax), %rax | |
// 8: 8b 80 80 01 00 00 movl 0x180(%rax), %eax | |
// e: 3b 05 00 00 00 00 cmpl (%rip), %eax # 0x14 <_JIT_ENTRY+0x14> | |
// 0000000000000010: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 14: 75 07 jne 0x1d <_JIT_ENTRY+0x1d> | |
// 16: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1d <_JIT_ENTRY+0x1d> | |
// 0000000000000019: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 1d: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x24 <_JIT_ENTRY+0x24> | |
// 0000000000000020: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 24: | |
const unsigned char code_body[36] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x8b, 0x40, 0x08, | |
0x8b, 0x80, 0x80, 0x01, 0x00, 0x00, 0x3b, 0x05, | |
0x00, 0x00, 0x00, 0x00, 0x75, 0x07, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: CONTINUE | |
// 10: JUMP_TARGET | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x10, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x19, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x20, (uintptr_t)data + 0xc); | |
} | |
void | |
emit__IMPORT_FROM( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_IMPORT_FROM.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 55 f8 movq -0x8(%rbp), %rdx | |
// 8: 49 8b 45 00 movq (%r13), %rax | |
// c: 48 8b 40 20 movq 0x20(%rax), %rax | |
// 10: 0f b7 0d 00 00 00 00 movzwl (%rip), %ecx # 0x17 <_JIT_ENTRY+0x17> | |
// 0000000000000013: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 17: 4c 8b 44 c8 18 movq 0x18(%rax,%rcx,8), %r8 | |
// 1c: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 20: 4c 89 e1 movq %r12, %rcx | |
// 23: ff 15 00 00 00 00 callq *(%rip) # 0x29 <_JIT_ENTRY+0x29> | |
// 0000000000000025: IMAGE_REL_AMD64_REL32 __imp__PyEval_ImportFrom | |
// 29: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 2d: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 35: 48 85 c0 testq %rax, %rax | |
// 38: 74 13 je 0x4d <_JIT_ENTRY+0x4d> | |
// 3a: 48 89 45 00 movq %rax, (%rbp) | |
// 3e: 48 83 c5 08 addq $0x8, %rbp | |
// 42: 48 83 c4 28 addq $0x28, %rsp | |
// 46: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x4d <_JIT_ENTRY+0x4d> | |
// 0000000000000049: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 4d: 48 83 c4 28 addq $0x28, %rsp | |
// 51: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x58 <_JIT_ENTRY+0x58> | |
// 0000000000000054: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 58: | |
const unsigned char code_body[88] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x55, 0xf8, | |
0x49, 0x8b, 0x45, 0x00, 0x48, 0x8b, 0x40, 0x20, | |
0x0f, 0xb7, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x4c, | |
0x8b, 0x44, 0xc8, 0x18, 0x49, 0x89, 0x6d, 0x40, | |
0x4c, 0x89, 0xe1, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, 0xc7, 0x45, | |
0x40, 0x00, 0x00, 0x00, 0x00, 0x48, 0x85, 0xc0, | |
0x74, 0x13, 0x48, 0x89, 0x45, 0x00, 0x48, 0x83, | |
0xc5, 0x08, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &_PyEval_ImportFrom+0x0 | |
// 10: CONTINUE | |
// 18: ERROR_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&_PyEval_ImportFrom); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x13, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x25, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x49, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x54, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__IMPORT_NAME( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_IMPORT_NAME.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 5d f0 movq -0x10(%rbp), %rbx | |
// 8: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// c: 49 8b 45 00 movq (%r13), %rax | |
// 10: 48 8b 40 20 movq 0x20(%rax), %rax | |
// 14: 0f b7 0d 00 00 00 00 movzwl (%rip), %ecx # 0x1b <_JIT_ENTRY+0x1b> | |
// 0000000000000017: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 1b: 4c 8b 44 c8 18 movq 0x18(%rax,%rcx,8), %r8 | |
// 20: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 24: 48 89 5c 24 20 movq %rbx, 0x20(%rsp) | |
// 29: 4c 89 e1 movq %r12, %rcx | |
// 2c: 4c 89 ea movq %r13, %rdx | |
// 2f: 49 89 f1 movq %rsi, %r9 | |
// 32: ff 15 00 00 00 00 callq *(%rip) # 0x38 <_JIT_ENTRY+0x38> | |
// 0000000000000034: IMAGE_REL_AMD64_REL32 __imp__PyEval_ImportName | |
// 38: 48 89 c7 movq %rax, %rdi | |
// 3b: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 3f: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 47: 48 8b 03 movq (%rbx), %rax | |
// 4a: 85 c0 testl %eax, %eax | |
// 4c: 78 08 js 0x56 <_JIT_ENTRY+0x56> | |
// 4e: 48 ff c8 decq %rax | |
// 51: 48 89 03 movq %rax, (%rbx) | |
// 54: 74 1a je 0x70 <_JIT_ENTRY+0x70> | |
// 56: 48 8b 06 movq (%rsi), %rax | |
// 59: 85 c0 testl %eax, %eax | |
// 5b: 78 23 js 0x80 <_JIT_ENTRY+0x80> | |
// 5d: 48 ff c8 decq %rax | |
// 60: 48 89 06 movq %rax, (%rsi) | |
// 63: 75 1b jne 0x80 <_JIT_ENTRY+0x80> | |
// 65: 48 89 f1 movq %rsi, %rcx | |
// 68: ff 15 00 00 00 00 callq *(%rip) # 0x6e <_JIT_ENTRY+0x6e> | |
// 000000000000006a: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 6e: eb 10 jmp 0x80 <_JIT_ENTRY+0x80> | |
// 70: 48 89 d9 movq %rbx, %rcx | |
// 73: ff 15 00 00 00 00 callq *(%rip) # 0x79 <_JIT_ENTRY+0x79> | |
// 0000000000000075: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 79: 48 8b 06 movq (%rsi), %rax | |
// 7c: 85 c0 testl %eax, %eax | |
// 7e: 79 dd jns 0x5d <_JIT_ENTRY+0x5d> | |
// 80: 48 85 ff testq %rdi, %rdi | |
// 83: 74 13 je 0x98 <_JIT_ENTRY+0x98> | |
// 85: 48 89 7d f0 movq %rdi, -0x10(%rbp) | |
// 89: 48 83 c5 f8 addq $-0x8, %rbp | |
// 8d: 48 83 c4 28 addq $0x28, %rsp | |
// 91: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x98 <_JIT_ENTRY+0x98> | |
// 0000000000000094: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 98: 48 83 c4 28 addq $0x28, %rsp | |
// 9c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xa3 <_JIT_ENTRY+0xa3> | |
// 000000000000009f: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// a3: | |
const unsigned char code_body[163] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x5d, 0xf0, | |
0x48, 0x8b, 0x75, 0xf8, 0x49, 0x8b, 0x45, 0x00, | |
0x48, 0x8b, 0x40, 0x20, 0x0f, 0xb7, 0x0d, 0x00, | |
0x00, 0x00, 0x00, 0x4c, 0x8b, 0x44, 0xc8, 0x18, | |
0x49, 0x89, 0x6d, 0x40, 0x48, 0x89, 0x5c, 0x24, | |
0x20, 0x4c, 0x89, 0xe1, 0x4c, 0x89, 0xea, 0x49, | |
0x89, 0xf1, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x89, 0xc7, 0x49, 0x8b, 0x6d, 0x40, 0x49, | |
0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x03, 0x85, 0xc0, 0x78, 0x08, 0x48, 0xff, | |
0xc8, 0x48, 0x89, 0x03, 0x74, 0x1a, 0x48, 0x8b, | |
0x06, 0x85, 0xc0, 0x78, 0x23, 0x48, 0xff, 0xc8, | |
0x48, 0x89, 0x06, 0x75, 0x1b, 0x48, 0x89, 0xf1, | |
0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0xeb, 0x10, | |
0x48, 0x89, 0xd9, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x8b, 0x06, 0x85, 0xc0, 0x79, 0xdd, | |
0x48, 0x85, 0xff, 0x74, 0x13, 0x48, 0x89, 0x7d, | |
0xf0, 0x48, 0x83, 0xc5, 0xf8, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &_PyEval_ImportName+0x0 | |
// 10: &_Py_Dealloc+0x0 | |
// 18: CONTINUE | |
// 20: ERROR_TARGET | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&_PyEval_ImportName); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x18, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x20, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x17, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x34, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x6a, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x75, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x94, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x9f, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__INIT_CALL_BOUND_METHOD_EXACT_ARGS( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_INIT_CALL_BOUND_METHOD_EXACT_ARGS.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: ba fe ff ff ff movl $0xfffffffe, %edx # imm = 0xFFFFFFFE | |
// 10: 29 c2 subl %eax, %edx | |
// 12: f7 d0 notl %eax | |
// 14: 48 63 c8 movslq %eax, %rcx | |
// 17: 48 63 c2 movslq %edx, %rax | |
// 1a: 48 8b 54 c5 00 movq (%rbp,%rax,8), %rdx | |
// 1f: 48 8b 72 18 movq 0x18(%rdx), %rsi | |
// 23: 8b 3e movl (%rsi), %edi | |
// 25: ff c7 incl %edi | |
// 27: 74 02 je 0x2b <_JIT_ENTRY+0x2b> | |
// 29: 89 3e movl %edi, (%rsi) | |
// 2b: 48 89 74 cd 00 movq %rsi, (%rbp,%rcx,8) | |
// 30: 48 8b 4c c5 00 movq (%rbp,%rax,8), %rcx | |
// 35: 48 8b 52 10 movq 0x10(%rdx), %rdx | |
// 39: 8b 32 movl (%rdx), %esi | |
// 3b: ff c6 incl %esi | |
// 3d: 74 02 je 0x41 <_JIT_ENTRY+0x41> | |
// 3f: 89 32 movl %esi, (%rdx) | |
// 41: 48 89 54 c5 00 movq %rdx, (%rbp,%rax,8) | |
// 46: 48 8b 01 movq (%rcx), %rax | |
// 49: 85 c0 testl %eax, %eax | |
// 4b: 78 08 js 0x55 <_JIT_ENTRY+0x55> | |
// 4d: 48 ff c8 decq %rax | |
// 50: 48 89 01 movq %rax, (%rcx) | |
// 53: 74 0b je 0x60 <_JIT_ENTRY+0x60> | |
// 55: 48 83 c4 28 addq $0x28, %rsp | |
// 59: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x60 <_JIT_ENTRY+0x60> | |
// 000000000000005c: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 60: ff 15 00 00 00 00 callq *(%rip) # 0x66 <_JIT_ENTRY+0x66> | |
// 0000000000000062: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 66: 48 83 c4 28 addq $0x28, %rsp | |
// 6a: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x71 <_JIT_ENTRY+0x71> | |
// 000000000000006d: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 6a: | |
const unsigned char code_body[106] = { | |
0x48, 0x83, 0xec, 0x28, 0x0f, 0xb7, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0xba, 0xfe, 0xff, 0xff, 0xff, | |
0x29, 0xc2, 0xf7, 0xd0, 0x48, 0x63, 0xc8, 0x48, | |
0x63, 0xc2, 0x48, 0x8b, 0x54, 0xc5, 0x00, 0x48, | |
0x8b, 0x72, 0x18, 0x8b, 0x3e, 0xff, 0xc7, 0x74, | |
0x02, 0x89, 0x3e, 0x48, 0x89, 0x74, 0xcd, 0x00, | |
0x48, 0x8b, 0x4c, 0xc5, 0x00, 0x48, 0x8b, 0x52, | |
0x10, 0x8b, 0x32, 0xff, 0xc6, 0x74, 0x02, 0x89, | |
0x32, 0x48, 0x89, 0x54, 0xc5, 0x00, 0x48, 0x8b, | |
0x01, 0x85, 0xc0, 0x78, 0x08, 0x48, 0xff, 0xc8, | |
0x48, 0x89, 0x01, 0x74, 0x0b, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x83, | |
0xc4, 0x28, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: CONTINUE | |
// 10: &_Py_Dealloc+0x0 | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x5c, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x62, (uintptr_t)data + 0xc); | |
} | |
void | |
emit__INIT_CALL_PY_EXACT_ARGS( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_INIT_CALL_PY_EXACT_ARGS.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 0f b7 35 00 00 00 00 movzwl (%rip), %esi # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 7: 89 f0 movl %esi, %eax | |
// 9: f7 d0 notl %eax | |
// b: 48 98 cltq | |
// d: b9 fe ff ff ff movl $0xfffffffe, %ecx # imm = 0xFFFFFFFE | |
// 12: 29 f1 subl %esi, %ecx | |
// 14: 48 63 c9 movslq %ecx, %rcx | |
// 17: 4c 8b 54 c5 00 movq (%rbp,%rax,8), %r10 | |
// 1c: 49 83 fa 01 cmpq $0x1, %r10 | |
// 20: 89 f3 movl %esi, %ebx | |
// 22: 83 db ff sbbl $-0x1, %ebx | |
// 25: 48 8b 7c cd 00 movq (%rbp,%rcx,8), %rdi | |
// 2a: 4c 8b 4f 30 movq 0x30(%rdi), %r9 | |
// 2e: 49 8b 94 24 e8 00 00 00 movq 0xe8(%r12), %rdx | |
// 36: 4d 63 41 4c movslq 0x4c(%r9), %r8 | |
// 3a: 4e 8d 04 c2 leaq (%rdx,%r8,8), %r8 | |
// 3e: 4d 89 84 24 e8 00 00 00 movq %r8, 0xe8(%r12) | |
// 46: 4c 89 6a 08 movq %r13, 0x8(%rdx) | |
// 4a: 48 89 7a 10 movq %rdi, 0x10(%rdx) | |
// 4e: 45 8b 01 movl (%r9), %r8d | |
// 51: 41 ff c0 incl %r8d | |
// 54: 74 03 je 0x59 <_JIT_ENTRY+0x59> | |
// 56: 45 89 01 movl %r8d, (%r9) | |
// 59: 48 8d 04 c5 00 00 00 00 leaq (,%rax,8), %rax | |
// 61: 48 01 e8 addq %rbp, %rax | |
// 64: 4c 89 0a movq %r9, (%rdx) | |
// 67: 0f 10 47 10 movups 0x10(%rdi), %xmm0 | |
// 6b: 0f 11 42 18 movups %xmm0, 0x18(%rdx) | |
// 6f: 48 c7 42 28 00 00 00 00 movq $0x0, 0x28(%rdx) | |
// 77: 48 8d 7a 50 leaq 0x50(%rdx), %rdi | |
// 7b: 4d 63 41 48 movslq 0x48(%r9), %r8 | |
// 7f: 4e 8d 1c c2 leaq (%rdx,%r8,8), %r11 | |
// 83: 49 83 c3 50 addq $0x50, %r11 | |
// 87: 4c 89 5a 40 movq %r11, 0x40(%rdx) | |
// 8b: 48 c7 42 30 00 00 00 00 movq $0x0, 0x30(%rdx) | |
// 93: 49 81 c1 c8 00 00 00 addq $0xc8, %r9 | |
// 9a: 4c 89 4a 38 movq %r9, 0x38(%rdx) | |
// 9e: 66 c7 42 48 00 00 movw $0x0, 0x48(%rdx) | |
// a4: c6 42 4a 00 movb $0x0, 0x4a(%rdx) | |
// a8: 41 39 d8 cmpl %ebx, %r8d | |
// ab: 7e 63 jle 0x110 <_JIT_ENTRY+0x110> | |
// ad: 41 89 d9 movl %ebx, %r9d | |
// b0: 4d 89 c3 movq %r8, %r11 | |
// b3: 4d 29 cb subq %r9, %r11 | |
// b6: 49 83 fb 04 cmpq $0x4, %r11 | |
// ba: 72 44 jb 0x100 <_JIT_ENTRY+0x100> | |
// bc: 4c 89 db movq %r11, %rbx | |
// bf: 48 83 e3 fc andq $-0x4, %rbx | |
// c3: 4e 8d 34 ca leaq (%rdx,%r9,8), %r14 | |
// c7: 49 83 c6 60 addq $0x60, %r14 | |
// cb: 45 31 ff xorl %r15d, %r15d | |
// ce: 0f 57 c0 xorps %xmm0, %xmm0 | |
// d1: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:(%rax,%rax) | |
// e0: 43 0f 11 44 fe f0 movups %xmm0, -0x10(%r14,%r15,8) | |
// e6: 43 0f 11 04 fe movups %xmm0, (%r14,%r15,8) | |
// eb: 49 83 c7 04 addq $0x4, %r15 | |
// ef: 4c 39 fb cmpq %r15, %rbx | |
// f2: 75 ec jne 0xe0 <_JIT_ENTRY+0xe0> | |
// f4: 49 39 db cmpq %rbx, %r11 | |
// f7: 74 17 je 0x110 <_JIT_ENTRY+0x110> | |
// f9: 49 01 d9 addq %rbx, %r9 | |
// fc: 0f 1f 40 00 nopl (%rax) | |
// 100: 4a c7 04 cf 00 00 00 00 movq $0x0, (%rdi,%r9,8) | |
// 108: 49 ff c1 incq %r9 | |
// 10b: 4d 39 c8 cmpq %r9, %r8 | |
// 10e: 75 f0 jne 0x100 <_JIT_ENTRY+0x100> | |
// 110: 45 31 c9 xorl %r9d, %r9d | |
// 113: 4d 85 d2 testq %r10, %r10 | |
// 116: 0f 95 c3 setne %bl | |
// 119: 4c 8b 00 movq (%rax), %r8 | |
// 11c: 4c 89 07 movq %r8, (%rdi) | |
// 11f: 4c 8b 05 00 00 00 00 movq (%rip), %r8 # 0x126 <_JIT_ENTRY+0x126> | |
// 0000000000000122: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 126: 66 45 85 c0 testw %r8w, %r8w | |
// 12a: 0f 84 18 01 00 00 je 0x248 <_JIT_ENTRY+0x248> | |
// 130: 41 88 d9 movb %bl, %r9b | |
// 133: 83 fe 01 cmpl $0x1, %esi | |
// 136: 41 89 f0 movl %esi, %r8d | |
// 139: 41 83 d0 00 adcl $0x0, %r8d | |
// 13d: 4c 8b 1d 00 00 00 00 movq (%rip), %r11 # 0x144 <_JIT_ENTRY+0x144> | |
// 0000000000000140: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 144: 66 41 83 fb 14 cmpw $0x14, %r11w | |
// 149: 72 30 jb 0x17b <_JIT_ENTRY+0x17b> | |
// 14b: 45 31 db xorl %r11d, %r11d | |
// 14e: 4d 85 d2 testq %r10, %r10 | |
// 151: 41 0f 95 c3 setne %r11b | |
// 155: 0f b7 1d 00 00 00 00 movzwl (%rip), %ebx # 0x15c <_JIT_ENTRY+0x15c> | |
// 0000000000000158: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 15c: 48 c1 e3 03 shlq $0x3, %rbx | |
// 160: 49 89 da movq %rbx, %r10 | |
// 163: 49 29 ea subq %rbp, %r10 | |
// 166: 4f 8d 14 da leaq (%r10,%r11,8), %r10 | |
// 16a: 49 01 d2 addq %rdx, %r10 | |
// 16d: 49 83 c2 50 addq $0x50, %r10 | |
// 171: 49 83 fa 20 cmpq $0x20, %r10 | |
// 175: 0f 83 86 00 00 00 jae 0x201 <_JIT_ENTRY+0x201> | |
// 17b: 45 31 d2 xorl %r10d, %r10d | |
// 17e: c1 e6 03 shll $0x3, %esi | |
// 181: 4c 89 c3 movq %r8, %rbx | |
// 184: 4d 89 d3 movq %r10, %r11 | |
// 187: 48 83 e3 03 andq $0x3, %rbx | |
// 18b: 74 23 je 0x1b0 <_JIT_ENTRY+0x1b0> | |
// 18d: 49 89 ee movq %rbp, %r14 | |
// 190: 49 29 f6 subq %rsi, %r14 | |
// 193: 4a 8d 3c cf leaq (%rdi,%r9,8), %rdi | |
// 197: 4d 89 d3 movq %r10, %r11 | |
// 19a: 66 0f 1f 44 00 00 nopw (%rax,%rax) | |
// 1a0: 4f 8b 3c de movq (%r14,%r11,8), %r15 | |
// 1a4: 4e 89 3c df movq %r15, (%rdi,%r11,8) | |
// 1a8: 49 ff c3 incq %r11 | |
// 1ab: 48 ff cb decq %rbx | |
// 1ae: 75 f0 jne 0x1a0 <_JIT_ENTRY+0x1a0> | |
// 1b0: 4d 29 c2 subq %r8, %r10 | |
// 1b3: 49 83 fa fc cmpq $-0x4, %r10 | |
// 1b7: 0f 87 8b 00 00 00 ja 0x248 <_JIT_ENTRY+0x248> | |
// 1bd: 48 89 ef movq %rbp, %rdi | |
// 1c0: 48 29 f7 subq %rsi, %rdi | |
// 1c3: 48 83 c7 18 addq $0x18, %rdi | |
// 1c7: 4a 8d 34 ca leaq (%rdx,%r9,8), %rsi | |
// 1cb: 48 83 c6 68 addq $0x68, %rsi | |
// 1cf: 90 nop | |
// 1d0: 4e 8b 4c df e8 movq -0x18(%rdi,%r11,8), %r9 | |
// 1d5: 4e 89 4c de e8 movq %r9, -0x18(%rsi,%r11,8) | |
// 1da: 4e 8b 4c df f0 movq -0x10(%rdi,%r11,8), %r9 | |
// 1df: 4e 89 4c de f0 movq %r9, -0x10(%rsi,%r11,8) | |
// 1e4: 4e 8b 4c df f8 movq -0x8(%rdi,%r11,8), %r9 | |
// 1e9: 4e 89 4c de f8 movq %r9, -0x8(%rsi,%r11,8) | |
// 1ee: 4e 8b 0c df movq (%rdi,%r11,8), %r9 | |
// 1f2: 4e 89 0c de movq %r9, (%rsi,%r11,8) | |
// 1f6: 49 83 c3 04 addq $0x4, %r11 | |
// 1fa: 4d 39 d8 cmpq %r11, %r8 | |
// 1fd: 75 d1 jne 0x1d0 <_JIT_ENTRY+0x1d0> | |
// 1ff: eb 47 jmp 0x248 <_JIT_ENTRY+0x248> | |
// 201: 45 89 c2 movl %r8d, %r10d | |
// 204: 41 81 e2 fc ff 00 00 andl $0xfffc, %r10d # imm = 0xFFFC | |
// 20b: 49 89 eb movq %rbp, %r11 | |
// 20e: 49 29 db subq %rbx, %r11 | |
// 211: 49 83 c3 10 addq $0x10, %r11 | |
// 215: 4a 8d 1c ca leaq (%rdx,%r9,8), %rbx | |
// 219: 48 83 c3 60 addq $0x60, %rbx | |
// 21d: 45 31 f6 xorl %r14d, %r14d | |
// 220: 43 0f 10 44 f3 f0 movups -0x10(%r11,%r14,8), %xmm0 | |
// 226: 43 0f 10 0c f3 movups (%r11,%r14,8), %xmm1 | |
// 22b: 42 0f 11 44 f3 f0 movups %xmm0, -0x10(%rbx,%r14,8) | |
// 231: 42 0f 11 0c f3 movups %xmm1, (%rbx,%r14,8) | |
// 236: 49 83 c6 04 addq $0x4, %r14 | |
// 23a: 4d 39 f2 cmpq %r14, %r10 | |
// 23d: 75 e1 jne 0x220 <_JIT_ENTRY+0x220> | |
// 23f: 4d 39 c2 cmpq %r8, %r10 | |
// 242: 0f 85 36 ff ff ff jne 0x17e <_JIT_ENTRY+0x17e> | |
// 248: 48 89 54 cd 00 movq %rdx, (%rbp,%rcx,8) | |
// 24d: 48 89 c5 movq %rax, %rbp | |
// 250: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x257 <_JIT_ENTRY+0x257> | |
// 0000000000000253: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 250: | |
const unsigned char code_body[592] = { | |
0x0f, 0xb7, 0x35, 0x00, 0x00, 0x00, 0x00, 0x89, | |
0xf0, 0xf7, 0xd0, 0x48, 0x98, 0xb9, 0xfe, 0xff, | |
0xff, 0xff, 0x29, 0xf1, 0x48, 0x63, 0xc9, 0x4c, | |
0x8b, 0x54, 0xc5, 0x00, 0x49, 0x83, 0xfa, 0x01, | |
0x89, 0xf3, 0x83, 0xdb, 0xff, 0x48, 0x8b, 0x7c, | |
0xcd, 0x00, 0x4c, 0x8b, 0x4f, 0x30, 0x49, 0x8b, | |
0x94, 0x24, 0xe8, 0x00, 0x00, 0x00, 0x4d, 0x63, | |
0x41, 0x4c, 0x4e, 0x8d, 0x04, 0xc2, 0x4d, 0x89, | |
0x84, 0x24, 0xe8, 0x00, 0x00, 0x00, 0x4c, 0x89, | |
0x6a, 0x08, 0x48, 0x89, 0x7a, 0x10, 0x45, 0x8b, | |
0x01, 0x41, 0xff, 0xc0, 0x74, 0x03, 0x45, 0x89, | |
0x01, 0x48, 0x8d, 0x04, 0xc5, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x01, 0xe8, 0x4c, 0x89, 0x0a, 0x0f, | |
0x10, 0x47, 0x10, 0x0f, 0x11, 0x42, 0x18, 0x48, | |
0xc7, 0x42, 0x28, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8d, 0x7a, 0x50, 0x4d, 0x63, 0x41, 0x48, 0x4e, | |
0x8d, 0x1c, 0xc2, 0x49, 0x83, 0xc3, 0x50, 0x4c, | |
0x89, 0x5a, 0x40, 0x48, 0xc7, 0x42, 0x30, 0x00, | |
0x00, 0x00, 0x00, 0x49, 0x81, 0xc1, 0xc8, 0x00, | |
0x00, 0x00, 0x4c, 0x89, 0x4a, 0x38, 0x66, 0xc7, | |
0x42, 0x48, 0x00, 0x00, 0xc6, 0x42, 0x4a, 0x00, | |
0x41, 0x39, 0xd8, 0x7e, 0x63, 0x41, 0x89, 0xd9, | |
0x4d, 0x89, 0xc3, 0x4d, 0x29, 0xcb, 0x49, 0x83, | |
0xfb, 0x04, 0x72, 0x44, 0x4c, 0x89, 0xdb, 0x48, | |
0x83, 0xe3, 0xfc, 0x4e, 0x8d, 0x34, 0xca, 0x49, | |
0x83, 0xc6, 0x60, 0x45, 0x31, 0xff, 0x0f, 0x57, | |
0xc0, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x2e, | |
0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x43, 0x0f, 0x11, 0x44, 0xfe, 0xf0, 0x43, 0x0f, | |
0x11, 0x04, 0xfe, 0x49, 0x83, 0xc7, 0x04, 0x4c, | |
0x39, 0xfb, 0x75, 0xec, 0x49, 0x39, 0xdb, 0x74, | |
0x17, 0x49, 0x01, 0xd9, 0x0f, 0x1f, 0x40, 0x00, | |
0x4a, 0xc7, 0x04, 0xcf, 0x00, 0x00, 0x00, 0x00, | |
0x49, 0xff, 0xc1, 0x4d, 0x39, 0xc8, 0x75, 0xf0, | |
0x45, 0x31, 0xc9, 0x4d, 0x85, 0xd2, 0x0f, 0x95, | |
0xc3, 0x4c, 0x8b, 0x00, 0x4c, 0x89, 0x07, 0x4c, | |
0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x66, 0x45, | |
0x85, 0xc0, 0x0f, 0x84, 0x18, 0x01, 0x00, 0x00, | |
0x41, 0x88, 0xd9, 0x83, 0xfe, 0x01, 0x41, 0x89, | |
0xf0, 0x41, 0x83, 0xd0, 0x00, 0x4c, 0x8b, 0x1d, | |
0x00, 0x00, 0x00, 0x00, 0x66, 0x41, 0x83, 0xfb, | |
0x14, 0x72, 0x30, 0x45, 0x31, 0xdb, 0x4d, 0x85, | |
0xd2, 0x41, 0x0f, 0x95, 0xc3, 0x0f, 0xb7, 0x1d, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0xc1, 0xe3, 0x03, | |
0x49, 0x89, 0xda, 0x49, 0x29, 0xea, 0x4f, 0x8d, | |
0x14, 0xda, 0x49, 0x01, 0xd2, 0x49, 0x83, 0xc2, | |
0x50, 0x49, 0x83, 0xfa, 0x20, 0x0f, 0x83, 0x86, | |
0x00, 0x00, 0x00, 0x45, 0x31, 0xd2, 0xc1, 0xe6, | |
0x03, 0x4c, 0x89, 0xc3, 0x4d, 0x89, 0xd3, 0x48, | |
0x83, 0xe3, 0x03, 0x74, 0x23, 0x49, 0x89, 0xee, | |
0x49, 0x29, 0xf6, 0x4a, 0x8d, 0x3c, 0xcf, 0x4d, | |
0x89, 0xd3, 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00, | |
0x4f, 0x8b, 0x3c, 0xde, 0x4e, 0x89, 0x3c, 0xdf, | |
0x49, 0xff, 0xc3, 0x48, 0xff, 0xcb, 0x75, 0xf0, | |
0x4d, 0x29, 0xc2, 0x49, 0x83, 0xfa, 0xfc, 0x0f, | |
0x87, 0x8b, 0x00, 0x00, 0x00, 0x48, 0x89, 0xef, | |
0x48, 0x29, 0xf7, 0x48, 0x83, 0xc7, 0x18, 0x4a, | |
0x8d, 0x34, 0xca, 0x48, 0x83, 0xc6, 0x68, 0x90, | |
0x4e, 0x8b, 0x4c, 0xdf, 0xe8, 0x4e, 0x89, 0x4c, | |
0xde, 0xe8, 0x4e, 0x8b, 0x4c, 0xdf, 0xf0, 0x4e, | |
0x89, 0x4c, 0xde, 0xf0, 0x4e, 0x8b, 0x4c, 0xdf, | |
0xf8, 0x4e, 0x89, 0x4c, 0xde, 0xf8, 0x4e, 0x8b, | |
0x0c, 0xdf, 0x4e, 0x89, 0x0c, 0xde, 0x49, 0x83, | |
0xc3, 0x04, 0x4d, 0x39, 0xd8, 0x75, 0xd1, 0xeb, | |
0x47, 0x45, 0x89, 0xc2, 0x41, 0x81, 0xe2, 0xfc, | |
0xff, 0x00, 0x00, 0x49, 0x89, 0xeb, 0x49, 0x29, | |
0xdb, 0x49, 0x83, 0xc3, 0x10, 0x4a, 0x8d, 0x1c, | |
0xca, 0x48, 0x83, 0xc3, 0x60, 0x45, 0x31, 0xf6, | |
0x43, 0x0f, 0x10, 0x44, 0xf3, 0xf0, 0x43, 0x0f, | |
0x10, 0x0c, 0xf3, 0x42, 0x0f, 0x11, 0x44, 0xf3, | |
0xf0, 0x42, 0x0f, 0x11, 0x0c, 0xf3, 0x49, 0x83, | |
0xc6, 0x04, 0x4d, 0x39, 0xf2, 0x75, 0xe1, 0x4d, | |
0x39, 0xc2, 0x0f, 0x85, 0x36, 0xff, 0xff, 0xff, | |
0x48, 0x89, 0x54, 0xcd, 0x00, 0x48, 0x89, 0xc5, | |
}; | |
// 0: | |
// 0: OPARG | |
const unsigned char data_body[8] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x122, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x140, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x158, (uintptr_t)data + -0x4); | |
} | |
void | |
emit__INIT_CALL_PY_EXACT_ARGS_0( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_INIT_CALL_PY_EXACT_ARGS_0.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 55 f0 movq -0x10(%rbp), %rdx | |
// 4: 48 8b 7d f8 movq -0x8(%rbp), %rdi | |
// 8: 31 f6 xorl %esi, %esi | |
// a: 48 85 ff testq %rdi, %rdi | |
// d: 40 0f 95 c6 setne %sil | |
// 11: 4c 8b 42 30 movq 0x30(%rdx), %r8 | |
// 15: 49 8b 8c 24 e8 00 00 00 movq 0xe8(%r12), %rcx | |
// 1d: 49 63 40 4c movslq 0x4c(%r8), %rax | |
// 21: 48 8d 04 c1 leaq (%rcx,%rax,8), %rax | |
// 25: 49 89 84 24 e8 00 00 00 movq %rax, 0xe8(%r12) | |
// 2d: 4c 89 69 08 movq %r13, 0x8(%rcx) | |
// 31: 48 89 51 10 movq %rdx, 0x10(%rcx) | |
// 35: 41 8b 00 movl (%r8), %eax | |
// 38: ff c0 incl %eax | |
// 3a: 74 03 je 0x3f <_JIT_ENTRY+0x3f> | |
// 3c: 41 89 00 movl %eax, (%r8) | |
// 3f: 48 8d 45 f8 leaq -0x8(%rbp), %rax | |
// 43: 4c 89 01 movq %r8, (%rcx) | |
// 46: 0f 10 42 10 movups 0x10(%rdx), %xmm0 | |
// 4a: 0f 11 41 18 movups %xmm0, 0x18(%rcx) | |
// 4e: 48 c7 41 28 00 00 00 00 movq $0x0, 0x28(%rcx) | |
// 56: 49 63 50 48 movslq 0x48(%r8), %rdx | |
// 5a: 4c 8d 0c d1 leaq (%rcx,%rdx,8), %r9 | |
// 5e: 49 83 c1 50 addq $0x50, %r9 | |
// 62: 4c 89 49 40 movq %r9, 0x40(%rcx) | |
// 66: 48 c7 41 30 00 00 00 00 movq $0x0, 0x30(%rcx) | |
// 6e: 49 81 c0 c8 00 00 00 addq $0xc8, %r8 | |
// 75: 4c 89 41 38 movq %r8, 0x38(%rcx) | |
// 79: 66 c7 41 48 00 00 movw $0x0, 0x48(%rcx) | |
// 7f: c6 41 4a 00 movb $0x0, 0x4a(%rcx) | |
// 83: 39 f2 cmpl %esi, %edx | |
// 85: 7e 6a jle 0xf1 <_JIT_ENTRY+0xf1> | |
// 87: 31 f6 xorl %esi, %esi | |
// 89: 48 85 ff testq %rdi, %rdi | |
// 8c: 40 0f 95 c6 setne %sil | |
// 90: 48 89 d7 movq %rdx, %rdi | |
// 93: 48 29 f7 subq %rsi, %rdi | |
// 96: 48 83 ff 04 cmpq $0x4, %rdi | |
// 9a: 72 44 jb 0xe0 <_JIT_ENTRY+0xe0> | |
// 9c: 49 89 f8 movq %rdi, %r8 | |
// 9f: 49 83 e0 fc andq $-0x4, %r8 | |
// a3: 4c 8d 0c f1 leaq (%rcx,%rsi,8), %r9 | |
// a7: 49 83 c1 60 addq $0x60, %r9 | |
// ab: 45 31 d2 xorl %r10d, %r10d | |
// ae: 0f 57 c0 xorps %xmm0, %xmm0 | |
// b1: 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:(%rax,%rax) | |
// c0: 43 0f 11 44 d1 f0 movups %xmm0, -0x10(%r9,%r10,8) | |
// c6: 43 0f 11 04 d1 movups %xmm0, (%r9,%r10,8) | |
// cb: 49 83 c2 04 addq $0x4, %r10 | |
// cf: 4d 39 d0 cmpq %r10, %r8 | |
// d2: 75 ec jne 0xc0 <_JIT_ENTRY+0xc0> | |
// d4: 4c 39 c7 cmpq %r8, %rdi | |
// d7: 74 18 je 0xf1 <_JIT_ENTRY+0xf1> | |
// d9: 4c 09 c6 orq %r8, %rsi | |
// dc: 0f 1f 40 00 nopl (%rax) | |
// e0: 48 c7 44 f1 50 00 00 00 00 movq $0x0, 0x50(%rcx,%rsi,8) | |
// e9: 48 ff c6 incq %rsi | |
// ec: 48 39 f2 cmpq %rsi, %rdx | |
// ef: 75 ef jne 0xe0 <_JIT_ENTRY+0xe0> | |
// f1: 48 8b 55 f8 movq -0x8(%rbp), %rdx | |
// f5: 48 89 51 50 movq %rdx, 0x50(%rcx) | |
// f9: 48 89 4d f0 movq %rcx, -0x10(%rbp) | |
// fd: 48 89 c5 movq %rax, %rbp | |
// 100: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x107 <_JIT_ENTRY+0x107> | |
// 0000000000000103: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 100: | |
const unsigned char code_body[256] = { | |
0x48, 0x8b, 0x55, 0xf0, 0x48, 0x8b, 0x7d, 0xf8, | |
0x31, 0xf6, 0x48, 0x85, 0xff, 0x40, 0x0f, 0x95, | |
0xc6, 0x4c, 0x8b, 0x42, 0x30, 0x49, 0x8b, 0x8c, | |
0x24, 0xe8, 0x00, 0x00, 0x00, 0x49, 0x63, 0x40, | |
0x4c, 0x48, 0x8d, 0x04, 0xc1, 0x49, 0x89, 0x84, | |
0x24, 0xe8, 0x00, 0x00, 0x00, 0x4c, 0x89, 0x69, | |
0x08, 0x48, 0x89, 0x51, 0x10, 0x41, 0x8b, 0x00, | |
0xff, 0xc0, 0x74, 0x03, 0x41, 0x89, 0x00, 0x48, | |
0x8d, 0x45, 0xf8, 0x4c, 0x89, 0x01, 0x0f, 0x10, | |
0x42, 0x10, 0x0f, 0x11, 0x41, 0x18, 0x48, 0xc7, | |
0x41, 0x28, 0x00, 0x00, 0x00, 0x00, 0x49, 0x63, | |
0x50, 0x48, 0x4c, 0x8d, 0x0c, 0xd1, 0x49, 0x83, | |
0xc1, 0x50, 0x4c, 0x89, 0x49, 0x40, 0x48, 0xc7, | |
0x41, 0x30, 0x00, 0x00, 0x00, 0x00, 0x49, 0x81, | |
0xc0, 0xc8, 0x00, 0x00, 0x00, 0x4c, 0x89, 0x41, | |
0x38, 0x66, 0xc7, 0x41, 0x48, 0x00, 0x00, 0xc6, | |
0x41, 0x4a, 0x00, 0x39, 0xf2, 0x7e, 0x6a, 0x31, | |
0xf6, 0x48, 0x85, 0xff, 0x40, 0x0f, 0x95, 0xc6, | |
0x48, 0x89, 0xd7, 0x48, 0x29, 0xf7, 0x48, 0x83, | |
0xff, 0x04, 0x72, 0x44, 0x49, 0x89, 0xf8, 0x49, | |
0x83, 0xe0, 0xfc, 0x4c, 0x8d, 0x0c, 0xf1, 0x49, | |
0x83, 0xc1, 0x60, 0x45, 0x31, 0xd2, 0x0f, 0x57, | |
0xc0, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x2e, | |
0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x43, 0x0f, 0x11, 0x44, 0xd1, 0xf0, 0x43, 0x0f, | |
0x11, 0x04, 0xd1, 0x49, 0x83, 0xc2, 0x04, 0x4d, | |
0x39, 0xd0, 0x75, 0xec, 0x4c, 0x39, 0xc7, 0x74, | |
0x18, 0x4c, 0x09, 0xc6, 0x0f, 0x1f, 0x40, 0x00, | |
0x48, 0xc7, 0x44, 0xf1, 0x50, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0xff, 0xc6, 0x48, 0x39, 0xf2, 0x75, | |
0xef, 0x48, 0x8b, 0x55, 0xf8, 0x48, 0x89, 0x51, | |
0x50, 0x48, 0x89, 0x4d, 0xf0, 0x48, 0x89, 0xc5, | |
}; | |
// 0: | |
memcpy(code, code_body, sizeof(code_body)); | |
} | |
void | |
emit__INIT_CALL_PY_EXACT_ARGS_1( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_INIT_CALL_PY_EXACT_ARGS_1.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 75 e8 movq -0x18(%rbp), %rsi | |
// 4: 48 8b 55 f0 movq -0x10(%rbp), %rdx | |
// 8: 48 83 fa 01 cmpq $0x1, %rdx | |
// c: bf 01 00 00 00 movl $0x1, %edi | |
// 11: 83 df ff sbbl $-0x1, %edi | |
// 14: 4c 8b 46 30 movq 0x30(%rsi), %r8 | |
// 18: 49 8b 8c 24 e8 00 00 00 movq 0xe8(%r12), %rcx | |
// 20: 49 63 40 4c movslq 0x4c(%r8), %rax | |
// 24: 48 8d 04 c1 leaq (%rcx,%rax,8), %rax | |
// 28: 49 89 84 24 e8 00 00 00 movq %rax, 0xe8(%r12) | |
// 30: 4c 89 69 08 movq %r13, 0x8(%rcx) | |
// 34: 48 89 71 10 movq %rsi, 0x10(%rcx) | |
// 38: 41 8b 00 movl (%r8), %eax | |
// 3b: ff c0 incl %eax | |
// 3d: 74 03 je 0x42 <_JIT_ENTRY+0x42> | |
// 3f: 41 89 00 movl %eax, (%r8) | |
// 42: 48 8d 45 f0 leaq -0x10(%rbp), %rax | |
// 46: 4c 89 01 movq %r8, (%rcx) | |
// 49: 0f 10 46 10 movups 0x10(%rsi), %xmm0 | |
// 4d: 0f 11 41 18 movups %xmm0, 0x18(%rcx) | |
// 51: 48 c7 41 28 00 00 00 00 movq $0x0, 0x28(%rcx) | |
// 59: 49 63 70 48 movslq 0x48(%r8), %rsi | |
// 5d: 4c 8d 0c f1 leaq (%rcx,%rsi,8), %r9 | |
// 61: 49 83 c1 50 addq $0x50, %r9 | |
// 65: 4c 89 49 40 movq %r9, 0x40(%rcx) | |
// 69: 48 c7 41 30 00 00 00 00 movq $0x0, 0x30(%rcx) | |
// 71: 49 81 c0 c8 00 00 00 addq $0xc8, %r8 | |
// 78: 4c 89 41 38 movq %r8, 0x38(%rcx) | |
// 7c: 66 c7 41 48 00 00 movw $0x0, 0x48(%rcx) | |
// 82: c6 41 4a 00 movb $0x0, 0x4a(%rcx) | |
// 86: 39 fe cmpl %edi, %esi | |
// 88: 7e 57 jle 0xe1 <_JIT_ENTRY+0xe1> | |
// 8a: 89 ff movl %edi, %edi | |
// 8c: 49 89 f0 movq %rsi, %r8 | |
// 8f: 49 29 f8 subq %rdi, %r8 | |
// 92: 49 83 f8 04 cmpq $0x4, %r8 | |
// 96: 72 38 jb 0xd0 <_JIT_ENTRY+0xd0> | |
// 98: 4d 89 c1 movq %r8, %r9 | |
// 9b: 49 83 e1 fc andq $-0x4, %r9 | |
// 9f: 4c 8d 14 f9 leaq (%rcx,%rdi,8), %r10 | |
// a3: 49 83 c2 60 addq $0x60, %r10 | |
// a7: 45 31 db xorl %r11d, %r11d | |
// aa: 0f 57 c0 xorps %xmm0, %xmm0 | |
// ad: 0f 1f 00 nopl (%rax) | |
// b0: 43 0f 11 44 da f0 movups %xmm0, -0x10(%r10,%r11,8) | |
// b6: 43 0f 11 04 da movups %xmm0, (%r10,%r11,8) | |
// bb: 49 83 c3 04 addq $0x4, %r11 | |
// bf: 4d 39 d9 cmpq %r11, %r9 | |
// c2: 75 ec jne 0xb0 <_JIT_ENTRY+0xb0> | |
// c4: 4d 39 c8 cmpq %r9, %r8 | |
// c7: 74 18 je 0xe1 <_JIT_ENTRY+0xe1> | |
// c9: 4c 09 cf orq %r9, %rdi | |
// cc: 0f 1f 40 00 nopl (%rax) | |
// d0: 48 c7 44 f9 50 00 00 00 00 movq $0x0, 0x50(%rcx,%rdi,8) | |
// d9: 48 ff c7 incq %rdi | |
// dc: 48 39 fe cmpq %rdi, %rsi | |
// df: 75 ef jne 0xd0 <_JIT_ENTRY+0xd0> | |
// e1: 31 f6 xorl %esi, %esi | |
// e3: 48 85 d2 testq %rdx, %rdx | |
// e6: 40 0f 95 c6 setne %sil | |
// ea: 48 8b 55 f0 movq -0x10(%rbp), %rdx | |
// ee: 48 89 51 50 movq %rdx, 0x50(%rcx) | |
// f2: 48 8b 55 f8 movq -0x8(%rbp), %rdx | |
// f6: 48 89 54 f1 50 movq %rdx, 0x50(%rcx,%rsi,8) | |
// fb: 48 89 4d e8 movq %rcx, -0x18(%rbp) | |
// ff: 48 89 c5 movq %rax, %rbp | |
// 102: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x109 <_JIT_ENTRY+0x109> | |
// 0000000000000105: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 102: | |
const unsigned char code_body[258] = { | |
0x48, 0x8b, 0x75, 0xe8, 0x48, 0x8b, 0x55, 0xf0, | |
0x48, 0x83, 0xfa, 0x01, 0xbf, 0x01, 0x00, 0x00, | |
0x00, 0x83, 0xdf, 0xff, 0x4c, 0x8b, 0x46, 0x30, | |
0x49, 0x8b, 0x8c, 0x24, 0xe8, 0x00, 0x00, 0x00, | |
0x49, 0x63, 0x40, 0x4c, 0x48, 0x8d, 0x04, 0xc1, | |
0x49, 0x89, 0x84, 0x24, 0xe8, 0x00, 0x00, 0x00, | |
0x4c, 0x89, 0x69, 0x08, 0x48, 0x89, 0x71, 0x10, | |
0x41, 0x8b, 0x00, 0xff, 0xc0, 0x74, 0x03, 0x41, | |
0x89, 0x00, 0x48, 0x8d, 0x45, 0xf0, 0x4c, 0x89, | |
0x01, 0x0f, 0x10, 0x46, 0x10, 0x0f, 0x11, 0x41, | |
0x18, 0x48, 0xc7, 0x41, 0x28, 0x00, 0x00, 0x00, | |
0x00, 0x49, 0x63, 0x70, 0x48, 0x4c, 0x8d, 0x0c, | |
0xf1, 0x49, 0x83, 0xc1, 0x50, 0x4c, 0x89, 0x49, | |
0x40, 0x48, 0xc7, 0x41, 0x30, 0x00, 0x00, 0x00, | |
0x00, 0x49, 0x81, 0xc0, 0xc8, 0x00, 0x00, 0x00, | |
0x4c, 0x89, 0x41, 0x38, 0x66, 0xc7, 0x41, 0x48, | |
0x00, 0x00, 0xc6, 0x41, 0x4a, 0x00, 0x39, 0xfe, | |
0x7e, 0x57, 0x89, 0xff, 0x49, 0x89, 0xf0, 0x49, | |
0x29, 0xf8, 0x49, 0x83, 0xf8, 0x04, 0x72, 0x38, | |
0x4d, 0x89, 0xc1, 0x49, 0x83, 0xe1, 0xfc, 0x4c, | |
0x8d, 0x14, 0xf9, 0x49, 0x83, 0xc2, 0x60, 0x45, | |
0x31, 0xdb, 0x0f, 0x57, 0xc0, 0x0f, 0x1f, 0x00, | |
0x43, 0x0f, 0x11, 0x44, 0xda, 0xf0, 0x43, 0x0f, | |
0x11, 0x04, 0xda, 0x49, 0x83, 0xc3, 0x04, 0x4d, | |
0x39, 0xd9, 0x75, 0xec, 0x4d, 0x39, 0xc8, 0x74, | |
0x18, 0x4c, 0x09, 0xcf, 0x0f, 0x1f, 0x40, 0x00, | |
0x48, 0xc7, 0x44, 0xf9, 0x50, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0xff, 0xc7, 0x48, 0x39, 0xfe, 0x75, | |
0xef, 0x31, 0xf6, 0x48, 0x85, 0xd2, 0x40, 0x0f, | |
0x95, 0xc6, 0x48, 0x8b, 0x55, 0xf0, 0x48, 0x89, | |
0x51, 0x50, 0x48, 0x8b, 0x55, 0xf8, 0x48, 0x89, | |
0x54, 0xf1, 0x50, 0x48, 0x89, 0x4d, 0xe8, 0x48, | |
0x89, 0xc5, | |
}; | |
// 0: | |
memcpy(code, code_body, sizeof(code_body)); | |
} | |
void | |
emit__INIT_CALL_PY_EXACT_ARGS_2( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_INIT_CALL_PY_EXACT_ARGS_2.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 75 e0 movq -0x20(%rbp), %rsi | |
// 4: 48 8b 55 e8 movq -0x18(%rbp), %rdx | |
// 8: 48 83 fa 01 cmpq $0x1, %rdx | |
// c: bf 02 00 00 00 movl $0x2, %edi | |
// 11: 83 df ff sbbl $-0x1, %edi | |
// 14: 4c 8b 46 30 movq 0x30(%rsi), %r8 | |
// 18: 49 8b 8c 24 e8 00 00 00 movq 0xe8(%r12), %rcx | |
// 20: 49 63 40 4c movslq 0x4c(%r8), %rax | |
// 24: 48 8d 04 c1 leaq (%rcx,%rax,8), %rax | |
// 28: 49 89 84 24 e8 00 00 00 movq %rax, 0xe8(%r12) | |
// 30: 4c 89 69 08 movq %r13, 0x8(%rcx) | |
// 34: 48 89 71 10 movq %rsi, 0x10(%rcx) | |
// 38: 41 8b 00 movl (%r8), %eax | |
// 3b: ff c0 incl %eax | |
// 3d: 74 03 je 0x42 <_JIT_ENTRY+0x42> | |
// 3f: 41 89 00 movl %eax, (%r8) | |
// 42: 48 8d 45 e8 leaq -0x18(%rbp), %rax | |
// 46: 4c 89 01 movq %r8, (%rcx) | |
// 49: 0f 10 46 10 movups 0x10(%rsi), %xmm0 | |
// 4d: 0f 11 41 18 movups %xmm0, 0x18(%rcx) | |
// 51: 48 c7 41 28 00 00 00 00 movq $0x0, 0x28(%rcx) | |
// 59: 49 63 70 48 movslq 0x48(%r8), %rsi | |
// 5d: 4c 8d 0c f1 leaq (%rcx,%rsi,8), %r9 | |
// 61: 49 83 c1 50 addq $0x50, %r9 | |
// 65: 4c 89 49 40 movq %r9, 0x40(%rcx) | |
// 69: 48 c7 41 30 00 00 00 00 movq $0x0, 0x30(%rcx) | |
// 71: 49 81 c0 c8 00 00 00 addq $0xc8, %r8 | |
// 78: 4c 89 41 38 movq %r8, 0x38(%rcx) | |
// 7c: 66 c7 41 48 00 00 movw $0x0, 0x48(%rcx) | |
// 82: c6 41 4a 00 movb $0x0, 0x4a(%rcx) | |
// 86: 39 fe cmpl %edi, %esi | |
// 88: 7e 57 jle 0xe1 <_JIT_ENTRY+0xe1> | |
// 8a: 89 ff movl %edi, %edi | |
// 8c: 49 89 f0 movq %rsi, %r8 | |
// 8f: 49 29 f8 subq %rdi, %r8 | |
// 92: 49 83 f8 04 cmpq $0x4, %r8 | |
// 96: 72 38 jb 0xd0 <_JIT_ENTRY+0xd0> | |
// 98: 4d 89 c1 movq %r8, %r9 | |
// 9b: 49 83 e1 fc andq $-0x4, %r9 | |
// 9f: 4c 8d 14 f9 leaq (%rcx,%rdi,8), %r10 | |
// a3: 49 83 c2 60 addq $0x60, %r10 | |
// a7: 45 31 db xorl %r11d, %r11d | |
// aa: 0f 57 c0 xorps %xmm0, %xmm0 | |
// ad: 0f 1f 00 nopl (%rax) | |
// b0: 43 0f 11 44 da f0 movups %xmm0, -0x10(%r10,%r11,8) | |
// b6: 43 0f 11 04 da movups %xmm0, (%r10,%r11,8) | |
// bb: 49 83 c3 04 addq $0x4, %r11 | |
// bf: 4d 39 d9 cmpq %r11, %r9 | |
// c2: 75 ec jne 0xb0 <_JIT_ENTRY+0xb0> | |
// c4: 4d 39 c8 cmpq %r9, %r8 | |
// c7: 74 18 je 0xe1 <_JIT_ENTRY+0xe1> | |
// c9: 4c 09 cf orq %r9, %rdi | |
// cc: 0f 1f 40 00 nopl (%rax) | |
// d0: 48 c7 44 f9 50 00 00 00 00 movq $0x0, 0x50(%rcx,%rdi,8) | |
// d9: 48 ff c7 incq %rdi | |
// dc: 48 39 fe cmpq %rdi, %rsi | |
// df: 75 ef jne 0xd0 <_JIT_ENTRY+0xd0> | |
// e1: 31 f6 xorl %esi, %esi | |
// e3: 48 85 d2 testq %rdx, %rdx | |
// e6: 40 0f 95 c6 setne %sil | |
// ea: 48 8b 55 e8 movq -0x18(%rbp), %rdx | |
// ee: 48 89 51 50 movq %rdx, 0x50(%rcx) | |
// f2: 48 8b 55 f0 movq -0x10(%rbp), %rdx | |
// f6: 48 89 54 f1 50 movq %rdx, 0x50(%rcx,%rsi,8) | |
// fb: 48 8b 55 f8 movq -0x8(%rbp), %rdx | |
// ff: 48 89 54 f1 58 movq %rdx, 0x58(%rcx,%rsi,8) | |
// 104: 48 89 4d e0 movq %rcx, -0x20(%rbp) | |
// 108: 48 89 c5 movq %rax, %rbp | |
// 10b: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x112 <_JIT_ENTRY+0x112> | |
// 000000000000010e: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 10b: | |
const unsigned char code_body[267] = { | |
0x48, 0x8b, 0x75, 0xe0, 0x48, 0x8b, 0x55, 0xe8, | |
0x48, 0x83, 0xfa, 0x01, 0xbf, 0x02, 0x00, 0x00, | |
0x00, 0x83, 0xdf, 0xff, 0x4c, 0x8b, 0x46, 0x30, | |
0x49, 0x8b, 0x8c, 0x24, 0xe8, 0x00, 0x00, 0x00, | |
0x49, 0x63, 0x40, 0x4c, 0x48, 0x8d, 0x04, 0xc1, | |
0x49, 0x89, 0x84, 0x24, 0xe8, 0x00, 0x00, 0x00, | |
0x4c, 0x89, 0x69, 0x08, 0x48, 0x89, 0x71, 0x10, | |
0x41, 0x8b, 0x00, 0xff, 0xc0, 0x74, 0x03, 0x41, | |
0x89, 0x00, 0x48, 0x8d, 0x45, 0xe8, 0x4c, 0x89, | |
0x01, 0x0f, 0x10, 0x46, 0x10, 0x0f, 0x11, 0x41, | |
0x18, 0x48, 0xc7, 0x41, 0x28, 0x00, 0x00, 0x00, | |
0x00, 0x49, 0x63, 0x70, 0x48, 0x4c, 0x8d, 0x0c, | |
0xf1, 0x49, 0x83, 0xc1, 0x50, 0x4c, 0x89, 0x49, | |
0x40, 0x48, 0xc7, 0x41, 0x30, 0x00, 0x00, 0x00, | |
0x00, 0x49, 0x81, 0xc0, 0xc8, 0x00, 0x00, 0x00, | |
0x4c, 0x89, 0x41, 0x38, 0x66, 0xc7, 0x41, 0x48, | |
0x00, 0x00, 0xc6, 0x41, 0x4a, 0x00, 0x39, 0xfe, | |
0x7e, 0x57, 0x89, 0xff, 0x49, 0x89, 0xf0, 0x49, | |
0x29, 0xf8, 0x49, 0x83, 0xf8, 0x04, 0x72, 0x38, | |
0x4d, 0x89, 0xc1, 0x49, 0x83, 0xe1, 0xfc, 0x4c, | |
0x8d, 0x14, 0xf9, 0x49, 0x83, 0xc2, 0x60, 0x45, | |
0x31, 0xdb, 0x0f, 0x57, 0xc0, 0x0f, 0x1f, 0x00, | |
0x43, 0x0f, 0x11, 0x44, 0xda, 0xf0, 0x43, 0x0f, | |
0x11, 0x04, 0xda, 0x49, 0x83, 0xc3, 0x04, 0x4d, | |
0x39, 0xd9, 0x75, 0xec, 0x4d, 0x39, 0xc8, 0x74, | |
0x18, 0x4c, 0x09, 0xcf, 0x0f, 0x1f, 0x40, 0x00, | |
0x48, 0xc7, 0x44, 0xf9, 0x50, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0xff, 0xc7, 0x48, 0x39, 0xfe, 0x75, | |
0xef, 0x31, 0xf6, 0x48, 0x85, 0xd2, 0x40, 0x0f, | |
0x95, 0xc6, 0x48, 0x8b, 0x55, 0xe8, 0x48, 0x89, | |
0x51, 0x50, 0x48, 0x8b, 0x55, 0xf0, 0x48, 0x89, | |
0x54, 0xf1, 0x50, 0x48, 0x8b, 0x55, 0xf8, 0x48, | |
0x89, 0x54, 0xf1, 0x58, 0x48, 0x89, 0x4d, 0xe0, | |
0x48, 0x89, 0xc5, | |
}; | |
// 0: | |
memcpy(code, code_body, sizeof(code_body)); | |
} | |
void | |
emit__INIT_CALL_PY_EXACT_ARGS_3( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_INIT_CALL_PY_EXACT_ARGS_3.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 75 d8 movq -0x28(%rbp), %rsi | |
// 4: 48 8b 55 e0 movq -0x20(%rbp), %rdx | |
// 8: 48 83 fa 01 cmpq $0x1, %rdx | |
// c: bf 03 00 00 00 movl $0x3, %edi | |
// 11: 83 df ff sbbl $-0x1, %edi | |
// 14: 4c 8b 46 30 movq 0x30(%rsi), %r8 | |
// 18: 49 8b 8c 24 e8 00 00 00 movq 0xe8(%r12), %rcx | |
// 20: 49 63 40 4c movslq 0x4c(%r8), %rax | |
// 24: 48 8d 04 c1 leaq (%rcx,%rax,8), %rax | |
// 28: 49 89 84 24 e8 00 00 00 movq %rax, 0xe8(%r12) | |
// 30: 4c 89 69 08 movq %r13, 0x8(%rcx) | |
// 34: 48 89 71 10 movq %rsi, 0x10(%rcx) | |
// 38: 41 8b 00 movl (%r8), %eax | |
// 3b: ff c0 incl %eax | |
// 3d: 74 03 je 0x42 <_JIT_ENTRY+0x42> | |
// 3f: 41 89 00 movl %eax, (%r8) | |
// 42: 48 8d 45 e0 leaq -0x20(%rbp), %rax | |
// 46: 4c 89 01 movq %r8, (%rcx) | |
// 49: 0f 10 46 10 movups 0x10(%rsi), %xmm0 | |
// 4d: 0f 11 41 18 movups %xmm0, 0x18(%rcx) | |
// 51: 48 c7 41 28 00 00 00 00 movq $0x0, 0x28(%rcx) | |
// 59: 49 63 70 48 movslq 0x48(%r8), %rsi | |
// 5d: 4c 8d 0c f1 leaq (%rcx,%rsi,8), %r9 | |
// 61: 49 83 c1 50 addq $0x50, %r9 | |
// 65: 4c 89 49 40 movq %r9, 0x40(%rcx) | |
// 69: 48 c7 41 30 00 00 00 00 movq $0x0, 0x30(%rcx) | |
// 71: 49 81 c0 c8 00 00 00 addq $0xc8, %r8 | |
// 78: 4c 89 41 38 movq %r8, 0x38(%rcx) | |
// 7c: 66 c7 41 48 00 00 movw $0x0, 0x48(%rcx) | |
// 82: c6 41 4a 00 movb $0x0, 0x4a(%rcx) | |
// 86: 39 fe cmpl %edi, %esi | |
// 88: 7e 57 jle 0xe1 <_JIT_ENTRY+0xe1> | |
// 8a: 89 ff movl %edi, %edi | |
// 8c: 49 89 f0 movq %rsi, %r8 | |
// 8f: 49 29 f8 subq %rdi, %r8 | |
// 92: 49 83 f8 04 cmpq $0x4, %r8 | |
// 96: 72 38 jb 0xd0 <_JIT_ENTRY+0xd0> | |
// 98: 4d 89 c1 movq %r8, %r9 | |
// 9b: 49 83 e1 fc andq $-0x4, %r9 | |
// 9f: 4c 8d 14 f9 leaq (%rcx,%rdi,8), %r10 | |
// a3: 49 83 c2 60 addq $0x60, %r10 | |
// a7: 45 31 db xorl %r11d, %r11d | |
// aa: 0f 57 c0 xorps %xmm0, %xmm0 | |
// ad: 0f 1f 00 nopl (%rax) | |
// b0: 43 0f 11 44 da f0 movups %xmm0, -0x10(%r10,%r11,8) | |
// b6: 43 0f 11 04 da movups %xmm0, (%r10,%r11,8) | |
// bb: 49 83 c3 04 addq $0x4, %r11 | |
// bf: 4d 39 d9 cmpq %r11, %r9 | |
// c2: 75 ec jne 0xb0 <_JIT_ENTRY+0xb0> | |
// c4: 4d 39 c8 cmpq %r9, %r8 | |
// c7: 74 18 je 0xe1 <_JIT_ENTRY+0xe1> | |
// c9: 4c 01 cf addq %r9, %rdi | |
// cc: 0f 1f 40 00 nopl (%rax) | |
// d0: 48 c7 44 f9 50 00 00 00 00 movq $0x0, 0x50(%rcx,%rdi,8) | |
// d9: 48 ff c7 incq %rdi | |
// dc: 48 39 fe cmpq %rdi, %rsi | |
// df: 75 ef jne 0xd0 <_JIT_ENTRY+0xd0> | |
// e1: 31 f6 xorl %esi, %esi | |
// e3: 48 85 d2 testq %rdx, %rdx | |
// e6: 40 0f 95 c6 setne %sil | |
// ea: 48 8b 55 e0 movq -0x20(%rbp), %rdx | |
// ee: 48 89 51 50 movq %rdx, 0x50(%rcx) | |
// f2: 48 8b 55 e8 movq -0x18(%rbp), %rdx | |
// f6: 48 89 54 f1 50 movq %rdx, 0x50(%rcx,%rsi,8) | |
// fb: 48 8b 55 f0 movq -0x10(%rbp), %rdx | |
// ff: 48 89 54 f1 58 movq %rdx, 0x58(%rcx,%rsi,8) | |
// 104: 48 8b 55 f8 movq -0x8(%rbp), %rdx | |
// 108: 48 89 54 f1 60 movq %rdx, 0x60(%rcx,%rsi,8) | |
// 10d: 48 89 4d d8 movq %rcx, -0x28(%rbp) | |
// 111: 48 89 c5 movq %rax, %rbp | |
// 114: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x11b <_JIT_ENTRY+0x11b> | |
// 0000000000000117: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 114: | |
const unsigned char code_body[276] = { | |
0x48, 0x8b, 0x75, 0xd8, 0x48, 0x8b, 0x55, 0xe0, | |
0x48, 0x83, 0xfa, 0x01, 0xbf, 0x03, 0x00, 0x00, | |
0x00, 0x83, 0xdf, 0xff, 0x4c, 0x8b, 0x46, 0x30, | |
0x49, 0x8b, 0x8c, 0x24, 0xe8, 0x00, 0x00, 0x00, | |
0x49, 0x63, 0x40, 0x4c, 0x48, 0x8d, 0x04, 0xc1, | |
0x49, 0x89, 0x84, 0x24, 0xe8, 0x00, 0x00, 0x00, | |
0x4c, 0x89, 0x69, 0x08, 0x48, 0x89, 0x71, 0x10, | |
0x41, 0x8b, 0x00, 0xff, 0xc0, 0x74, 0x03, 0x41, | |
0x89, 0x00, 0x48, 0x8d, 0x45, 0xe0, 0x4c, 0x89, | |
0x01, 0x0f, 0x10, 0x46, 0x10, 0x0f, 0x11, 0x41, | |
0x18, 0x48, 0xc7, 0x41, 0x28, 0x00, 0x00, 0x00, | |
0x00, 0x49, 0x63, 0x70, 0x48, 0x4c, 0x8d, 0x0c, | |
0xf1, 0x49, 0x83, 0xc1, 0x50, 0x4c, 0x89, 0x49, | |
0x40, 0x48, 0xc7, 0x41, 0x30, 0x00, 0x00, 0x00, | |
0x00, 0x49, 0x81, 0xc0, 0xc8, 0x00, 0x00, 0x00, | |
0x4c, 0x89, 0x41, 0x38, 0x66, 0xc7, 0x41, 0x48, | |
0x00, 0x00, 0xc6, 0x41, 0x4a, 0x00, 0x39, 0xfe, | |
0x7e, 0x57, 0x89, 0xff, 0x49, 0x89, 0xf0, 0x49, | |
0x29, 0xf8, 0x49, 0x83, 0xf8, 0x04, 0x72, 0x38, | |
0x4d, 0x89, 0xc1, 0x49, 0x83, 0xe1, 0xfc, 0x4c, | |
0x8d, 0x14, 0xf9, 0x49, 0x83, 0xc2, 0x60, 0x45, | |
0x31, 0xdb, 0x0f, 0x57, 0xc0, 0x0f, 0x1f, 0x00, | |
0x43, 0x0f, 0x11, 0x44, 0xda, 0xf0, 0x43, 0x0f, | |
0x11, 0x04, 0xda, 0x49, 0x83, 0xc3, 0x04, 0x4d, | |
0x39, 0xd9, 0x75, 0xec, 0x4d, 0x39, 0xc8, 0x74, | |
0x18, 0x4c, 0x01, 0xcf, 0x0f, 0x1f, 0x40, 0x00, | |
0x48, 0xc7, 0x44, 0xf9, 0x50, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0xff, 0xc7, 0x48, 0x39, 0xfe, 0x75, | |
0xef, 0x31, 0xf6, 0x48, 0x85, 0xd2, 0x40, 0x0f, | |
0x95, 0xc6, 0x48, 0x8b, 0x55, 0xe0, 0x48, 0x89, | |
0x51, 0x50, 0x48, 0x8b, 0x55, 0xe8, 0x48, 0x89, | |
0x54, 0xf1, 0x50, 0x48, 0x8b, 0x55, 0xf0, 0x48, | |
0x89, 0x54, 0xf1, 0x58, 0x48, 0x8b, 0x55, 0xf8, | |
0x48, 0x89, 0x54, 0xf1, 0x60, 0x48, 0x89, 0x4d, | |
0xd8, 0x48, 0x89, 0xc5, | |
}; | |
// 0: | |
memcpy(code, code_body, sizeof(code_body)); | |
} | |
void | |
emit__INIT_CALL_PY_EXACT_ARGS_4( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_INIT_CALL_PY_EXACT_ARGS_4.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 75 d0 movq -0x30(%rbp), %rsi | |
// 4: 48 8b 55 d8 movq -0x28(%rbp), %rdx | |
// 8: 48 83 fa 01 cmpq $0x1, %rdx | |
// c: bf 04 00 00 00 movl $0x4, %edi | |
// 11: 83 df ff sbbl $-0x1, %edi | |
// 14: 4c 8b 46 30 movq 0x30(%rsi), %r8 | |
// 18: 49 8b 8c 24 e8 00 00 00 movq 0xe8(%r12), %rcx | |
// 20: 49 63 40 4c movslq 0x4c(%r8), %rax | |
// 24: 48 8d 04 c1 leaq (%rcx,%rax,8), %rax | |
// 28: 49 89 84 24 e8 00 00 00 movq %rax, 0xe8(%r12) | |
// 30: 4c 89 69 08 movq %r13, 0x8(%rcx) | |
// 34: 48 89 71 10 movq %rsi, 0x10(%rcx) | |
// 38: 41 8b 00 movl (%r8), %eax | |
// 3b: ff c0 incl %eax | |
// 3d: 74 03 je 0x42 <_JIT_ENTRY+0x42> | |
// 3f: 41 89 00 movl %eax, (%r8) | |
// 42: 48 8d 45 d8 leaq -0x28(%rbp), %rax | |
// 46: 4c 89 01 movq %r8, (%rcx) | |
// 49: 0f 10 46 10 movups 0x10(%rsi), %xmm0 | |
// 4d: 0f 11 41 18 movups %xmm0, 0x18(%rcx) | |
// 51: 48 c7 41 28 00 00 00 00 movq $0x0, 0x28(%rcx) | |
// 59: 49 63 70 48 movslq 0x48(%r8), %rsi | |
// 5d: 4c 8d 0c f1 leaq (%rcx,%rsi,8), %r9 | |
// 61: 49 83 c1 50 addq $0x50, %r9 | |
// 65: 4c 89 49 40 movq %r9, 0x40(%rcx) | |
// 69: 48 c7 41 30 00 00 00 00 movq $0x0, 0x30(%rcx) | |
// 71: 49 81 c0 c8 00 00 00 addq $0xc8, %r8 | |
// 78: 4c 89 41 38 movq %r8, 0x38(%rcx) | |
// 7c: 66 c7 41 48 00 00 movw $0x0, 0x48(%rcx) | |
// 82: c6 41 4a 00 movb $0x0, 0x4a(%rcx) | |
// 86: 39 fe cmpl %edi, %esi | |
// 88: 7e 57 jle 0xe1 <_JIT_ENTRY+0xe1> | |
// 8a: 89 ff movl %edi, %edi | |
// 8c: 49 89 f0 movq %rsi, %r8 | |
// 8f: 49 29 f8 subq %rdi, %r8 | |
// 92: 49 83 f8 04 cmpq $0x4, %r8 | |
// 96: 72 38 jb 0xd0 <_JIT_ENTRY+0xd0> | |
// 98: 4d 89 c1 movq %r8, %r9 | |
// 9b: 49 83 e1 fc andq $-0x4, %r9 | |
// 9f: 4c 8d 14 f9 leaq (%rcx,%rdi,8), %r10 | |
// a3: 49 83 c2 60 addq $0x60, %r10 | |
// a7: 45 31 db xorl %r11d, %r11d | |
// aa: 0f 57 c0 xorps %xmm0, %xmm0 | |
// ad: 0f 1f 00 nopl (%rax) | |
// b0: 43 0f 11 44 da f0 movups %xmm0, -0x10(%r10,%r11,8) | |
// b6: 43 0f 11 04 da movups %xmm0, (%r10,%r11,8) | |
// bb: 49 83 c3 04 addq $0x4, %r11 | |
// bf: 4d 39 d9 cmpq %r11, %r9 | |
// c2: 75 ec jne 0xb0 <_JIT_ENTRY+0xb0> | |
// c4: 4d 39 c8 cmpq %r9, %r8 | |
// c7: 74 18 je 0xe1 <_JIT_ENTRY+0xe1> | |
// c9: 4c 01 cf addq %r9, %rdi | |
// cc: 0f 1f 40 00 nopl (%rax) | |
// d0: 48 c7 44 f9 50 00 00 00 00 movq $0x0, 0x50(%rcx,%rdi,8) | |
// d9: 48 ff c7 incq %rdi | |
// dc: 48 39 fe cmpq %rdi, %rsi | |
// df: 75 ef jne 0xd0 <_JIT_ENTRY+0xd0> | |
// e1: 31 f6 xorl %esi, %esi | |
// e3: 48 85 d2 testq %rdx, %rdx | |
// e6: 40 0f 95 c6 setne %sil | |
// ea: 48 8b 55 d8 movq -0x28(%rbp), %rdx | |
// ee: 48 89 51 50 movq %rdx, 0x50(%rcx) | |
// f2: 48 8b 55 e0 movq -0x20(%rbp), %rdx | |
// f6: 48 89 54 f1 50 movq %rdx, 0x50(%rcx,%rsi,8) | |
// fb: 48 8b 55 e8 movq -0x18(%rbp), %rdx | |
// ff: 48 89 54 f1 58 movq %rdx, 0x58(%rcx,%rsi,8) | |
// 104: 48 8b 55 f0 movq -0x10(%rbp), %rdx | |
// 108: 48 89 54 f1 60 movq %rdx, 0x60(%rcx,%rsi,8) | |
// 10d: 48 8b 55 f8 movq -0x8(%rbp), %rdx | |
// 111: 48 89 54 f1 68 movq %rdx, 0x68(%rcx,%rsi,8) | |
// 116: 48 89 4d d0 movq %rcx, -0x30(%rbp) | |
// 11a: 48 89 c5 movq %rax, %rbp | |
// 11d: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x124 <_JIT_ENTRY+0x124> | |
// 0000000000000120: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 11d: | |
const unsigned char code_body[285] = { | |
0x48, 0x8b, 0x75, 0xd0, 0x48, 0x8b, 0x55, 0xd8, | |
0x48, 0x83, 0xfa, 0x01, 0xbf, 0x04, 0x00, 0x00, | |
0x00, 0x83, 0xdf, 0xff, 0x4c, 0x8b, 0x46, 0x30, | |
0x49, 0x8b, 0x8c, 0x24, 0xe8, 0x00, 0x00, 0x00, | |
0x49, 0x63, 0x40, 0x4c, 0x48, 0x8d, 0x04, 0xc1, | |
0x49, 0x89, 0x84, 0x24, 0xe8, 0x00, 0x00, 0x00, | |
0x4c, 0x89, 0x69, 0x08, 0x48, 0x89, 0x71, 0x10, | |
0x41, 0x8b, 0x00, 0xff, 0xc0, 0x74, 0x03, 0x41, | |
0x89, 0x00, 0x48, 0x8d, 0x45, 0xd8, 0x4c, 0x89, | |
0x01, 0x0f, 0x10, 0x46, 0x10, 0x0f, 0x11, 0x41, | |
0x18, 0x48, 0xc7, 0x41, 0x28, 0x00, 0x00, 0x00, | |
0x00, 0x49, 0x63, 0x70, 0x48, 0x4c, 0x8d, 0x0c, | |
0xf1, 0x49, 0x83, 0xc1, 0x50, 0x4c, 0x89, 0x49, | |
0x40, 0x48, 0xc7, 0x41, 0x30, 0x00, 0x00, 0x00, | |
0x00, 0x49, 0x81, 0xc0, 0xc8, 0x00, 0x00, 0x00, | |
0x4c, 0x89, 0x41, 0x38, 0x66, 0xc7, 0x41, 0x48, | |
0x00, 0x00, 0xc6, 0x41, 0x4a, 0x00, 0x39, 0xfe, | |
0x7e, 0x57, 0x89, 0xff, 0x49, 0x89, 0xf0, 0x49, | |
0x29, 0xf8, 0x49, 0x83, 0xf8, 0x04, 0x72, 0x38, | |
0x4d, 0x89, 0xc1, 0x49, 0x83, 0xe1, 0xfc, 0x4c, | |
0x8d, 0x14, 0xf9, 0x49, 0x83, 0xc2, 0x60, 0x45, | |
0x31, 0xdb, 0x0f, 0x57, 0xc0, 0x0f, 0x1f, 0x00, | |
0x43, 0x0f, 0x11, 0x44, 0xda, 0xf0, 0x43, 0x0f, | |
0x11, 0x04, 0xda, 0x49, 0x83, 0xc3, 0x04, 0x4d, | |
0x39, 0xd9, 0x75, 0xec, 0x4d, 0x39, 0xc8, 0x74, | |
0x18, 0x4c, 0x01, 0xcf, 0x0f, 0x1f, 0x40, 0x00, | |
0x48, 0xc7, 0x44, 0xf9, 0x50, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0xff, 0xc7, 0x48, 0x39, 0xfe, 0x75, | |
0xef, 0x31, 0xf6, 0x48, 0x85, 0xd2, 0x40, 0x0f, | |
0x95, 0xc6, 0x48, 0x8b, 0x55, 0xd8, 0x48, 0x89, | |
0x51, 0x50, 0x48, 0x8b, 0x55, 0xe0, 0x48, 0x89, | |
0x54, 0xf1, 0x50, 0x48, 0x8b, 0x55, 0xe8, 0x48, | |
0x89, 0x54, 0xf1, 0x58, 0x48, 0x8b, 0x55, 0xf0, | |
0x48, 0x89, 0x54, 0xf1, 0x60, 0x48, 0x8b, 0x55, | |
0xf8, 0x48, 0x89, 0x54, 0xf1, 0x68, 0x48, 0x89, | |
0x4d, 0xd0, 0x48, 0x89, 0xc5, | |
}; | |
// 0: | |
memcpy(code, code_body, sizeof(code_body)); | |
} | |
void | |
emit__INTERNAL_INCREMENT_OPT_COUNTER( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_INTERNAL_INCREMENT_OPT_COUNTER.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 ff 40 18 incq 0x18(%rax) | |
// 8: 48 83 c5 f8 addq $-0x8, %rbp | |
// c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x13 <_JIT_ENTRY+0x13> | |
// 000000000000000f: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// c: | |
const unsigned char code_body[12] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0xff, 0x40, 0x18, | |
0x48, 0x83, 0xc5, 0xf8, | |
}; | |
// 0: | |
memcpy(code, code_body, sizeof(code_body)); | |
} | |
void | |
emit__IS_NONE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_IS_NONE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 4d f8 movq -0x8(%rbp), %rcx | |
// 8: 48 3b 0d 00 00 00 00 cmpq (%rip), %rcx # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp__Py_NoneStruct | |
// f: 75 16 jne 0x27 <_JIT_ENTRY+0x27> | |
// 11: 48 8b 35 00 00 00 00 movq (%rip), %rsi # 0x18 <_JIT_ENTRY+0x18> | |
// 0000000000000014: IMAGE_REL_AMD64_REL32 __imp__Py_TrueStruct | |
// 18: 48 89 75 f8 movq %rsi, -0x8(%rbp) | |
// 1c: 48 83 c4 28 addq $0x28, %rsp | |
// 20: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x27 <_JIT_ENTRY+0x27> | |
// 0000000000000023: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 27: 48 8b 01 movq (%rcx), %rax | |
// 2a: 48 8b 35 00 00 00 00 movq (%rip), %rsi # 0x31 <_JIT_ENTRY+0x31> | |
// 000000000000002d: IMAGE_REL_AMD64_REL32 __imp__Py_FalseStruct | |
// 31: 85 c0 testl %eax, %eax | |
// 33: 78 e3 js 0x18 <_JIT_ENTRY+0x18> | |
// 35: 48 ff c8 decq %rax | |
// 38: 48 89 01 movq %rax, (%rcx) | |
// 3b: 75 db jne 0x18 <_JIT_ENTRY+0x18> | |
// 3d: ff 15 00 00 00 00 callq *(%rip) # 0x43 <_JIT_ENTRY+0x43> | |
// 000000000000003f: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 43: 48 89 75 f8 movq %rsi, -0x8(%rbp) | |
// 47: 48 83 c4 28 addq $0x28, %rsp | |
// 4b: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x52 <_JIT_ENTRY+0x52> | |
// 000000000000004e: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 4b: | |
const unsigned char code_body[75] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x4d, 0xf8, | |
0x48, 0x3b, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x75, | |
0x16, 0x48, 0x8b, 0x35, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x89, 0x75, 0xf8, 0x48, 0x83, 0xc4, 0x28, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x01, 0x48, 0x8b, 0x35, 0x00, 0x00, 0x00, | |
0x00, 0x85, 0xc0, 0x78, 0xe3, 0x48, 0xff, 0xc8, | |
0x48, 0x89, 0x01, 0x75, 0xdb, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x89, 0x75, 0xf8, 0x48, | |
0x83, 0xc4, 0x28, | |
}; | |
// 0: | |
// 0: &_Py_NoneStruct+0x0 | |
// 8: &_Py_TrueStruct+0x0 | |
// 10: CONTINUE | |
// 18: &_Py_FalseStruct+0x0 | |
// 20: &_Py_Dealloc+0x0 | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&_Py_NoneStruct); | |
patch_64(data + 0x8, (uintptr_t)&_Py_TrueStruct); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, (uintptr_t)&_Py_FalseStruct); | |
patch_64(data + 0x20, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x14, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x23, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x2d, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x3f, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__IS_OP( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_IS_OP.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 75 f0 movq -0x10(%rbp), %rsi | |
// 8: 48 8b 7d f8 movq -0x8(%rbp), %rdi | |
// c: 48 8b 06 movq (%rsi), %rax | |
// f: 85 c0 testl %eax, %eax | |
// 11: 78 08 js 0x1b <_JIT_ENTRY+0x1b> | |
// 13: 48 ff c8 decq %rax | |
// 16: 48 89 06 movq %rax, (%rsi) | |
// 19: 74 1a je 0x35 <_JIT_ENTRY+0x35> | |
// 1b: 48 8b 07 movq (%rdi), %rax | |
// 1e: 85 c0 testl %eax, %eax | |
// 20: 78 23 js 0x45 <_JIT_ENTRY+0x45> | |
// 22: 48 ff c8 decq %rax | |
// 25: 48 89 07 movq %rax, (%rdi) | |
// 28: 75 1b jne 0x45 <_JIT_ENTRY+0x45> | |
// 2a: 48 89 f9 movq %rdi, %rcx | |
// 2d: ff 15 00 00 00 00 callq *(%rip) # 0x33 <_JIT_ENTRY+0x33> | |
// 000000000000002f: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 33: eb 10 jmp 0x45 <_JIT_ENTRY+0x45> | |
// 35: 48 89 f1 movq %rsi, %rcx | |
// 38: ff 15 00 00 00 00 callq *(%rip) # 0x3e <_JIT_ENTRY+0x3e> | |
// 000000000000003a: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 3e: 48 8b 07 movq (%rdi), %rax | |
// 41: 85 c0 testl %eax, %eax | |
// 43: 79 dd jns 0x22 <_JIT_ENTRY+0x22> | |
// 45: 48 8d 45 f8 leaq -0x8(%rbp), %rax | |
// 49: 31 c9 xorl %ecx, %ecx | |
// 4b: 48 39 fe cmpq %rdi, %rsi | |
// 4e: 0f 94 c1 sete %cl | |
// 51: 48 8b 15 00 00 00 00 movq (%rip), %rdx # 0x58 <_JIT_ENTRY+0x58> | |
// 0000000000000054: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 58: 66 39 d1 cmpw %dx, %cx | |
// 5b: 75 19 jne 0x76 <_JIT_ENTRY+0x76> | |
// 5d: 48 8b 0d 00 00 00 00 movq (%rip), %rcx # 0x64 <_JIT_ENTRY+0x64> | |
// 0000000000000060: IMAGE_REL_AMD64_REL32 __imp__Py_FalseStruct | |
// 64: 48 89 4d f0 movq %rcx, -0x10(%rbp) | |
// 68: 48 89 c5 movq %rax, %rbp | |
// 6b: 48 83 c4 28 addq $0x28, %rsp | |
// 6f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x76 <_JIT_ENTRY+0x76> | |
// 0000000000000072: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 76: 48 8b 0d 00 00 00 00 movq (%rip), %rcx # 0x7d <_JIT_ENTRY+0x7d> | |
// 0000000000000079: IMAGE_REL_AMD64_REL32 __imp__Py_TrueStruct | |
// 7d: 48 89 4d f0 movq %rcx, -0x10(%rbp) | |
// 81: 48 89 c5 movq %rax, %rbp | |
// 84: 48 83 c4 28 addq $0x28, %rsp | |
// 88: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x8f <_JIT_ENTRY+0x8f> | |
// 000000000000008b: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 88: | |
const unsigned char code_body[136] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x75, 0xf0, | |
0x48, 0x8b, 0x7d, 0xf8, 0x48, 0x8b, 0x06, 0x85, | |
0xc0, 0x78, 0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, | |
0x06, 0x74, 0x1a, 0x48, 0x8b, 0x07, 0x85, 0xc0, | |
0x78, 0x23, 0x48, 0xff, 0xc8, 0x48, 0x89, 0x07, | |
0x75, 0x1b, 0x48, 0x89, 0xf9, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0xeb, 0x10, 0x48, 0x89, 0xf1, | |
0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, | |
0x07, 0x85, 0xc0, 0x79, 0xdd, 0x48, 0x8d, 0x45, | |
0xf8, 0x31, 0xc9, 0x48, 0x39, 0xfe, 0x0f, 0x94, | |
0xc1, 0x48, 0x8b, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x66, 0x39, 0xd1, 0x75, 0x19, 0x48, 0x8b, 0x0d, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0x4d, 0xf0, | |
0x48, 0x89, 0xc5, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, | |
0x0d, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0x4d, | |
0xf0, 0x48, 0x89, 0xc5, 0x48, 0x83, 0xc4, 0x28, | |
}; | |
// 0: | |
// 0: &_Py_Dealloc+0x0 | |
// 8: OPARG | |
// 10: &_Py_FalseStruct+0x0 | |
// 18: CONTINUE | |
// 20: &_Py_TrueStruct+0x0 | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x8, instruction->oparg); | |
patch_64(data + 0x10, (uintptr_t)&_Py_FalseStruct); | |
patch_64(data + 0x18, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x20, (uintptr_t)&_Py_TrueStruct); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x2f, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x3a, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x54, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x60, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x72, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x79, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__ITER_CHECK_LIST( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_ITER_CHECK_LIST.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 8b 40 08 movq 0x8(%rax), %rax | |
// 8: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp_PyListIter_Type | |
// f: 74 07 je 0x18 <_JIT_ENTRY+0x18> | |
// 11: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x18 <_JIT_ENTRY+0x18> | |
// 0000000000000014: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 18: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1f <_JIT_ENTRY+0x1f> | |
// 000000000000001b: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 18: | |
const unsigned char code_body[24] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x8b, 0x40, 0x08, | |
0x48, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x74, | |
0x07, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PyListIter_Type+0x0 | |
// 8: JUMP_TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyListIter_Type); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x14, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__ITER_CHECK_RANGE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_ITER_CHECK_RANGE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 8b 40 08 movq 0x8(%rax), %rax | |
// 8: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp_PyRangeIter_Type | |
// f: 74 07 je 0x18 <_JIT_ENTRY+0x18> | |
// 11: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x18 <_JIT_ENTRY+0x18> | |
// 0000000000000014: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 18: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1f <_JIT_ENTRY+0x1f> | |
// 000000000000001b: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 18: | |
const unsigned char code_body[24] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x8b, 0x40, 0x08, | |
0x48, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x74, | |
0x07, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PyRangeIter_Type+0x0 | |
// 8: JUMP_TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyRangeIter_Type); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x14, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__ITER_CHECK_TUPLE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_ITER_CHECK_TUPLE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 8b 40 08 movq 0x8(%rax), %rax | |
// 8: 48 3b 05 00 00 00 00 cmpq (%rip), %rax # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp_PyTupleIter_Type | |
// f: 74 07 je 0x18 <_JIT_ENTRY+0x18> | |
// 11: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x18 <_JIT_ENTRY+0x18> | |
// 0000000000000014: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 18: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1f <_JIT_ENTRY+0x1f> | |
// 000000000000001b: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 18: | |
const unsigned char code_body[24] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x8b, 0x40, 0x08, | |
0x48, 0x3b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x74, | |
0x07, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PyTupleIter_Type+0x0 | |
// 8: JUMP_TARGET | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyTupleIter_Type); | |
patch_64(data + 0x8, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x14, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__ITER_NEXT_LIST( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_ITER_NEXT_LIST.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 8b 48 10 movq 0x10(%rax), %rcx | |
// 8: 48 8b 50 18 movq 0x18(%rax), %rdx | |
// c: 48 8b 52 18 movq 0x18(%rdx), %rdx | |
// 10: 48 8d 71 01 leaq 0x1(%rcx), %rsi | |
// 14: 48 89 70 10 movq %rsi, 0x10(%rax) | |
// 18: 48 8b 04 ca movq (%rdx,%rcx,8), %rax | |
// 1c: 8b 08 movl (%rax), %ecx | |
// 1e: ff c1 incl %ecx | |
// 20: 74 02 je 0x24 <_JIT_ENTRY+0x24> | |
// 22: 89 08 movl %ecx, (%rax) | |
// 24: 48 89 45 00 movq %rax, (%rbp) | |
// 28: 48 83 c5 08 addq $0x8, %rbp | |
// 2c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x33 <_JIT_ENTRY+0x33> | |
// 000000000000002f: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 2c: | |
const unsigned char code_body[44] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x8b, 0x48, 0x10, | |
0x48, 0x8b, 0x50, 0x18, 0x48, 0x8b, 0x52, 0x18, | |
0x48, 0x8d, 0x71, 0x01, 0x48, 0x89, 0x70, 0x10, | |
0x48, 0x8b, 0x04, 0xca, 0x8b, 0x08, 0xff, 0xc1, | |
0x74, 0x02, 0x89, 0x08, 0x48, 0x89, 0x45, 0x00, | |
0x48, 0x83, 0xc5, 0x08, | |
}; | |
// 0: | |
memcpy(code, code_body, sizeof(code_body)); | |
} | |
void | |
emit__ITER_NEXT_RANGE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_ITER_NEXT_RANGE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 8: 8b 48 10 movl 0x10(%rax), %ecx | |
// b: 8b 50 14 movl 0x14(%rax), %edx | |
// e: 01 ca addl %ecx, %edx | |
// 10: 89 50 10 movl %edx, 0x10(%rax) | |
// 13: ff 48 18 decl 0x18(%rax) | |
// 16: ff 15 00 00 00 00 callq *(%rip) # 0x1c <_JIT_ENTRY+0x1c> | |
// 0000000000000018: IMAGE_REL_AMD64_REL32 __imp_PyLong_FromLong | |
// 1c: 48 85 c0 testq %rax, %rax | |
// 1f: 74 13 je 0x34 <_JIT_ENTRY+0x34> | |
// 21: 48 89 45 00 movq %rax, (%rbp) | |
// 25: 48 83 c5 08 addq $0x8, %rbp | |
// 29: 48 83 c4 28 addq $0x28, %rsp | |
// 2d: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x34 <_JIT_ENTRY+0x34> | |
// 0000000000000030: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 34: 48 83 c4 28 addq $0x28, %rsp | |
// 38: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x3f <_JIT_ENTRY+0x3f> | |
// 000000000000003b: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 3f: | |
const unsigned char code_body[63] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x45, 0xf8, | |
0x8b, 0x48, 0x10, 0x8b, 0x50, 0x14, 0x01, 0xca, | |
0x89, 0x50, 0x10, 0xff, 0x48, 0x18, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x85, 0xc0, 0x74, | |
0x13, 0x48, 0x89, 0x45, 0x00, 0x48, 0x83, 0xc5, | |
0x08, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, 0x28, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: &PyLong_FromLong+0x0 | |
// 8: CONTINUE | |
// 10: ERROR_TARGET | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, (uintptr_t)&PyLong_FromLong); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x18, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x30, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x3b, (uintptr_t)data + 0xc); | |
} | |
void | |
emit__ITER_NEXT_TUPLE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_ITER_NEXT_TUPLE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 8b 48 10 movq 0x10(%rax), %rcx | |
// 8: 48 8b 50 18 movq 0x18(%rax), %rdx | |
// c: 48 8d 71 01 leaq 0x1(%rcx), %rsi | |
// 10: 48 89 70 10 movq %rsi, 0x10(%rax) | |
// 14: 48 8b 44 ca 18 movq 0x18(%rdx,%rcx,8), %rax | |
// 19: 8b 08 movl (%rax), %ecx | |
// 1b: ff c1 incl %ecx | |
// 1d: 74 02 je 0x21 <_JIT_ENTRY+0x21> | |
// 1f: 89 08 movl %ecx, (%rax) | |
// 21: 48 89 45 00 movq %rax, (%rbp) | |
// 25: 48 83 c5 08 addq $0x8, %rbp | |
// 29: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x30 <_JIT_ENTRY+0x30> | |
// 000000000000002c: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 29: | |
const unsigned char code_body[41] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x8b, 0x48, 0x10, | |
0x48, 0x8b, 0x50, 0x18, 0x48, 0x8d, 0x71, 0x01, | |
0x48, 0x89, 0x70, 0x10, 0x48, 0x8b, 0x44, 0xca, | |
0x18, 0x8b, 0x08, 0xff, 0xc1, 0x74, 0x02, 0x89, | |
0x08, 0x48, 0x89, 0x45, 0x00, 0x48, 0x83, 0xc5, | |
0x08, | |
}; | |
// 0: | |
memcpy(code, code_body, sizeof(code_body)); | |
} | |
void | |
emit__JUMP_TO_TOP( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_JUMP_TO_TOP.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 7: | |
const unsigned char code_body[7] = { | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: JUMP_TARGET | |
const unsigned char data_body[8] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
} | |
void | |
emit__LIST_APPEND( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LIST_APPEND.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 8b 05 00 00 00 00 movl (%rip), %eax # 0xa <_JIT_ENTRY+0xa> | |
// 0000000000000006: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// a: f7 d0 notl %eax | |
// c: 48 8b 55 f8 movq -0x8(%rbp), %rdx | |
// 10: c1 e0 03 shll $0x3, %eax | |
// 13: 48 0d 00 00 f8 ff orq $-0x80000, %rax # imm = 0xFFF80000 | |
// 19: 48 8b 4c 05 00 movq (%rbp,%rax), %rcx | |
// 1e: 48 8b 41 10 movq 0x10(%rcx), %rax | |
// 22: 48 39 41 20 cmpq %rax, 0x20(%rcx) | |
// 26: 7e 1e jle 0x46 <_JIT_ENTRY+0x46> | |
// 28: 48 8b 71 18 movq 0x18(%rcx), %rsi | |
// 2c: 48 89 14 c6 movq %rdx, (%rsi,%rax,8) | |
// 30: 48 ff c0 incq %rax | |
// 33: 48 89 41 10 movq %rax, 0x10(%rcx) | |
// 37: 48 83 c5 f8 addq $-0x8, %rbp | |
// 3b: 48 83 c4 28 addq $0x28, %rsp | |
// 3f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x46 <_JIT_ENTRY+0x46> | |
// 0000000000000042: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 46: ff 15 00 00 00 00 callq *(%rip) # 0x4c <_JIT_ENTRY+0x4c> | |
// 0000000000000048: IMAGE_REL_AMD64_REL32 __imp__PyList_AppendTakeRefListResize | |
// 4c: 85 c0 testl %eax, %eax | |
// 4e: 78 0f js 0x5f <_JIT_ENTRY+0x5f> | |
// 50: 48 83 c5 f8 addq $-0x8, %rbp | |
// 54: 48 83 c4 28 addq $0x28, %rsp | |
// 58: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x5f <_JIT_ENTRY+0x5f> | |
// 000000000000005b: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 5f: 48 83 c4 28 addq $0x28, %rsp | |
// 63: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x6a <_JIT_ENTRY+0x6a> | |
// 0000000000000066: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 6a: | |
const unsigned char code_body[106] = { | |
0x48, 0x83, 0xec, 0x28, 0x8b, 0x05, 0x00, 0x00, | |
0x00, 0x00, 0xf7, 0xd0, 0x48, 0x8b, 0x55, 0xf8, | |
0xc1, 0xe0, 0x03, 0x48, 0x0d, 0x00, 0x00, 0xf8, | |
0xff, 0x48, 0x8b, 0x4c, 0x05, 0x00, 0x48, 0x8b, | |
0x41, 0x10, 0x48, 0x39, 0x41, 0x20, 0x7e, 0x1e, | |
0x48, 0x8b, 0x71, 0x18, 0x48, 0x89, 0x14, 0xc6, | |
0x48, 0xff, 0xc0, 0x48, 0x89, 0x41, 0x10, 0x48, | |
0x83, 0xc5, 0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x85, 0xc0, 0x78, 0x0f, | |
0x48, 0x83, 0xc5, 0xf8, 0x48, 0x83, 0xc4, 0x28, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: CONTINUE | |
// 10: &_PyList_AppendTakeRefListResize+0x0 | |
// 18: ERROR_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, (uintptr_t)&_PyList_AppendTakeRefListResize); | |
patch_64(data + 0x18, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x6, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x42, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x48, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x5b, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x66, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__LIST_EXTEND( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LIST_EXTEND.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 8b 05 00 00 00 00 movl (%rip), %eax # 0xa <_JIT_ENTRY+0xa> | |
// 0000000000000006: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// a: f7 d0 notl %eax | |
// c: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// 10: c1 e0 03 shll $0x3, %eax | |
// 13: 48 0d 00 00 f8 ff orq $-0x80000, %rax # imm = 0xFFF80000 | |
// 19: 48 8b 4c 05 00 movq (%rbp,%rax), %rcx | |
// 1e: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 22: 48 89 f2 movq %rsi, %rdx | |
// 25: ff 15 00 00 00 00 callq *(%rip) # 0x2b <_JIT_ENTRY+0x2b> | |
// 0000000000000027: IMAGE_REL_AMD64_REL32 __imp__PyList_Extend | |
// 2b: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 2f: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 37: 48 85 c0 testq %rax, %rax | |
// 3a: 74 22 je 0x5e <_JIT_ENTRY+0x5e> | |
// 3c: 48 8b 06 movq (%rsi), %rax | |
// 3f: 85 c0 testl %eax, %eax | |
// 41: 78 0c js 0x4f <_JIT_ENTRY+0x4f> | |
// 43: 48 ff c8 decq %rax | |
// 46: 48 89 06 movq %rax, (%rsi) | |
// 49: 0f 84 9f 00 00 00 je 0xee <_JIT_ENTRY+0xee> | |
// 4f: 48 83 c5 f8 addq $-0x8, %rbp | |
// 53: 48 83 c4 28 addq $0x28, %rsp | |
// 57: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x5e <_JIT_ENTRY+0x5e> | |
// 000000000000005a: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 5e: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 62: 48 8b 3d 00 00 00 00 movq (%rip), %rdi # 0x69 <_JIT_ENTRY+0x69> | |
// 0000000000000065: IMAGE_REL_AMD64_REL32 __imp_PyExc_TypeError | |
// 69: 48 8b 17 movq (%rdi), %rdx | |
// 6c: 4c 89 e1 movq %r12, %rcx | |
// 6f: ff 15 00 00 00 00 callq *(%rip) # 0x75 <_JIT_ENTRY+0x75> | |
// 0000000000000071: IMAGE_REL_AMD64_REL32 __imp__PyErr_ExceptionMatches | |
// 75: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 79: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 81: 85 c0 testl %eax, %eax | |
// 83: 74 4f je 0xd4 <_JIT_ENTRY+0xd4> | |
// 85: 48 8b 46 08 movq 0x8(%rsi), %rax | |
// 89: 48 83 b8 d8 00 00 00 00 cmpq $0x0, 0xd8(%rax) | |
// 91: 75 41 jne 0xd4 <_JIT_ENTRY+0xd4> | |
// 93: 48 89 f1 movq %rsi, %rcx | |
// 96: ff 15 00 00 00 00 callq *(%rip) # 0x9c <_JIT_ENTRY+0x9c> | |
// 0000000000000098: IMAGE_REL_AMD64_REL32 __imp_PySequence_Check | |
// 9c: 85 c0 testl %eax, %eax | |
// 9e: 75 34 jne 0xd4 <_JIT_ENTRY+0xd4> | |
// a0: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// a4: 4c 89 e1 movq %r12, %rcx | |
// a7: ff 15 00 00 00 00 callq *(%rip) # 0xad <_JIT_ENTRY+0xad> | |
// 00000000000000a9: IMAGE_REL_AMD64_REL32 __imp__PyErr_Clear | |
// ad: 48 8b 46 08 movq 0x8(%rsi), %rax | |
// b1: 4c 8b 48 18 movq 0x18(%rax), %r9 | |
// b5: 48 8b 17 movq (%rdi), %rdx | |
// b8: 4c 8d 05 00 00 00 00 leaq (%rip), %r8 # 0xbf <_JIT_ENTRY+0xbf> | |
// 00000000000000bb: IMAGE_REL_AMD64_REL32 ??_C@_0CO@OBBMLOHJ@Value?5after?5?$CK?5must?5be?5an?5iterabl@ | |
// bf: 4c 89 e1 movq %r12, %rcx | |
// c2: ff 15 00 00 00 00 callq *(%rip) # 0xc8 <_JIT_ENTRY+0xc8> | |
// 00000000000000c4: IMAGE_REL_AMD64_REL32 __imp__PyErr_Format | |
// c8: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// cc: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// d4: 48 8b 06 movq (%rsi), %rax | |
// d7: 85 c0 testl %eax, %eax | |
// d9: 78 08 js 0xe3 <_JIT_ENTRY+0xe3> | |
// db: 48 ff c8 decq %rax | |
// de: 48 89 06 movq %rax, (%rsi) | |
// e1: 74 23 je 0x106 <_JIT_ENTRY+0x106> | |
// e3: 48 83 c4 28 addq $0x28, %rsp | |
// e7: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xee <_JIT_ENTRY+0xee> | |
// 00000000000000ea: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// ee: 48 89 f1 movq %rsi, %rcx | |
// f1: ff 15 00 00 00 00 callq *(%rip) # 0xf7 <_JIT_ENTRY+0xf7> | |
// 00000000000000f3: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// f7: 48 83 c5 f8 addq $-0x8, %rbp | |
// fb: 48 83 c4 28 addq $0x28, %rsp | |
// ff: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x106 <_JIT_ENTRY+0x106> | |
// 0000000000000102: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 106: 48 89 f1 movq %rsi, %rcx | |
// 109: ff 15 00 00 00 00 callq *(%rip) # 0x10f <_JIT_ENTRY+0x10f> | |
// 000000000000010b: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 10f: 48 83 c4 28 addq $0x28, %rsp | |
// 113: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x11a <_JIT_ENTRY+0x11a> | |
// 0000000000000116: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 11a: | |
const unsigned char code_body[282] = { | |
0x48, 0x83, 0xec, 0x28, 0x8b, 0x05, 0x00, 0x00, | |
0x00, 0x00, 0xf7, 0xd0, 0x48, 0x8b, 0x75, 0xf8, | |
0xc1, 0xe0, 0x03, 0x48, 0x0d, 0x00, 0x00, 0xf8, | |
0xff, 0x48, 0x8b, 0x4c, 0x05, 0x00, 0x49, 0x89, | |
0x6d, 0x40, 0x48, 0x89, 0xf2, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, | |
0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x85, 0xc0, 0x74, 0x22, 0x48, 0x8b, 0x06, 0x85, | |
0xc0, 0x78, 0x0c, 0x48, 0xff, 0xc8, 0x48, 0x89, | |
0x06, 0x0f, 0x84, 0x9f, 0x00, 0x00, 0x00, 0x48, | |
0x83, 0xc5, 0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x49, 0x89, | |
0x6d, 0x40, 0x48, 0x8b, 0x3d, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x8b, 0x17, 0x4c, 0x89, 0xe1, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, | |
0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, | |
0x00, 0x85, 0xc0, 0x74, 0x4f, 0x48, 0x8b, 0x46, | |
0x08, 0x48, 0x83, 0xb8, 0xd8, 0x00, 0x00, 0x00, | |
0x00, 0x75, 0x41, 0x48, 0x89, 0xf1, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x85, 0xc0, 0x75, 0x34, | |
0x49, 0x89, 0x6d, 0x40, 0x4c, 0x89, 0xe1, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x46, | |
0x08, 0x4c, 0x8b, 0x48, 0x18, 0x48, 0x8b, 0x17, | |
0x4c, 0x8d, 0x05, 0x00, 0x00, 0x00, 0x00, 0x4c, | |
0x89, 0xe1, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x49, 0x8b, 0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x06, 0x85, | |
0xc0, 0x78, 0x08, 0x48, 0xff, 0xc8, 0x48, 0x89, | |
0x06, 0x74, 0x23, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, | |
0xf1, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x83, 0xc5, 0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, | |
0xf1, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, | |
}; | |
// 0: 'Value after * must be an iterable, not %.200s\x00' | |
// 2e: 00 00 | |
// 30: OPARG | |
// 38: &_PyList_Extend+0x0 | |
// 40: CONTINUE | |
// 48: &PyExc_TypeError+0x0 | |
// 50: &_PyErr_ExceptionMatches+0x0 | |
// 58: &PySequence_Check+0x0 | |
// 60: &_PyErr_Clear+0x0 | |
// 68: &_PyErr_Format+0x0 | |
// 70: ERROR_TARGET | |
// 78: &_Py_Dealloc+0x0 | |
const unsigned char data_body[128] = { | |
0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x61, 0x66, | |
0x74, 0x65, 0x72, 0x20, 0x2a, 0x20, 0x6d, 0x75, | |
0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x6e, | |
0x20, 0x69, 0x74, 0x65, 0x72, 0x61, 0x62, 0x6c, | |
0x65, 0x2c, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x25, | |
0x2e, 0x32, 0x30, 0x30, 0x73, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x30, instruction->oparg); | |
patch_64(data + 0x38, (uintptr_t)&_PyList_Extend); | |
patch_64(data + 0x40, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x48, (uintptr_t)&PyExc_TypeError); | |
patch_64(data + 0x50, (uintptr_t)&_PyErr_ExceptionMatches); | |
patch_64(data + 0x58, (uintptr_t)&PySequence_Check); | |
patch_64(data + 0x60, (uintptr_t)&_PyErr_Clear); | |
patch_64(data + 0x68, (uintptr_t)&_PyErr_Format); | |
patch_64(data + 0x70, state->instruction_starts[instruction->error_target]); | |
patch_64(data + 0x78, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x6, (uintptr_t)data + 0x2c); | |
patch_x86_64_32rx(code + 0x27, (uintptr_t)data + 0x34); | |
patch_x86_64_32rx(code + 0x5a, (uintptr_t)data + 0x3c); | |
patch_x86_64_32rx(code + 0x65, (uintptr_t)data + 0x44); | |
patch_x86_64_32rx(code + 0x71, (uintptr_t)data + 0x4c); | |
patch_x86_64_32rx(code + 0x98, (uintptr_t)data + 0x54); | |
patch_x86_64_32rx(code + 0xa9, (uintptr_t)data + 0x5c); | |
patch_x86_64_32rx(code + 0xbb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0xc4, (uintptr_t)data + 0x64); | |
patch_x86_64_32rx(code + 0xea, (uintptr_t)data + 0x6c); | |
patch_x86_64_32rx(code + 0xf3, (uintptr_t)data + 0x74); | |
patch_x86_64_32rx(code + 0x102, (uintptr_t)data + 0x3c); | |
patch_x86_64_32rx(code + 0x10b, (uintptr_t)data + 0x74); | |
patch_x86_64_32rx(code + 0x116, (uintptr_t)data + 0x6c); | |
} | |
void | |
emit__LOAD_ATTR( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_ATTR.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 8b 3d 00 00 00 00 movl (%rip), %edi # 0xa <_JIT_ENTRY+0xa> | |
// 0000000000000006: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// a: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// e: 49 8b 45 00 movq (%r13), %rax | |
// 12: 48 8b 40 20 movq 0x20(%rax), %rax | |
// 16: 89 f9 movl %edi, %ecx | |
// 18: 81 e1 fe ff 00 00 andl $0xfffe, %ecx # imm = 0xFFFE | |
// 1e: 48 8b 54 88 18 movq 0x18(%rax,%rcx,4), %rdx | |
// 23: 83 e7 01 andl $0x1, %edi | |
// 26: 75 4b jne 0x73 <_JIT_ENTRY+0x73> | |
// 28: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 2c: 48 89 f1 movq %rsi, %rcx | |
// 2f: ff 15 00 00 00 00 callq *(%rip) # 0x35 <_JIT_ENTRY+0x35> | |
// 0000000000000031: IMAGE_REL_AMD64_REL32 __imp_PyObject_GetAttr | |
// 35: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 39: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 41: 48 8b 0e movq (%rsi), %rcx | |
// 44: 85 c9 testl %ecx, %ecx | |
// 46: 78 0c js 0x54 <_JIT_ENTRY+0x54> | |
// 48: 48 ff c9 decq %rcx | |
// 4b: 48 89 0e movq %rcx, (%rsi) | |
// 4e: 0f 84 8f 00 00 00 je 0xe3 <_JIT_ENTRY+0xe3> | |
// 54: 48 85 c0 testq %rax, %rax | |
// 57: 0f 84 9e 00 00 00 je 0xfb <_JIT_ENTRY+0xfb> | |
// 5d: 48 89 45 f8 movq %rax, -0x8(%rbp) | |
// 61: 89 f8 movl %edi, %eax | |
// 63: 48 8d 6c c5 00 leaq (%rbp,%rax,8), %rbp | |
// 68: 48 83 c4 28 addq $0x28, %rsp | |
// 6c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x73 <_JIT_ENTRY+0x73> | |
// 000000000000006f: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 73: 48 c7 44 24 20 00 00 00 00 movq $0x0, 0x20(%rsp) | |
// 7c: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 80: 4c 8d 44 24 20 leaq 0x20(%rsp), %r8 | |
// 85: 48 89 f1 movq %rsi, %rcx | |
// 88: ff 15 00 00 00 00 callq *(%rip) # 0x8e <_JIT_ENTRY+0x8e> | |
// 000000000000008a: IMAGE_REL_AMD64_REL32 __imp__PyObject_GetMethod | |
// 8e: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 92: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 9a: 85 c0 testl %eax, %eax | |
// 9c: 74 07 je 0xa5 <_JIT_ENTRY+0xa5> | |
// 9e: 48 8b 44 24 20 movq 0x20(%rsp), %rax | |
// a3: eb 24 jmp 0xc9 <_JIT_ENTRY+0xc9> | |
// a5: 48 8b 06 movq (%rsi), %rax | |
// a8: 85 c0 testl %eax, %eax | |
// aa: 78 11 js 0xbd <_JIT_ENTRY+0xbd> | |
// ac: 48 ff c8 decq %rax | |
// af: 48 89 06 movq %rax, (%rsi) | |
// b2: 75 09 jne 0xbd <_JIT_ENTRY+0xbd> | |
// b4: 48 89 f1 movq %rsi, %rcx | |
// b7: ff 15 00 00 00 00 callq *(%rip) # 0xbd <_JIT_ENTRY+0xbd> | |
// 00000000000000b9: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// bd: 48 8b 44 24 20 movq 0x20(%rsp), %rax | |
// c2: 48 85 c0 testq %rax, %rax | |
// c5: 74 34 je 0xfb <_JIT_ENTRY+0xfb> | |
// c7: 31 f6 xorl %esi, %esi | |
// c9: 48 89 45 f8 movq %rax, -0x8(%rbp) | |
// cd: 48 89 75 00 movq %rsi, (%rbp) | |
// d1: 89 f8 movl %edi, %eax | |
// d3: 48 8d 6c c5 00 leaq (%rbp,%rax,8), %rbp | |
// d8: 48 83 c4 28 addq $0x28, %rsp | |
// dc: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xe3 <_JIT_ENTRY+0xe3> | |
// 00000000000000df: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// e3: 48 89 f1 movq %rsi, %rcx | |
// e6: 48 89 c6 movq %rax, %rsi | |
// e9: ff 15 00 00 00 00 callq *(%rip) # 0xef <_JIT_ENTRY+0xef> | |
// 00000000000000eb: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// ef: 48 89 f0 movq %rsi, %rax | |
// f2: 48 85 c0 testq %rax, %rax | |
// f5: 0f 85 62 ff ff ff jne 0x5d <_JIT_ENTRY+0x5d> | |
// fb: 48 83 c4 28 addq $0x28, %rsp | |
// ff: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x106 <_JIT_ENTRY+0x106> | |
// 0000000000000102: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 106: | |
const unsigned char code_body[262] = { | |
0x48, 0x83, 0xec, 0x28, 0x8b, 0x3d, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x8b, 0x75, 0xf8, 0x49, 0x8b, | |
0x45, 0x00, 0x48, 0x8b, 0x40, 0x20, 0x89, 0xf9, | |
0x81, 0xe1, 0xfe, 0xff, 0x00, 0x00, 0x48, 0x8b, | |
0x54, 0x88, 0x18, 0x83, 0xe7, 0x01, 0x75, 0x4b, | |
0x49, 0x89, 0x6d, 0x40, 0x48, 0x89, 0xf1, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, | |
0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x8b, 0x0e, 0x85, 0xc9, 0x78, 0x0c, | |
0x48, 0xff, 0xc9, 0x48, 0x89, 0x0e, 0x0f, 0x84, | |
0x8f, 0x00, 0x00, 0x00, 0x48, 0x85, 0xc0, 0x0f, | |
0x84, 0x9e, 0x00, 0x00, 0x00, 0x48, 0x89, 0x45, | |
0xf8, 0x89, 0xf8, 0x48, 0x8d, 0x6c, 0xc5, 0x00, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0xc7, 0x44, 0x24, 0x20, | |
0x00, 0x00, 0x00, 0x00, 0x49, 0x89, 0x6d, 0x40, | |
0x4c, 0x8d, 0x44, 0x24, 0x20, 0x48, 0x89, 0xf1, | |
0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, | |
0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, | |
0x00, 0x00, 0x85, 0xc0, 0x74, 0x07, 0x48, 0x8b, | |
0x44, 0x24, 0x20, 0xeb, 0x24, 0x48, 0x8b, 0x06, | |
0x85, 0xc0, 0x78, 0x11, 0x48, 0xff, 0xc8, 0x48, | |
0x89, 0x06, 0x75, 0x09, 0x48, 0x89, 0xf1, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x44, | |
0x24, 0x20, 0x48, 0x85, 0xc0, 0x74, 0x34, 0x31, | |
0xf6, 0x48, 0x89, 0x45, 0xf8, 0x48, 0x89, 0x75, | |
0x00, 0x89, 0xf8, 0x48, 0x8d, 0x6c, 0xc5, 0x00, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x89, 0xf1, 0x48, 0x89, | |
0xc6, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x89, 0xf0, 0x48, 0x85, 0xc0, 0x0f, 0x85, 0x62, | |
0xff, 0xff, 0xff, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &PyObject_GetAttr+0x0 | |
// 10: CONTINUE | |
// 18: &_PyObject_GetMethod+0x0 | |
// 20: &_Py_Dealloc+0x0 | |
// 28: ERROR_TARGET | |
const unsigned char data_body[48] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&PyObject_GetAttr); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, (uintptr_t)&_PyObject_GetMethod); | |
patch_64(data + 0x20, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x28, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x6, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x31, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x6f, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x8a, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0xb9, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0xdf, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xeb, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0x102, (uintptr_t)data + 0x24); | |
} | |
void | |
emit__LOAD_ATTR_CLASS_0( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_ATTR_CLASS_0.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 4d f8 movq -0x8(%rbp), %rcx | |
// 8: 48 8b 35 00 00 00 00 movq (%rip), %rsi # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// f: 8b 06 movl (%rsi), %eax | |
// 11: ff c0 incl %eax | |
// 13: 74 02 je 0x17 <_JIT_ENTRY+0x17> | |
// 15: 89 06 movl %eax, (%rsi) | |
// 17: 48 8b 01 movq (%rcx), %rax | |
// 1a: 85 c0 testl %eax, %eax | |
// 1c: 78 08 js 0x26 <_JIT_ENTRY+0x26> | |
// 1e: 48 ff c8 decq %rax | |
// 21: 48 89 01 movq %rax, (%rcx) | |
// 24: 74 0f je 0x35 <_JIT_ENTRY+0x35> | |
// 26: 48 89 75 f8 movq %rsi, -0x8(%rbp) | |
// 2a: 48 83 c4 28 addq $0x28, %rsp | |
// 2e: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x35 <_JIT_ENTRY+0x35> | |
// 0000000000000031: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 35: ff 15 00 00 00 00 callq *(%rip) # 0x3b <_JIT_ENTRY+0x3b> | |
// 0000000000000037: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 3b: 48 89 75 f8 movq %rsi, -0x8(%rbp) | |
// 3f: 48 83 c4 28 addq $0x28, %rsp | |
// 43: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x4a <_JIT_ENTRY+0x4a> | |
// 0000000000000046: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 43: | |
const unsigned char code_body[67] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x4d, 0xf8, | |
0x48, 0x8b, 0x35, 0x00, 0x00, 0x00, 0x00, 0x8b, | |
0x06, 0xff, 0xc0, 0x74, 0x02, 0x89, 0x06, 0x48, | |
0x8b, 0x01, 0x85, 0xc0, 0x78, 0x08, 0x48, 0xff, | |
0xc8, 0x48, 0x89, 0x01, 0x74, 0x0f, 0x48, 0x89, | |
0x75, 0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x89, 0x75, 0xf8, 0x48, | |
0x83, 0xc4, 0x28, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: CONTINUE | |
// 10: &_Py_Dealloc+0x0 | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x31, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x37, (uintptr_t)data + 0xc); | |
} | |
void | |
emit__LOAD_ATTR_CLASS_1( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_ATTR_CLASS_1.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 4d f8 movq -0x8(%rbp), %rcx | |
// 8: 48 8b 35 00 00 00 00 movq (%rip), %rsi # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// f: 8b 06 movl (%rsi), %eax | |
// 11: ff c0 incl %eax | |
// 13: 74 02 je 0x17 <_JIT_ENTRY+0x17> | |
// 15: 89 06 movl %eax, (%rsi) | |
// 17: 48 8b 01 movq (%rcx), %rax | |
// 1a: 85 c0 testl %eax, %eax | |
// 1c: 78 0e js 0x2c <_JIT_ENTRY+0x2c> | |
// 1e: 48 ff c8 decq %rax | |
// 21: 48 89 01 movq %rax, (%rcx) | |
// 24: 75 06 jne 0x2c <_JIT_ENTRY+0x2c> | |
// 26: ff 15 00 00 00 00 callq *(%rip) # 0x2c <_JIT_ENTRY+0x2c> | |
// 0000000000000028: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 2c: 48 89 75 f8 movq %rsi, -0x8(%rbp) | |
// 30: 48 c7 45 00 00 00 00 00 movq $0x0, (%rbp) | |
// 38: 48 83 c5 08 addq $0x8, %rbp | |
// 3c: 48 83 c4 28 addq $0x28, %rsp | |
// 40: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x47 <_JIT_ENTRY+0x47> | |
// 0000000000000043: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 40: | |
const unsigned char code_body[64] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x4d, 0xf8, | |
0x48, 0x8b, 0x35, 0x00, 0x00, 0x00, 0x00, 0x8b, | |
0x06, 0xff, 0xc0, 0x74, 0x02, 0x89, 0x06, 0x48, | |
0x8b, 0x01, 0x85, 0xc0, 0x78, 0x0e, 0x48, 0xff, | |
0xc8, 0x48, 0x89, 0x01, 0x75, 0x06, 0xff, 0x15, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0x75, 0xf8, | |
0x48, 0xc7, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x83, 0xc5, 0x08, 0x48, 0x83, 0xc4, 0x28, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: &_Py_Dealloc+0x0 | |
const unsigned char data_body[16] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x28, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__LOAD_ATTR_INSTANCE_VALUE_0( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_ATTR_INSTANCE_VALUE_0.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 4d f8 movq -0x8(%rbp), %rcx | |
// 8: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// f: 48 8b 34 01 movq (%rcx,%rax), %rsi | |
// 13: 48 85 f6 testq %rsi, %rsi | |
// 16: 74 26 je 0x3e <_JIT_ENTRY+0x3e> | |
// 18: 8b 06 movl (%rsi), %eax | |
// 1a: ff c0 incl %eax | |
// 1c: 74 02 je 0x20 <_JIT_ENTRY+0x20> | |
// 1e: 89 06 movl %eax, (%rsi) | |
// 20: 48 8b 01 movq (%rcx), %rax | |
// 23: 85 c0 testl %eax, %eax | |
// 25: 78 08 js 0x2f <_JIT_ENTRY+0x2f> | |
// 27: 48 ff c8 decq %rax | |
// 2a: 48 89 01 movq %rax, (%rcx) | |
// 2d: 74 1a je 0x49 <_JIT_ENTRY+0x49> | |
// 2f: 48 89 75 f8 movq %rsi, -0x8(%rbp) | |
// 33: 48 83 c4 28 addq $0x28, %rsp | |
// 37: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x3e <_JIT_ENTRY+0x3e> | |
// 000000000000003a: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 3e: 48 83 c4 28 addq $0x28, %rsp | |
// 42: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x49 <_JIT_ENTRY+0x49> | |
// 0000000000000045: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 49: ff 15 00 00 00 00 callq *(%rip) # 0x4f <_JIT_ENTRY+0x4f> | |
// 000000000000004b: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 4f: 48 89 75 f8 movq %rsi, -0x8(%rbp) | |
// 53: 48 83 c4 28 addq $0x28, %rsp | |
// 57: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x5e <_JIT_ENTRY+0x5e> | |
// 000000000000005a: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 57: | |
const unsigned char code_body[87] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x4d, 0xf8, | |
0x0f, 0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x34, 0x01, 0x48, 0x85, 0xf6, 0x74, 0x26, | |
0x8b, 0x06, 0xff, 0xc0, 0x74, 0x02, 0x89, 0x06, | |
0x48, 0x8b, 0x01, 0x85, 0xc0, 0x78, 0x08, 0x48, | |
0xff, 0xc8, 0x48, 0x89, 0x01, 0x74, 0x1a, 0x48, | |
0x89, 0x75, 0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x83, | |
0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x89, 0x75, 0xf8, 0x48, 0x83, 0xc4, 0x28, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: CONTINUE | |
// 10: JUMP_TARGET | |
// 18: &_Py_Dealloc+0x0 | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x18, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x3a, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x45, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x4b, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__LOAD_ATTR_INSTANCE_VALUE_1( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_ATTR_INSTANCE_VALUE_1.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 4d f8 movq -0x8(%rbp), %rcx | |
// 8: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// f: 48 8b 34 01 movq (%rcx,%rax), %rsi | |
// 13: 48 85 f6 testq %rsi, %rsi | |
// 16: 74 38 je 0x50 <_JIT_ENTRY+0x50> | |
// 18: 8b 06 movl (%rsi), %eax | |
// 1a: ff c0 incl %eax | |
// 1c: 74 02 je 0x20 <_JIT_ENTRY+0x20> | |
// 1e: 89 06 movl %eax, (%rsi) | |
// 20: 48 8b 01 movq (%rcx), %rax | |
// 23: 85 c0 testl %eax, %eax | |
// 25: 78 0e js 0x35 <_JIT_ENTRY+0x35> | |
// 27: 48 ff c8 decq %rax | |
// 2a: 48 89 01 movq %rax, (%rcx) | |
// 2d: 75 06 jne 0x35 <_JIT_ENTRY+0x35> | |
// 2f: ff 15 00 00 00 00 callq *(%rip) # 0x35 <_JIT_ENTRY+0x35> | |
// 0000000000000031: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 35: 48 89 75 f8 movq %rsi, -0x8(%rbp) | |
// 39: 48 c7 45 00 00 00 00 00 movq $0x0, (%rbp) | |
// 41: 48 83 c5 08 addq $0x8, %rbp | |
// 45: 48 83 c4 28 addq $0x28, %rsp | |
// 49: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x50 <_JIT_ENTRY+0x50> | |
// 000000000000004c: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 50: 48 83 c4 28 addq $0x28, %rsp | |
// 54: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x5b <_JIT_ENTRY+0x5b> | |
// 0000000000000057: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 5b: | |
const unsigned char code_body[91] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x4d, 0xf8, | |
0x0f, 0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x34, 0x01, 0x48, 0x85, 0xf6, 0x74, 0x38, | |
0x8b, 0x06, 0xff, 0xc0, 0x74, 0x02, 0x89, 0x06, | |
0x48, 0x8b, 0x01, 0x85, 0xc0, 0x78, 0x0e, 0x48, | |
0xff, 0xc8, 0x48, 0x89, 0x01, 0x75, 0x06, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0x75, | |
0xf8, 0x48, 0xc7, 0x45, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x83, 0xc5, 0x08, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: &_Py_Dealloc+0x0 | |
// 10: CONTINUE | |
// 18: JUMP_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x31, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x4c, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x57, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__LOAD_ATTR_METHOD_LAZY_DICT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_ATTR_METHOD_LAZY_DICT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 8b 0d 00 00 00 00 movq (%rip), %rcx # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// b: 8b 11 movl (%rcx), %edx | |
// d: ff c2 incl %edx | |
// f: 74 02 je 0x13 <_JIT_ENTRY+0x13> | |
// 11: 89 11 movl %edx, (%rcx) | |
// 13: 48 89 4d f8 movq %rcx, -0x8(%rbp) | |
// 17: 48 89 45 00 movq %rax, (%rbp) | |
// 1b: 48 83 c5 08 addq $0x8, %rbp | |
// 1f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x26 <_JIT_ENTRY+0x26> | |
// 0000000000000022: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 1f: | |
const unsigned char code_body[31] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x8b, 0x0d, 0x00, | |
0x00, 0x00, 0x00, 0x8b, 0x11, 0xff, 0xc2, 0x74, | |
0x02, 0x89, 0x11, 0x48, 0x89, 0x4d, 0xf8, 0x48, | |
0x89, 0x45, 0x00, 0x48, 0x83, 0xc5, 0x08, | |
}; | |
// 0: | |
// 0: OPERAND | |
const unsigned char data_body[8] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
} | |
void | |
emit__LOAD_ATTR_METHOD_NO_DICT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_ATTR_METHOD_NO_DICT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 8b 0d 00 00 00 00 movq (%rip), %rcx # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// b: 8b 11 movl (%rcx), %edx | |
// d: ff c2 incl %edx | |
// f: 74 02 je 0x13 <_JIT_ENTRY+0x13> | |
// 11: 89 11 movl %edx, (%rcx) | |
// 13: 48 89 4d f8 movq %rcx, -0x8(%rbp) | |
// 17: 48 89 45 00 movq %rax, (%rbp) | |
// 1b: 48 83 c5 08 addq $0x8, %rbp | |
// 1f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x26 <_JIT_ENTRY+0x26> | |
// 0000000000000022: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 1f: | |
const unsigned char code_body[31] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x8b, 0x0d, 0x00, | |
0x00, 0x00, 0x00, 0x8b, 0x11, 0xff, 0xc2, 0x74, | |
0x02, 0x89, 0x11, 0x48, 0x89, 0x4d, 0xf8, 0x48, | |
0x89, 0x45, 0x00, 0x48, 0x83, 0xc5, 0x08, | |
}; | |
// 0: | |
// 0: OPERAND | |
const unsigned char data_body[8] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
} | |
void | |
emit__LOAD_ATTR_METHOD_WITH_VALUES( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_ATTR_METHOD_WITH_VALUES.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 4: 48 8b 0d 00 00 00 00 movq (%rip), %rcx # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// b: 8b 11 movl (%rcx), %edx | |
// d: ff c2 incl %edx | |
// f: 74 02 je 0x13 <_JIT_ENTRY+0x13> | |
// 11: 89 11 movl %edx, (%rcx) | |
// 13: 48 89 4d f8 movq %rcx, -0x8(%rbp) | |
// 17: 48 89 45 00 movq %rax, (%rbp) | |
// 1b: 48 83 c5 08 addq $0x8, %rbp | |
// 1f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x26 <_JIT_ENTRY+0x26> | |
// 0000000000000022: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 1f: | |
const unsigned char code_body[31] = { | |
0x48, 0x8b, 0x45, 0xf8, 0x48, 0x8b, 0x0d, 0x00, | |
0x00, 0x00, 0x00, 0x8b, 0x11, 0xff, 0xc2, 0x74, | |
0x02, 0x89, 0x11, 0x48, 0x89, 0x4d, 0xf8, 0x48, | |
0x89, 0x45, 0x00, 0x48, 0x83, 0xc5, 0x08, | |
}; | |
// 0: | |
// 0: OPERAND | |
const unsigned char data_body[8] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
} | |
void | |
emit__LOAD_ATTR_MODULE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_ATTR_MODULE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 8: 48 8b 48 10 movq 0x10(%rax), %rcx | |
// c: 48 8b 51 20 movq 0x20(%rcx), %rdx | |
// 10: 0f b6 4a 09 movzbl 0x9(%rdx), %ecx | |
// 14: be 01 00 00 00 movl $0x1, %esi | |
// 19: 48 d3 e6 shlq %cl, %rsi | |
// 1c: 48 01 d6 addq %rdx, %rsi | |
// 1f: 0f b7 0d 00 00 00 00 movzwl (%rip), %ecx # 0x26 <_JIT_ENTRY+0x26> | |
// 0000000000000022: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 26: c1 e1 04 shll $0x4, %ecx | |
// 29: 48 8b 74 31 28 movq 0x28(%rcx,%rsi), %rsi | |
// 2e: 48 85 f6 testq %rsi, %rsi | |
// 31: 74 4c je 0x7f <_JIT_ENTRY+0x7f> | |
// 33: 8b 0e movl (%rsi), %ecx | |
// 35: ff c1 incl %ecx | |
// 37: 74 02 je 0x3b <_JIT_ENTRY+0x3b> | |
// 39: 89 0e movl %ecx, (%rsi) | |
// 3b: 48 8b 08 movq (%rax), %rcx | |
// 3e: 85 c9 testl %ecx, %ecx | |
// 40: 78 11 js 0x53 <_JIT_ENTRY+0x53> | |
// 42: 48 ff c9 decq %rcx | |
// 45: 48 89 08 movq %rcx, (%rax) | |
// 48: 75 09 jne 0x53 <_JIT_ENTRY+0x53> | |
// 4a: 48 89 c1 movq %rax, %rcx | |
// 4d: ff 15 00 00 00 00 callq *(%rip) # 0x53 <_JIT_ENTRY+0x53> | |
// 000000000000004f: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 53: 48 89 75 f8 movq %rsi, -0x8(%rbp) | |
// 57: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x5e <_JIT_ENTRY+0x5e> | |
// 000000000000005a: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 5e: 66 83 e0 01 andw $0x1, %ax | |
// 62: 74 08 je 0x6c <_JIT_ENTRY+0x6c> | |
// 64: 48 c7 45 00 00 00 00 00 movq $0x0, (%rbp) | |
// 6c: 0f b7 c0 movzwl %ax, %eax | |
// 6f: 48 8d 6c c5 00 leaq (%rbp,%rax,8), %rbp | |
// 74: 48 83 c4 28 addq $0x28, %rsp | |
// 78: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x7f <_JIT_ENTRY+0x7f> | |
// 000000000000007b: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 7f: 48 83 c4 28 addq $0x28, %rsp | |
// 83: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x8a <_JIT_ENTRY+0x8a> | |
// 0000000000000086: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 8a: | |
const unsigned char code_body[138] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x45, 0xf8, | |
0x48, 0x8b, 0x48, 0x10, 0x48, 0x8b, 0x51, 0x20, | |
0x0f, 0xb6, 0x4a, 0x09, 0xbe, 0x01, 0x00, 0x00, | |
0x00, 0x48, 0xd3, 0xe6, 0x48, 0x01, 0xd6, 0x0f, | |
0xb7, 0x0d, 0x00, 0x00, 0x00, 0x00, 0xc1, 0xe1, | |
0x04, 0x48, 0x8b, 0x74, 0x31, 0x28, 0x48, 0x85, | |
0xf6, 0x74, 0x4c, 0x8b, 0x0e, 0xff, 0xc1, 0x74, | |
0x02, 0x89, 0x0e, 0x48, 0x8b, 0x08, 0x85, 0xc9, | |
0x78, 0x11, 0x48, 0xff, 0xc9, 0x48, 0x89, 0x08, | |
0x75, 0x09, 0x48, 0x89, 0xc1, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x89, 0x75, 0xf8, 0x48, | |
0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x66, 0x83, | |
0xe0, 0x01, 0x74, 0x08, 0x48, 0xc7, 0x45, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x0f, 0xb7, 0xc0, 0x48, | |
0x8d, 0x6c, 0xc5, 0x00, 0x48, 0x83, 0xc4, 0x28, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, | |
0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: &_Py_Dealloc+0x0 | |
// 10: OPARG | |
// 18: CONTINUE | |
// 20: JUMP_TARGET | |
const unsigned char data_body[40] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x10, instruction->oparg); | |
patch_64(data + 0x18, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x20, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x22, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x4f, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x5a, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x7b, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x86, (uintptr_t)data + 0x1c); | |
} | |
void | |
emit__LOAD_ATTR_NONDESCRIPTOR_NO_DICT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_ATTR_NONDESCRIPTOR_NO_DICT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 4d f8 movq -0x8(%rbp), %rcx | |
// 8: 48 8b 01 movq (%rcx), %rax | |
// b: 85 c0 testl %eax, %eax | |
// d: 78 08 js 0x17 <_JIT_ENTRY+0x17> | |
// f: 48 ff c8 decq %rax | |
// 12: 48 89 01 movq %rax, (%rcx) | |
// 15: 74 1e je 0x35 <_JIT_ENTRY+0x35> | |
// 17: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x1e <_JIT_ENTRY+0x1e> | |
// 000000000000001a: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 1e: 8b 08 movl (%rax), %ecx | |
// 20: ff c1 incl %ecx | |
// 22: 74 02 je 0x26 <_JIT_ENTRY+0x26> | |
// 24: 89 08 movl %ecx, (%rax) | |
// 26: 48 89 45 f8 movq %rax, -0x8(%rbp) | |
// 2a: 48 83 c4 28 addq $0x28, %rsp | |
// 2e: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x35 <_JIT_ENTRY+0x35> | |
// 0000000000000031: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 35: ff 15 00 00 00 00 callq *(%rip) # 0x3b <_JIT_ENTRY+0x3b> | |
// 0000000000000037: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 3b: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x42 <_JIT_ENTRY+0x42> | |
// 000000000000003e: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 42: 8b 08 movl (%rax), %ecx | |
// 44: ff c1 incl %ecx | |
// 46: 75 dc jne 0x24 <_JIT_ENTRY+0x24> | |
// 48: eb dc jmp 0x26 <_JIT_ENTRY+0x26> | |
// 4a: | |
const unsigned char code_body[74] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x4d, 0xf8, | |
0x48, 0x8b, 0x01, 0x85, 0xc0, 0x78, 0x08, 0x48, | |
0xff, 0xc8, 0x48, 0x89, 0x01, 0x74, 0x1e, 0x48, | |
0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x8b, 0x08, | |
0xff, 0xc1, 0x74, 0x02, 0x89, 0x08, 0x48, 0x89, | |
0x45, 0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x8b, 0x05, 0x00, 0x00, | |
0x00, 0x00, 0x8b, 0x08, 0xff, 0xc1, 0x75, 0xdc, | |
0xeb, 0xdc, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: CONTINUE | |
// 10: &_Py_Dealloc+0x0 | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x1a, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x31, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x37, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x3e, (uintptr_t)data + -0x4); | |
} | |
void | |
emit__LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 4d f8 movq -0x8(%rbp), %rcx | |
// 8: 48 8b 01 movq (%rcx), %rax | |
// b: 85 c0 testl %eax, %eax | |
// d: 78 08 js 0x17 <_JIT_ENTRY+0x17> | |
// f: 48 ff c8 decq %rax | |
// 12: 48 89 01 movq %rax, (%rcx) | |
// 15: 74 1e je 0x35 <_JIT_ENTRY+0x35> | |
// 17: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x1e <_JIT_ENTRY+0x1e> | |
// 000000000000001a: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 1e: 8b 08 movl (%rax), %ecx | |
// 20: ff c1 incl %ecx | |
// 22: 74 02 je 0x26 <_JIT_ENTRY+0x26> | |
// 24: 89 08 movl %ecx, (%rax) | |
// 26: 48 89 45 f8 movq %rax, -0x8(%rbp) | |
// 2a: 48 83 c4 28 addq $0x28, %rsp | |
// 2e: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x35 <_JIT_ENTRY+0x35> | |
// 0000000000000031: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 35: ff 15 00 00 00 00 callq *(%rip) # 0x3b <_JIT_ENTRY+0x3b> | |
// 0000000000000037: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 3b: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x42 <_JIT_ENTRY+0x42> | |
// 000000000000003e: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 42: 8b 08 movl (%rax), %ecx | |
// 44: ff c1 incl %ecx | |
// 46: 75 dc jne 0x24 <_JIT_ENTRY+0x24> | |
// 48: eb dc jmp 0x26 <_JIT_ENTRY+0x26> | |
// 4a: | |
const unsigned char code_body[74] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x4d, 0xf8, | |
0x48, 0x8b, 0x01, 0x85, 0xc0, 0x78, 0x08, 0x48, | |
0xff, 0xc8, 0x48, 0x89, 0x01, 0x74, 0x1e, 0x48, | |
0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x8b, 0x08, | |
0xff, 0xc1, 0x74, 0x02, 0x89, 0x08, 0x48, 0x89, | |
0x45, 0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x8b, 0x05, 0x00, 0x00, | |
0x00, 0x00, 0x8b, 0x08, 0xff, 0xc1, 0x75, 0xdc, | |
0xeb, 0xdc, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: CONTINUE | |
// 10: &_Py_Dealloc+0x0 | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x1a, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x31, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x37, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x3e, (uintptr_t)data + -0x4); | |
} | |
void | |
emit__LOAD_ATTR_PROPERTY_FRAME( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_ATTR_PROPERTY_FRAME.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 35 00 00 00 00 movq (%rip), %rsi # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 7: 48 8b 56 30 movq 0x30(%rsi), %rdx | |
// b: 8b 42 30 movl 0x30(%rdx), %eax | |
// e: 83 e0 0d andl $0xd, %eax | |
// 11: 83 f8 01 cmpl $0x1, %eax | |
// 14: 0f 85 16 01 00 00 jne 0x130 <_JIT_ENTRY+0x130> | |
// 1a: 83 7a 3c 00 cmpl $0x0, 0x3c(%rdx) | |
// 1e: 0f 85 0c 01 00 00 jne 0x130 <_JIT_ENTRY+0x130> | |
// 24: 83 7a 34 01 cmpl $0x1, 0x34(%rdx) | |
// 28: 0f 85 02 01 00 00 jne 0x130 <_JIT_ENTRY+0x130> | |
// 2e: 49 8b 84 24 e8 00 00 00 movq 0xe8(%r12), %rax | |
// 36: 48 85 c0 testq %rax, %rax | |
// 39: 0f 84 f1 00 00 00 je 0x130 <_JIT_ENTRY+0x130> | |
// 3f: 48 63 7a 4c movslq 0x4c(%rdx), %rdi | |
// 43: 49 8b 8c 24 f0 00 00 00 movq 0xf0(%r12), %rcx | |
// 4b: 48 29 c1 subq %rax, %rcx | |
// 4e: 48 c1 f9 03 sarq $0x3, %rcx | |
// 52: 48 39 f9 cmpq %rdi, %rcx | |
// 55: 0f 8e d5 00 00 00 jle 0x130 <_JIT_ENTRY+0x130> | |
// 5b: 48 8b 4d f8 movq -0x8(%rbp), %rcx | |
// 5f: 8b 1e movl (%rsi), %ebx | |
// 61: ff c3 incl %ebx | |
// 63: 74 02 je 0x67 <_JIT_ENTRY+0x67> | |
// 65: 89 1e movl %ebx, (%rsi) | |
// 67: 48 8d 3c f8 leaq (%rax,%rdi,8), %rdi | |
// 6b: 49 89 bc 24 e8 00 00 00 movq %rdi, 0xe8(%r12) | |
// 73: 4c 89 68 08 movq %r13, 0x8(%rax) | |
// 77: 48 89 70 10 movq %rsi, 0x10(%rax) | |
// 7b: 8b 3a movl (%rdx), %edi | |
// 7d: ff c7 incl %edi | |
// 7f: 74 02 je 0x83 <_JIT_ENTRY+0x83> | |
// 81: 89 3a movl %edi, (%rdx) | |
// 83: 48 89 10 movq %rdx, (%rax) | |
// 86: 0f 10 46 10 movups 0x10(%rsi), %xmm0 | |
// 8a: 0f 11 40 18 movups %xmm0, 0x18(%rax) | |
// 8e: 48 c7 40 28 00 00 00 00 movq $0x0, 0x28(%rax) | |
// 96: 48 63 72 48 movslq 0x48(%rdx), %rsi | |
// 9a: 48 81 c2 c8 00 00 00 addq $0xc8, %rdx | |
// a1: 48 8d 3c f0 leaq (%rax,%rsi,8), %rdi | |
// a5: 48 83 c7 50 addq $0x50, %rdi | |
// a9: 48 89 78 40 movq %rdi, 0x40(%rax) | |
// ad: 48 c7 40 30 00 00 00 00 movq $0x0, 0x30(%rax) | |
// b5: 48 89 50 38 movq %rdx, 0x38(%rax) | |
// b9: 66 c7 40 48 00 00 movw $0x0, 0x48(%rax) | |
// bf: c6 40 4a 00 movb $0x0, 0x4a(%rax) | |
// c3: 48 83 fe 02 cmpq $0x2, %rsi | |
// c7: 7c 58 jl 0x121 <_JIT_ENTRY+0x121> | |
// c9: 89 f2 movl %esi, %edx | |
// cb: be 01 00 00 00 movl $0x1, %esi | |
// d0: 83 fa 05 cmpl $0x5, %edx | |
// d3: 72 3b jb 0x110 <_JIT_ENTRY+0x110> | |
// d5: 48 8d 7a ff leaq -0x1(%rdx), %rdi | |
// d9: 48 89 fe movq %rdi, %rsi | |
// dc: 48 83 e6 fc andq $-0x4, %rsi | |
// e0: 45 31 c0 xorl %r8d, %r8d | |
// e3: 0f 57 c0 xorps %xmm0, %xmm0 | |
// e6: 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:(%rax,%rax) | |
// f0: 42 0f 11 44 c0 58 movups %xmm0, 0x58(%rax,%r8,8) | |
// f6: 42 0f 11 44 c0 68 movups %xmm0, 0x68(%rax,%r8,8) | |
// fc: 49 83 c0 04 addq $0x4, %r8 | |
// 100: 4c 39 c6 cmpq %r8, %rsi | |
// 103: 75 eb jne 0xf0 <_JIT_ENTRY+0xf0> | |
// 105: 48 39 f7 cmpq %rsi, %rdi | |
// 108: 74 17 je 0x121 <_JIT_ENTRY+0x121> | |
// 10a: 48 83 ce 01 orq $0x1, %rsi | |
// 10e: 66 90 nop | |
// 110: 48 c7 44 f0 50 00 00 00 00 movq $0x0, 0x50(%rax,%rsi,8) | |
// 119: 48 ff c6 incq %rsi | |
// 11c: 48 39 f2 cmpq %rsi, %rdx | |
// 11f: 75 ef jne 0x110 <_JIT_ENTRY+0x110> | |
// 121: 48 89 48 50 movq %rcx, 0x50(%rax) | |
// 125: 48 89 45 f8 movq %rax, -0x8(%rbp) | |
// 129: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x130 <_JIT_ENTRY+0x130> | |
// 000000000000012c: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 130: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x137 <_JIT_ENTRY+0x137> | |
// 0000000000000133: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 137: | |
const unsigned char code_body[311] = { | |
0x48, 0x8b, 0x35, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x56, 0x30, 0x8b, 0x42, 0x30, 0x83, 0xe0, | |
0x0d, 0x83, 0xf8, 0x01, 0x0f, 0x85, 0x16, 0x01, | |
0x00, 0x00, 0x83, 0x7a, 0x3c, 0x00, 0x0f, 0x85, | |
0x0c, 0x01, 0x00, 0x00, 0x83, 0x7a, 0x34, 0x01, | |
0x0f, 0x85, 0x02, 0x01, 0x00, 0x00, 0x49, 0x8b, | |
0x84, 0x24, 0xe8, 0x00, 0x00, 0x00, 0x48, 0x85, | |
0xc0, 0x0f, 0x84, 0xf1, 0x00, 0x00, 0x00, 0x48, | |
0x63, 0x7a, 0x4c, 0x49, 0x8b, 0x8c, 0x24, 0xf0, | |
0x00, 0x00, 0x00, 0x48, 0x29, 0xc1, 0x48, 0xc1, | |
0xf9, 0x03, 0x48, 0x39, 0xf9, 0x0f, 0x8e, 0xd5, | |
0x00, 0x00, 0x00, 0x48, 0x8b, 0x4d, 0xf8, 0x8b, | |
0x1e, 0xff, 0xc3, 0x74, 0x02, 0x89, 0x1e, 0x48, | |
0x8d, 0x3c, 0xf8, 0x49, 0x89, 0xbc, 0x24, 0xe8, | |
0x00, 0x00, 0x00, 0x4c, 0x89, 0x68, 0x08, 0x48, | |
0x89, 0x70, 0x10, 0x8b, 0x3a, 0xff, 0xc7, 0x74, | |
0x02, 0x89, 0x3a, 0x48, 0x89, 0x10, 0x0f, 0x10, | |
0x46, 0x10, 0x0f, 0x11, 0x40, 0x18, 0x48, 0xc7, | |
0x40, 0x28, 0x00, 0x00, 0x00, 0x00, 0x48, 0x63, | |
0x72, 0x48, 0x48, 0x81, 0xc2, 0xc8, 0x00, 0x00, | |
0x00, 0x48, 0x8d, 0x3c, 0xf0, 0x48, 0x83, 0xc7, | |
0x50, 0x48, 0x89, 0x78, 0x40, 0x48, 0xc7, 0x40, | |
0x30, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0x50, | |
0x38, 0x66, 0xc7, 0x40, 0x48, 0x00, 0x00, 0xc6, | |
0x40, 0x4a, 0x00, 0x48, 0x83, 0xfe, 0x02, 0x7c, | |
0x58, 0x89, 0xf2, 0xbe, 0x01, 0x00, 0x00, 0x00, | |
0x83, 0xfa, 0x05, 0x72, 0x3b, 0x48, 0x8d, 0x7a, | |
0xff, 0x48, 0x89, 0xfe, 0x48, 0x83, 0xe6, 0xfc, | |
0x45, 0x31, 0xc0, 0x0f, 0x57, 0xc0, 0x66, 0x2e, | |
0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x42, 0x0f, 0x11, 0x44, 0xc0, 0x58, 0x42, 0x0f, | |
0x11, 0x44, 0xc0, 0x68, 0x49, 0x83, 0xc0, 0x04, | |
0x4c, 0x39, 0xc6, 0x75, 0xeb, 0x48, 0x39, 0xf7, | |
0x74, 0x17, 0x48, 0x83, 0xce, 0x01, 0x66, 0x90, | |
0x48, 0xc7, 0x44, 0xf0, 0x50, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0xff, 0xc6, 0x48, 0x39, 0xf2, 0x75, | |
0xef, 0x48, 0x89, 0x48, 0x50, 0x48, 0x89, 0x45, | |
0xf8, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: CONTINUE | |
// 10: JUMP_TARGET | |
const unsigned char data_body[24] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x12c, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x133, (uintptr_t)data + 0xc); | |
} | |
void | |
emit__LOAD_ATTR_SLOT_0( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_ATTR_SLOT_0.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 4d f8 movq -0x8(%rbp), %rcx | |
// 8: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// f: 48 8b 34 01 movq (%rcx,%rax), %rsi | |
// 13: 48 85 f6 testq %rsi, %rsi | |
// 16: 74 26 je 0x3e <_JIT_ENTRY+0x3e> | |
// 18: 8b 06 movl (%rsi), %eax | |
// 1a: ff c0 incl %eax | |
// 1c: 74 02 je 0x20 <_JIT_ENTRY+0x20> | |
// 1e: 89 06 movl %eax, (%rsi) | |
// 20: 48 8b 01 movq (%rcx), %rax | |
// 23: 85 c0 testl %eax, %eax | |
// 25: 78 08 js 0x2f <_JIT_ENTRY+0x2f> | |
// 27: 48 ff c8 decq %rax | |
// 2a: 48 89 01 movq %rax, (%rcx) | |
// 2d: 74 1a je 0x49 <_JIT_ENTRY+0x49> | |
// 2f: 48 89 75 f8 movq %rsi, -0x8(%rbp) | |
// 33: 48 83 c4 28 addq $0x28, %rsp | |
// 37: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x3e <_JIT_ENTRY+0x3e> | |
// 000000000000003a: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 3e: 48 83 c4 28 addq $0x28, %rsp | |
// 42: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x49 <_JIT_ENTRY+0x49> | |
// 0000000000000045: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 49: ff 15 00 00 00 00 callq *(%rip) # 0x4f <_JIT_ENTRY+0x4f> | |
// 000000000000004b: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 4f: 48 89 75 f8 movq %rsi, -0x8(%rbp) | |
// 53: 48 83 c4 28 addq $0x28, %rsp | |
// 57: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x5e <_JIT_ENTRY+0x5e> | |
// 000000000000005a: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 57: | |
const unsigned char code_body[87] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x4d, 0xf8, | |
0x0f, 0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x34, 0x01, 0x48, 0x85, 0xf6, 0x74, 0x26, | |
0x8b, 0x06, 0xff, 0xc0, 0x74, 0x02, 0x89, 0x06, | |
0x48, 0x8b, 0x01, 0x85, 0xc0, 0x78, 0x08, 0x48, | |
0xff, 0xc8, 0x48, 0x89, 0x01, 0x74, 0x1a, 0x48, | |
0x89, 0x75, 0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x83, | |
0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x89, 0x75, 0xf8, 0x48, 0x83, 0xc4, 0x28, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: CONTINUE | |
// 10: JUMP_TARGET | |
// 18: &_Py_Dealloc+0x0 | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x18, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x3a, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x45, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x4b, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__LOAD_ATTR_SLOT_1( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_ATTR_SLOT_1.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 4d f8 movq -0x8(%rbp), %rcx | |
// 8: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// f: 48 8b 34 01 movq (%rcx,%rax), %rsi | |
// 13: 48 85 f6 testq %rsi, %rsi | |
// 16: 74 38 je 0x50 <_JIT_ENTRY+0x50> | |
// 18: 8b 06 movl (%rsi), %eax | |
// 1a: ff c0 incl %eax | |
// 1c: 74 02 je 0x20 <_JIT_ENTRY+0x20> | |
// 1e: 89 06 movl %eax, (%rsi) | |
// 20: 48 8b 01 movq (%rcx), %rax | |
// 23: 85 c0 testl %eax, %eax | |
// 25: 78 0e js 0x35 <_JIT_ENTRY+0x35> | |
// 27: 48 ff c8 decq %rax | |
// 2a: 48 89 01 movq %rax, (%rcx) | |
// 2d: 75 06 jne 0x35 <_JIT_ENTRY+0x35> | |
// 2f: ff 15 00 00 00 00 callq *(%rip) # 0x35 <_JIT_ENTRY+0x35> | |
// 0000000000000031: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 35: 48 89 75 f8 movq %rsi, -0x8(%rbp) | |
// 39: 48 c7 45 00 00 00 00 00 movq $0x0, (%rbp) | |
// 41: 48 83 c5 08 addq $0x8, %rbp | |
// 45: 48 83 c4 28 addq $0x28, %rsp | |
// 49: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x50 <_JIT_ENTRY+0x50> | |
// 000000000000004c: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 50: 48 83 c4 28 addq $0x28, %rsp | |
// 54: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x5b <_JIT_ENTRY+0x5b> | |
// 0000000000000057: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 5b: | |
const unsigned char code_body[91] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x4d, 0xf8, | |
0x0f, 0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x34, 0x01, 0x48, 0x85, 0xf6, 0x74, 0x38, | |
0x8b, 0x06, 0xff, 0xc0, 0x74, 0x02, 0x89, 0x06, | |
0x48, 0x8b, 0x01, 0x85, 0xc0, 0x78, 0x0e, 0x48, | |
0xff, 0xc8, 0x48, 0x89, 0x01, 0x75, 0x06, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0x75, | |
0xf8, 0x48, 0xc7, 0x45, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x83, 0xc5, 0x08, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: &_Py_Dealloc+0x0 | |
// 10: CONTINUE | |
// 18: JUMP_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x31, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x4c, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x57, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__LOAD_ATTR_WITH_HINT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_ATTR_WITH_HINT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 45 f8 movq -0x8(%rbp), %rax | |
// 8: 48 8b 48 e8 movq -0x18(%rax), %rcx | |
// c: 0f b7 15 00 00 00 00 movzwl (%rip), %edx # 0x13 <_JIT_ENTRY+0x13> | |
// 000000000000000f: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 13: 48 8b 79 20 movq 0x20(%rcx), %rdi | |
// 17: 48 39 57 18 cmpq %rdx, 0x18(%rdi) | |
// 1b: 76 3e jbe 0x5b <_JIT_ENTRY+0x5b> | |
// 1d: 80 7f 0a 00 cmpb $0x0, 0xa(%rdi) | |
// 21: 74 38 je 0x5b <_JIT_ENTRY+0x5b> | |
// 23: 0f b7 35 00 00 00 00 movzwl (%rip), %esi # 0x2a <_JIT_ENTRY+0x2a> | |
// 0000000000000026: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 2a: 49 8b 4d 00 movq (%r13), %rcx | |
// 2e: 4c 8b 49 20 movq 0x20(%rcx), %r9 | |
// 32: 0f b6 4f 09 movzbl 0x9(%rdi), %ecx | |
// 36: 41 b8 01 00 00 00 movl $0x1, %r8d | |
// 3c: 49 d3 e0 shlq %cl, %r8 | |
// 3f: 89 f1 movl %esi, %ecx | |
// 41: 83 e1 fe andl $-0x2, %ecx | |
// 44: 4e 8d 14 07 leaq (%rdi,%r8), %r10 | |
// 48: 41 89 d3 movl %edx, %r11d | |
// 4b: 41 c1 e3 04 shll $0x4, %r11d | |
// 4f: 4f 8b 54 13 20 movq 0x20(%r11,%r10), %r10 | |
// 54: 4d 3b 54 89 18 cmpq 0x18(%r9,%rcx,4), %r10 | |
// 59: 74 0b je 0x66 <_JIT_ENTRY+0x66> | |
// 5b: 48 83 c4 28 addq $0x28, %rsp | |
// 5f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x66 <_JIT_ENTRY+0x66> | |
// 0000000000000062: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 66: 4a 8d 0c 07 leaq (%rdi,%r8), %rcx | |
// 6a: 48 83 c1 20 addq $0x20, %rcx | |
// 6e: c1 e2 04 shll $0x4, %edx | |
// 71: 48 8b 7c 11 08 movq 0x8(%rcx,%rdx), %rdi | |
// 76: 48 85 ff testq %rdi, %rdi | |
// 79: 74 e0 je 0x5b <_JIT_ENTRY+0x5b> | |
// 7b: 8b 0f movl (%rdi), %ecx | |
// 7d: ff c1 incl %ecx | |
// 7f: 74 02 je 0x83 <_JIT_ENTRY+0x83> | |
// 81: 89 0f movl %ecx, (%rdi) | |
// 83: 48 8b 08 movq (%rax), %rcx | |
// 86: 85 c9 testl %ecx, %ecx | |
// 88: 78 11 js 0x9b <_JIT_ENTRY+0x9b> | |
// 8a: 48 ff c9 decq %rcx | |
// 8d: 48 89 08 movq %rcx, (%rax) | |
// 90: 75 09 jne 0x9b <_JIT_ENTRY+0x9b> | |
// 92: 48 89 c1 movq %rax, %rcx | |
// 95: ff 15 00 00 00 00 callq *(%rip) # 0x9b <_JIT_ENTRY+0x9b> | |
// 0000000000000097: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// 9b: 48 89 7d f8 movq %rdi, -0x8(%rbp) | |
// 9f: 83 e6 01 andl $0x1, %esi | |
// a2: 74 08 je 0xac <_JIT_ENTRY+0xac> | |
// a4: 48 c7 45 00 00 00 00 00 movq $0x0, (%rbp) | |
// ac: 89 f0 movl %esi, %eax | |
// ae: 48 8d 6c c5 00 leaq (%rbp,%rax,8), %rbp | |
// b3: 48 83 c4 28 addq $0x28, %rsp | |
// b7: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xbe <_JIT_ENTRY+0xbe> | |
// 00000000000000ba: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// b7: | |
const unsigned char code_body[183] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x45, 0xf8, | |
0x48, 0x8b, 0x48, 0xe8, 0x0f, 0xb7, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x8b, 0x79, 0x20, 0x48, | |
0x39, 0x57, 0x18, 0x76, 0x3e, 0x80, 0x7f, 0x0a, | |
0x00, 0x74, 0x38, 0x0f, 0xb7, 0x35, 0x00, 0x00, | |
0x00, 0x00, 0x49, 0x8b, 0x4d, 0x00, 0x4c, 0x8b, | |
0x49, 0x20, 0x0f, 0xb6, 0x4f, 0x09, 0x41, 0xb8, | |
0x01, 0x00, 0x00, 0x00, 0x49, 0xd3, 0xe0, 0x89, | |
0xf1, 0x83, 0xe1, 0xfe, 0x4e, 0x8d, 0x14, 0x07, | |
0x41, 0x89, 0xd3, 0x41, 0xc1, 0xe3, 0x04, 0x4f, | |
0x8b, 0x54, 0x13, 0x20, 0x4d, 0x3b, 0x54, 0x89, | |
0x18, 0x74, 0x0b, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x4a, 0x8d, | |
0x0c, 0x07, 0x48, 0x83, 0xc1, 0x20, 0xc1, 0xe2, | |
0x04, 0x48, 0x8b, 0x7c, 0x11, 0x08, 0x48, 0x85, | |
0xff, 0x74, 0xe0, 0x8b, 0x0f, 0xff, 0xc1, 0x74, | |
0x02, 0x89, 0x0f, 0x48, 0x8b, 0x08, 0x85, 0xc9, | |
0x78, 0x11, 0x48, 0xff, 0xc9, 0x48, 0x89, 0x08, | |
0x75, 0x09, 0x48, 0x89, 0xc1, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x89, 0x7d, 0xf8, 0x83, | |
0xe6, 0x01, 0x74, 0x08, 0x48, 0xc7, 0x45, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x89, 0xf0, 0x48, 0x8d, | |
0x6c, 0xc5, 0x00, 0x48, 0x83, 0xc4, 0x28, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: OPARG | |
// 10: JUMP_TARGET | |
// 18: &_Py_Dealloc+0x0 | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, instruction->oparg); | |
patch_64(data + 0x10, state->instruction_starts[instruction->jump_target]); | |
patch_64(data + 0x18, (uintptr_t)&_Py_Dealloc); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xf, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x26, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x62, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x97, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__LOAD_BUILD_CLASS( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_BUILD_CLASS.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 8: 49 8b 4d 20 movq 0x20(%r13), %rcx | |
// c: ba 60 8e 00 00 movl $0x8e60, %edx # imm = 0x8E60 | |
// 11: 48 03 15 00 00 00 00 addq (%rip), %rdx # 0x18 <_JIT_ENTRY+0x18> | |
// 0000000000000014: IMAGE_REL_AMD64_REL32 __imp__PyRuntime | |
// 18: 4c 8d 44 24 20 leaq 0x20(%rsp), %r8 | |
// 1d: ff 15 00 00 00 00 callq *(%rip) # 0x23 <_JIT_ENTRY+0x23> | |
// 000000000000001f: IMAGE_REL_AMD64_REL32 __imp_PyMapping_GetOptionalItem | |
// 23: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 27: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 2f: 85 c0 testl %eax, %eax | |
// 31: 78 1d js 0x50 <_JIT_ENTRY+0x50> | |
// 33: 48 8b 44 24 20 movq 0x20(%rsp), %rax | |
// 38: 48 85 c0 testq %rax, %rax | |
// 3b: 74 1e je 0x5b <_JIT_ENTRY+0x5b> | |
// 3d: 48 89 45 00 movq %rax, (%rbp) | |
// 41: 48 83 c5 08 addq $0x8, %rbp | |
// 45: 48 83 c4 28 addq $0x28, %rsp | |
// 49: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x50 <_JIT_ENTRY+0x50> | |
// 000000000000004c: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 50: 48 83 c4 28 addq $0x28, %rsp | |
// 54: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x5b <_JIT_ENTRY+0x5b> | |
// 0000000000000057: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 5b: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 5f: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x66 <_JIT_ENTRY+0x66> | |
// 0000000000000062: IMAGE_REL_AMD64_REL32 __imp_PyExc_NameError | |
// 66: 48 8b 10 movq (%rax), %rdx | |
// 69: 4c 8d 05 00 00 00 00 leaq (%rip), %r8 # 0x70 <_JIT_ENTRY+0x70> | |
// 000000000000006c: IMAGE_REL_AMD64_REL32 ??_C@_0BK@IAGNFEAN@__build_class__?5not?5found?$AA@ | |
// 70: 4c 89 e1 movq %r12, %rcx | |
// 73: ff 15 00 00 00 00 callq *(%rip) # 0x79 <_JIT_ENTRY+0x79> | |
// 0000000000000075: IMAGE_REL_AMD64_REL32 __imp__PyErr_SetString | |
// 79: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 7d: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 85: 48 83 c4 28 addq $0x28, %rsp | |
// 89: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x90 <_JIT_ENTRY+0x90> | |
// 000000000000008c: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 90: | |
const unsigned char code_body[144] = { | |
0x48, 0x83, 0xec, 0x28, 0x49, 0x89, 0x6d, 0x40, | |
0x49, 0x8b, 0x4d, 0x20, 0xba, 0x60, 0x8e, 0x00, | |
0x00, 0x48, 0x03, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x4c, 0x8d, 0x44, 0x24, 0x20, 0xff, 0x15, 0x00, | |
0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, | |
0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x85, | |
0xc0, 0x78, 0x1d, 0x48, 0x8b, 0x44, 0x24, 0x20, | |
0x48, 0x85, 0xc0, 0x74, 0x1e, 0x48, 0x89, 0x45, | |
0x00, 0x48, 0x83, 0xc5, 0x08, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x49, 0x89, 0x6d, 0x40, 0x48, | |
0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, | |
0x10, 0x4c, 0x8d, 0x05, 0x00, 0x00, 0x00, 0x00, | |
0x4c, 0x89, 0xe1, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, 0xc7, 0x45, | |
0x40, 0x00, 0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, | |
0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: '__build_class__ not found\x00' | |
// 1a: 00 00 00 00 00 00 | |
// 20: &_PyRuntime+0x0 | |
// 28: &PyMapping_GetOptionalItem+0x0 | |
// 30: CONTINUE | |
// 38: ERROR_TARGET | |
// 40: &PyExc_NameError+0x0 | |
// 48: &_PyErr_SetString+0x0 | |
const unsigned char data_body[80] = { | |
0x5f, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f, | |
0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x5f, 0x20, | |
0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, | |
0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x20, (uintptr_t)&_PyRuntime); | |
patch_64(data + 0x28, (uintptr_t)&PyMapping_GetOptionalItem); | |
patch_64(data + 0x30, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x38, state->instruction_starts[instruction->error_target]); | |
patch_64(data + 0x40, (uintptr_t)&PyExc_NameError); | |
patch_64(data + 0x48, (uintptr_t)&_PyErr_SetString); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x14, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0x1f, (uintptr_t)data + 0x24); | |
patch_x86_64_32rx(code + 0x4c, (uintptr_t)data + 0x2c); | |
patch_x86_64_32rx(code + 0x57, (uintptr_t)data + 0x34); | |
patch_x86_64_32rx(code + 0x62, (uintptr_t)data + 0x3c); | |
patch_x86_64_32rx(code + 0x6c, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x75, (uintptr_t)data + 0x44); | |
patch_x86_64_32rx(code + 0x8c, (uintptr_t)data + 0x34); | |
} | |
void | |
emit__LOAD_COMMON_CONSTANT( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_COMMON_CONSTANT.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 7: 66 85 c0 testw %ax, %ax | |
// a: 75 19 jne 0x25 <_JIT_ENTRY+0x25> | |
// c: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x13 <_JIT_ENTRY+0x13> | |
// 000000000000000f: IMAGE_REL_AMD64_REL32 __imp_PyExc_AssertionError | |
// 13: 48 8b 00 movq (%rax), %rax | |
// 16: 48 89 45 00 movq %rax, (%rbp) | |
// 1a: 48 83 c5 08 addq $0x8, %rbp | |
// 1e: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x25 <_JIT_ENTRY+0x25> | |
// 0000000000000021: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 25: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x2c <_JIT_ENTRY+0x2c> | |
// 0000000000000028: IMAGE_REL_AMD64_REL32 __imp_PyExc_NotImplementedError | |
// 2c: 48 8b 00 movq (%rax), %rax | |
// 2f: 48 89 45 00 movq %rax, (%rbp) | |
// 33: 48 83 c5 08 addq $0x8, %rbp | |
// 37: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x3e <_JIT_ENTRY+0x3e> | |
// 000000000000003a: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 37: | |
const unsigned char code_body[55] = { | |
0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x66, | |
0x85, 0xc0, 0x75, 0x19, 0x48, 0x8b, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x8b, 0x00, 0x48, 0x89, | |
0x45, 0x00, 0x48, 0x83, 0xc5, 0x08, 0x48, 0xff, | |
0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x05, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x8b, 0x00, 0x48, | |
0x89, 0x45, 0x00, 0x48, 0x83, 0xc5, 0x08, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &PyExc_AssertionError+0x0 | |
// 10: CONTINUE | |
// 18: &PyExc_NotImplementedError+0x0 | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&PyExc_AssertionError); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, (uintptr_t)&PyExc_NotImplementedError); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0xf, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x21, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x28, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__LOAD_CONST( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_CONST.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 49 8b 45 00 movq (%r13), %rax | |
// 4: 48 8b 40 18 movq 0x18(%rax), %rax | |
// 8: 0f b7 0d 00 00 00 00 movzwl (%rip), %ecx # 0xf <_JIT_ENTRY+0xf> | |
// 000000000000000b: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// f: 48 8b 44 c8 18 movq 0x18(%rax,%rcx,8), %rax | |
// 14: 8b 08 movl (%rax), %ecx | |
// 16: ff c1 incl %ecx | |
// 18: 74 02 je 0x1c <_JIT_ENTRY+0x1c> | |
// 1a: 89 08 movl %ecx, (%rax) | |
// 1c: 48 89 45 00 movq %rax, (%rbp) | |
// 20: 48 83 c5 08 addq $0x8, %rbp | |
// 24: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x2b <_JIT_ENTRY+0x2b> | |
// 0000000000000027: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 24: | |
const unsigned char code_body[36] = { | |
0x49, 0x8b, 0x45, 0x00, 0x48, 0x8b, 0x40, 0x18, | |
0x0f, 0xb7, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x44, 0xc8, 0x18, 0x8b, 0x08, 0xff, 0xc1, | |
0x74, 0x02, 0x89, 0x08, 0x48, 0x89, 0x45, 0x00, | |
0x48, 0x83, 0xc5, 0x08, | |
}; | |
// 0: | |
// 0: OPARG | |
const unsigned char data_body[8] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0xb, (uintptr_t)data + -0x4); | |
} | |
void | |
emit__LOAD_CONST_INLINE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_CONST_INLINE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 7: 8b 08 movl (%rax), %ecx | |
// 9: ff c1 incl %ecx | |
// b: 74 02 je 0xf <_JIT_ENTRY+0xf> | |
// d: 89 08 movl %ecx, (%rax) | |
// f: 48 89 45 00 movq %rax, (%rbp) | |
// 13: 48 83 c5 08 addq $0x8, %rbp | |
// 17: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1e <_JIT_ENTRY+0x1e> | |
// 000000000000001a: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 17: | |
const unsigned char code_body[23] = { | |
0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x8b, | |
0x08, 0xff, 0xc1, 0x74, 0x02, 0x89, 0x08, 0x48, | |
0x89, 0x45, 0x00, 0x48, 0x83, 0xc5, 0x08, | |
}; | |
// 0: | |
// 0: OPERAND | |
const unsigned char data_body[8] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
} | |
void | |
emit__LOAD_CONST_INLINE_BORROW( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_CONST_INLINE_BORROW.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 7: 48 89 45 00 movq %rax, (%rbp) | |
// b: 48 83 c5 08 addq $0x8, %rbp | |
// f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x16 <_JIT_ENTRY+0x16> | |
// 0000000000000012: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// f: | |
const unsigned char code_body[15] = { | |
0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x89, 0x45, 0x00, 0x48, 0x83, 0xc5, 0x08, | |
}; | |
// 0: | |
// 0: OPERAND | |
const unsigned char data_body[8] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
} | |
void | |
emit__LOAD_CONST_INLINE_BORROW_WITH_NULL( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_CONST_INLINE_BORROW_WITH_NULL.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 7: 48 89 45 00 movq %rax, (%rbp) | |
// b: 48 c7 45 08 00 00 00 00 movq $0x0, 0x8(%rbp) | |
// 13: 48 83 c5 10 addq $0x10, %rbp | |
// 17: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1e <_JIT_ENTRY+0x1e> | |
// 000000000000001a: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 17: | |
const unsigned char code_body[23] = { | |
0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x89, 0x45, 0x00, 0x48, 0xc7, 0x45, 0x08, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x83, 0xc5, 0x10, | |
}; | |
// 0: | |
// 0: OPERAND | |
const unsigned char data_body[8] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
} | |
void | |
emit__LOAD_CONST_INLINE_WITH_NULL( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_CONST_INLINE_WITH_NULL.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 7: 8b 08 movl (%rax), %ecx | |
// 9: ff c1 incl %ecx | |
// b: 74 02 je 0xf <_JIT_ENTRY+0xf> | |
// d: 89 08 movl %ecx, (%rax) | |
// f: 48 89 45 00 movq %rax, (%rbp) | |
// 13: 48 c7 45 08 00 00 00 00 movq $0x0, 0x8(%rbp) | |
// 1b: 48 83 c5 10 addq $0x10, %rbp | |
// 1f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x26 <_JIT_ENTRY+0x26> | |
// 0000000000000022: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 1f: | |
const unsigned char code_body[31] = { | |
0x48, 0x8b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x8b, | |
0x08, 0xff, 0xc1, 0x74, 0x02, 0x89, 0x08, 0x48, | |
0x89, 0x45, 0x00, 0x48, 0xc7, 0x45, 0x08, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x83, 0xc5, 0x10, | |
}; | |
// 0: | |
// 0: OPERAND | |
const unsigned char data_body[8] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
} | |
void | |
emit__LOAD_DEREF( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_DEREF.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: 49 8b 44 c5 50 movq 0x50(%r13,%rax,8), %rax | |
// 10: 48 8b 40 10 movq 0x10(%rax), %rax | |
// 14: 48 85 c0 testq %rax, %rax | |
// 17: 74 1b je 0x34 <_JIT_ENTRY+0x34> | |
// 19: 8b 08 movl (%rax), %ecx | |
// 1b: ff c1 incl %ecx | |
// 1d: 74 02 je 0x21 <_JIT_ENTRY+0x21> | |
// 1f: 89 08 movl %ecx, (%rax) | |
// 21: 48 89 45 00 movq %rax, (%rbp) | |
// 25: 48 83 c5 08 addq $0x8, %rbp | |
// 29: 48 83 c4 28 addq $0x28, %rsp | |
// 2d: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x34 <_JIT_ENTRY+0x34> | |
// 0000000000000030: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 34: 44 0f b7 05 00 00 00 00 movzwl (%rip), %r8d # 0x3c <_JIT_ENTRY+0x3c> | |
// 0000000000000038: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 3c: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 40: 49 8b 55 00 movq (%r13), %rdx | |
// 44: 4c 89 e1 movq %r12, %rcx | |
// 47: ff 15 00 00 00 00 callq *(%rip) # 0x4d <_JIT_ENTRY+0x4d> | |
// 0000000000000049: IMAGE_REL_AMD64_REL32 __imp__PyEval_FormatExcUnbound | |
// 4d: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 51: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 59: 48 83 c4 28 addq $0x28, %rsp | |
// 5d: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x64 <_JIT_ENTRY+0x64> | |
// 0000000000000060: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 64: | |
const unsigned char code_body[100] = { | |
0x48, 0x83, 0xec, 0x28, 0x0f, 0xb7, 0x05, 0x00, | |
0x00, 0x00, 0x00, 0x49, 0x8b, 0x44, 0xc5, 0x50, | |
0x48, 0x8b, 0x40, 0x10, 0x48, 0x85, 0xc0, 0x74, | |
0x1b, 0x8b, 0x08, 0xff, 0xc1, 0x74, 0x02, 0x89, | |
0x08, 0x48, 0x89, 0x45, 0x00, 0x48, 0x83, 0xc5, | |
0x08, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x44, 0x0f, 0xb7, 0x05, | |
0x00, 0x00, 0x00, 0x00, 0x49, 0x89, 0x6d, 0x40, | |
0x49, 0x8b, 0x55, 0x00, 0x4c, 0x89, 0xe1, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, | |
0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: CONTINUE | |
// 10: &_PyEval_FormatExcUnbound+0x0 | |
// 18: ERROR_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x10, (uintptr_t)&_PyEval_FormatExcUnbound); | |
patch_64(data + 0x18, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x30, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x38, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x49, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x60, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__LOAD_FAST( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_FAST.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 7: 49 8b 44 c5 50 movq 0x50(%r13,%rax,8), %rax | |
// c: 8b 08 movl (%rax), %ecx | |
// e: ff c1 incl %ecx | |
// 10: 74 02 je 0x14 <_JIT_ENTRY+0x14> | |
// 12: 89 08 movl %ecx, (%rax) | |
// 14: 48 89 45 00 movq %rax, (%rbp) | |
// 18: 48 83 c5 08 addq $0x8, %rbp | |
// 1c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x23 <_JIT_ENTRY+0x23> | |
// 000000000000001f: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 1c: | |
const unsigned char code_body[28] = { | |
0x0f, 0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0x49, | |
0x8b, 0x44, 0xc5, 0x50, 0x8b, 0x08, 0xff, 0xc1, | |
0x74, 0x02, 0x89, 0x08, 0x48, 0x89, 0x45, 0x00, | |
0x48, 0x83, 0xc5, 0x08, | |
}; | |
// 0: | |
// 0: OPARG | |
const unsigned char data_body[8] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
} | |
void | |
emit__LOAD_FAST_0( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_FAST_0.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 49 8b 45 50 movq 0x50(%r13), %rax | |
// 4: 8b 08 movl (%rax), %ecx | |
// 6: ff c1 incl %ecx | |
// 8: 74 02 je 0xc <_JIT_ENTRY+0xc> | |
// a: 89 08 movl %ecx, (%rax) | |
// c: 48 89 45 00 movq %rax, (%rbp) | |
// 10: 48 83 c5 08 addq $0x8, %rbp | |
// 14: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1b <_JIT_ENTRY+0x1b> | |
// 0000000000000017: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 14: | |
const unsigned char code_body[20] = { | |
0x49, 0x8b, 0x45, 0x50, 0x8b, 0x08, 0xff, 0xc1, | |
0x74, 0x02, 0x89, 0x08, 0x48, 0x89, 0x45, 0x00, | |
0x48, 0x83, 0xc5, 0x08, | |
}; | |
// 0: | |
memcpy(code, code_body, sizeof(code_body)); | |
} | |
void | |
emit__LOAD_FAST_1( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_FAST_1.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 49 8b 45 58 movq 0x58(%r13), %rax | |
// 4: 8b 08 movl (%rax), %ecx | |
// 6: ff c1 incl %ecx | |
// 8: 74 02 je 0xc <_JIT_ENTRY+0xc> | |
// a: 89 08 movl %ecx, (%rax) | |
// c: 48 89 45 00 movq %rax, (%rbp) | |
// 10: 48 83 c5 08 addq $0x8, %rbp | |
// 14: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1b <_JIT_ENTRY+0x1b> | |
// 0000000000000017: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 14: | |
const unsigned char code_body[20] = { | |
0x49, 0x8b, 0x45, 0x58, 0x8b, 0x08, 0xff, 0xc1, | |
0x74, 0x02, 0x89, 0x08, 0x48, 0x89, 0x45, 0x00, | |
0x48, 0x83, 0xc5, 0x08, | |
}; | |
// 0: | |
memcpy(code, code_body, sizeof(code_body)); | |
} | |
void | |
emit__LOAD_FAST_2( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_FAST_2.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 49 8b 45 60 movq 0x60(%r13), %rax | |
// 4: 8b 08 movl (%rax), %ecx | |
// 6: ff c1 incl %ecx | |
// 8: 74 02 je 0xc <_JIT_ENTRY+0xc> | |
// a: 89 08 movl %ecx, (%rax) | |
// c: 48 89 45 00 movq %rax, (%rbp) | |
// 10: 48 83 c5 08 addq $0x8, %rbp | |
// 14: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1b <_JIT_ENTRY+0x1b> | |
// 0000000000000017: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 14: | |
const unsigned char code_body[20] = { | |
0x49, 0x8b, 0x45, 0x60, 0x8b, 0x08, 0xff, 0xc1, | |
0x74, 0x02, 0x89, 0x08, 0x48, 0x89, 0x45, 0x00, | |
0x48, 0x83, 0xc5, 0x08, | |
}; | |
// 0: | |
memcpy(code, code_body, sizeof(code_body)); | |
} | |
void | |
emit__LOAD_FAST_3( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_FAST_3.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 49 8b 45 68 movq 0x68(%r13), %rax | |
// 4: 8b 08 movl (%rax), %ecx | |
// 6: ff c1 incl %ecx | |
// 8: 74 02 je 0xc <_JIT_ENTRY+0xc> | |
// a: 89 08 movl %ecx, (%rax) | |
// c: 48 89 45 00 movq %rax, (%rbp) | |
// 10: 48 83 c5 08 addq $0x8, %rbp | |
// 14: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1b <_JIT_ENTRY+0x1b> | |
// 0000000000000017: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 14: | |
const unsigned char code_body[20] = { | |
0x49, 0x8b, 0x45, 0x68, 0x8b, 0x08, 0xff, 0xc1, | |
0x74, 0x02, 0x89, 0x08, 0x48, 0x89, 0x45, 0x00, | |
0x48, 0x83, 0xc5, 0x08, | |
}; | |
// 0: | |
memcpy(code, code_body, sizeof(code_body)); | |
} | |
void | |
emit__LOAD_FAST_4( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_FAST_4.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 49 8b 45 70 movq 0x70(%r13), %rax | |
// 4: 8b 08 movl (%rax), %ecx | |
// 6: ff c1 incl %ecx | |
// 8: 74 02 je 0xc <_JIT_ENTRY+0xc> | |
// a: 89 08 movl %ecx, (%rax) | |
// c: 48 89 45 00 movq %rax, (%rbp) | |
// 10: 48 83 c5 08 addq $0x8, %rbp | |
// 14: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1b <_JIT_ENTRY+0x1b> | |
// 0000000000000017: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 14: | |
const unsigned char code_body[20] = { | |
0x49, 0x8b, 0x45, 0x70, 0x8b, 0x08, 0xff, 0xc1, | |
0x74, 0x02, 0x89, 0x08, 0x48, 0x89, 0x45, 0x00, | |
0x48, 0x83, 0xc5, 0x08, | |
}; | |
// 0: | |
memcpy(code, code_body, sizeof(code_body)); | |
} | |
void | |
emit__LOAD_FAST_5( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_FAST_5.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 49 8b 45 78 movq 0x78(%r13), %rax | |
// 4: 8b 08 movl (%rax), %ecx | |
// 6: ff c1 incl %ecx | |
// 8: 74 02 je 0xc <_JIT_ENTRY+0xc> | |
// a: 89 08 movl %ecx, (%rax) | |
// c: 48 89 45 00 movq %rax, (%rbp) | |
// 10: 48 83 c5 08 addq $0x8, %rbp | |
// 14: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1b <_JIT_ENTRY+0x1b> | |
// 0000000000000017: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 14: | |
const unsigned char code_body[20] = { | |
0x49, 0x8b, 0x45, 0x78, 0x8b, 0x08, 0xff, 0xc1, | |
0x74, 0x02, 0x89, 0x08, 0x48, 0x89, 0x45, 0x00, | |
0x48, 0x83, 0xc5, 0x08, | |
}; | |
// 0: | |
memcpy(code, code_body, sizeof(code_body)); | |
} | |
void | |
emit__LOAD_FAST_6( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_FAST_6.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 49 8b 85 80 00 00 00 movq 0x80(%r13), %rax | |
// 7: 8b 08 movl (%rax), %ecx | |
// 9: ff c1 incl %ecx | |
// b: 74 02 je 0xf <_JIT_ENTRY+0xf> | |
// d: 89 08 movl %ecx, (%rax) | |
// f: 48 89 45 00 movq %rax, (%rbp) | |
// 13: 48 83 c5 08 addq $0x8, %rbp | |
// 17: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1e <_JIT_ENTRY+0x1e> | |
// 000000000000001a: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 17: | |
const unsigned char code_body[23] = { | |
0x49, 0x8b, 0x85, 0x80, 0x00, 0x00, 0x00, 0x8b, | |
0x08, 0xff, 0xc1, 0x74, 0x02, 0x89, 0x08, 0x48, | |
0x89, 0x45, 0x00, 0x48, 0x83, 0xc5, 0x08, | |
}; | |
// 0: | |
memcpy(code, code_body, sizeof(code_body)); | |
} | |
void | |
emit__LOAD_FAST_7( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_FAST_7.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 49 8b 85 88 00 00 00 movq 0x88(%r13), %rax | |
// 7: 8b 08 movl (%rax), %ecx | |
// 9: ff c1 incl %ecx | |
// b: 74 02 je 0xf <_JIT_ENTRY+0xf> | |
// d: 89 08 movl %ecx, (%rax) | |
// f: 48 89 45 00 movq %rax, (%rbp) | |
// 13: 48 83 c5 08 addq $0x8, %rbp | |
// 17: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x1e <_JIT_ENTRY+0x1e> | |
// 000000000000001a: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 17: | |
const unsigned char code_body[23] = { | |
0x49, 0x8b, 0x85, 0x88, 0x00, 0x00, 0x00, 0x8b, | |
0x08, 0xff, 0xc1, 0x74, 0x02, 0x89, 0x08, 0x48, | |
0x89, 0x45, 0x00, 0x48, 0x83, 0xc5, 0x08, | |
}; | |
// 0: | |
memcpy(code, code_body, sizeof(code_body)); | |
} | |
void | |
emit__LOAD_FAST_AND_CLEAR( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_FAST_AND_CLEAR.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0x7 <_JIT_ENTRY+0x7> | |
// 0000000000000003: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 7: 49 8b 4c c5 50 movq 0x50(%r13,%rax,8), %rcx | |
// c: 49 c7 44 c5 50 00 00 00 00 movq $0x0, 0x50(%r13,%rax,8) | |
// 15: 48 89 4d 00 movq %rcx, (%rbp) | |
// 19: 48 83 c5 08 addq $0x8, %rbp | |
// 1d: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x24 <_JIT_ENTRY+0x24> | |
// 0000000000000020: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 1d: | |
const unsigned char code_body[29] = { | |
0x0f, 0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0x49, | |
0x8b, 0x4c, 0xc5, 0x50, 0x49, 0xc7, 0x44, 0xc5, | |
0x50, 0x00, 0x00, 0x00, 0x00, 0x48, 0x89, 0x4d, | |
0x00, 0x48, 0x83, 0xc5, 0x08, | |
}; | |
// 0: | |
// 0: OPARG | |
const unsigned char data_body[8] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x3, (uintptr_t)data + -0x4); | |
} | |
void | |
emit__LOAD_FAST_CHECK( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_FAST_CHECK.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 0d 00 00 00 00 movq (%rip), %rcx # 0xb <_JIT_ENTRY+0xb> | |
// 0000000000000007: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// b: 0f b7 c1 movzwl %cx, %eax | |
// e: 49 8b 44 c5 50 movq 0x50(%r13,%rax,8), %rax | |
// 13: 48 85 c0 testq %rax, %rax | |
// 16: 74 1b je 0x33 <_JIT_ENTRY+0x33> | |
// 18: 8b 08 movl (%rax), %ecx | |
// 1a: ff c1 incl %ecx | |
// 1c: 74 02 je 0x20 <_JIT_ENTRY+0x20> | |
// 1e: 89 08 movl %ecx, (%rax) | |
// 20: 48 89 45 00 movq %rax, (%rbp) | |
// 24: 48 83 c5 08 addq $0x8, %rbp | |
// 28: 48 83 c4 28 addq $0x28, %rsp | |
// 2c: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x33 <_JIT_ENTRY+0x33> | |
// 000000000000002f: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 33: 0f b7 d1 movzwl %cx, %edx | |
// 36: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 3a: 49 8b 45 00 movq (%r13), %rax | |
// 3e: 48 8b 48 60 movq 0x60(%rax), %rcx | |
// 42: ff 15 00 00 00 00 callq *(%rip) # 0x48 <_JIT_ENTRY+0x48> | |
// 0000000000000044: IMAGE_REL_AMD64_REL32 __imp_PyTuple_GetItem | |
// 48: 48 8b 0d 00 00 00 00 movq (%rip), %rcx # 0x4f <_JIT_ENTRY+0x4f> | |
// 000000000000004b: IMAGE_REL_AMD64_REL32 __imp_PyExc_UnboundLocalError | |
// 4f: 48 8b 11 movq (%rcx), %rdx | |
// 52: 4c 8d 05 00 00 00 00 leaq (%rip), %r8 # 0x59 <_JIT_ENTRY+0x59> | |
// 0000000000000055: IMAGE_REL_AMD64_REL32 ??_C@_0EK@CHGBBAMA@cannot?5access?5local?5variable?5?8?$CFs@ | |
// 59: 4c 89 e1 movq %r12, %rcx | |
// 5c: 49 89 c1 movq %rax, %r9 | |
// 5f: ff 15 00 00 00 00 callq *(%rip) # 0x65 <_JIT_ENTRY+0x65> | |
// 0000000000000061: IMAGE_REL_AMD64_REL32 __imp__PyEval_FormatExcCheckArg | |
// 65: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 69: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 71: 48 83 c4 28 addq $0x28, %rsp | |
// 75: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x7c <_JIT_ENTRY+0x7c> | |
// 0000000000000078: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 7c: | |
const unsigned char code_body[124] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x0d, 0x00, | |
0x00, 0x00, 0x00, 0x0f, 0xb7, 0xc1, 0x49, 0x8b, | |
0x44, 0xc5, 0x50, 0x48, 0x85, 0xc0, 0x74, 0x1b, | |
0x8b, 0x08, 0xff, 0xc1, 0x74, 0x02, 0x89, 0x08, | |
0x48, 0x89, 0x45, 0x00, 0x48, 0x83, 0xc5, 0x08, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x0f, 0xb7, 0xd1, 0x49, 0x89, | |
0x6d, 0x40, 0x49, 0x8b, 0x45, 0x00, 0x48, 0x8b, | |
0x48, 0x60, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x48, 0x8b, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x48, | |
0x8b, 0x11, 0x4c, 0x8d, 0x05, 0x00, 0x00, 0x00, | |
0x00, 0x4c, 0x89, 0xe1, 0x49, 0x89, 0xc1, 0xff, | |
0x15, 0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x6d, | |
0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: "cannot access local variable '%s' where it is not associated with a value\x00" | |
// 4a: 00 00 00 00 00 00 | |
// 50: OPARG | |
// 58: CONTINUE | |
// 60: &PyTuple_GetItem+0x0 | |
// 68: &PyExc_UnboundLocalError+0x0 | |
// 70: &_PyEval_FormatExcCheckArg+0x0 | |
// 78: ERROR_TARGET | |
const unsigned char data_body[128] = { | |
0x63, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x20, 0x61, | |
0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x6c, 0x6f, | |
0x63, 0x61, 0x6c, 0x20, 0x76, 0x61, 0x72, 0x69, | |
0x61, 0x62, 0x6c, 0x65, 0x20, 0x27, 0x25, 0x73, | |
0x27, 0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x20, | |
0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, | |
0x74, 0x20, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, | |
0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, | |
0x68, 0x20, 0x61, 0x20, 0x76, 0x61, 0x6c, 0x75, | |
0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x50, instruction->oparg); | |
patch_64(data + 0x58, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x60, (uintptr_t)&PyTuple_GetItem); | |
patch_64(data + 0x68, (uintptr_t)&PyExc_UnboundLocalError); | |
patch_64(data + 0x70, (uintptr_t)&_PyEval_FormatExcCheckArg); | |
patch_64(data + 0x78, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x7, (uintptr_t)data + 0x4c); | |
patch_x86_64_32rx(code + 0x2f, (uintptr_t)data + 0x54); | |
patch_x86_64_32rx(code + 0x44, (uintptr_t)data + 0x5c); | |
patch_x86_64_32rx(code + 0x4b, (uintptr_t)data + 0x64); | |
patch_x86_64_32rx(code + 0x55, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x61, (uintptr_t)data + 0x6c); | |
patch_x86_64_32rx(code + 0x78, (uintptr_t)data + 0x74); | |
} | |
void | |
emit__LOAD_FROM_DICT_OR_DEREF( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_FROM_DICT_OR_DEREF.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 8b 75 f8 movq -0x8(%rbp), %rsi | |
// 8: 49 8b 45 00 movq (%r13), %rax | |
// c: 48 8b 40 60 movq 0x60(%rax), %rax | |
// 10: 48 8b 3d 00 00 00 00 movq (%rip), %rdi # 0x17 <_JIT_ENTRY+0x17> | |
// 0000000000000013: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 17: 0f b7 cf movzwl %di, %ecx | |
// 1a: 48 8b 54 c8 18 movq 0x18(%rax,%rcx,8), %rdx | |
// 1f: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 23: 4c 8d 44 24 20 leaq 0x20(%rsp), %r8 | |
// 28: 48 89 f1 movq %rsi, %rcx | |
// 2b: ff 15 00 00 00 00 callq *(%rip) # 0x31 <_JIT_ENTRY+0x31> | |
// 000000000000002d: IMAGE_REL_AMD64_REL32 __imp_PyMapping_GetOptionalItem | |
// 31: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 35: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 3d: 85 c0 testl %eax, %eax | |
// 3f: 78 20 js 0x61 <_JIT_ENTRY+0x61> | |
// 41: 48 8b 44 24 20 movq 0x20(%rsp), %rax | |
// 46: 48 85 c0 testq %rax, %rax | |
// 49: 74 21 je 0x6c <_JIT_ENTRY+0x6c> | |
// 4b: 48 8b 0e movq (%rsi), %rcx | |
// 4e: 85 c9 testl %ecx, %ecx | |
// 50: 79 3f jns 0x91 <_JIT_ENTRY+0x91> | |
// 52: 48 89 45 f8 movq %rax, -0x8(%rbp) | |
// 56: 48 83 c4 28 addq $0x28, %rsp | |
// 5a: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x61 <_JIT_ENTRY+0x61> | |
// 000000000000005d: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 61: 48 83 c4 28 addq $0x28, %rsp | |
// 65: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x6c <_JIT_ENTRY+0x6c> | |
// 0000000000000068: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 6c: 0f b7 c7 movzwl %di, %eax | |
// 6f: 49 8b 44 c5 50 movq 0x50(%r13,%rax,8), %rax | |
// 74: 48 8b 40 10 movq 0x10(%rax), %rax | |
// 78: 48 85 c0 testq %rax, %rax | |
// 7b: 74 39 je 0xb6 <_JIT_ENTRY+0xb6> | |
// 7d: 8b 08 movl (%rax), %ecx | |
// 7f: ff c1 incl %ecx | |
// 81: 74 02 je 0x85 <_JIT_ENTRY+0x85> | |
// 83: 89 08 movl %ecx, (%rax) | |
// 85: 48 89 44 24 20 movq %rax, 0x20(%rsp) | |
// 8a: 48 8b 0e movq (%rsi), %rcx | |
// 8d: 85 c9 testl %ecx, %ecx | |
// 8f: 78 c1 js 0x52 <_JIT_ENTRY+0x52> | |
// 91: 48 ff c9 decq %rcx | |
// 94: 48 89 0e movq %rcx, (%rsi) | |
// 97: 75 b9 jne 0x52 <_JIT_ENTRY+0x52> | |
// 99: 48 89 f1 movq %rsi, %rcx | |
// 9c: ff 15 00 00 00 00 callq *(%rip) # 0xa2 <_JIT_ENTRY+0xa2> | |
// 000000000000009e: IMAGE_REL_AMD64_REL32 __imp__Py_Dealloc | |
// a2: 48 8b 44 24 20 movq 0x20(%rsp), %rax | |
// a7: 48 89 45 f8 movq %rax, -0x8(%rbp) | |
// ab: 48 83 c4 28 addq $0x28, %rsp | |
// af: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xb6 <_JIT_ENTRY+0xb6> | |
// 00000000000000b2: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// b6: 48 c7 44 24 20 00 00 00 00 movq $0x0, 0x20(%rsp) | |
// bf: 44 0f b7 05 00 00 00 00 movzwl (%rip), %r8d # 0xc7 <_JIT_ENTRY+0xc7> | |
// 00000000000000c3: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// c7: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// cb: 49 8b 55 00 movq (%r13), %rdx | |
// cf: 4c 89 e1 movq %r12, %rcx | |
// d2: ff 15 00 00 00 00 callq *(%rip) # 0xd8 <_JIT_ENTRY+0xd8> | |
// 00000000000000d4: IMAGE_REL_AMD64_REL32 __imp__PyEval_FormatExcUnbound | |
// d8: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// dc: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// e4: 48 83 c4 28 addq $0x28, %rsp | |
// e8: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0xef <_JIT_ENTRY+0xef> | |
// 00000000000000eb: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// ef: | |
const unsigned char code_body[239] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x8b, 0x75, 0xf8, | |
0x49, 0x8b, 0x45, 0x00, 0x48, 0x8b, 0x40, 0x60, | |
0x48, 0x8b, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x0f, | |
0xb7, 0xcf, 0x48, 0x8b, 0x54, 0xc8, 0x18, 0x49, | |
0x89, 0x6d, 0x40, 0x4c, 0x8d, 0x44, 0x24, 0x20, | |
0x48, 0x89, 0xf1, 0xff, 0x15, 0x00, 0x00, 0x00, | |
0x00, 0x49, 0x8b, 0x6d, 0x40, 0x49, 0xc7, 0x45, | |
0x40, 0x00, 0x00, 0x00, 0x00, 0x85, 0xc0, 0x78, | |
0x20, 0x48, 0x8b, 0x44, 0x24, 0x20, 0x48, 0x85, | |
0xc0, 0x74, 0x21, 0x48, 0x8b, 0x0e, 0x85, 0xc9, | |
0x79, 0x3f, 0x48, 0x89, 0x45, 0xf8, 0x48, 0x83, | |
0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x0f, 0xb7, 0xc7, 0x49, | |
0x8b, 0x44, 0xc5, 0x50, 0x48, 0x8b, 0x40, 0x10, | |
0x48, 0x85, 0xc0, 0x74, 0x39, 0x8b, 0x08, 0xff, | |
0xc1, 0x74, 0x02, 0x89, 0x08, 0x48, 0x89, 0x44, | |
0x24, 0x20, 0x48, 0x8b, 0x0e, 0x85, 0xc9, 0x78, | |
0xc1, 0x48, 0xff, 0xc9, 0x48, 0x89, 0x0e, 0x75, | |
0xb9, 0x48, 0x89, 0xf1, 0xff, 0x15, 0x00, 0x00, | |
0x00, 0x00, 0x48, 0x8b, 0x44, 0x24, 0x20, 0x48, | |
0x89, 0x45, 0xf8, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x48, 0xc7, | |
0x44, 0x24, 0x20, 0x00, 0x00, 0x00, 0x00, 0x44, | |
0x0f, 0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0x49, | |
0x89, 0x6d, 0x40, 0x49, 0x8b, 0x55, 0x00, 0x4c, | |
0x89, 0xe1, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, | |
0x49, 0x8b, 0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, 0x28, | |
0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &PyMapping_GetOptionalItem+0x0 | |
// 10: CONTINUE | |
// 18: ERROR_TARGET | |
// 20: &_Py_Dealloc+0x0 | |
// 28: &_PyEval_FormatExcUnbound+0x0 | |
const unsigned char data_body[48] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&PyMapping_GetOptionalItem); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, state->instruction_starts[instruction->error_target]); | |
patch_64(data + 0x20, (uintptr_t)&_Py_Dealloc); | |
patch_64(data + 0x28, (uintptr_t)&_PyEval_FormatExcUnbound); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x13, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x2d, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x5d, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x68, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x9e, (uintptr_t)data + 0x1c); | |
patch_x86_64_32rx(code + 0xb2, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0xc3, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0xd4, (uintptr_t)data + 0x24); | |
patch_x86_64_32rx(code + 0xeb, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__LOAD_GLOBAL( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_GLOBAL.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 48 89 ee movq %rbp, %rsi | |
// 7: 8b 3d 00 00 00 00 movl (%rip), %edi # 0xd <_JIT_ENTRY+0xd> | |
// 0000000000000009: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// d: 49 8b 45 00 movq (%r13), %rax | |
// 11: 49 8b 4d 18 movq 0x18(%r13), %rcx | |
// 15: 48 8b 40 20 movq 0x20(%rax), %rax | |
// 19: 89 fa movl %edi, %edx | |
// 1b: 81 e2 fe ff 00 00 andl $0xfffe, %edx # imm = 0xFFFE | |
// 21: 4c 8b 44 90 18 movq 0x18(%rax,%rdx,4), %r8 | |
// 26: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 2a: 49 8b 55 20 movq 0x20(%r13), %rdx | |
// 2e: 49 89 e9 movq %rbp, %r9 | |
// 31: ff 15 00 00 00 00 callq *(%rip) # 0x37 <_JIT_ENTRY+0x37> | |
// 0000000000000033: IMAGE_REL_AMD64_REL32 __imp__PyEval_LoadGlobalStackRef | |
// 37: 49 8b 6d 40 movq 0x40(%r13), %rbp | |
// 3b: 49 c7 45 40 00 00 00 00 movq $0x0, 0x40(%r13) | |
// 43: 48 83 3e 00 cmpq $0x0, (%rsi) | |
// 47: 74 22 je 0x6b <_JIT_ENTRY+0x6b> | |
// 49: 0f b7 c7 movzwl %di, %eax | |
// 4c: 83 e0 01 andl $0x1, %eax | |
// 4f: 74 08 je 0x59 <_JIT_ENTRY+0x59> | |
// 51: 48 c7 45 08 00 00 00 00 movq $0x0, 0x8(%rbp) | |
// 59: 89 c0 movl %eax, %eax | |
// 5b: 48 8d 6c c5 08 leaq 0x8(%rbp,%rax,8), %rbp | |
// 60: 48 83 c4 28 addq $0x28, %rsp | |
// 64: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x6b <_JIT_ENTRY+0x6b> | |
// 0000000000000067: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 6b: 48 83 c4 28 addq $0x28, %rsp | |
// 6f: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x76 <_JIT_ENTRY+0x76> | |
// 0000000000000072: IMAGE_REL_AMD64_REL32 __imp__JIT_ERROR_TARGET | |
// 76: | |
const unsigned char code_body[118] = { | |
0x48, 0x83, 0xec, 0x28, 0x48, 0x89, 0xee, 0x8b, | |
0x3d, 0x00, 0x00, 0x00, 0x00, 0x49, 0x8b, 0x45, | |
0x00, 0x49, 0x8b, 0x4d, 0x18, 0x48, 0x8b, 0x40, | |
0x20, 0x89, 0xfa, 0x81, 0xe2, 0xfe, 0xff, 0x00, | |
0x00, 0x4c, 0x8b, 0x44, 0x90, 0x18, 0x49, 0x89, | |
0x6d, 0x40, 0x49, 0x8b, 0x55, 0x20, 0x49, 0x89, | |
0xe9, 0xff, 0x15, 0x00, 0x00, 0x00, 0x00, 0x49, | |
0x8b, 0x6d, 0x40, 0x49, 0xc7, 0x45, 0x40, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x83, 0x3e, 0x00, 0x74, | |
0x22, 0x0f, 0xb7, 0xc7, 0x83, 0xe0, 0x01, 0x74, | |
0x08, 0x48, 0xc7, 0x45, 0x08, 0x00, 0x00, 0x00, | |
0x00, 0x89, 0xc0, 0x48, 0x8d, 0x6c, 0xc5, 0x08, | |
0x48, 0x83, 0xc4, 0x28, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x48, 0x83, 0xc4, 0x28, 0x48, | |
0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
}; | |
// 0: | |
// 0: OPARG | |
// 8: &_PyEval_LoadGlobalStackRef+0x0 | |
// 10: CONTINUE | |
// 18: ERROR_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->oparg); | |
patch_64(data + 0x8, (uintptr_t)&_PyEval_LoadGlobalStackRef); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, state->instruction_starts[instruction->error_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x9, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x33, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x67, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x72, (uintptr_t)data + 0x14); | |
} | |
void | |
emit__LOAD_GLOBAL_BUILTINS( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_GLOBAL_BUILTINS.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 49 8b 45 20 movq 0x20(%r13), %rax | |
// 4: 48 8b 40 20 movq 0x20(%rax), %rax | |
// 8: 0f b6 48 09 movzbl 0x9(%rax), %ecx | |
// c: ba 01 00 00 00 movl $0x1, %edx | |
// 11: 48 d3 e2 shlq %cl, %rdx | |
// 14: 48 01 c2 addq %rax, %rdx | |
// 17: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0x1e <_JIT_ENTRY+0x1e> | |
// 000000000000001a: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 1e: c1 e0 04 shll $0x4, %eax | |
// 21: 48 8b 44 10 28 movq 0x28(%rax,%rdx), %rax | |
// 26: 48 85 c0 testq %rax, %rax | |
// 29: 74 26 je 0x51 <_JIT_ENTRY+0x51> | |
// 2b: 8b 08 movl (%rax), %ecx | |
// 2d: ff c1 incl %ecx | |
// 2f: 75 27 jne 0x58 <_JIT_ENTRY+0x58> | |
// 31: 48 89 45 00 movq %rax, (%rbp) | |
// 35: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x3c <_JIT_ENTRY+0x3c> | |
// 0000000000000038: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 3c: 66 83 e0 01 andw $0x1, %ax | |
// 40: 75 29 jne 0x6b <_JIT_ENTRY+0x6b> | |
// 42: 0f b7 c0 movzwl %ax, %eax | |
// 45: 48 8d 6c c5 08 leaq 0x8(%rbp,%rax,8), %rbp | |
// 4a: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x51 <_JIT_ENTRY+0x51> | |
// 000000000000004d: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 51: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x58 <_JIT_ENTRY+0x58> | |
// 0000000000000054: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 58: 89 08 movl %ecx, (%rax) | |
// 5a: 48 89 45 00 movq %rax, (%rbp) | |
// 5e: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x65 <_JIT_ENTRY+0x65> | |
// 0000000000000061: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 65: 66 83 e0 01 andw $0x1, %ax | |
// 69: 74 d7 je 0x42 <_JIT_ENTRY+0x42> | |
// 6b: 48 c7 45 08 00 00 00 00 movq $0x0, 0x8(%rbp) | |
// 73: 0f b7 c0 movzwl %ax, %eax | |
// 76: 48 8d 6c c5 08 leaq 0x8(%rbp,%rax,8), %rbp | |
// 7b: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x82 <_JIT_ENTRY+0x82> | |
// 000000000000007e: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 7b: | |
const unsigned char code_body[123] = { | |
0x49, 0x8b, 0x45, 0x20, 0x48, 0x8b, 0x40, 0x20, | |
0x0f, 0xb6, 0x48, 0x09, 0xba, 0x01, 0x00, 0x00, | |
0x00, 0x48, 0xd3, 0xe2, 0x48, 0x01, 0xc2, 0x0f, | |
0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0xc1, 0xe0, | |
0x04, 0x48, 0x8b, 0x44, 0x10, 0x28, 0x48, 0x85, | |
0xc0, 0x74, 0x26, 0x8b, 0x08, 0xff, 0xc1, 0x75, | |
0x27, 0x48, 0x89, 0x45, 0x00, 0x48, 0x8b, 0x05, | |
0x00, 0x00, 0x00, 0x00, 0x66, 0x83, 0xe0, 0x01, | |
0x75, 0x29, 0x0f, 0xb7, 0xc0, 0x48, 0x8d, 0x6c, | |
0xc5, 0x08, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x89, 0x08, 0x48, 0x89, 0x45, 0x00, 0x48, 0x8b, | |
0x05, 0x00, 0x00, 0x00, 0x00, 0x66, 0x83, 0xe0, | |
0x01, 0x74, 0xd7, 0x48, 0xc7, 0x45, 0x08, 0x00, | |
0x00, 0x00, 0x00, 0x0f, 0xb7, 0xc0, 0x48, 0x8d, | |
0x6c, 0xc5, 0x08, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: OPARG | |
// 10: CONTINUE | |
// 18: JUMP_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, instruction->oparg); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x1a, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x38, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x4d, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x54, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x61, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__LOAD_GLOBAL_BUILTINS_FROM_KEYS( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_GLOBAL_BUILTINS_FROM_KEYS.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 89 e8 movq %rbp, %rax | |
// 3: 48 83 c5 f8 addq $-0x8, %rbp | |
// 7: 48 8b 50 f8 movq -0x8(%rax), %rdx | |
// b: 0f b6 4a 09 movzbl 0x9(%rdx), %ecx | |
// f: be 01 00 00 00 movl $0x1, %esi | |
// 14: 48 d3 e6 shlq %cl, %rsi | |
// 17: 48 01 d6 addq %rdx, %rsi | |
// 1a: 0f b7 0d 00 00 00 00 movzwl (%rip), %ecx # 0x21 <_JIT_ENTRY+0x21> | |
// 000000000000001d: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 21: c1 e1 04 shll $0x4, %ecx | |
// 24: 48 8b 4c 31 28 movq 0x28(%rcx,%rsi), %rcx | |
// 29: 48 85 c9 testq %rcx, %rcx | |
// 2c: 74 26 je 0x54 <_JIT_ENTRY+0x54> | |
// 2e: 8b 11 movl (%rcx), %edx | |
// 30: ff c2 incl %edx | |
// 32: 75 27 jne 0x5b <_JIT_ENTRY+0x5b> | |
// 34: 48 89 4d 00 movq %rcx, (%rbp) | |
// 38: 48 8b 0d 00 00 00 00 movq (%rip), %rcx # 0x3f <_JIT_ENTRY+0x3f> | |
// 000000000000003b: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 3f: 66 83 e1 01 andw $0x1, %cx | |
// 43: 75 29 jne 0x6e <_JIT_ENTRY+0x6e> | |
// 45: 0f b7 c1 movzwl %cx, %eax | |
// 48: 48 8d 6c c5 08 leaq 0x8(%rbp,%rax,8), %rbp | |
// 4d: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x54 <_JIT_ENTRY+0x54> | |
// 0000000000000050: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 54: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x5b <_JIT_ENTRY+0x5b> | |
// 0000000000000057: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 5b: 89 11 movl %edx, (%rcx) | |
// 5d: 48 89 4d 00 movq %rcx, (%rbp) | |
// 61: 48 8b 0d 00 00 00 00 movq (%rip), %rcx # 0x68 <_JIT_ENTRY+0x68> | |
// 0000000000000064: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 68: 66 83 e1 01 andw $0x1, %cx | |
// 6c: 74 d7 je 0x45 <_JIT_ENTRY+0x45> | |
// 6e: 48 c7 00 00 00 00 00 movq $0x0, (%rax) | |
// 75: 0f b7 c1 movzwl %cx, %eax | |
// 78: 48 8d 6c c5 08 leaq 0x8(%rbp,%rax,8), %rbp | |
// 7d: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x84 <_JIT_ENTRY+0x84> | |
// 0000000000000080: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 7d: | |
const unsigned char code_body[125] = { | |
0x48, 0x89, 0xe8, 0x48, 0x83, 0xc5, 0xf8, 0x48, | |
0x8b, 0x50, 0xf8, 0x0f, 0xb6, 0x4a, 0x09, 0xbe, | |
0x01, 0x00, 0x00, 0x00, 0x48, 0xd3, 0xe6, 0x48, | |
0x01, 0xd6, 0x0f, 0xb7, 0x0d, 0x00, 0x00, 0x00, | |
0x00, 0xc1, 0xe1, 0x04, 0x48, 0x8b, 0x4c, 0x31, | |
0x28, 0x48, 0x85, 0xc9, 0x74, 0x26, 0x8b, 0x11, | |
0xff, 0xc2, 0x75, 0x27, 0x48, 0x89, 0x4d, 0x00, | |
0x48, 0x8b, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x66, | |
0x83, 0xe1, 0x01, 0x75, 0x29, 0x0f, 0xb7, 0xc1, | |
0x48, 0x8d, 0x6c, 0xc5, 0x08, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x89, 0x11, 0x48, 0x89, 0x4d, | |
0x00, 0x48, 0x8b, 0x0d, 0x00, 0x00, 0x00, 0x00, | |
0x66, 0x83, 0xe1, 0x01, 0x74, 0xd7, 0x48, 0xc7, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xb7, 0xc1, | |
0x48, 0x8d, 0x6c, 0xc5, 0x08, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: OPARG | |
// 10: CONTINUE | |
// 18: JUMP_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, instruction->oparg); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x1d, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x3b, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x50, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x57, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x64, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__LOAD_GLOBAL_MODULE( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_GLOBAL_MODULE.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 49 8b 45 18 movq 0x18(%r13), %rax | |
// 4: 48 8b 40 20 movq 0x20(%rax), %rax | |
// 8: 0f b6 48 09 movzbl 0x9(%rax), %ecx | |
// c: ba 01 00 00 00 movl $0x1, %edx | |
// 11: 48 d3 e2 shlq %cl, %rdx | |
// 14: 48 01 c2 addq %rax, %rdx | |
// 17: 0f b7 05 00 00 00 00 movzwl (%rip), %eax # 0x1e <_JIT_ENTRY+0x1e> | |
// 000000000000001a: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 1e: c1 e0 04 shll $0x4, %eax | |
// 21: 48 8b 44 10 28 movq 0x28(%rax,%rdx), %rax | |
// 26: 48 85 c0 testq %rax, %rax | |
// 29: 74 26 je 0x51 <_JIT_ENTRY+0x51> | |
// 2b: 8b 08 movl (%rax), %ecx | |
// 2d: ff c1 incl %ecx | |
// 2f: 75 27 jne 0x58 <_JIT_ENTRY+0x58> | |
// 31: 48 89 45 00 movq %rax, (%rbp) | |
// 35: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x3c <_JIT_ENTRY+0x3c> | |
// 0000000000000038: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 3c: 66 83 e0 01 andw $0x1, %ax | |
// 40: 75 29 jne 0x6b <_JIT_ENTRY+0x6b> | |
// 42: 0f b7 c0 movzwl %ax, %eax | |
// 45: 48 8d 6c c5 08 leaq 0x8(%rbp,%rax,8), %rbp | |
// 4a: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x51 <_JIT_ENTRY+0x51> | |
// 000000000000004d: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 51: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x58 <_JIT_ENTRY+0x58> | |
// 0000000000000054: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 58: 89 08 movl %ecx, (%rax) | |
// 5a: 48 89 45 00 movq %rax, (%rbp) | |
// 5e: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x65 <_JIT_ENTRY+0x65> | |
// 0000000000000061: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 65: 66 83 e0 01 andw $0x1, %ax | |
// 69: 74 d7 je 0x42 <_JIT_ENTRY+0x42> | |
// 6b: 48 c7 45 08 00 00 00 00 movq $0x0, 0x8(%rbp) | |
// 73: 0f b7 c0 movzwl %ax, %eax | |
// 76: 48 8d 6c c5 08 leaq 0x8(%rbp,%rax,8), %rbp | |
// 7b: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x82 <_JIT_ENTRY+0x82> | |
// 000000000000007e: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 7b: | |
const unsigned char code_body[123] = { | |
0x49, 0x8b, 0x45, 0x18, 0x48, 0x8b, 0x40, 0x20, | |
0x0f, 0xb6, 0x48, 0x09, 0xba, 0x01, 0x00, 0x00, | |
0x00, 0x48, 0xd3, 0xe2, 0x48, 0x01, 0xc2, 0x0f, | |
0xb7, 0x05, 0x00, 0x00, 0x00, 0x00, 0xc1, 0xe0, | |
0x04, 0x48, 0x8b, 0x44, 0x10, 0x28, 0x48, 0x85, | |
0xc0, 0x74, 0x26, 0x8b, 0x08, 0xff, 0xc1, 0x75, | |
0x27, 0x48, 0x89, 0x45, 0x00, 0x48, 0x8b, 0x05, | |
0x00, 0x00, 0x00, 0x00, 0x66, 0x83, 0xe0, 0x01, | |
0x75, 0x29, 0x0f, 0xb7, 0xc0, 0x48, 0x8d, 0x6c, | |
0xc5, 0x08, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, | |
0x00, 0x48, 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, | |
0x89, 0x08, 0x48, 0x89, 0x45, 0x00, 0x48, 0x8b, | |
0x05, 0x00, 0x00, 0x00, 0x00, 0x66, 0x83, 0xe0, | |
0x01, 0x74, 0xd7, 0x48, 0xc7, 0x45, 0x08, 0x00, | |
0x00, 0x00, 0x00, 0x0f, 0xb7, 0xc0, 0x48, 0x8d, | |
0x6c, 0xc5, 0x08, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: OPARG | |
// 10: CONTINUE | |
// 18: JUMP_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, instruction->oparg); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x1a, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x38, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x4d, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x54, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x61, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__LOAD_GLOBAL_MODULE_FROM_KEYS( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_GLOBAL_MODULE_FROM_KEYS.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 89 e8 movq %rbp, %rax | |
// 3: 48 83 c5 f8 addq $-0x8, %rbp | |
// 7: 48 8b 50 f8 movq -0x8(%rax), %rdx | |
// b: 0f b6 4a 09 movzbl 0x9(%rdx), %ecx | |
// f: be 01 00 00 00 movl $0x1, %esi | |
// 14: 48 d3 e6 shlq %cl, %rsi | |
// 17: 48 01 d6 addq %rdx, %rsi | |
// 1a: 0f b7 0d 00 00 00 00 movzwl (%rip), %ecx # 0x21 <_JIT_ENTRY+0x21> | |
// 000000000000001d: IMAGE_REL_AMD64_REL32 __imp__JIT_OPERAND | |
// 21: c1 e1 04 shll $0x4, %ecx | |
// 24: 48 8b 4c 31 28 movq 0x28(%rcx,%rsi), %rcx | |
// 29: 48 85 c9 testq %rcx, %rcx | |
// 2c: 74 26 je 0x54 <_JIT_ENTRY+0x54> | |
// 2e: 8b 11 movl (%rcx), %edx | |
// 30: ff c2 incl %edx | |
// 32: 75 27 jne 0x5b <_JIT_ENTRY+0x5b> | |
// 34: 48 89 4d 00 movq %rcx, (%rbp) | |
// 38: 48 8b 0d 00 00 00 00 movq (%rip), %rcx # 0x3f <_JIT_ENTRY+0x3f> | |
// 000000000000003b: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 3f: 66 83 e1 01 andw $0x1, %cx | |
// 43: 75 29 jne 0x6e <_JIT_ENTRY+0x6e> | |
// 45: 0f b7 c1 movzwl %cx, %eax | |
// 48: 48 8d 6c c5 08 leaq 0x8(%rbp,%rax,8), %rbp | |
// 4d: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x54 <_JIT_ENTRY+0x54> | |
// 0000000000000050: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 54: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x5b <_JIT_ENTRY+0x5b> | |
// 0000000000000057: IMAGE_REL_AMD64_REL32 __imp__JIT_JUMP_TARGET | |
// 5b: 89 11 movl %edx, (%rcx) | |
// 5d: 48 89 4d 00 movq %rcx, (%rbp) | |
// 61: 48 8b 0d 00 00 00 00 movq (%rip), %rcx # 0x68 <_JIT_ENTRY+0x68> | |
// 0000000000000064: IMAGE_REL_AMD64_REL32 __imp__JIT_OPARG | |
// 68: 66 83 e1 01 andw $0x1, %cx | |
// 6c: 74 d7 je 0x45 <_JIT_ENTRY+0x45> | |
// 6e: 48 c7 00 00 00 00 00 movq $0x0, (%rax) | |
// 75: 0f b7 c1 movzwl %cx, %eax | |
// 78: 48 8d 6c c5 08 leaq 0x8(%rbp,%rax,8), %rbp | |
// 7d: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x84 <_JIT_ENTRY+0x84> | |
// 0000000000000080: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 7d: | |
const unsigned char code_body[125] = { | |
0x48, 0x89, 0xe8, 0x48, 0x83, 0xc5, 0xf8, 0x48, | |
0x8b, 0x50, 0xf8, 0x0f, 0xb6, 0x4a, 0x09, 0xbe, | |
0x01, 0x00, 0x00, 0x00, 0x48, 0xd3, 0xe6, 0x48, | |
0x01, 0xd6, 0x0f, 0xb7, 0x0d, 0x00, 0x00, 0x00, | |
0x00, 0xc1, 0xe1, 0x04, 0x48, 0x8b, 0x4c, 0x31, | |
0x28, 0x48, 0x85, 0xc9, 0x74, 0x26, 0x8b, 0x11, | |
0xff, 0xc2, 0x75, 0x27, 0x48, 0x89, 0x4d, 0x00, | |
0x48, 0x8b, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x66, | |
0x83, 0xe1, 0x01, 0x75, 0x29, 0x0f, 0xb7, 0xc1, | |
0x48, 0x8d, 0x6c, 0xc5, 0x08, 0x48, 0xff, 0x25, | |
0x00, 0x00, 0x00, 0x00, 0x48, 0xff, 0x25, 0x00, | |
0x00, 0x00, 0x00, 0x89, 0x11, 0x48, 0x89, 0x4d, | |
0x00, 0x48, 0x8b, 0x0d, 0x00, 0x00, 0x00, 0x00, | |
0x66, 0x83, 0xe1, 0x01, 0x74, 0xd7, 0x48, 0xc7, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xb7, 0xc1, | |
0x48, 0x8d, 0x6c, 0xc5, 0x08, | |
}; | |
// 0: | |
// 0: OPERAND | |
// 8: OPARG | |
// 10: CONTINUE | |
// 18: JUMP_TARGET | |
const unsigned char data_body[32] = { | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
}; | |
memcpy(data, data_body, sizeof(data_body)); | |
patch_64(data + 0x0, instruction->operand); | |
patch_64(data + 0x8, instruction->oparg); | |
patch_64(data + 0x10, (uintptr_t)code + sizeof(code_body)); | |
patch_64(data + 0x18, state->instruction_starts[instruction->jump_target]); | |
memcpy(code, code_body, sizeof(code_body)); | |
patch_x86_64_32rx(code + 0x1d, (uintptr_t)data + -0x4); | |
patch_x86_64_32rx(code + 0x3b, (uintptr_t)data + 0x4); | |
patch_x86_64_32rx(code + 0x50, (uintptr_t)data + 0xc); | |
patch_x86_64_32rx(code + 0x57, (uintptr_t)data + 0x14); | |
patch_x86_64_32rx(code + 0x64, (uintptr_t)data + 0x4); | |
} | |
void | |
emit__LOAD_LOCALS( | |
unsigned char *code, unsigned char *data, _PyExecutorObject *executor, | |
const _PyUOpInstruction *instruction, jit_state *state) | |
{ | |
// | |
// C:\Users\DDFUN\AppData\Local\Temp\tmpwlwcrdc9\_LOAD_LOCALS.o: file format coff-x86-64 | |
// | |
// Disassembly of section .text: | |
// | |
// 0000000000000000 <_JIT_ENTRY>: | |
// 0: 48 83 ec 28 subq $0x28, %rsp | |
// 4: 49 8b 45 28 movq 0x28(%r13), %rax | |
// 8: 48 85 c0 testq %rax, %rax | |
// b: 74 1b je 0x28 <_JIT_ENTRY+0x28> | |
// d: 8b 08 movl (%rax), %ecx | |
// f: ff c1 incl %ecx | |
// 11: 74 02 je 0x15 <_JIT_ENTRY+0x15> | |
// 13: 89 08 movl %ecx, (%rax) | |
// 15: 48 89 45 00 movq %rax, (%rbp) | |
// 19: 48 83 c5 08 addq $0x8, %rbp | |
// 1d: 48 83 c4 28 addq $0x28, %rsp | |
// 21: 48 ff 25 00 00 00 00 jmpq *(%rip) # 0x28 <_JIT_ENTRY+0x28> | |
// 0000000000000024: IMAGE_REL_AMD64_REL32 __imp__JIT_CONTINUE | |
// 28: 49 89 6d 40 movq %rbp, 0x40(%r13) | |
// 2c: 48 8b 05 00 00 00 00 movq (%rip), %rax # 0x33 <_JIT_ENTRY+0x33> | |
// 000000000000002f: IMAGE_REL_AMD64_REL32 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment