Skip to content

Instantly share code, notes, and snippets.

@23Skidoo
Last active December 24, 2015 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 23Skidoo/6718150 to your computer and use it in GitHub Desktop.
Save 23Skidoo/6718150 to your computer and use it in GitHub Desktop.
Asm code for the TypeLits example: GHC 7.6 vs 7.8 See http://stackoverflow.com/questions/19020829/ghc-typelits-overhead/19035200
.data
.align 4
.align 1
.globl __stginit_main:Test
.type __stginit_main:Test, @object
__stginit_main:Test:
.data
.align 4
.align 1
.globl Test.test_closure
.type Test.test_closure, @object
Test.test_closure:
.long Type.S#_static_info
.long 2345
.data
.align 4
.align 1
.globl __stginit_main:Test
.type __stginit_main:Test, @object
__stginit_main:Test:
.data
.align 4
.align 1
.globl Test.test1_closure
.type Test.test1_closure, @object
Test.test1_closure:
.long Type.S#_static_info
.long 2345
.section .data
.align 4
.align 1
Test.test_srt:
.long Test.test1_closure
.data
.align 4
.align 1
.globl Test.test_closure
.type Test.test_closure, @object
Test.test_closure:
.long Test.test_info
.long 0
.long 0
.long 0
.text
.align 4,0x90
.long Test.test_srt-(Test.test_info)+0
.long 0
.long 65558
.globl Test.test_info
.type Test.test_info, @object
Test.test_info:
_chK:
leal -8(%ebp),%eax
cmpl 84(%ebx),%eax
jb _chM
addl $8,%edi
cmpl 92(%ebx),%edi
ja _chO
movl $stg_CAF_BLACKHOLE_info,-4(%edi)
movl 100(%ebx),%eax
movl %eax,0(%edi)
leal -4(%edi),%eax
pushl %eax
pushl %esi
pushl %ebx
call newCAF
movl 100(%ebx),%eax
movl %eax,0(%edi)
leal -4(%edi),%eax
pushl %eax
pushl %esi
pushl %ebx
call newCAF
addl $12,%esp
testl %eax,%eax
je _chP
_chQ:
movl $stg_bh_upd_frame_info,-8(%ebp)
leal -4(%edi),%eax
movl %eax,-4(%ebp)
movl $Test.test1_closure+1,%esi
addl $-8,%ebp
jmp *0(%ebp)
_chO:
movl $8,116(%ebx)
_chM:
jmp *-8(%ebx)
_chP:
jmp *(%esi)
.size Test.test_info, .-Test.test_info
.data
.align 4
.align 1
.globl __stginit_main:Test
.type __stginit_main:Test, @object
__stginit_main:Test:
.data
.align 4
.align 1
.globl Test.test_closure
.type Test.test_closure, @object
Test.test_closure:
.long Type.S#_static_info
.long 2345
.section .data
.align 4
.align 1
ShL_srt:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment