2 ; LeftBehind.j - contrived test to see how japhar reacts to
3 ; stuff left on the stack after a method returns.
4 .
class public LeftBehind
5 .
super java
/lang
/Object
7 .
method public static test
()I
8 .
limit stack
10 ; up to 10 items can be pushed
16 ; then push some strings.
22 ; now push our return value
28 .
method public static main
([Ljava
/lang
/String
;)V
29 .
limit stack
3 ; up to three items can be pushed
31 ; we push a value onto the stack, and
32 ; then check to see that only one item (the return
33 ; value from the test() method) is on the stack on top
37 invokestatic LeftBehind
/test
()I
39 pop ; get rid of the return value
46 ; push System.out onto the stack
47 getstatic java
/lang
/System
/out Ljava
/io
/PrintStream
;
51 invokevirtual java
/io
/PrintStream
/println
(Ljava
/lang
/String
;)V
53 invokestatic java
/lang
/System
/exit
(I
)V
56 ; push System.out onto the stack
57 getstatic java
/lang
/System
/out Ljava
/io
/PrintStream
;
61 invokevirtual java
/io
/PrintStream
/println
(Ljava
/lang
/String
;)V
63 invokestatic java
/lang
/System
/exit
(I
)V