PageRenderTime 36ms CodeModel.GetById 33ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

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