over-eager verification
Per Bothner
per@bothner.com
Mon Mar 4 20:58:00 GMT 2002
If I understand the code right, _Jv_PrepareClass calls _Jv_VerifyMethod
on each method. This may have made sense when we were trying to debug
the verifier, but at this point it seems overkill: We should verify a
method the first time it is invoked, not when its class is prepared,
since since most methods will never get called.
Implementing this seems easy enough: Just add a 'verified' flag to
_Jv_InterpMethod, and check this flag in _Jv_InterpMethod::run.
The only complication I can see is that we have to synchronize so
we only verify once. Easiest I assume would be to synchronize on
the class containing the method, since I assume we can't synchronize
on the method itself.
A refinement is to use different native code trampolines depending
on whether the code is verified or not, but I doubt it's worth it,
When we add a JIT, then we'll want do the verification just before
the JIT-compilation. (Actually, ideally verfication should be done
in conjunction with JIT-compilation, since a JIT will need the type
information that the verifier has recoved.)
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/
More information about the Java
mailing list