Skip to content

Conversation

@hankluo6
Copy link
Collaborator

@hankluo6 hankluo6 commented Aug 7, 2022

This patch handle fields and methods existing in the parent class. If fields or methods are not found in the class, pitifulvm will try to find them from the parent class recursively. Also, ensure all constructors and static initialization are executed in order.

If fields or methods are not found in the class, pitifulvm will try
to find them from the parent class recursively.

Note that ptitfulvm have not supported objects' fields in the parent
class yet, so `getfield` and `putfield` still don't find fields from
the parent class.

Add a new test script: "Inherit.java"
In `new` opcode, jvm needs to call constructor and initialization
in order. The sequence is begin at base class static initialization,
and then derived class static initialization. After all classes are
initialized, base class constructor will be executed, then execute
its child class constructor.

Add a new test script: Initializer.java
@jserv jserv merged commit 7331be2 into sysprog21:master Aug 7, 2022
@hankluo6 hankluo6 deleted the inheritance branch August 9, 2022 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants