call | ||||
· Operation | Call a method | |||
· Format |
| |||
· Direct Format |
| |||
· Forms | call = 206 (0xCE) | |||
· Description | The call instruction effects a method
call to mptr. The call proceeds as follows:
| |||
· Notes | The mptr value is a 32-bit or 64-bit method
pointer reference. The call instruction does not set up a new frame pointer. The set_num_args instruction is used to set up local variable frames at the start of the new method's code. The return* instructions are responsible for popping the method arguments from the stack at method exit. | |||
· Exceptions | System.Security.VerificationException -- Raised if
the method could not be translated into CVM bytecode. |
call_ctor | ||||
· Operation | Call a constructor | |||
· Format |
| |||
· Direct Format |
| |||
· Forms | call_ctor = 207 (0xCF) | |||
· Description | The call_ctor instruction effects a method call to the constructor identified by mptr. | |||
· Notes | Constructors in the CVM system have two entry points: one
which creates a block of memory and then initializes it; and the
other which initializes a pre-allocated block. The particular
entry point is chosen based on the constructor's usage in the
original CIL bytecode:
|
call_interface | ||||||||||||
· Operation | Call an interface method | |||||||||||
· Format |
| |||||||||||
· Direct Format |
| |||||||||||
· Forms | call_interface = 213 (0xD5) | |||||||||||
· Description | The call_interface instruction effects an
interface method call. The value N indicates the
position of the this pointer on the stack:
1 indicates the top of stack, 2 indicates the stack word
just below the top-most stack word, etc. The value M
is the offset into the interface's vtable for the method. The value
cptr indicates the interface class pointer. | |||||||||||
· Notes | See the description of the call instruction for
a full account of frame handling, argument handling, etc. The cptr value is a native pointer that may be either 32 or 64 bits in size, depending upon the platform. | |||||||||||
· Exceptions | System.NullReferenceException -- Raised if
the this pointer is null .System.Security.VerificationException -- Raised if
the method could not be translated into CVM bytecode. |
call_native | |||||
· Operation | Call a native function that has a return value | ||||
· Format |
| ||||
· Direct Format |
| ||||
· Forms | call_native = 208 (0xD0) | ||||
· Stack | ..., address => ... | ||||
· Description | The call_native instruction effects a native function call to function, using cif to define the format of the function arguments and return value. The return value is stored at address. The arguments are assumed to have already been stored into the "native argument buffer" using the waddr_native* instructions. | ||||
· Notes | Both function and cif are native pointers,
which may be either 32 or 64 bits in size, depending upon the
platform. Native function calls occur in CIL "InternalCall" and "PInvoke" methods. For each such method, the CVM translation process creates a CVM stub method that transfers the arguments on the CVM stack to the native argument buffer, makes the native call, and then puts the function's return value back onto the CVM stack prior to exiting. |
call_native_raw | |||||
· Operation | Call a native function that has a return value, using a raw call | ||||
· Format |
| ||||
· Direct Format |
| ||||
· Forms | call_native_raw = 210 (0xD2) | ||||
· Stack | ..., avalue, rvalue => ... | ||||
· Description | The call_native_raw instruction effects a native function call to function, using cif to define the format of the function arguments and return value. The arguments are stored on the stack beginning at avalue. The return value is stored at rvalue. | ||||
· Notes | This instruction differs from call_native in the manner in which the call is performed. This instruction uses a "raw" call, which is only applicable on some platforms. The arguments are passed on the stack, instead of in a separate native argument buffer. |
call_native_void | |||||
· Operation | Call a native function with no return value | ||||
· Format |
| ||||
· Direct Format |
| ||||
· Forms | call_native_void = 209 (0xD1) | ||||
· Description | The call_native_void instruction is identical to call_native, except that the native function is assumed not to have a return value. |
call_native_void_raw | |||||
· Operation | Call a native function with no return value using a raw call | ||||
· Format |
| ||||
· Direct Format |
| ||||
· Forms | call_native_void_raw = 211 (0xD3) | ||||
· Stack | ..., avalue => ... | ||||
· Description | The call_native_void_raw instruction is identical to call_native_raw, except that the native function is assumed not to have a return value. |
call_virtual | ||||||||||
· Operation | Call a virtual method | |||||||||
· Format |
| |||||||||
· Direct Format |
| |||||||||
· Forms | call_virtual = 212 (0xD4) | |||||||||
· Description | The call_virtual instruction effects a
virtual method call. The value N indicates the
position of the this pointer on the stack:
1 indicates the top of stack, 2 indicates the stack word
just below the top-most stack word, etc. The value M
is the offset into the object's vtable for the method. | |||||||||
· Notes | See the description of the call instruction for a full account of frame handling, argument handling, etc. | |||||||||
· Exceptions | System.NullReferenceException -- Raised if
the this pointer is null .System.Security.VerificationException -- Raised if
the method could not be translated into CVM bytecode. |
cctor_once | |||
· Operation | Block the current method from being executed more than once | ||
· Format |
| ||
· Direct Format |
| ||
· Forms | cctor_once = 223 (0xDF) | ||
· Description | The cctor_once instruction is typically the first instruction in a static constructor. If this is the first time that the static constructor has been called, then the method will continue. Otherwise, the effect will be the same as for return. | ||
· Notes | This instruction permits CVM bytecode to call static constructors from anywhere in the system, without having to worry about whether it has already been called. This instruction will also prevent recursive static constructor calls from looping indefinitely. |
ldftn | |||||
· Operation | Load the address of a function method onto the stack | ||||
· Format |
| ||||
· Direct Format |
| ||||
· Forms | ldftn = 255, 23 (0xFF, 0x17) | ||||
· Stack | ... => ..., method | ||||
· Description | Push method onto the stack as a ptr
value. | ||||
· Notes | The method value may be either 32 or 64 bits in size, depending upon the platform. |
ldinterfftn | ||||||
· Operation | Load the address of an interface function method onto the stack | |||||
· Format |
| |||||
· Direct Format |
| |||||
· Forms | ldinterfftn = 255, 25 (0xFF, 0x19) | |||||
· Stack | ..., object => ..., address | |||||
· Description | Pop object from the stack as type ptr
and locate the virtual method at index within the object's
interface vtable for the interface class. The address of
this method is pushed onto the stack as type
ptr . | |||||
· Notes | The class value may be either 32 or 64 bits in size, depending upon the platform. |
ldvirtftn | |||||
· Operation | Load the address of a virtual function method onto the stack | ||||
· Format |
| ||||
· Direct Format |
| ||||
· Forms | ldvirtftn = 255, 24 (0xFF, 0x18) | ||||
· Stack | ..., object => ..., address | ||||
· Description | Pop object from the stack as type ptr
and locate the virtual method at index within the object's
vtable. The address of this method is pushed onto the stack
as type ptr . |
pack_varargs | |||||||
· Operation | Pack a set of arguments for a vararg method call | ||||||
· Format |
| ||||||
· Direct Format |
| ||||||
· Forms | pack_varargs = 255, 26 (0xFF, 0x1A) | ||||||
· Stack | ..., arg1, ..., argN => ..., array | ||||||
· Description | Pop N words from the stack and pack them
into an array of type System.Object . The first
value is the index of the first parameter in signature
that corresponds to a word on the stack. The num value is
the number of logical arguments to be packed. The final
array is pushed onto the stack as type ptr .
| ||||||
· Notes | The signature value may be either 32 or 64 bits in size,
depending upon the platform, and will usually include a sentinel
marker at position first - 1. The signature may not
have a sentinel marker if num is zero.
This instruction is used to pack the arguments for a call to a
|
push_thread | |||
· Operation | Push the thread identifier onto the native argument stack | ||
· Format |
| ||
· Direct Format |
| ||
· Forms | push_thread = 220 (0xDC) | ||
· Description | Pushes an identifier for the current thread onto the native argument stack. This is only used for "InternalCall" methods. "PInvoke" methods should use waddr_native_m1 instead. |
push_thread_raw | |||
· Operation | Push the thread identifier onto the native argument stack as a raw value | ||
· Format |
| ||
· Direct Format |
| ||
· Forms | push_thread_raw = 221 (0xDD) | ||
· Description | Pushes an identifier for the current thread onto the native argument stack. This is only used for "InternalCall" methods. This instruction differs from push_thread in that it is intended for use with call_native_raw instead of call_native. |
pushdown | ||||
· Operation | Push the ptr value at the top of
stack down and duplicate it twice | |||
· Format |
| |||
· Direct Format |
| |||
· Forms | pushdown = 222 (0xDE) | |||
· Stack | ..., val1, ..., valN, value => ..., value, value, val1, ..., valN | |||
· Description | The value at the top of the stack is popped, pushed down N stack words, and duplicated twice. | |||
· Notes | This instruction is used in combination with new
to construct a block of memory for a new object. The block
is allocated, and then pushed down. The lowest duplicated
value becomes the return value for the constructor method.
The other duplicated value becomes the this
argument for the constructor method. |
return | |||
· Operation | Return from the current method with no return value | ||
· Format |
| ||
· Direct Format |
| ||
· Forms | return = 214 (0xD6) | ||
· Description | Return control to the method that called the current
method, as follows:
| ||
· Notes | The set_num_args instruction has previously set the frame pointer to the address of the first argument. When return is executed, the first step above will pop all of the arguments. |
return_1 | |||
· Operation | Return from the current method with a single stack word as a return value | ||
· Format |
| ||
· Direct Format |
| ||
· Forms | return_1 = 215 (0xD7) | ||
· Description | Return control to the method that called the current
method, as follows:
| ||
· Notes | The set_num_args instruction has previously set the frame pointer to the address of the first argument. When return_1 is executed, the first step above will pop all of the arguments, with the single-word return value left in their place. |
return_2 | |||
· Operation | Return from the current method with two stack words as the return value | ||
· Format |
| ||
· Direct Format |
| ||
· Forms | return_2 = 216 (0xD8) | ||
· Description | Return control to the method that called the current
method, as follows:
| ||
· Notes | The set_num_args instruction has previously set the frame pointer to the address of the first argument. When return_2 is executed, the first step above will pop all of the arguments, with the double-word return value left in their place. |
return_n | ||||
· Operation | Return from the current method with n stack words as the return value | |||
· Format |
| |||
· Direct Format |
| |||
· Forms | return_n = 217 (0xD9) | |||
· Description | Return control to the method that called the current
method, as follows:
| |||
· Notes | The set_num_args instruction has previously set the frame pointer to the address of the first argument. When return_n is executed, the first step above will pop all of the arguments, with the n-word return value left in their place. |
set_num_args | ||||||||
· Operation | Set the number of arguments for the current method | |||||||
· Format |
| |||||||
· Direct Format |
| |||||||
· Forms | set_num_args = 66 (0x42) | |||||||
· Description | Set the frame pointer for the current method to the address of the N'th word down the stack. | |||||||
· Notes | This is typically the first instruction in a method, which sets up the local variable frame. |
tail_call | |||||
· Operation | Call a method using tail call semantics | ||||
· Format |
| ||||
· Direct Format |
| ||||
· Forms | tail_call = 255, 22 (0xFF, 0x16) | ||||
· Description | This instruction is identical to call, except that it performs a tail-optimized call to the method identified by mptr. |
waddr_native_<n> | ||||||||
· Operation | Set position n of the native argument buffer to the address of a local variable | |||||||
· Format |
| |||||||
· Direct Format |
| |||||||
· Forms | waddr_native_m1 = 241 (0xF1) waddr_native_0 = 242 (0xF2) waddr_native_1 = 243 (0xF3) waddr_native_2 = 244 (0xF4) waddr_native_3 = 245 (0xF5) waddr_native_4 = 246 (0xF6) waddr_native_5 = 247 (0xF7) waddr_native_6 = 248 (0xF8) waddr_native_7 = 249 (0xF9) | |||||||
· Description | Set position n of the native argument buffer to the address of local variable V. For an "InternalCall" method, 0 is the first argument. For a "PInvoke" method, -1 (m1) is the first argument. |
Copyright © Southern
Storm Software Pty Ltd 2002
Licensed under GNU FDL