methodHandles, MethodOops and Method*
Nils Eliasson
nils.eliasson at oracle.com
Tue Dec 11 06:01:30 PST 2012
Looking at the compiler code I see two patterns, which one is correct?
Which one should we use?
When we access things in a Method* from CompilerOracle we transition to
native and use methodHandles.
check_is_loaded(); // check that ciMethod is loaded
VM_ENTRY_MARK; // Transition to VM from Native
methodHandle mh(THREAD, get_Method()); // create a handle to a Method*
(methodOop with permgen)
But in other places I see a shorter form:
bool force_inline() { return get_Method()->force_inline(); }
Pre-permgen-removal - I belive the first example was the correct way to
do things. We need to transition to VM-running, and to do that we need a
methodHandle to the MethodOop to keep it from being reclaimed while we
are looking at it. But how are things supposed to work post-permgen? Do
we still need the methodHandle or is it direct access allowed like in
the 2nd example?
//Nils E
More information about the hotspot-compiler-dev
mailing list