/test/kilim/test/ex/ExJSR.j

http://github.com/kilim/kilim · Unknown · 86 lines · 69 code · 17 blank · 0 comment · 0 complexity · 917b267b41dd4d7b0eae0dec639751d8 MD5 · raw file

  1. .class public kilim/test/ex/ExJSR
  2. .super java/lang/Object
  3. .method public <init>()V
  4. aload 0
  5. invokenonvirtual java/lang/Object/<init>()V
  6. return
  7. .end method
  8. ;; --------------------------------------------
  9. ;; Make a single jsr call that simply returns
  10. ;; --------------------------------------------
  11. .method private static simpleJSR()V
  12. .limit locals 3
  13. .limit stack 3
  14. bipush 100
  15. istore 1
  16. jsr D
  17. iload 1
  18. istore 0
  19. return
  20. D:
  21. astore 2
  22. ret 2
  23. .end method
  24. ;; --------------------------------------------
  25. ;; Single jsr call that calls pausable method
  26. ;; The number of basic blocks should be 4
  27. ;; --------------------------------------------
  28. .method private static pausableJSR1()V
  29. .throws kilim/Pausable
  30. .limit locals 3
  31. .limit stack 3
  32. ;; BB 0
  33. bipush 100
  34. istore 1
  35. jsr D
  36. ;; BB 1
  37. iload 1
  38. istore 0
  39. return
  40. D:
  41. ;; BB 2
  42. astore 2
  43. ;; BB 3
  44. invokestatic kilim/test/ex/ExBasicBlock/pausable()V
  45. ret 2
  46. .end method
  47. ;; --------------------------------------------
  48. ;; Multiple jsr calls to a pausable subr
  49. ;; The number of basic blocks should be 7
  50. ;; because the number of basic blocks without
  51. ;; inlining is 5, and inlining the second
  52. ;; jsr adds another two.
  53. ;; --------------------------------------------
  54. .method private static pausableJSR2()V
  55. .throws kilim/Pausable
  56. .limit locals 3
  57. .limit stack 3
  58. bipush 100
  59. istore 1
  60. jsr D
  61. jsr D
  62. iload 1
  63. istore 0
  64. return
  65. D:
  66. astore 2
  67. invokestatic kilim/test/ex/ExBasicBlock/pausable()V
  68. ret 2
  69. .end method