Show newer

: This stack trace makes me quite happy! Now I can more easily see where that fatal bad thing happened in the code my VM is executing (since parsing debug messages was really difficult and messy)! But so happy and it actually gives more detail than Java SE!

: I could be a mean girl, but I am just going to fold and support ASCII for my project even though it is not required at all by the standard library! LOL! I do not know if there are programs for J2ME which actually use ASCII though.

: The fun part of the library that will be implemented now will be encodings! Luckily only ISO-8859-1 and UTF-8 are required!

: So to handle this, the interpreter I am writing right now will need to keep track in a global table all of the objects which were created to represent these constant strings. It does not really matter how I initialize them, as long as they are the same objects.

Show thread

: Any strings which are constant at compile time, if the characters are exactly the same then they refer to the same String object even if the constants are used in different classes. So if __v is "aaa" passed in from another class, then "aaa" == __v is true.

: I hit into the weirdest bug. Checking over my code in Throwable there were some logic errors but that was not the reason, although I did fix them. Turns out I was using the wrong length for IINC (should be 3, not 2). So I got extra ACONST_NULL which did bad things.

: Throwable is initialized with a stack trace when it is created, however this might not be a fast operation at all. To make it as fast as I can, I will obtain very raw basic stack trace information. When it comes time to pretty print it, is when the slow stuff comes.

: Have my first infinite loop. I have an error `TODO` which I used to signal a fatal incomplete code (I like to fail fast). Since `TODO` is an error it initializes `Throwable` then `Error`. However `Throwable` is not implemented and throws a `TODO`.

: Time to implement monitors in this virtual machine (used by `synchronized`). Monitors are your basic re-entrant locks which also act as memory barriers. If a thread attempts to lock a monitor which is already taken it will wait until it is freed.

: The first Java byte code that is probably going to be executed in my training VM is ALOAD0, which loads a reference (Object) from local variable zero and places it on the stack. Yay!

The code being executed is going to crash horrible because objects do not exist!

: Taking a different approach to implementing this entry level training virtual machine I am building, it is going on with as needed basis and I am making a bunch of assumptions just to get it done.

Xer Shadow Tail ☄️🌺's choices:

Awoo Space

Awoo.space is a Mastodon instance where members can rely on a team of moderators to help resolve conflict, and limits federation with other instances using a specific access list to minimize abuse.

While mature content is allowed here, we strongly believe in being able to choose to engage with content on your own terms, so please make sure to put mature and potentially sensitive content behind the CW feature with enough description that people know what it's about.

Before signing up, please read our community guidelines. While it's a very broad swath of topics it covers, please do your best! We believe that as long as you're putting forth genuine effort to limit harm you might cause – even if you haven't read the document – you'll be okay!