'this' is passed as the first item on the stack. so that you can save it in a local variable with jvm ALOAD and ASTORE instructions.
For example, the following code generates the corresponding jvm instructions.
public void test() { Test var1 = this; Test var2 = this; } ALOAD 0 ASTORE 1 ALOAD 0 ASTORE 2 RETURN
source share