I am trying to implement a subset of Java for an academic study. Well, I\'m in the last stages (code generation) and I wrote a rather simple program to see how method arguments
aload_0 is supposed to push 'this' on to the stack
Not quite … aload_0
reads the first reference argument (or, more generally, the first local reference variable) of the method and pushes it onto the stack.
In member functions, the first local variable happens to be the this
reference.
But main
is not a member function, it’s a static function so there is no this
argument, and the true first argument of the method is args
.