3 ***DISCLAIMER***: _These notes are from the defunct k8 project which_
4 _precedes SquirrelJME. The notes for SquirrelJME start on 2016/02/26!_
5 _The k8 project was effectively a Java SE 8 operating system and as such_
6 _all of the notes are in the context of that scope. That project is no_
7 _longer my goal as SquirrelJME is the spiritual successor to it._
11 The main thing is determining the best way to represent structure data. A
12 recursive linked hash map would work well, or rather a tree.
16 The best thing to do, is have individual classes for each attribute (since
17 they are not really going to change much). However, class generation is
18 complex so I will instead take the language structures which will generate
19 Java code which can read an input structure (or rather "memory map" over it)
20 and provide structure information from it. However, it would also have to be
21 capable of recursiven natures, so that would mean that each struct is a
22 specially named class with specific members inside of it. I would like the
23 structures able to be modified as needed. So I should go through the attribute
24 markups that I have and do some renaming to make things a bit better Java
29 A base class which represents a view of a structure (with no getters and
30 setters, but starts with a ByteBuffer, offset, and range). Then the actual
31 attribute classes extend off that one for each individual attribute. Since
32 there are so many attributes, for pollution reduction I will have the base
33 class in file but will place all the attributes in respective subpackages.
37 I could always just ignore attributes and handle them specifically when needed
38 during any code translation. Loading all of the class related structures and
39 parsing languages would be slow anyway, as the class loading needs to be very
44 Loading a class file, then running the stuff through a translator to better
45 represent the class, then after that running a compiler translation on it will
46 be a bit slow. Would be best to one shot it efficiently, and remove any
47 dependence on the constant pool. However, it would be best to have it load
48 into a generic byte code information syntax layout first, then have
49 compilation run through that. But that information would have no constant pool
50 stuff and can have the class fully verified and ready to go. Keeping it in an
51 abstract format would help for any potential inlining and optimization.
55 In fact, the class information should be able to be used like a factory so
56 that things are made easier. In the future, I will have to dynamically create
57 classes at run-time like proxy classes and such. In that case, I can just
58 create a blank ClassFormat that implements all the desired interfaces, add a
59 bunch of methods that execute the proxy object, then perform native
60 compilation on it. So the ClassFormat class will require a factory-like
61 builder from a stream of bytes.
65 Well, the class file is very dependent on the constant pool.