MethodHandles

Version 3 by john.rose
on Jul 18, 2008 22:51.

compared with
Current by john.rose
on Jul 19, 2008 01:27.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (11)

View page history

h3. Calling Sequences
Method handle calling sequence is a variation of the virtual calling sequence. (The gory details [are documented elsewhere|[HotSpotInternals:CallingSequences].) The caller sets up the call as if the method handle were the receiver of a virtual call (which is nominally {{invoke}}).

Control is transferred to a location fetched from the method handle. This location is the method handle's __call handler__. The call handler serves for both interpreted and compiled calls. It is called directly from compiled code, and indirectly (after a load with a short negative displacement) from the interpreter.
{noformat:title=simplest call to a non-constant method handle}
callSite:
set #callSiteType, CHECK
load (MH + #handler), TEM
call (TEM)
---
callHandler:
cmp (MH + #type), CHECK
jump,ne wrongMethodType
load (MH + #method), METHOD
load (METHOD + #compiledEntry), TEM
jump (TEM)
---
compiledEntry:
...
...
{noformat}

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