There are several virtual machines in Harmony project and none of them provides subroutine verification for Java bytecode. I would like to discuss appropriate methodology of subroutine verification.
In Java bytecode, subroutines represent code in "finally" construction. The use of such subroutines makes bytecode analysis very difficult. Fortunately, modern compilers eliminate usage of subroutines through inlining. Subroutine verification approach described in the Java Virtual Machine Specification 2nd Edition has a fundamental limit and rejects a legal Java code. The limit is inherent to approach of tracking modified variables and selectively propagating from ret to jsr instructions. A possible approach is to inline subroutines for bytecode verification. After inlining, the simpler data flow analysis can be run. In certain cases it's not clear how to define subroutine boundaries for inlining so in general, some analysis is needed to define subroutines' boundaries. The question is whether it is better to inline subroutines and then run a simpler data flow analysis, or to run directly a more complex data flow analysis. -- Best regards, Pavel Rebriy
