StaticCalls

When an invokestatic call is linked, the actual target method is determined, and its address is patched directly into the caller.

An invokespecial call is treated exactly the same, except that the receiver argument is null-checked before control is transferred to the target method.

In the interpreter, this means the method (as a methodOop) is patched into the constant pool cache entry used by the instruction. If several instructions share a single CP cache entry, the first one executed performs linking for them all.

In compiled code, the call instruction is patched to the compiled entry point of the target method. If the target method is not (yet) compiled, adapter code takes execution back into the interpreter.

(Note that argument transmission is mostly stack-based in the interpreter. In compiled code, arguments are passed in registers when possible, similarly to other compiled languages. There should be a wiki page on this.)

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact