List of High-Level IR opcodes used in Jitrino.OPT compiler:
Use this link for details on type system used in Jitrino.OPT compiler
Op_MulHi - Gets high part of multiply.
Op_Min - Compares src1 and src2 and stores minimal value to dst. Modifiers: none
Op_Max - Compares src1 and src2 and stores maximal value to dst. Modifiers: none
Op_Abs - Stores absolute value of src1 to dst. Modifiers: none
Op_And - A bitwise AND takes src1 and src2 operands of equal size and performs the logical AND operation on each pair of corresponding bits storing the result to dst. In each pair, the result is 1 if the first bit is 1 AND the second bit is 1. Otherwise, the result is 0. Modifiers: none
Op_Or - A bitwise OR takes src1 and src2 operands of equal size and performs the logical OR operation on each pair of corresponding bits storing the result to dst. In each pair, the result is 1 if the first bit is 1 OR the second bit is 1 OR both the first and the second bits are 1. Otherwise, the result is 0. Modifiers: none
Op_Xor - A bitwise XOR takes src1 and src2 operands of equal size and performs the logical XOR operation on each pair of corresponding bits storing the result to dst. In each pair, the result is 1 if the two bits are different, and 0 if they are the same. Modifiers: none
Op_Not - A bitwise NOT takes src1 and performs the logical NOT operation storing the result to dst. For each bit that was 0 the result is 1. For each bit that was 1 the results is 0. Modifiers: none
Op_Select - Selects a value: (src1 ? src2 : src3).
Op_Conv - Converts src1 to dst using type information provided as a parameter. Must not be used for conversion of managed pointers to Unmanaged Pointers and via versa. Modifiers: OverflowModifier, ExceptionModifier
Op_ConvZE - Converts src1 to dst using type information provided as a parameter. If the size of dst of greater that the size of src1 all extra bits are filled with 0. Must not be used for conversion of managed pointers to Unmanaged Pointers and via versa. Modifiers: OverflowModifier, ExceptionModifier
Op_ConvUnmanaged - Converts src1 from managed memory pointer type to unmanaged memory pointer type or via versa and stores the result of conversion to dst. Modifiers: none.
Op_Cmp3 - 3-way compare, e.g.: ((s0>s1)?1:((s1>s0)?-1:0)). For floats, exactly 1 of the two comparisons is unordered. Modifiers: ComparisonModifier. The modifier in the instruction applies to the first test.
Op_Branch - There are two types of instructions with this opcode. For the first if the src1 is not 0 the branch pointed by label operand is taken. The second version of the instruction combines both Op_Cmp and the first version of this operation. It takes two src1 and src2 operands, compares them and jumps to the label block if comparison condition is 'true'. Modifiers: ComparisonModifier
Op_Jump - Unconditional jump to a node pointer by the label operand. Modifiers: none.
Op_Switch - Takes src1, labels and defaultLabel operands and jumps to the label with the index stored in src0. If the src1 is out of the labels range, a jump to the defaultLabel is used.
Op_DirectCall - A direct call to a Java method. Takes the list of method's parameters and two tau operands to ensure that this is not null and all parameter types are checked. Stores the result of the call to dst operand. Modifiers: ExceptionModifier
Op_TauVirtualCall - - A virtual call to a Java method. Takes the list of method's parameters and two tau operands to ensure that this is not null and all parameter types are checked. Stores the result of the call to dst operand. Modifiers: ExceptionModifier
Op_IndirectCall - An indirect call to an arbitrary native method. Takes the address of the call as src1 operand, the list of method's parameters and two tau operands to ensure that the first operand is not null and types for operands are checked. Stores the result of the call to dst operand. Modifiers: ExceptionModifier
Op_Return - A result of the current method. Uses 1 or no operands as return operands. Modifiers: none.
Op_Catch - Stores exception object to dst operand. Usually this is the first inst (except label and phi insts) in a catch block. Modifiers: none.
Op_JSR - An unconditional branch to a subroutine. Modifiers: none.
Op_Ret - A return from a subroutine called with Op_JSR instruction. Modifiers: none.
Op_SaveRet - Prepares an operand for saving result of subroutine. Modifiers: none.
Op_Copy - Creates a copy of an operand. No conversion is applied. Modifiers: none.
Op_LdRef - Loads constant String or reference address. The index of the contant in a method's metadata structure (constant pool index in case of Java) and the type of the resulted value are provided as parameters.
Op_LdVar - Loads temporary src1 operand into var operand
Op_LdVarAddr - Loads address of a var operand into dst operand. The type of the result is a managed pointer to source var operand's type.
Op_TauLdInd - Gets address of a value as src1 operand and 2 taus to ensure that address is in valid range and this pointer for the loaded field is not null. Loads the value referenced by src0 operand and returns it as a result.
Op_LdStatic - Loads a value of a static field into dst operand. No null check is needed.
Op_TauLdElem - Loads a value stored in array operand of array type located by the index parameter value. Uses 2 tau operandsto ensure that array is not null and the index is not out of bounds.
Op_LdFieldAddr - For the provided base and field_handle operands returns the address of a field.
Op_LdStaticAddr - For the field_handle operand of the static field returns the address of a field.
Op_LdElemAddr - Loads an address of array element referenced by array and index parameters
Op_TauLdVTableAddr - Returns an address of VTable structure for the provided base operand of object type.
Op_TauLdIntfcVTableAddr - Returns an address of interface VTable structure for the provided base operand of object type. The interface type is provided as a second type parameter.
Op_TauLdVirtFunAddr - For the given VTable address and method handle loads the address of the method. Uses 1 tau parameter to ensure that VTable does really have a pointer to the method.
Op_TauLdVirtFunAddrSlot -For the given VTable address and method handle loads the offset of the method in VTable. Uses 1 tau parameter to ensure that VTable does really have a pointer to the method.
Op_LdFunAddr - Loads address of the memory location that contains function address.
Op_GetVTableAddr - Obtains the address of the VTable for a particular object type provided as a parameter.
Op_TauArrayLen - Gets arrays pointer as a parameter and returns a length of the array. Uses 2 tau parameters to ensure that pointed object type is array and that it's not null.
Op_LdArrayBaseAddr - Load the base (zero'th element) address of array.
Op_AddScaledIndex - Add a scaled index to an array element address
Op_StVar - Stores var operand into temporary dst operand.
Op_TauStInd - Stores the src operand into memory area referenced by ptr operand. Uses 3 tau operands to ensure that that object pointed by ptr is not null, the type of src operand matches the type of the field pointed by ptr operand and that address pointer by ptr operand is in valid range. Modifiers: StoreModifier
Op_TauStElem - Stores src value as index element of array parameter. Uses 3 tau operands to ensure that array is not null, src type is checked to match the element type and index is not is out of bounds. Modifiers: StoreModifier
Op_TauStStatic - Stores src value into static field referenced by field_handle parameter.
Op_TauStRef - A high-level version of TauStInd that also has a pointer to an dst object referenced by ptr operand and can be used for a mode with write barriers support, when the addresses of both src and dstobjects must be reported.
Runtime exception check instructions:
// all of these take ExceptionModifier
Op_TauCheckBounds - Takes index and array length arguments, the overflow modifier == none indicates that 0<=idx*element_size<2^31
Op_TauMonitorEnter - Locks monitor for the given object. The object must not be null.
// this could take an ExceptionModifier
Op_TypeMonitorEnter - Locks monitor for the given class (type) object.
// cast takes an ExceptionModifier
Op_TauStaticCast - Compile-time assertion. Asserts that cast is legal.
Op_TauAsType - Returns casted object if argument is an instance of, or return null otherwise.
Op_TauInstanceOf - Returns true if argument is a non-null instance of type T
Op_TauHasType- Returns tau that the cast is safe.
Op_TauIsNonNull - Returns tau that can be used to prove that argument is not null
Op_InitType - Initialize type before static method invocation or field access. For Java language it means that <clinit> will be called for an uninitialized class. Nothing happened if a class is already initialized.
Labels & markers:
Op_Label - A special label instructions for branch labels, finally, catch blocks. Every node in HIR must start with this instruction.
Op_MethodEntry - Method entry label. Used to mark inlined methods boundaries.
Op_MethodEnd - Method end label. Used to mark inlined methods boundaries.
Profile instrumentation instructions:
Op_IncCounter - Increment edge profile profile counter by 1. The counter's key provided as an argument is used to derive the address of a counter. If the key == 0, entry counter address is used.
Op_Prefetch - Prefetches a given memory location.
Compressed Pointer instructions:
Op_UncompressRef - Performs uncompress operation for compressed_ref, e.g. uncompressed_ref = (compressed_ref<<s) + heapbase
Op_LdFieldOffset - Loads field offset from the start of the object.
Op_LdFieldOffsetPlusHeapbase - Loads field offset and adds heapbase to it.
Op_LdArrayBaseOffset - Loads the offset of array base.
Op_LdArrayBaseOffsetPlusHeapbase - Offset of array base plus heap base.
Op_LdArrayLenOffset - Returns offset of array length field.
Op_LdArrayLenOffsetPlusHeapbase - Returns offset of array length field plus heap base.
Op_AddOffset - Adds offset to uncompressed reference.
Op_AddOffsetPlusHeapbase - Uncompresses compressed reference and adds field offsets to result.