Created
July 21, 2010 03:19
-
-
Save nixeagle/484004 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| Below is the assembly output for the following function: | |
| ;;; Note that dispatch-entry is a lisp structure. This is sorta equivalent | |
| ;;; to a C structure, the way they are stored is very similar | |
| (defun dispatch-entry-equal (entry1 entry2) | |
| (declare (dispatch-entry entry1 entry2)) | |
| (equal (dispatch-entry-type entry1) | |
| (dispatch-entry-type entry2))) | |
| ;; OPTIMIZED (safety 0) (speed 3) <lisp acts like C here and treats types | |
| ;; as compiler hints> | |
| ; disassembly for DISPATCH-ENTRY-EQUAL | |
| ; 04F7307F: 488B520F MOV RDX, [RDX+15] ; no-arg-parsing entry point | |
| ; 83: 488B7F0F MOV RDI, [RDI+15] | |
| ; 87: 488B05A2FFFFFF MOV RAX, [RIP-94] ; #<FDEFINITION object for EQUAL> | |
| ; 8E: B910000000 MOV ECX, 16 | |
| ; 93: FF7508 PUSH QWORD PTR [RBP+8] | |
| ; 96: FF6009 JMP QWORD PTR [RAX+9] | |
| ;; UNOPTIMIZED (safety 3) (speed 0) <lisp treats types as assertions> | |
| ; disassembly for DISPATCH-ENTRY-EQUAL | |
| ; 04E325C2: 498B442438 MOV RAX, [R12+56] ; no-arg-parsing entry point | |
| ; 5C7: 4883C010 ADD RAX, 16 | |
| ; 5CB: 48C740F852000000 MOV QWORD PTR [RAX-8], 82 | |
| ; 5D3: 488968F0 MOV [RAX-16], RBP | |
| ; 5D7: 4989442438 MOV [R12+56], RAX | |
| ; 5DC: 488B45F8 MOV RAX, [RBP-8] | |
| ; 5E0: 488B500F MOV RDX, [RAX+15] | |
| ; 5E4: 488B45F0 MOV RAX, [RBP-16] | |
| ; 5E8: 488B780F MOV RDI, [RAX+15] | |
| ; 5EC: 488D5C24F0 LEA RBX, [RSP-16] | |
| ; 5F1: 4883EC18 SUB RSP, 24 | |
| ; 5F5: 488B05E4FEFFFF MOV RAX, [RIP-284] ; #<FDEFINITION object for EQUAL> | |
| ; 5FC: B910000000 MOV ECX, 16 | |
| ; 601: 48892B MOV [RBX], RBP | |
| ; 604: 488BEB MOV RBP, RBX | |
| ; 607: FF5009 CALL QWORD PTR [RAX+9] | |
| ; 60A: 498B442438 MOV RAX, [R12+56] | |
| ; 60F: 48C740F000000000 MOV QWORD PTR [RAX-16], 0 | |
| ; 617: 48C740F800000000 MOV QWORD PTR [RAX-8], 0 | |
| ; 61F: 4883E810 SUB RAX, 16 | |
| ; 623: 4989442438 MOV [R12+56], RAX | |
| ; 628: 488BE5 MOV RSP, RBP | |
| ; 62B: F8 CLC | |
| ; 62C: 5D POP RBP | |
| ; 62D: C3 RET | |
| ; 62E: CC0A BREAK 10 ; error trap | |
| ; 630: 02 BYTE #X02 | |
| ; 631: 18 BYTE #X18 ; INVALID-ARG-COUNT-ERROR | |
| ; 632: D4 BYTE #XD4 ; RBX |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment