2016/04/05

09:17

My missing collections needs an empty map.

09:41

If I use Reference and ReferenceQueue for object registration, then I can have it where objects which exist in the virtual machine may be garbage collected by the host virtual machine. So if a virtual object does get garbage collected on the host virtual machine then it should be gone in the target virtual machine. This saves implementing a garbage collector in the interpreter. I can also do the same with loaded classes. Classes which are no longer referenced by any object would go away. However, I already do that, I will just need a ReferenceQueue to know when classes go away.

15:33

Going to need a bunch of wrapped exceptions so to speak.

15:36

I need a slight refactor. I should have the loaded class code and the class initialization and finder stuff in its own class. I have JVMClassPath but perhaps it should become JVMClassPathElement. Then the JVMClassPath will manage loaded classes and will be able to handle arrays and such. This way, all classes are handled by the class path stuff and the engine is free of class initialization and such, sort of. I can extend the locks too, so that each individual part has its own lock. This way when multiple threads run, only one can use the classpath at a time, but if one is not even looking up classes they do not have to wait around for it. I will also add an object mananger which keeps the reference of objects which exist as stated earlier today. Instead of having new instance in the class, I can instead have the object manager handle creation of instances and stuff such as arrays. I should also perhaps when the object is an array, instead of conditional object I can instead have a class called JVMArray. This way JVMObject is not cluttered with the conditional case of arrays. However, arrays would still be objects, just the array objects will be wrapped. The only thing I do not like is the engine which has everything in it, it would be best split off.