Advertisement
Guest User

Untitled

a guest
Jun 30th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.11 KB | None | 0 0
  1. /* fはloop1の内部でループしてる関数 */
  2. camlExept2__f_1464:
  3. .cfi_startproc
  4. .L104:
  5. /* クロージャの環境から定数を持ってきて */
  6. movq 16(%rbx), %rdi
  7. /* 比較 */
  8. cmpq %rdi, %rax
  9. /* 比較結果のフラグで分岐 */
  10. jne .L103
  11. /* もし成り立てば、今投げようとしてる例外の番号を取ってきてraxレジスタにコピー */
  12. movq camlExept2@GOTPCREL(%rip), %rax
  13. movq (%rax), %rax
  14. /* r14レジスタ(おそらく直前の例外ハンドラの位置を覚えてるレジスタ)
  15. の内容をレジスタスタックポインタにコピーしてretによりその場所に戻る */
  16. movq %r14, %rsp
  17. popq %r14
  18. ret
  19. .align 4
  20. .L103:
  21. /* 関数f1の引数に1たして、関数先頭にジャンプする
  22. (末尾再帰最適化によりジャンプになってる) */
  23. addq $2, %rax
  24. jmp .L104
  25. .cfi_endproc
  26. .type camlExept2__f_1464,@function
  27. .size camlExept2__f_1464,.-camlExept2__f_1464
  28. .text
  29. .align 16
  30. .globl camlExept2__g_1468
  31.  
  32. /* gはloop2の内部でループしてる関数 */
  33. camlExept2__g_1468:
  34. .cfi_startproc
  35. subq $8, %rsp
  36. .cfi_adjust_cfa_offset 8
  37. .L109:
  38. /* クロージャの環境から定数を持ってきて */
  39. movq 16(%rbx), %rdi
  40. /* 比較 */
  41. cmpq %rdi, %rax
  42. /* 比較結果のフラグで分岐 */
  43. jne .L108
  44. /* もし成り立てば、今投げようとしてる例外の番号を取ってきてraxレジスタにコピー
  45. おそらく例外を投げた時、その例外を区別するためのラベルをraxレジスタに覚えてる */
  46. movq camlExept2@GOTPCREL(%rip), %rax
  47. movq 8(%rax), %rax
  48. /* r14レジスタ(おそらく直前の例外ハンドラの位置を覚えてるレジスタ)
  49. の内容をレジスタスタックポインタにコピーしてretによりその場所に戻る */
  50. movq %r14, %rsp
  51. popq %r14
  52. ret
  53. .align 4
  54. .L108:
  55. /* try - withの中身の処理をする */
  56. call .L106
  57. /* raxレジスタをみてキャッチしたい例外の番号と一緒だったら */
  58. movq camlExept2@GOTPCREL(%rip), %rbx
  59. movq 8(%rbx), %rbx
  60. cmpq %rbx, %rax
  61. jne .L107
  62. /* ユニット($1のこと)をraxレジスタにセットして戻る */
  63. movq $1, %rax
  64. addq $8, %rsp
  65. .cfi_adjust_cfa_offset -8
  66. ret
  67. .cfi_adjust_cfa_offset 8
  68. .align 4
  69. .L107:
  70. /* 番号が一緒でなければ更に前の例外ハンドラを遡るよ */
  71. movq %r14, %rsp
  72. popq %r14
  73. ret
  74. .align 4
  75. .L106: ; try-withの中身の処理
  76. .cfi_adjust_cfa_offset 8
  77. pushq %r14 ; 前からあった内容をスタックに避難する
  78. .cfi_adjust_cfa_offset 8
  79. movq %rsp, %r14 ; 例外がキャッチされた時に戻る場所をr14に覚えておくよ
  80. addq $2, %rax
  81. call camlExept2__g_1468@PLT  ; 関数f1の引数に1たして、関数呼び出し
  82. .L110:
  83. popq %r14 ;try-withを抜けるときにスタックをpopして積んだものを除去
  84. .cfi_adjust_cfa_offset -8
  85. addq $8, %rsp
  86. .cfi_adjust_cfa_offset -8
  87. .L105:
  88. addq $8, %rsp
  89. .cfi_adjust_cfa_offset -8
  90. ret
  91. .cfi_adjust_cfa_offset 8
  92. .cfi_endproc
  93. .type camlExept2__g_1468,@function
  94. .size camlExept2__g_1468,.-camlExept2__g_1468
  95. .text
  96. .align 16
  97. .globl camlExept2__fun_2854
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement