Java Reference
In-Depth Information
D.5.3
Method Instructions
Mnemonic
Operation
Operand Stack
invokevirtual Invoke instance method;
dispatch based on class
;objectref; [arg1; [arg2]] )
invokeinterface Invoke interface method ;objectref; [arg1; [arg2]] )
invokespecial Invoke instance method;
special handling for su-
perclass, private, and
instance initialization
method invocations
;objectref; [arg1; [arg2]] )
invokestatic Invoke
a
class
(static)
; [arg1; [arg2]] )
method
invokedynamic Invoke instance method;
dispatch based on class
;objectref; [arg1; [arg2]] )
The above instructions can be added to the code section of a method by sending the
CLEmitter instance the following message:
publicvoidaddMemberAccessInstruction(intopcode,
Stringtarget,
Stringname,
Stringtype)
where opcode is the mnemonic of the instruction to be added, target is the name (in
internal form) of the class to which the method belongs, name is the name of the method,
and type is the type descriptor of the method.
Mnemonic
Operation
Operand Stack
ireturn Return int from method ;value ) [empty]
lreturn Return long from method ;value ) [empty]
freturn Return float from
method
;value ) [empty]
dreturn Return double from
method
;value ) [empty]
areturn Return
reference
from
;objectref ) [empty]
method
return Return void from method ) [empty]
The above instructions can be added to the code section of a method by sending the
CLEmitter instance the following message:
publicvoidaddNoArgInstruction(intopcode)
where opcode is the mnemonic of the instruction to be added.
 
Search WWH ::




Custom Search