Contents Prev Next Up


The Virtual Machine Instruction Set


Function Return

ireturn
lreturn
freturn
dreturn
areturn
return

ireturn

Return integer from function

..., value => [empty]

value should be an integer. The value value is pushed onto the stack of the previous execution environment. Any other values on the operand stack are discarded. The interpreter then returns control to its caller.

[Note: this may be confusing to people expecting that the stack is like the C stack. However, the operand stack should be seen as consisting of a number of discontiguous segments, each corresponding to a method invocation. A return instruction empties the Java operand stack segment corresponding to the activity of the returning invocation, but does not affect the segment of any parent invocations.]]

lreturn

Return long integer from function

..., value-word1, value-word2 => [empty]

value should be a long integer. The value value is pushed onto the stack of the previous execution environment. Any other values on the operand stack are discarded. The interpreter then returns control to its caller.

freturn

Return single float from function

..., value => [empty]

value should be a single precision floating point number. The value value is pushed onto the stack of the previous execution environment. Any other values on the operand stack are discarded. The interpreter then returns control to its caller.

dreturn

Return double float from function

..., value-word1, value-word2 => [empty]

value should be a double precision floating point number. The value value is pushed onto the stack of the previous execution environment. Any other values on the operand stack are discarded. The interpreter then returns control to its caller.

areturn

Return object reference from function

..., value => [empty]

value should be a handle to an object or an array. The value value is pushed onto the stack of the previous execution environment. Any other values on the operand stack are discarded. The interpreter then returns control to its caller.

return

Return (void) from procedure

... => [empty]

All values on the operand stack are discarded. The interpreter then returns control to its caller.


Contents Prev Next Up

Generated with CERN WebMaker