9 I should make it so that `JVMClass` can temporarily be mutable (when it is
10 partially loaded) then once I am done constructing it, it can be made
11 immutable. I could then remove some data locks when accessing classes for
12 example. I could also split off instance related information and have an
13 instance state in the virtual machine also. Instead of having the interpreter
14 bits built into the `JVM` code, I can branch it off and have a base engine
15 for it. So essentially, I would be forking the code so to speak. Thus, what
16 I have now with the compiler bits will go into its own project. There would
17 only be things needed for loading classes and such, stuff which the compiler
18 can use but not what the interpreter should use. The compiler generally is
19 not going to need to create new instances of strings and create arrays and
20 threads for example, it just wants to pass through the code. This would also
21 act as separation which would be good too. If the interpreter engine needs to
22 be rewritten then there is no need to worry about interfering with the code
23 that is part of the compiler.
27 Also my list of errors is getting a bit cumbersome, so I need a better way to
28 store the dictionary of sorts. At least when moving the code over I will
29 potentially have to reassociate all of the error codes and prune them as
30 needed. However, the most likely case is that most parts of the current
31 interpreter namespace become part of the compiler base. Thus, performing these
32 changes should result in cleaner and better to maintain code. For the mutable
33 and immutable `JVMClass` variants, I will have a base class for classes and
34 then derive a partial and complete from them. The compiler will just know
35 about loaded classes, the interpreter would keep a cache of the classes as
36 they are loaded into memory (one which the virtual machine would expect).
40 When it comes to the error codes, I can use special JavaDoc tags and put the
41 error codes in the method description where the error is thrown. Then I can
42 write a script which reads source code and then extracts those error codes and
43 places them into a list.
47 Would also have to do the same thing with class members too, so that they are
48 mutable and can be partially loaded also.
52 I would suppose that the class loading code should be part of the base code.
56 Looks like Java 9 will be released later this year. But regardless of that, it
61 Also instead of `java-interpreter` and `java-interpreter-local` it will just be
62 the former with the base class stuff split off as required.
66 I can also split off the code parser and the compiler core (the program stuff)
67 from the base class loading stuff.
71 Now that the code has been moved, I just need to fix it all up with my new plan
72 that I have written earlier today. The first hurdle would be to fixup the class
73 file handler since it has at least 100 errors. However once the basic layout
74 is fixed and such, it should be better. When it comes to programs the class
75 file handler will just not touch that at all. Thus the program and the
76 class file support would essentially be standalone except the program needs
77 stuff such as the constant pool for example when the byte code and other things
78 are parsed. `CFClass` will be immutable and the class file parser will just
79 build it instead. The eventual fixup of the interpreter will have its own
80 notion of the class and its state. This way the class file code and the
81 program parser code remain cleaner and simpler.
85 This means the class file parser does not need locks at all.