Hello: Fail
Source:
Hello.java
1 /**
2 * @author Miko
3 */
4 
5 public class Hello {
6     public static void main(String[] aArg) throws Exception {
7         Console.write("Hello World!");
8     }
9 }


syntax highlighted by Code2HTML, v. 0.9.1
Compiler output:

JVM output:
Hello World!
TVM output:
Reading binary Hello.tvm
Installing binary 15740944
Checking validity of magic number
New object for class 5
Allocate 2 - free 8186
new_object_for_class: returning 15761212
New object for class 6
Allocate 2 - free 8184
new_object_for_class: returning 15761208
New object for class 7
Allocate 2 - free 8182
new_object_for_class: returning 15761204
New object for class 8
Allocate 2 - free 8180
new_object_for_class: returning 15761200
New object for class 9
Allocate 2 - free 8178
new_object_for_class: returning 15761196
New object for class 10
Allocate 2 - free 8176
new_object_for_class: returning 15761192
New object for class 11
Allocate 2 - free 8174
new_object_for_class: returning 15761188
New object for class 12
Allocate 2 - free 8172
new_object_for_class: returning 15761184
New object for class 13
Allocate 2 - free 8170
new_object_for_class: returning 15761180
New object for class 14
Allocate 2 - free 8168
new_object_for_class: returning 15761176
New object for class 15
Allocate 2 - free 8166
new_object_for_class: returning 15761172
New object for class 4
Allocate 2 - free 8164
new_object_for_class: returning 15761168
New object for class 1
Allocate 18 - free 8146
new_object_for_class: returning 15761132
Created bootThread: 15761132. Initializing...
Setting intial priority to 5
New array of type 1, length 4
Allocate 82 - free 8064
Array ptr=15760968
New array of type 10, length 10
Allocate 22 - free 8042
Array ptr=15760924
Engine starting.
switching thread: 140
------ switch_thread: currentThread at 15761132
switchThread: current stack frame: 0
Checking state of thread 15761132(1)(s=2,p=5,i=-128,d=0)
Starting thread 15761132: 1

------ dispatch special - 0 ------------------

dispatch_special: 15741924, 0
-- signature id = 0
-- code offset  = 1695
-- flags        = 4
-- num params   = 1
-- stack ptr    = 15760928
-- max stack ptr= 15760968
pc set to 0xF036AF
Found a non-daemon thread 15761132: 1(3)
switch_thread: done processing thread 15761132: 1
currentThread=15761132, ndr=1
Leaving switch_thread()
Current thread is 15761132: 1(3)
getting current stack frame...
updating registers...
done updating registers
done switching thread
0xF036AF: 
OPCODE (0x12) ldc
New object for class 2
Allocate 4 - free 8038
new_object_for_class: returning 15760916
New array of type 5, length 12
Allocate 14 - free 8024
Array ptr=15760888
0xF036B1: 
OPCODE (0xB8) invokestatic
dispatch_special_checked: 21, 1, 15742644, 15742641

------ dispatch special - 50 ------------------

dispatch_special: 15742020, 15742644
-- signature id = 50
-- code offset  = 0
-- flags        = 5
-- num params   = 1
-- stack ptr    = 15760936
-- max stack ptr= 15760928
-- native
Hello World!0xF036B4: 
OPCODE (0xB1) return

------ return ----- 0 ------------------

do_return: method: 0  #  num. words: 0
do_return: stack frame array size: 1
do_return: thread is done: 15761132
switching thread: 140
------ switch_thread: currentThread at 15761132
Tidying up DEAD thread 15761132: 1
Deallocate 2 at 15760924 - free 8026
Deallocate 82 at 15760968 - free 8108
Previous thread 15761132
Previous thread 15761132
No more threads of priority 5
currentThread=0, ndr=0
Leaving switch_thread()
done switching thread
Engine finished.
Casting: Fail
Source:
Casting.java
 1 // https://github.com/int3/doppio/blob/master/classes/test/Casting.java
 2 
 3 public class Casting {
 4   public static void main(String[] args) {
 5     {
 6       int a = 999999;
 7       Console.writeln(a);
 8       Console.writeln((long)a);
 9       Console.writeln((double)a);
10       Console.writeln((float)a);
11       Console.writeln((short)a);
12       Console.writeln((int)((char)a));
13       Console.writeln((byte)a);
14       a = -a;
15       Console.writeln(a);
16       Console.writeln((long)a);
17       Console.writeln((double)a);
18       Console.writeln((float)a);
19       Console.writeln((short)a);
20       Console.writeln((int)((char)a));
21       Console.writeln((byte)a);
22     }
23     {
24       long a = 8888888888888L;
25       Console.writeln(a);
26       Console.writeln((int)a);
27       Console.writeln((double)a);
28       Console.writeln((float)a);
29       a = -a;
30       Console.writeln(a);
31       Console.writeln((int)a);
32       Console.writeln((double)a);
33       Console.writeln((float)a);
34     }
35     {
36       double a = 777777777777.0;
37       Console.writeln(a);
38       Console.writeln((long)a);
39       Console.writeln((int)a);
40       Console.writeln((float)a);
41       a = -a;
42       Console.writeln(a);
43       Console.writeln((long)a);
44       Console.writeln((int)a);
45       Console.writeln((float)a);
46     }
47     {
48       float a = 6666666.0f;
49       Console.writeln(a);
50       Console.writeln((long)a);
51       Console.writeln((double)a);
52       Console.writeln((int)a);
53       a = -a;
54       Console.writeln(a);
55       Console.writeln((long)a);
56       Console.writeln((double)a);
57       Console.writeln((int)a);
58     }
59   }
60 
61 }


syntax highlighted by Code2HTML, v. 0.9.1
Compiler output:

JVM output:
999999
999999.0
999999.0
999999.0
16959
16959
63
-999999
-999999.0
-999999.0
-999999.0
-16959
48577
-63
8.8888889E12
-1693413832
8.888888888888E12
8.8888889E12
-8.8888889E12
1693413832
-8.888888888888E12
-8.8888889E12
7.77777777777E11
7.7777777E11
2147483647
7.7777777E11
-7.77777777777E11
-7.7777777E11
-2147483648
-7.7777777E11
6666666.0
6666666.0
6666666.0
6666666
-6666666.0
-6666666.0
-6666666.0
-6666666
TVM output:
Fatal: Unsupported lneg in Casting:main.
The following features/conditions are currently unsupported::
- Switch statements.
- Integer increment constant too large. (If > 255, declare it).
- Arithmetic or logical operations on variables of type long.
- Remainder operations on floats or doubles.
- Too many constants or locals ( > 255).
- Method code too long ( > 64 Kb!).

Reading binary Casting.tvm
Unable to open Casting.tvm
Loops: Fail
Source:
Loops.java
1 class Loops{
2   public static void main(String[] args) {
3     int i;
4     for(i=0;i<10;i++)
5       Console.write("a");
6     for(i=0;i<10;i++)
7       Console.write(i);
8   }
9 }


syntax highlighted by Code2HTML, v. 0.9.1
Compiler output:

JVM output:
aaaaaaaaaa0123456789
TVM output:
Reading binary Loops.tvm
Installing binary 8405008
Checking validity of magic number
New object for class 5
Allocate 2 - free 8186
new_object_for_class: returning 8425324
New object for class 6
Allocate 2 - free 8184
new_object_for_class: returning 8425320
New object for class 7
Allocate 2 - free 8182
new_object_for_class: returning 8425316
New object for class 8
Allocate 2 - free 8180
new_object_for_class: returning 8425312
New object for class 9
Allocate 2 - free 8178
new_object_for_class: returning 8425308
New object for class 10
Allocate 2 - free 8176
new_object_for_class: returning 8425304
New object for class 11
Allocate 2 - free 8174
new_object_for_class: returning 8425300
New object for class 12
Allocate 2 - free 8172
new_object_for_class: returning 8425296
New object for class 13
Allocate 2 - free 8170
new_object_for_class: returning 8425292
New object for class 14
Allocate 2 - free 8168
new_object_for_class: returning 8425288
New object for class 15
Allocate 2 - free 8166
new_object_for_class: returning 8425284
New object for class 4
Allocate 2 - free 8164
new_object_for_class: returning 8425280
New object for class 1
Allocate 18 - free 8146
new_object_for_class: returning 8425244
Created bootThread: 8425244. Initializing...
Setting intial priority to 5
New array of type 1, length 4
Allocate 82 - free 8064
Array ptr=8425080
New array of type 10, length 10
Allocate 22 - free 8042
Array ptr=8425036
Engine starting.
switching thread: 140
------ switch_thread: currentThread at 8425244
switchThread: current stack frame: 0
Checking state of thread 8425244(1)(s=2,p=5,i=-128,d=0)
Starting thread 8425244: 1

------ dispatch special - 0 ------------------

dispatch_special: 8405988, 0
-- signature id = 0
-- code offset  = 1707
-- flags        = 4
-- num params   = 1
-- stack ptr    = 8425040
-- max stack ptr= 8425080
pc set to 0x8046BB
Found a non-daemon thread 8425244: 1(3)
switch_thread: done processing thread 8425244: 1
currentThread=8425244, ndr=1
Leaving switch_thread()
Current thread is 8425244: 1(3)
getting current stack frame...
updating registers...
done updating registers
done switching thread
0x8046BB: 
OPCODE (0x3) iconst_0
0x8046BC: 
OPCODE (0x3C) istore_1
0x8046BD: 
OPCODE (0x1B) iload_1
0x8046BE: 
OPCODE (0x10) bipush
0x8046C0: 
OPCODE (0xA2) if_icmpge
0x8046C3: 
OPCODE (0x12) ldc
New object for class 2
Allocate 4 - free 8038
new_object_for_class: returning 8425028
New array of type 5, length 1
Allocate 3 - free 8035
Array ptr=8425022
0x8046C5: 
OPCODE (0xB8) invokestatic
dispatch_special_checked: 21, 1, 8406728, 8406725

------ dispatch special - 50 ------------------

dispatch_special: 8406084, 8406728
-- signature id = 50
-- code offset  = 0
-- flags        = 5
-- num params   = 1
-- stack ptr    = 8425056
-- max stack ptr= 8425040
-- native
a0x8046C8: 
OPCODE (0x84) iinc
0x8046CB: 
OPCODE (0xA7) goto
0x8046BD: 
OPCODE (0x1B) iload_1
0x8046BE: 
OPCODE (0x10) bipush
0x8046C0: 
OPCODE (0xA2) if_icmpge
0x8046C3: 
OPCODE (0x12) ldc
New object for class 2
Allocate 4 - free 8031
new_object_for_class: returning 8425014
New array of type 5, length 1
Allocate 3 - free 8028
Array ptr=8425008
0x8046C5: 
OPCODE (0xB8) invokestatic
dispatch_special_checked: 21, 1, 8406728, 8406725

------ dispatch special - 50 ------------------

dispatch_special: 8406084, 8406728
-- signature id = 50
-- code offset  = 0
-- flags        = 5
-- num params   = 1
-- stack ptr    = 8425056
-- max stack ptr= 8425040
-- native
a0x8046C8: 
OPCODE (0x84) iinc
0x8046CB: 
OPCODE (0xA7) goto
0x8046BD: 
OPCODE (0x1B) iload_1
0x8046BE: 
OPCODE (0x10) bipush
0x8046C0: 
OPCODE (0xA2) if_icmpge
0x8046C3: 
OPCODE (0x12) ldc
New object for class 2
Allocate 4 - free 8024
new_object_for_class: returning 8425000
New array of type 5, length 1
Allocate 3 - free 8021
Array ptr=8424994
0x8046C5: 
OPCODE (0xB8) invokestatic
dispatch_special_checked: 21, 1, 8406728, 8406725

------ dispatch special - 50 ------------------

dispatch_special: 8406084, 8406728
-- signature id = 50
-- code offset  = 0
-- flags        = 5
-- num params   = 1
-- stack ptr    = 8425056
-- max stack ptr= 8425040
-- native
a0x8046C8: 
OPCODE (0x84) iinc
0x8046CB: 
OPCODE (0xA7) goto
0x8046BD: 
OPCODE (0x1B) iload_1
0x8046BE: 
OPCODE (0x10) bipush
0x8046C0: 
OPCODE (0xA2) if_icmpge
0x8046C3: 
OPCODE (0x12) ldc
New object for class 2
Allocate 4 - free 8017
new_object_for_class: returning 8424986
New array of type 5, length 1
Allocate 3 - free 8014
Array ptr=8424980
0x8046C5: 
OPCODE (0xB8) invokestatic
dispatch_special_checked: 21, 1, 8406728, 8406725

------ dispatch special - 50 ------------------

dispatch_special: 8406084, 8406728
-- signature id = 50
-- code offset  = 0
-- flags        = 5
-- num params   = 1
-- stack ptr    = 8425056
-- max stack ptr= 8425040
-- native
a0x8046C8: 
OPCODE (0x84) iinc
0x8046CB: 
OPCODE (0xA7) goto
0x8046BD: 
OPCODE (0x1B) iload_1
0x8046BE: 
OPCODE (0x10) bipush
0x8046C0: 
OPCODE (0xA2) if_icmpge
0x8046C3: 
OPCODE (0x12) ldc
New object for class 2
Allocate 4 - free 8010
new_object_for_class: returning 8424972
New array of type 5, length 1
Allocate 3 - free 8007
Array ptr=8424966
0x8046C5: 
OPCODE (0xB8) invokestatic
dispatch_special_checked: 21, 1, 8406728, 8406725

------ dispatch special - 50 ------------------

dispatch_special: 8406084, 8406728
-- signature id = 50
-- code offset  = 0
-- flags        = 5
-- num params   = 1
-- stack ptr    = 8425056
-- max stack ptr= 8425040
-- native
a0x8046C8: 
OPCODE (0x84) iinc
0x8046CB: 
OPCODE (0xA7) goto
0x8046BD: 
OPCODE (0x1B) iload_1
0x8046BE: 
OPCODE (0x10) bipush
0x8046C0: 
OPCODE (0xA2) if_icmpge
0x8046C3: 
OPCODE (0x12) ldc
New object for class 2
Allocate 4 - free 8003
new_object_for_class: returning 8424958
New array of type 5, length 1
Allocate 3 - free 8000
Array ptr=8424952
0x8046C5: 
OPCODE (0xB8) invokestatic
dispatch_special_checked: 21, 1, 8406728, 8406725

------ dispatch special - 50 ------------------

dispatch_special: 8406084, 8406728
-- signature id = 50
-- code offset  = 0
-- flags        = 5
-- num params   = 1
-- stack ptr    = 8425056
-- max stack ptr= 8425040
-- native
a0x8046C8: 
OPCODE (0x84) iinc
0x8046CB: 
OPCODE (0xA7) goto
0x8046BD: 
OPCODE (0x1B) iload_1
0x8046BE: 
OPCODE (0x10) bipush
0x8046C0: 
OPCODE (0xA2) if_icmpge
0x8046C3: 
OPCODE (0x12) ldc
New object for class 2
Allocate 4 - free 7996
new_object_for_class: returning 8424944
New array of type 5, length 1
Allocate 3 - free 7993
Array ptr=8424938
0x8046C5: 
OPCODE (0xB8) invokestatic
dispatch_special_checked: 21, 1, 8406728, 8406725

------ dispatch special - 50 ------------------

dispatch_special: 8406084, 8406728
-- signature id = 50
-- code offset  = 0
-- flags        = 5
-- num params   = 1
-- stack ptr    = 8425056
-- max stack ptr= 8425040
-- native
a0x8046C8: 
OPCODE (0x84) iinc
0x8046CB: 
OPCODE (0xA7) goto
0x8046BD: 
OPCODE (0x1B) iload_1
0x8046BE: 
OPCODE (0x10) bipush
0x8046C0: 
OPCODE (0xA2) if_icmpge
0x8046C3: 
OPCODE (0x12) ldc
New object for class 2
Allocate 4 - free 7989
new_object_for_class: returning 8424930
New array of type 5, length 1
Allocate 3 - free 7986
Array ptr=8424924
0x8046C5: 
OPCODE (0xB8) invokestatic
dispatch_special_checked: 21, 1, 8406728, 8406725

------ dispatch special - 50 ------------------

dispatch_special: 8406084, 8406728
-- signature id = 50
-- code offset  = 0
-- flags        = 5
-- num params   = 1
-- stack ptr    = 8425056
-- max stack ptr= 8425040
-- native
a0x8046C8: 
OPCODE (0x84) iinc
0x8046CB: 
OPCODE (0xA7) goto
0x8046BD: 
OPCODE (0x1B) iload_1
0x8046BE: 
OPCODE (0x10) bipush
0x8046C0: 
OPCODE (0xA2) if_icmpge
0x8046C3: 
OPCODE (0x12) ldc
New object for class 2
Allocate 4 - free 7982
new_object_for_class: returning 8424916
New array of type 5, length 1
Allocate 3 - free 7979
Array ptr=8424910
0x8046C5: 
OPCODE (0xB8) invokestatic
dispatch_special_checked: 21, 1, 8406728, 8406725

------ dispatch special - 50 ------------------

dispatch_special: 8406084, 8406728
-- signature id = 50
-- code offset  = 0
-- flags        = 5
-- num params   = 1
-- stack ptr    = 8425056
-- max stack ptr= 8425040
-- native
a0x8046C8: 
OPCODE (0x84) iinc
0x8046CB: 
OPCODE (0xA7) goto
0x8046BD: 
OPCODE (0x1B) iload_1
0x8046BE: 
OPCODE (0x10) bipush
0x8046C0: 
OPCODE (0xA2) if_icmpge
0x8046C3: 
OPCODE (0x12) ldc
New object for class 2
Allocate 4 - free 7975
new_object_for_class: returning 8424902
New array of type 5, length 1
Allocate 3 - free 7972
Array ptr=8424896
0x8046C5: 
OPCODE (0xB8) invokestatic
dispatch_special_checked: 21, 1, 8406728, 8406725

------ dispatch special - 50 ------------------

dispatch_special: 8406084, 8406728
-- signature id = 50
-- code offset  = 0
-- flags        = 5
-- num params   = 1
-- stack ptr    = 8425056
-- max stack ptr= 8425040
-- native
a0x8046C8: 
OPCODE (0x84) iinc
0x8046CB: 
OPCODE (0xA7) goto
0x8046BD: 
OPCODE (0x1B) iload_1
0x8046BE: 
OPCODE (0x10) bipush
0x8046C0: 
OPCODE (0xA2) if_icmpge
0x8046CE: 
OPCODE (0x3) iconst_0
0x8046CF: 
OPCODE (0x3C) istore_1
0x8046D0: 
OPCODE (0x1B) iload_1
0x8046D1: 
OPCODE (0x10) bipush
0x8046D3: 
OPCODE (0xA2) if_icmpge
0x8046D6: 
OPCODE (0x1B) iload_1
0x8046D7: 
OPCODE (0xB8) invokestatic
dispatch_special_checked: 21, 2, 8406746, 8406743

------ dispatch special - 58 ------------------

dispatch_special: 8406096, 8406746
-- signature id = 58
-- code offset  = 1798
-- flags        = 4
-- num params   = 1
-- stack ptr    = 8425056
-- max stack ptr= 8425040
-- param[0]    = 0
pc set to 0x804716
New array of type 0, length 7
Allocate 16 - free 7956
Array ptr=8424864
Assertion violation: 37
TestStringBuffer: Fail
Source:
TestStringBuffer.java
 1 public class TestStringBuffer
 2 {
 3         
 4     public static void main(String []args)
 5     {
 6         StringBuffer s1 = new StringBuffer(30);
 7         s1.append("2^10=");
 8         s1.append(1024);
 9         s1.append("!");
10         Console.writeln("2^10=1024!"+(s1.toString()));
11 
12         Console.writeln(1);
13                 
14         s1.delete(0,30);
15         s1.append("one=");
16         s1.append(1.0);
17         s1.append("!!");
18         Console.writeln("one=1.0!!"+(s1.toString()));
19         
20         Console.writeln(2);
21                 
22         s1.delete(0,30);
23         s1.append("pi=");
24         s1.append(3.1415927);
25         s1.append("!");
26         Console.writeln("pi=3.1415927!"+(s1.toString()));
27         
28         Console.writeln(3);
29                 
30         s1.delete(0,30);
31         s1.append("pi!=");
32         s1.append(-3.1415927);
33         s1.append("!");
34         Console.writeln("pi!=-3.1415927!"+(s1.toString()));
35         
36         Console.writeln(4);
37                 
38         s1.delete(0,30);
39         s1.append("pi!=");
40         s1.append(3.1415927e30);
41         s1.append("!");
42         Console.writeln("pi!=3.1415927E30!"+(s1.toString()));
43         
44         Console.writeln(5);
45                 
46         s1.delete(0,30);
47         s1.append("pi!=");
48         s1.append(3.1415927e-30);
49         s1.append("!");
50         Console.writeln("pi!=3.1415925E-30!"+(s1.toString()));
51         
52         Console.writeln(6);
53                 
54         s1.delete(0,30);
55         s1.append("pi!=");
56         s1.append(-3.1415927e30);
57         s1.append("!");
58         Console.writeln("pi!=-3.1415927E30!"+(s1.toString()));
59         
60         Console.writeln(7);
61                 
62         s1.delete(0,30);
63         s1.append("pi!=");
64         s1.append(-3.1415927e-30);
65         s1.append("!");
66         Console.writeln("pi!=-3.1415925E-30!"+(s1.toString()));        
67     }
68 }


syntax highlighted by Code2HTML, v. 0.9.1
Compiler output:

JVM output:
2^10=1024!2^10=1024!
1
one=1.0!!one=1.0!!
2
pi=3.1415927!pi=3.1415927!
3
pi!=-3.1415927!pi!=-3.1415927!
4
pi!=3.1415927E30!pi!=3.1415927E30!
5
pi!=3.1415925E-30!pi!=3.1415927E-30!
6
pi!=-3.1415927E30!pi!=-3.1415927E30!
7
pi!=-3.1415925E-30!pi!=-3.1415927E-30!
TVM output:
Reading binary TestStringBuffer.tvm
Installing binary 34349072
Checking validity of magic number
New object for class 5
Allocate 2 - free 8186
new_object_for_class: returning 34370252
New object for class 6
Allocate 2 - free 8184
new_object_for_class: returning 34370248
New object for class 7
Allocate 2 - free 8182
new_object_for_class: returning 34370244
New object for class 8
Allocate 2 - free 8180
new_object_for_class: returning 34370240
New object for class 9
Allocate 2 - free 8178
new_object_for_class: returning 34370236
New object for class 10
Allocate 2 - free 8176
new_object_for_class: returning 34370232
New object for class 11
Allocate 2 - free 8174
new_object_for_class: returning 34370228
New object for class 12
Allocate 2 - free 8172
new_object_for_class: returning 34370224
New object for class 13
Allocate 2 - free 8170
new_object_for_class: returning 34370220
New object for class 14
Allocate 2 - free 8168
new_object_for_class: returning 34370216
New object for class 15
Allocate 2 - free 8166
new_object_for_class: returning 34370212
New object for class 4
Allocate 2 - free 8164
new_object_for_class: returning 34370208
New object for class 1
Allocate 18 - free 8146
new_object_for_class: returning 34370172
Created bootThread: 34370172. Initializing...
Setting intial priority to 5
New array of type 1, length 4
Allocate 82 - free 8064
Array ptr=34370008
New array of type 10, length 10
Allocate 22 - free 8042
Array ptr=34369964
Engine starting.
switching thread: 140
------ switch_thread: currentThread at 34370172
switchThread: current stack frame: 0
Checking state of thread 34370172(1)(s=2,p=5,i=-128,d=0)
Starting thread 34370172: 1

------ dispatch special - 0 ------------------

dispatch_special: 34350128, 0
-- signature id = 0
-- code offset  = 1827
-- flags        = 4
-- num params   = 1
-- stack ptr    = 34369968
-- max stack ptr= 34370008
pc set to 0x20C2733
Found a non-daemon thread 34370172: 1(3)
switch_thread: done processing thread 34370172: 1
currentThread=34370172, ndr=1
Leaving switch_thread()
Current thread is 34370172: 1(3)
getting current stack frame...
updating registers...
done updating registers
done switching thread
0x20C2733: 
OPCODE (0xBB) new
dispatch_static_initializer: has clinit: 34349298, 34350899

------ dispatch special - 3 ------------------

dispatch_special: 34350320, 34350899
-- signature id = 3
-- code offset  = 3091
-- flags        = 4
-- num params   = 0
-- stack ptr    = 34369976
-- max stack ptr= 34370008
pc set to 0x20C2C23
New object checked returning null
0x20C2C23: 
OPCODE (0x10) bipush
0x20C2C25: 
OPCODE (0xBC) newarray
New array of type 5, length 10
Allocate 12 - free 8030
Array ptr=34369940
0x20C2C27: 
OPCODE (0x59) dup
0x20C2C28: 
OPCODE (0x3) iconst_0
0x20C2C29: 
OPCODE (0x10) bipush
0x20C2C2B: 
OPCODE (0x55) castore
0x20C2C2C: 
OPCODE (0x59) dup
0x20C2C2D: 
OPCODE (0x4) iconst_1
0x20C2C2E: 
OPCODE (0x10) bipush
0x20C2C30: 
OPCODE (0x55) castore
0x20C2C31: 
OPCODE (0x59) dup
0x20C2C32: 
OPCODE (0x5) iconst_2
0x20C2C33: 
OPCODE (0x10) bipush
0x20C2C35: 
OPCODE (0x55) castore
0x20C2C36: 
OPCODE (0x59) dup
0x20C2C37: 
OPCODE (0x6) iconst_3
0x20C2C38: 
OPCODE (0x10) bipush
0x20C2C3A: 
OPCODE (0x55) castore
0x20C2C3B: 
OPCODE (0x59) dup
0x20C2C3C: 
OPCODE (0x7) iconst_4
0x20C2C3D: 
OPCODE (0x10) bipush
0x20C2C3F: 
OPCODE (0x55) castore
0x20C2C40: 
OPCODE (0x59) dup
0x20C2C41: 
OPCODE (0x8) iconst_5
0x20C2C42: 
OPCODE (0x10) bipush
0x20C2C44: 
OPCODE (0x55) castore
0x20C2C45: 
OPCODE (0x59) dup
0x20C2C46: 
OPCODE (0x10) bipush
0x20C2C48: 
OPCODE (0x10) bipush
0x20C2C4A: 
OPCODE (0x55) castore
0x20C2C4B: 
OPCODE (0x59) dup
0x20C2C4C: 
OPCODE (0x10) bipush
0x20C2C4E: 
OPCODE (0x10) bipush
0x20C2C50: 
OPCODE (0x55) castore
0x20C2C51: 
OPCODE (0x59) dup
0x20C2C52: 
OPCODE (0x10) bipush
0x20C2C54: 
OPCODE (0x10) bipush
0x20C2C56: 
OPCODE (0x55) castore
0x20C2C57: 
OPCODE (0x59) dup
0x20C2C58: 
OPCODE (0x10) bipush
0x20C2C5A: 
OPCODE (0x10) bipush
0x20C2C5C: 
OPCODE (0x55) castore
0x20C2C5D: 
OPCODE (0xB3) putstatic
---  GET/PUTSTATIC --- (21, 3)
fieldSize  = 4
fbase1  = 34349380
0x20C2C60: 
OPCODE (0xB1) return

------ return ----- 3 ------------------

do_return: method: 3  #  num. words: 0
do_return: stack frame array size: 2
do_return: stack reset to:
-- stack ptr = 34369976
0x20C2733: 
OPCODE (0xBB) new
New object for class 21
Allocate 6 - free 8024
new_object_for_class: returning 34369928
0x20C2736: 
OPCODE (0x59) dup
0x20C2737: 
OPCODE (0x10) bipush
0x20C2739: 
OPCODE (0xB7) invokespecial
dispatch_special_checked: 21, 2, 34350908, 34350905

------ dispatch special - 58 ------------------

dispatch_special: 34350236, 34350908
-- signature id = 58
-- code offset  = 2381
-- flags        = 0
-- num params   = 2
-- stack ptr    = 34370000
-- max stack ptr= 34370008
-- param[0]    = 34369928
-- param[1]    = 30
pc set to 0x20C295D
0x20C295D: 
OPCODE (0x2A) aload_0
### aload_x(thread=1, frame=1, ref=34369992): 34369928
0x20C295E: 
OPCODE (0xB7) invokespecial
dispatch_special_checked: 0, 0, 34351457, 34351454

------ dispatch special - 2 ------------------

dispatch_special: 34349804, 34351457
-- signature id = 2
-- code offset  = 1659
-- flags        = 0
-- num params   = 1
-- stack ptr    = 34370008
-- max stack ptr= 34370008
-- param[0]    = 34369928
pc set to 0x20C268B
0x20C268B: 
OPCODE (0xB1) return

------ return ----- 2 ------------------

do_return: method: 2  #  num. words: 0
do_return: stack frame array size: 3
do_return: stack reset to:
-- stack ptr = 34370000
0x20C2961: 
OPCODE (0x2A) aload_0
### aload_x(thread=1, frame=1, ref=34369992): 34369928
0x20C2962: 
OPCODE (0x3) iconst_0
0x20C2963: 
OPCODE (0xB5) putfield
--- PUTFIELD ---
fieldType: 10
fieldSize: 4
wideWord: 0
reference: 34369928
0x20C2966: 
OPCODE (0x2A) aload_0
### aload_x(thread=1, frame=1, ref=34369992): 34369928
0x20C2967: 
OPCODE (0x1B) iload_1
0x20C2968: 
OPCODE (0xBC) newarray
New array of type 5, length 30
Allocate 32 - free 7992
Array ptr=34369864
0x20C296A: 
OPCODE (0xB5) putfield
--- PUTFIELD ---
fieldType: 0
fieldSize: 4
wideWord: 0
reference: 34369928
0x20C296D: 
OPCODE (0xB1) return

------ return ----- 58 ------------------

do_return: method: 58  #  num. words: 0
do_return: stack frame array size: 2
do_return: stack reset to:
-- stack ptr = 34369984
0x20C273C: 
OPCODE (0x4C) astore_1
0x20C273D: 
OPCODE (0x2B) aload_1
### aload_x(thread=1, frame=0, ref=34369968): 34369928
0x20C273E: 
OPCODE (0x12) ldc
New object for class 2
Allocate 4 - free 7988
new_object_for_class: returning 34369856
New array of type 5, length 5
Allocate 7 - free 7981
Array ptr=34369842
0x20C2740: 
OPCODE (0xB6) invokevirtual
dispatch_virtual 60

------ dispatch special - 60 ------------------

dispatch_special: 34350260, 34350915
-- signature id = 60
-- code offset  = 2464
-- flags        = 0
-- num params   = 2
-- stack ptr    = 34369992
-- max stack ptr= 34370008
-- param[0]    = 34369928
-- param[1]    = 34369856
pc set to 0x20C29B0
New array of type 10, length 34
Allocate 70 - free 7911
Array ptr=34369702
Deallocate 22 at 34369964 - free 7933
thread=1, stackTop(34369762), localsBase(34369722)=34369928
stackBase[1].localsBase(34369722) = 34369928
stackBase[0].localsBase(34369706) = 0
0x20C29B0: 
OPCODE (0x2B) aload_1
### aload_x(thread=1, frame=1, ref=34369722): 34369856
0x20C29B1: 
OPCODE (0xB6) invokevirtual
dispatch_virtual 55

------ dispatch special - 55 ------------------

dispatch_special: 34349924, 34351540
-- signature id = 55
-- code offset  = 1727
-- flags        = 0
-- num params   = 1
-- stack ptr    = 34369770
-- max stack ptr= 34369842
-- param[0]    = 34369856
pc set to 0x20C26CF
0x20C26CF: 
OPCODE (0x2A) aload_0
### aload_x(thread=1, frame=2, ref=34369770): 34369856
0x20C26D0: 
OPCODE (0xB4) getfield
--- GETFIELD ---
fieldType: 0
fieldSize: 4
wideWord: 0
reference: 34369856
stackTop: 34369794
### get_field base=34369860 size=4 pushed=34369856
### get_field base=34369860 size=4 pushed=0
Set top word done
Going home
0x20C26D3: 
OPCODE (0xBE) arraylength
Throw exception
Num exception handlers=0

------ return ----- 55 ------------------

do_return: method: 55  #  num. words: 0
do_return: stack frame array size: 3
do_returSegmentation fault (core dumped)
coredump:
[New LWP 17842]

warning: Can't read pathname for load map: Input/output error.
Core was generated by `emu-lejosrun -v TestStringBuffer.tvm'.
Program terminated with signal 11, Segmentation fault.
#0  0x00000000004042ed in throw_exception (exception=0x20c72c0) at ../vmsrc/exceptions.c:103
103	  gExceptionRecord = (ExceptionRecord *) (get_binary_base() + tempMethodRecord->exceptionTable);
TestThreadState: Fail
Source:
TestThreadState.java
 1 public class TestThreadState {
 2 	static class TestThread extends Thread {
 3 		public void run() {
 4 			try {
 5 				sleep(5000);
 6 			} catch (InterruptedException e) {
 7 				Assertion.test("Sleep interrupted", true);
 8 			}
 9 		}
10 	}
11 	public static void main(String[] args) {
12 		try {
13 			Thread t = new TestThread();
14 			Assertion.test("Alive1", !t.isAlive());
15 			t.start();
16 			Thread.yield();
17 			Assertion.test("Not alive", t.isAlive());
18 			t.interrupt();
19 			Thread.currentThread().sleep(500);
20 			Assertion.test("Alive2", !t.isAlive());
21 			boolean ex = false;
22 			try {
23 				t.start();
24 			} catch (IllegalStateException ise) {
25 				ex = true;
26 			}
27 			Assertion.test("No exception", ex);
28 			ex = false;
29 			try  {
30 				// Run out of memory whilst creating threads:
31 				while (true) {
32 					t = new TestThread();
33 					t.start();
34 					Thread.yield();
35 				}
36 			} catch (OutOfMemoryError oome) {
37 				ex = true;
38 			}
39 			Assertion.test("No OutOfMemoryError", ex);
40 		} catch (Throwable e) {
41 			System.exit(1);
42 		}
43 	}
44 }


syntax highlighted by Code2HTML, v. 0.9.1
Compiler output:

JVM output:
Assertion: Alive1 [ OK ]
Assertion: Not alive [ OK ]
Assertion: Sleep interrupted [ OK ]
Assertion: Alive2 [ OK ]
TVM output:
Segmentation fault (core dumped)
coredump:
[New LWP 17908]

warning: Can't read pathname for load map: Input/output error.
Core was generated by `emu-lejosrun -v TestThreadState.tvm'.
Program terminated with signal 11, Segmentation fault.
#0  0x000000000040581d in dispatch_special (methodRecord=0x1fad31c, retAddr=0x1fad703 "\261*\267") at ../vmsrc/language.c:289
289		printf("stackBase[%d].localsBase(%d) = %d\n", i, (int)stackBase[i].localsBase, (int)(*stackBase[i].localsBase));