SquirrelJME/SquirrelJME

View on GitHub
assets/developer-notes/stephanie-gawroriski/2016/09/06.mkd

Summary

Maintainability
Test Coverage
# 2016/09/06

## 06:44

Actually, determining if `SUPER` becomes `VIRTUAL` has to be done at link time
since I do not know if a class is a superclass of one.

## 07:30

Invocation of methods will be handling cached stack values.

## 08:13

So I have basic stack caching right now since the `this` in a constructor call
has been cached.

## 09:02

Forgot about removing stack entries.

## 09:08

And return values.

## 09:56

So as I planned before, method linking will have a source method and a target
method, which are both method references along with their linkage type. This
would reduce the amount of space required.

## 10:20

One thing I can do for speed is have prelinking of the JVM namespace.

## 11:51

I actually need a bulk pop. It will be performed before a method call and
will return all of the cached registers that should be used. That will be used
to access the cache system. The reason I need to do this is because there can
be cached values which are additionally cached on the stack (in the case of
`DUP`), and as such if any previous entry refers to one that is popped it must
be copied before it is lost completely.

## 12:29

I should make the build system truly determinstic along with the binary output
system also being deterministic. This means having no hash cookie that depends
on the time. One issue with that though is that the output ZIP file would have
the current time associated with it when I do support such things. Then the
build order given to by the builder can be sorted also. I would suppose I can
write a simple red-black tree. Although I will need a `Map` and a `Set`. I
can layer one upon the other. In general though a `Map` is layered on a `Set`
of entries.

## 13:15

It would likely be best if the red-black tree were left leaning, since based
on a paper such a tree is much simpler to implement and would be more sane in
the long run.

## 17:43

Actually it might be best to reverse course and have the Set implemented on
top of the map, although it really does not matter. Likely using the set might
be a bit cleaner.

## 17:46

It is interesting that Robert Sedgewick revisited his own algorithm after so
many years, that is dedication.

## 18:02

Actually it might be best to swap it and have it use the map as the base so I
can have `get` and `put`.

## 18:21

Although it really does not matter at all.

## 20:38

Tree iteration is just going right. If there is no right then go up until the
next right is found and then go down all the way left. This is how it is done
without a queue.