1 | |
---|
2 | This file describes the goals and current status of the |
---|
3 | branch it pertains to. In this case the generic-class-file branch. |
---|
4 | |
---|
5 | |
---|
6 | Goal(s) |
---|
7 | ======= |
---|
8 | |
---|
9 | The goal of the branch is to replace the existing class file writer which |
---|
10 | is restricted to writing 2 methods in a class file with an extremely |
---|
11 | restricted set of signatures. |
---|
12 | |
---|
13 | The new writer will allow any number of methods with no limitation on the |
---|
14 | signatures to be used. This allows a number of things impossible today: |
---|
15 | |
---|
16 | 1. Eliminating the external dependency of 'runtime-class.lisp' on ASM |
---|
17 | 2. Moving initialization of 'final static' fields to the '<clinit>' |
---|
18 | to make 100% sure they get initialized exactly once |
---|
19 | 3. Using the Java-paradigm of having multiple methods with different |
---|
20 | numbers of parameters to fill in default values |
---|
21 | |
---|
22 | --------------- example to go with item (3) |
---|
23 | final public LispObject execute() { |
---|
24 | return execute(<default value>); |
---|
25 | } |
---|
26 | |
---|
27 | final public LispObject execute(LispObject arg1) { |
---|
28 | return execute(arg1, <default value>); |
---|
29 | } |
---|
30 | |
---|
31 | final public LispObject execute(LispObject arg1, LispObject arg2) { |
---|
32 | ... do actual work ...; |
---|
33 | } |
---|
34 | --------------- end of example |
---|
35 | |
---|
36 | |
---|
37 | |
---|
38 | Design |
---|
39 | ====== |
---|
40 | |
---|
41 | The code uses structures and structure inclusion for the class file and |
---|
42 | class file attributes. Each attribute type has an associated specific |
---|
43 | finalizer and writer function. This should allow for future ease of |
---|
44 | extension. |
---|
45 | |
---|
46 | There are three phases in the design. Read about that in the file itself. |
---|
47 | |
---|
48 | Structure inclusion is used as a means of single inheritance. |
---|
49 | |
---|
50 | |
---|
51 | Status |
---|
52 | ====== |
---|
53 | |
---|
54 | The replacement code is located in the java-class-file.lisp file. |
---|
55 | |
---|
56 | TODO: |
---|
57 | |
---|
58 | * All methods preceded by an exclamation mark have equal names in |
---|
59 | compiler-pass2; this situation is to be resolved eventually. |
---|
60 | Preferrably even before merging back to trunk. |
---|
61 | |
---|
62 | * Move 'code-bytes' to opcodes.lisp |
---|
63 | |
---|
64 | * Rename opcodes.lisp to jvm-opcodes.lisp [probably more an action for trunk/] |
---|
65 | |
---|
66 | * Writing unit-tests |
---|
67 | |
---|
68 | * Write compiler-pass2.lisp to use WITH-CODE-TO-METHOD to select the |
---|
69 | method to send output to |
---|
70 | |
---|
71 | * |
---|
72 | |
---|
73 | |
---|
74 | The rest of the status is still to be described. |
---|
75 | |
---|