Differences between revisions 22 and 23
Revision 22 as of 2008-06-05 12:12:10
Size: 20320
Comment:
Revision 23 as of 2009-09-20 21:55:21
Size: 20432
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
Use [:Jitrino_OPT/types: this] link for details on type system used in Jitrino.OPT compiler Use [[Jitrino_OPT/types| this]] link for details on type system used in Jitrino.OPT compiler
Line 6: Line 6:
 * [:Jitrino_OPT/opcodes/Add: Op_Add] - Adds ''src1'' and ''src2'' operands and stores the result to ''dst''. Modifiers: OverflowModifier, ExceptionModifier
 * [:Jitrino_OPT/opcodes/Mul: Op_Mul] - Multiplies ''src1'' and ''src2'' operands and stores the result to ''dst''. Modifiers: OverflowModifier, ExceptionModifier
 * [:Jitrino_OPT/opcodes/Sub: Op_Sub] - Substracts ''src2'' from ''src1'' operands and stores the result to ''dst''. Modifiers: OverflowModifier, ExceptionModifier
 * [:Jitrino_OPT/opcodes/TauDiv: Op_TauDiv] - Divides ''src1'' by ''src2'' and stores the results to ''dst''. Uses ''tau'' operand to ensure that that 0/overflow cases were checked before. Modifiers: SignedModifier
 * [:Jitrino_OPT/opcodes/TauRem: Op_TauRem] - Computes residue of division of ''src1'' by ''src2'' and stores the results to ''dst''. Uses ''tau'' operand to ensure that that 0/overflow cases were checked before. Modifiers: SignedModifier
 * [:Jitrino_OPT/opcodes/Neg: Op_Neg] - Negates the ''src1'' operands and stores the result to ''dst''. Modifiers: SignedModifier
 * [:Jitrino_OPT/opcodes/MulHi: Op_MulHi] - Gets high part of multiply.
 * [:Jitrino_OPT/opcodes/Min: Op_Min] - Compares ''src1'' and ''src2'' and stores minimal value to ''dst''. Modifiers: none
 * [:Jitrino_OPT/opcodes/Max: Op_Max] - Compares ''src1'' and ''src2'' and stores maximal value to ''dst''. Modifiers: none
 * [:Jitrino_OPT/opcodes/Abs: Op_Abs] - Stores absolute value of ''src1'' to ''dst''. Modifiers: none
 * [[Jitrino_OPT/opcodes/Add| Op_Add]] - Adds ''src1'' and ''src2'' operands and stores the result to ''dst''. Modifiers: OverflowModifier, ExceptionModifier
 * [[Jitrino_OPT/opcodes/Mul| Op_Mul]] - Multiplies ''src1'' and ''src2'' operands and stores the result to ''dst''. Modifiers: OverflowModifier, ExceptionModifier
 * [[Jitrino_OPT/opcodes/Sub| Op_Sub]] - Substracts ''src2'' from ''src1'' operands and stores the result to ''dst''. Modifiers: OverflowModifier, ExceptionModifier
 * [[Jitrino_OPT/opcodes/TauDiv| Op_TauDiv]] - Divides ''src1'' by ''src2'' and stores the results to ''dst''. Uses ''tau'' operand to ensure that that 0/overflow cases were checked before. Modifiers: SignedModifier
 * [[Jitrino_OPT/opcodes/TauRem| Op_TauRem]] - Computes residue of division of ''src1'' by ''src2'' and stores the results to ''dst''. Uses ''tau'' operand to ensure that that 0/overflow cases were checked before. Modifiers: SignedModifier
 * [[Jitrino_OPT/opcodes/Neg| Op_Neg]] - Negates the ''src1'' operands and stores the result to ''dst''. Modifiers: SignedModifier
 * [[Jitrino_OPT/opcodes/MulHi| Op_MulHi]] - Gets high part of multiply.
 * [[Jitrino_OPT/opcodes/Min| Op_Min]] - Compares ''src1'' and ''src2'' and stores minimal value to ''dst''. Modifiers: none
 * [[Jitrino_OPT/opcodes/Max| Op_Max]] - Compares ''src1'' and ''src2'' and stores maximal value to ''dst''. Modifiers: none
 * [[Jitrino_OPT/opcodes/Abs| Op_Abs]] - Stores absolute value of ''src1'' to ''dst''. Modifiers: none
Line 17: Line 17:
 * [:Jitrino_OPT/opcodes/And: 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
 * [:Jitrino_OPT/opcodes/Or: 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
 * [:Jitrino_OPT/opcodes/Xor: 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
 * [:Jitrino_OPT/opcodes/Not: 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
 * [[Jitrino_OPT/opcodes/And| 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
 * [[Jitrino_OPT/opcodes/Or| 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
 * [[Jitrino_OPT/opcodes/Xor| 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
 * [[Jitrino_OPT/opcodes/Not| 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
Line 22: Line 22:
 * [:Jitrino_OPT/opcodes/Select: Op_Select] - Selects a value: (''src1'' ? ''src2'' : ''src3'').  * [[Jitrino_OPT/opcodes/Select| Op_Select]] - Selects a value: (''src1'' ? ''src2'' : ''src3'').
Line 24: Line 24:
 * [:Jitrino_OPT/opcodes/Conv: 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
 * [:Jitrino_OPT/opcodes/ConvZE: 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
 * [:Jitrino_OPT/opcodes/ConvUnmanaged: 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.
 * [[Jitrino_OPT/opcodes/Conv| 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
 * [[Jitrino_OPT/opcodes/ConvZE| 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
 * [[Jitrino_OPT/opcodes/ConvUnmanaged| 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.
Line 28: Line 28:
 * [:Jitrino_OPT/opcodes/Shladd: Op_Shladd] - Shifts 'src1' by ''src2'' bits left, adds ''src3'' to the result of the shift and stores the result to ''dst''. The ''src2'' must be an LdConstant result. Modifiers: none
 * [:Jitrino_OPT/opcodes/Shl: Op_Shl] - Shifts 'src1' left by ''src2'' bits left and stores the result in 'dst'. Modifiers: ShiftMaskModifier
 * [:Jitrino_OPT/opcodes/Shr: Op_Shr] - Shifts 'src1' left by ''src2'' bits right and stores the result in 'dst'. Modifiers: ShiftMaskModifier
 * [[Jitrino_OPT/opcodes/Shladd| Op_Shladd]] - Shifts 'src1' by ''src2'' bits left, adds ''src3'' to the result of the shift and stores the result to ''dst''. The ''src2'' must be an LdConstant result. Modifiers: none
 * [[Jitrino_OPT/opcodes/Shl| Op_Shl]] - Shifts 'src1' left by ''src2'' bits left and stores the result in 'dst'. Modifiers: ShiftMaskModifier
 * [[Jitrino_OPT/opcodes/Shr| Op_Shr]] - Shifts 'src1' left by ''src2'' bits right and stores the result in 'dst'. Modifiers: ShiftMaskModifier
Line 32: Line 32:
 * [:Jitrino_OPT/opcodes/Cmp: Op_Cmp] - Compares ''src1'' and ''src2'' and stores the result of comparison to ''dst''. The result of comparision is 32-bit signed integer. Modifiers: ComparisonModifier
 * [:Jitrino_OPT/opcodes/Cmp3: 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.
 * [[Jitrino_OPT/opcodes/Cmp| Op_Cmp]] - Compares ''src1'' and ''src2'' and stores the result of comparison to ''dst''. The result of comparision is 32-bit signed integer. Modifiers: ComparisonModifier
 * [[Jitrino_OPT/opcodes/Cmp3| 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.
Line 36: Line 36:
 * [:Jitrino_OPT/opcodes/Branch: 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
 * [:Jitrino_OPT/opcodes/Jump: Op_Jump] - Unconditional jump to a node pointer by the ''label'' operand. Modifiers: none.
 * [:Jitrino_OPT/opcodes/Switch: 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.
 * [:Jitrino_OPT/opcodes/DirectCall: 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
 * [:Jitrino_OPT/opcodes/TauVirtualCall: 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
 * [:Jitrino_OPT/opcodes/IndirectCall: 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
 * [:Jitrino_OPT/opcodes/IndirectMemoryCall: Op_IndirectMemoryCall] - Works the same as Op_IndirectCall. TODO: one of this instructions must be removed or its use clarified.
 * [:Jitrino_OPT/opcodes/JitHelperCall: Op_JitHelperCall] - A call of an internal JIT helper referenced by ''JitHelperCallId'' parameter. Modifiers: ExceptionModifier
 * [:Jitrino_OPT/opcodes/VMHelperCall: Op_VMHelperCall] - A call of an runtime VM helper referenced by ''VM_RT_SUPPORT'' parameter. Modifiers: ExceptionModifier
 * [:Jitrino_OPT/opcodes/Return: Op_Return] - A result of the current method. Uses 1 or no operands as return operands. Modifiers: none.
 * [[Jitrino_OPT/opcodes/Branch| 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
 * [[Jitrino_OPT/opcodes/Jump| Op_Jump]] - Unconditional jump to a node pointer by the ''label'' operand. Modifiers: none.
 * [[Jitrino_OPT/opcodes/Switch| 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.
 * [[Jitrino_OPT/opcodes/DirectCall| 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
 * [[Jitrino_OPT/opcodes/TauVirtualCall| 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
 * [[Jitrino_OPT/opcodes/IndirectCall| 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
 * [[Jitrino_OPT/opcodes/IndirectMemoryCall| Op_IndirectMemoryCall]] - Works the same as Op_IndirectCall. TODO: one of this instructions must be removed or its use clarified.
 * [[Jitrino_OPT/opcodes/JitHelperCall| Op_JitHelperCall]] - A call of an internal JIT helper referenced by ''JitHelperCallId'' parameter. Modifiers: ExceptionModifier
 * [[Jitrino_OPT/opcodes/VMHelperCall| Op_VMHelperCall]] - A call of an runtime VM helper referenced by ''VM_RT_SUPPORT'' parameter. Modifiers: ExceptionModifier
 * [[Jitrino_OPT/opcodes/Return| Op_Return]] - A result of the current method. Uses 1 or no operands as return operands. Modifiers: none.
Line 48: Line 48:
 * [:Jitrino_OPT/opcodes/Catch: 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.
 * [:Jitrino_OPT/opcodes/Throw: Op_Throw] - Throws the exception object located in ''src1'' operand. Modifiers: ThrowModifier
 * [:Jitrino_OPT/opcodes/PseudoThrow: Op_PseudoThrow] - A pseudo instruction to break infinte loops. Modifiers: ExceptionModifier
 * [:Jitrino_OPT/opcodes/ThrowSystemException: Op_ThrowSystemException] - A throw with a predefined object thrown. Takes a CompilationInterface::SystemExceptionId parameter. Modifiers: ThrowModifier
 * [:Jitrino_OPT/opcodes/ThrowLinkingException: Op_ThrowLinkingException] - A throw with a predefined object thrown. Generate a call to Helper_Throw_LinkingException. Modifiers: ThrowModifier
 * [[Jitrino_OPT/opcodes/Catch| 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.
 * [[Jitrino_OPT/opcodes/Throw| Op_Throw]] - Throws the exception object located in ''src1'' operand. Modifiers: ThrowModifier
 * [[Jitrino_OPT/opcodes/PseudoThrow| Op_PseudoThrow]] - A pseudo instruction to break infinte loops. Modifiers: ExceptionModifier
 * [[Jitrino_OPT/opcodes/ThrowSystemException| Op_ThrowSystemException]] - A throw with a predefined object thrown. Takes a CompilationInterface::SystemExceptionId parameter. Modifiers: ThrowModifier
 * [[Jitrino_OPT/opcodes/ThrowLinkingException| Op_ThrowLinkingException]] - A throw with a predefined object thrown. Generate a call to Helper_Throw_LinkingException. Modifiers: ThrowModifier
Line 54: Line 54:
 * [:Jitrino_OPT/opcodes/JSR: Op_JSR] - An unconditional branch to a subroutine. Modifiers: none.
 * [:Jitrino_OPT/opcodes/Ret: Op_Ret] - A return from a subroutine called with Op_JSR instruction. Modifiers: none.
 * [:Jitrino_OPT/opcodes/SaveRet: Op_SaveRet] - Prepares an operand for saving result of subroutine. Modifiers: none.
 * [[Jitrino_OPT/opcodes/JSR| Op_JSR]] - An unconditional branch to a subroutine. Modifiers: none.
 * [[Jitrino_OPT/opcodes/Ret| Op_Ret]] - A return from a subroutine called with Op_JSR instruction. Modifiers: none.
 * [[Jitrino_OPT/opcodes/SaveRet| Op_SaveRet]] - Prepares an operand for saving result of subroutine. Modifiers: none.
Line 59: Line 59:
 * [:Jitrino_OPT/opcodes/Copy: Op_Copy] - Creates a copy of an operand. No conversion is applied. Modifiers: none.
 * [:Jitrino_OPT/opcodes/DefArg: Op_DefArg] - Defines an argument of the current method. Usually one the first instructions in entry node. Modifiers: DefArgModifier
 * [[Jitrino_OPT/opcodes/Copy| Op_Copy]] - Creates a copy of an operand. No conversion is applied. Modifiers: none.
 * [[Jitrino_OPT/opcodes/DefArg| Op_DefArg]] - Defines an argument of the current method. Usually one the first instructions in entry node. Modifiers: DefArgModifier
Line 63: Line 63:
 * [:Jitrino_OPT/opcodes/LdConstant: Op_LdConstant] - Load constant provided as a ConstInst::ConstValue into ''dst'' operand.
 * [:Jitrino_OPT/opcodes/LdRef: 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.
 * [:Jitrino_OPT/opcodes/LdVar: Op_LdVar] - Loads temporary ''src1'' operand into ''var'' operand
 * [:Jitrino_OPT/opcodes/LdVarAddr: 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.
 * [:Jitrino_OPT/opcodes/TauLdInd: 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.
 * [:Jitrino_OPT/opcodes/TauLdField: Op_TauLdField] - The same as Op_TauLdInd but instead of the address of the field a field handle is provided.
 * [:Jitrino_OPT/opcodes/LdStatic: Op_LdStatic] - Loads a value of a static field into ''dst'' operand. No null check is needed.
 * [:Jitrino_OPT/opcodes/TauLdElem: 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.
 * [:Jitrino_OPT/opcodes/LdFieldAddr: Op_LdFieldAddr] - For the provided ''base'' and ''field_handle'' operands returns the address of a field.
 * [:Jitrino_OPT/opcodes/LdStaticAddr: Op_LdStaticAddr] - For the ''field_handle'' operand of the static field returns the address of a field.
 * [:Jitrino_OPT/opcodes/LdElemAddr: Op_LdElemAddr] - Loads an address of array element referenced by ''array'' and ''index'' parameters
 * [:Jitrino_OPT/opcodes/TauLdVTableAddr: Op_TauLdVTableAddr] - Returns an address of VTable structure for the provided ''base'' operand of object type.
 * [:Jitrino_OPT/opcodes/TauLdIntfcVTableAddr: 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.
 * [:Jitrino_OPT/opcodes/TauLdVirtFunAddr: 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.
 * [:Jitrino_OPT/opcodes/TauLdVirtFunAddrSlot: 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.
 * [:Jitrino_OPT/opcodes/LdFunAddr: Op_LdFunAddr] - Loads address of the memory location that contains function address.
 * [:Jitrino_OPT/opcodes/LdFunAddrSlot: Op_LdFunAddrSlot] - This opcode is processed the same ways as Op_LdFunAddr today. TODO: remove it or make it other meaning.
 * [:Jitrino_OPT/opcodes/GetVTableAddr: Op_GetVTableAddr] - Obtains the address of the VTable for a particular object type provided as a parameter.
 * [[Jitrino_OPT/opcodes/LdConstant| Op_LdConstant]] - Load constant provided as a ConstInst::ConstValue into ''dst'' operand.
 * [[Jitrino_OPT/opcodes/LdRef| 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.
 * [[Jitrino_OPT/opcodes/LdVar| Op_LdVar]] - Loads temporary ''src1'' operand into ''var'' operand
 * [[Jitrino_OPT/opcodes/LdVarAddr| 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.
 * [[Jitrino_OPT/opcodes/TauLdInd| 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.
 * [[Jitrino_OPT/opcodes/TauLdField| Op_TauLdField]] - The same as Op_TauLdInd but instead of the address of the field a field handle is provided.
 * [[Jitrino_OPT/opcodes/LdStatic| Op_LdStatic]] - Loads a value of a static field into ''dst'' operand. No null check is needed.
 * [[Jitrino_OPT/opcodes/TauLdElem| 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.
 * [[Jitrino_OPT/opcodes/LdFieldAddr| Op_LdFieldAddr]] - For the provided ''base'' and ''field_handle'' operands returns the address of a field.
 * [[Jitrino_OPT/opcodes/LdStaticAddr| Op_LdStaticAddr]] - For the ''field_handle'' operand of the static field returns the address of a field.
 * [[Jitrino_OPT/opcodes/LdElemAddr| Op_LdElemAddr]] - Loads an address of array element referenced by ''array'' and ''index'' parameters
 * [[Jitrino_OPT/opcodes/TauLdVTableAddr| Op_TauLdVTableAddr]] - Returns an address of VTable structure for the provided ''base'' operand of object type.
 * [[Jitrino_OPT/opcodes/TauLdIntfcVTableAddr| 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.
 * [[Jitrino_OPT/opcodes/TauLdVirtFunAddr| 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.
 * [[Jitrino_OPT/opcodes/TauLdVirtFunAddrSlot| 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.
 * [[Jitrino_OPT/opcodes/LdFunAddr| Op_LdFunAddr]] - Loads address of the memory location that contains function address.
 * [[Jitrino_OPT/opcodes/LdFunAddrSlot| Op_LdFunAddrSlot]] - This opcode is processed the same ways as Op_LdFunAddr today. TODO: remove it or make it other meaning.
 * [[Jitrino_OPT/opcodes/GetVTableAddr| Op_GetVTableAddr]] - Obtains the address of the VTable for a particular object type provided as a parameter.
Line 83: Line 83:
 * [:Jitrino_OPT/opcodes/TauArrayLen: 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.
 * [:Jitrino_OPT/opcodes/LdArrayBaseAddr: Op_LdArrayBaseAddr] - Load the base (zero'th element) address of array.
 * [:Jitrino_OPT/opcodes/AddScaledIndex: Op_AddScaledIndex] - Add a scaled index to an array element address
 * [[Jitrino_OPT/opcodes/TauArrayLen| 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.
 * [[Jitrino_OPT/opcodes/LdArrayBaseAddr| Op_LdArrayBaseAddr]] - Load the base (zero'th element) address of array.
 * [[Jitrino_OPT/opcodes/AddScaledIndex| Op_AddScaledIndex]] - Add a scaled index to an array element address
Line 88: Line 88:
 * [:Jitrino_OPT/opcodes/StVar: Op_StVar] - Stores ''var'' operand into temporary ''dst'' operand.
 * [:Jitrino_OPT/opcodes/TauStInd: 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
 * [:Jitrino_OPT/opcodes/TauStField: Op_TauStField] - The same as Op_TauStInd but uses ''field_handle'' instead of ''ptr'' operand. Modifiers: StoreModifier
 * [:Jitrino_OPT/opcodes/TauStElem: 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
 * [:Jitrino_OPT/opcodes/TauStStatic: Op_TauStStatic] - Stores ''src'' value into static field referenced by ''field_handle'' parameter.
 * [:Jitrino_OPT/opcodes/TauStRef: 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 ''dst''objects must be reported.
 * [[Jitrino_OPT/opcodes/StVar| Op_StVar]] - Stores ''var'' operand into temporary ''dst'' operand.
 * [[Jitrino_OPT/opcodes/TauStInd| 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
 * [[Jitrino_OPT/opcodes/TauStField| Op_TauStField]] - The same as Op_TauStInd but uses ''field_handle'' instead of ''ptr'' operand. Modifiers: StoreModifier
 * [[Jitrino_OPT/opcodes/TauStElem| 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
 * [[Jitrino_OPT/opcodes/TauStStatic| Op_TauStStatic]] - Stores ''src'' value into static field referenced by ''field_handle'' parameter.
 * [[Jitrino_OPT/opcodes/TauStRef| 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 ''dst''objects must be reported.
Line 97: Line 97:
 * [:Jitrino_OPT/opcodes/TauCheckBounds: Op_TauCheckBounds] - Takes index and array length arguments, the overflow modifier == none indicates that 0<=idx*element_size<2^31
 * [:Jitrino_OPT/opcodes/TauCheckLowerBound: Op_TauCheckLowerBound] - Throws ArrayOfBoundException unless src0 <= src1
 * [:Jitrino_OPT/opcodes/TauCheckUpperBound: Op_TauCheckUpperBound] - Throws ArrayOfBoundException unless src0 < src1
 * [:Jitrino_OPT/opcodes/TauCheckNull: Op_TauCheckNull] - Throws NullPointerException if ''src'' operand is null
 * [:Jitrino_OPT/opcodes/TauCheckZero: Op_TauCheckZero] - Throws DivideByZero exceptions. The resulted ''tau''operand is used in Op_TauDiv and Op_TauRem instructions.
 * [:Jitrino_OPT/opcodes/TauCheckDivOpnds: Op_TauCheckDivOpnds] - Was used for signed divide overflow in CLI (div/rem of MAXNEGINT, -1): generates an ArithmeticException. TODO: remove as unused.
 * [:Jitrino_OPT/opcodes/TauCheckElemType: Op_TauCheckElemType] - Checks array element type. The resulted ''tau'' operand is used in Op_TauStElem instruction.
 * [:Jitrino_OPT/opcodes/TauCheckFinite: Op_TauCheckFinite] - Throws ArithmeticException if ''src'' operand is NaN or +- infinity
 * [[Jitrino_OPT/opcodes/TauCheckBounds| Op_TauCheckBounds]] - Takes index and array length arguments, the overflow modifier == none indicates that 0<=idx*element_size<2^31
 * [[Jitrino_OPT/opcodes/TauCheckLowerBound| Op_TauCheckLowerBound]] - Throws ArrayOfBoundException unless src0 <= src1
 * [[Jitrino_OPT/opcodes/TauCheckUpperBound| Op_TauCheckUpperBound]] - Throws ArrayOfBoundException unless src0 < src1
 * [[Jitrino_OPT/opcodes/TauCheckNull| Op_TauCheckNull]] - Throws NullPointerException if ''src'' operand is null
 * [[Jitrino_OPT/opcodes/TauCheckZero| Op_TauCheckZero]] - Throws DivideByZero exceptions. The resulted ''tau''operand is used in Op_TauDiv and Op_TauRem instructions.
 * [[Jitrino_OPT/opcodes/TauCheckDivOpnds| Op_TauCheckDivOpnds]] - Was used for signed divide overflow in CLI (div/rem of MAXNEGINT, -1): generates an ArithmeticException. TODO: remove as unused.
 * [[Jitrino_OPT/opcodes/TauCheckElemType| Op_TauCheckElemType]] - Checks array element type. The resulted ''tau'' operand is used in Op_TauStElem instruction.
 * [[Jitrino_OPT/opcodes/TauCheckFinite| Op_TauCheckFinite]] - Throws ArithmeticException if ''src'' operand is NaN or +- infinity
Line 107: Line 107:
 * [:Jitrino_OPT/opcodes/NewObj: Op_NewObj] - Allocates an object instance of the specified type. Throws OutOfMemoryException.
 * [:Jitrino_OPT/opcodes/NewArray: Op_NewArray] - Allocates an array instance of the specified size and element type. Throws OutOfMemoryException, NegativeArraySizeException
 * [:Jitrino_OPT/opcodes/NewMultiArray: Op_NewMultiArray] - Allocates a multiarray instance. Gets number of dimension, sizes for each of the dimensions and element type as parameters. Throws OutOfMemoryException, NegativeArraySizeException
 * [[Jitrino_OPT/opcodes/NewObj| Op_NewObj]] - Allocates an object instance of the specified type. Throws OutOfMemoryException.
 * [[Jitrino_OPT/opcodes/NewArray| Op_NewArray]] - Allocates an array instance of the specified size and element type. Throws OutOfMemoryException, NegativeArraySizeException
 * [[Jitrino_OPT/opcodes/NewMultiArray| Op_NewMultiArray]] - Allocates a multiarray instance. Gets number of dimension, sizes for each of the dimensions and element type as parameters. Throws OutOfMemoryException, NegativeArraySizeException
Line 112: Line 112:
 * [:Jitrino_OPT/opcodes/TauMonitorEnter: Op_TauMonitorEnter] - Locks monitor for the given object. The object must not be null.  * [[Jitrino_OPT/opcodes/TauMonitorEnter| Op_TauMonitorEnter]] - Locks monitor for the given object. The object must not be null.
Line 114: Line 114:
 * [:Jitrino_OPT/opcodes/TauMonitorExit: Op_TauMonitorExit] - Unlocks monitor for the given object. The object must not be null. Throws IllegalMonitorStateException
 * [:Jitrino_OPT/opcodes/TypeMonitorEnter: Op_TypeMonitorEnter] - Locks monitor for the given class (type) object.
 * [:Jitrino_OPT/opcodes/TypeMonitorExit: Op_TypeMonitorExit] - Unlocks monitor for the given class (type) object.Throws IllegalMonitorStateException
 * [[Jitrino_OPT/opcodes/TauMonitorExit| Op_TauMonitorExit]] - Unlocks monitor for the given object. The object must not be null. Throws IllegalMonitorStateException
 * [[Jitrino_OPT/opcodes/TypeMonitorEnter| Op_TypeMonitorEnter]] - Locks monitor for the given class (type) object.
 * [[Jitrino_OPT/opcodes/TypeMonitorExit| Op_TypeMonitorExit]] - Unlocks monitor for the given class (type) object.Throws IllegalMonitorStateException
Line 120: Line 120:
 * [:Jitrino_OPT/opcodes/TauStaticCast: Op_TauStaticCast] - Compile-time assertion. Asserts that cast is legal.
 * [:Jitrino_OPT/opcodes/TauCast: Op_TauCast] - Casts the argument to the specified type. Succeeds if argument is null, returns casted object. throws CastException if cast is illegal.
 * [:Jitrino_OPT/opcodes/TauAsType: Op_TauAsType] - Returns casted object if argument is an instance of, or return null otherwise.
 * [:Jitrino_OPT/opcodes/TauInstanceOf: Op_TauInstanceOf] - Returns true if argument is a non-null instance of type T
 * [:Jitrino_OPT/opcodes/TauCheckCast: Op_TauCheckCast] - Returns ''tau'' that the cast is safe if argument is an instance of, or throws ClassCastException otherwise.
 * [:Jitrino_OPT/opcodes/TauHasType: Op_TauHasType]- Returns ''tau'' that the cast is safe.
 * [:Jitrino_OPT/opcodes/TauHasExactType: Op_TauHasExactType] - The same as Op_TauHasType but ensures that argument has exact type.
 * [:Jitrino_OPT/opcodes/TauIsNonNull: Op_TauIsNonNull] - Returns ''tau'' that can be used to prove that argument is not null
 * [[Jitrino_OPT/opcodes/TauStaticCast| Op_TauStaticCast]] - Compile-time assertion. Asserts that cast is legal.
 * [[Jitrino_OPT/opcodes/TauCast| Op_TauCast]] - Casts the argument to the specified type. Succeeds if argument is null, returns casted object. throws CastException if cast is illegal.
 * [[Jitrino_OPT/opcodes/TauAsType| Op_TauAsType]] - Returns casted object if argument is an instance of, or return null otherwise.
 * [[Jitrino_OPT/opcodes/TauInstanceOf| Op_TauInstanceOf]] - Returns true if argument is a non-null instance of type T
 * [[Jitrino_OPT/opcodes/TauCheckCast| Op_TauCheckCast]] - Returns ''tau'' that the cast is safe if argument is an instance of, or throws ClassCastException otherwise.
 * [[Jitrino_OPT/opcodes/TauHasType| Op_TauHasType]]- Returns ''tau'' that the cast is safe.
 * [[Jitrino_OPT/opcodes/TauHasExactType| Op_TauHasExactType]] - The same as Op_TauHasType but ensures that argument has exact type.
 * [[Jitrino_OPT/opcodes/TauIsNonNull| Op_TauIsNonNull]] - Returns ''tau'' that can be used to prove that argument is not null
Line 130: Line 130:
 * [:Jitrino_OPT/opcodes/InitType: 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.  * [[Jitrino_OPT/opcodes/InitType| 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.
Line 133: Line 133:
 * [:Jitrino_OPT/opcodes/Label: Op_Label] - A special label instructions for branch labels, finally, catch blocks. Every node in HIR must start with this instruction.
 * [:Jitrino_OPT/opcodes/MethodEntry: Op_MethodEntry] - Method entry label. Used to mark inlined methods boundaries.
 * [:Jitrino_OPT/opcodes/MethodEnd: Op_MethodEnd] - Method end label. Used to mark inlined methods boundaries.
 * [[Jitrino_OPT/opcodes/Label| Op_Label]] - A special label instructions for branch labels, finally, catch blocks. Every node in HIR must start with this instruction.
 * [[Jitrino_OPT/opcodes/MethodEntry| Op_MethodEntry]] - Method entry label. Used to mark inlined methods boundaries.
 * [[Jitrino_OPT/opcodes/MethodEnd| Op_MethodEnd]] - Method end label. Used to mark inlined methods boundaries.
Line 138: Line 138:
 * [:Jitrino_OPT/opcodes/IncCounter: 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.
 * [:Jitrino_OPT/opcodes/Prefetch: Op_Prefetch] - Prefetches a given memory location.
 * [[Jitrino_OPT/opcodes/IncCounter| 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.
 * [[Jitrino_OPT/opcodes/Prefetch| Op_Prefetch]] - Prefetches a given memory location.
Line 142: Line 142:
 * [:Jitrino_OPT/opcodes/UncompressRef: Op_UncompressRef] - Performs uncompress operation for ''compressed_ref'', e.g. uncompressed_ref = (compressed_ref<<s) + heapbase
 * [:Jitrino_OPT/opcodes/CompressRef: Op_CompressRef] - Performs compress operation, which is reverse operation for Op_UncompressRef.
 * [[Jitrino_OPT/opcodes/UncompressRef| Op_UncompressRef]] - Performs uncompress operation for ''compressed_ref'', e.g. uncompressed_ref = (compressed_ref<<s) + heapbase
 * [[Jitrino_OPT/opcodes/CompressRef| Op_CompressRef]] - Performs compress operation, which is reverse operation for Op_UncompressRef.
Line 145: Line 145:
 * [:Jitrino_OPT/opcodes/LdFieldOffset: Op_LdFieldOffset] - Loads field offset from the start of the object.
 * [:Jitrino_OPT/opcodes/LdFieldOffsetPlusHeapbase: Op_LdFieldOffsetPlusHeapbase] - Loads field offset and adds heapbase to it.
 * [:Jitrino_OPT/opcodes/LdArrayBaseOffset: Op_LdArrayBaseOffset] - Loads the offset of array base.
 * [:Jitrino_OPT/opcodes/LdArrayBaseOffsetPlusHeapbase: Op_LdArrayBaseOffsetPlusHeapbase] - Offset of array base plus heap base.
 * [:Jitrino_OPT/opcodes/LdArrayLenOffset: Op_LdArrayLenOffset] - Returns offset of array length field.
 * [:Jitrino_OPT/opcodes/LdArrayLenOffsetPlusHeapbase: Op_LdArrayLenOffsetPlusHeapbase] - Returns offset of array length field plus heap base.
 * [[Jitrino_OPT/opcodes/LdFieldOffset| Op_LdFieldOffset]] - Loads field offset from the start of the object.
 * [[Jitrino_OPT/opcodes/LdFieldOffsetPlusHeapbase| Op_LdFieldOffsetPlusHeapbase]] - Loads field offset and adds heapbase to it.
 * [[Jitrino_OPT/opcodes/LdArrayBaseOffset| Op_LdArrayBaseOffset]] - Loads the offset of array base.
 * [[Jitrino_OPT/opcodes/LdArrayBaseOffsetPlusHeapbase| Op_LdArrayBaseOffsetPlusHeapbase]] - Offset of array base plus heap base.
 * [[Jitrino_OPT/opcodes/LdArrayLenOffset| Op_LdArrayLenOffset]] - Returns offset of array length field.
 * [[Jitrino_OPT/opcodes/LdArrayLenOffsetPlusHeapbase| Op_LdArrayLenOffsetPlusHeapbase]] - Returns offset of array length field plus heap base.
Line 152: Line 152:
 * [:Jitrino_OPT/opcodes/AddOffset: Op_AddOffset] - Adds offset to uncompressed reference.
 * [:Jitrino_OPT/opcodes/AddOffsetPlusHeapbase: Op_AddOffsetPlusHeapbase] - Uncompresses compressed reference and adds field offsets to result.
 * [[Jitrino_OPT/opcodes/AddOffset| Op_AddOffset]] - Adds offset to uncompressed reference.
 * [[Jitrino_OPT/opcodes/AddOffsetPlusHeapbase| Op_AddOffsetPlusHeapbase]] - Uncompresses compressed reference and adds field offsets to result.
Line 156: Line 156:
 * [:Jitrino_OPT/opcodes/Phi: Op_Phi] - A merge point for variables.
 * [:Jitrino_OPT/opcodes/TauPi: Op_TauPi] - Leverage split based on condition.
 * [[Jitrino_OPT/opcodes/Phi| Op_Phi]] - A merge point for variables.
 * [[Jitrino_OPT/opcodes/TauPi| Op_TauPi]] - Leverage split based on condition.

List of High-Level IR opcodes used in Jitrino.OPT compiler:

Use this link for details on type system used in Jitrino.OPT compiler

Arithmetic:

  • Op_Add - Adds src1 and src2 operands and stores the result to dst. Modifiers: OverflowModifier, ExceptionModifier

  • Op_Mul - Multiplies src1 and src2 operands and stores the result to dst. Modifiers: OverflowModifier, ExceptionModifier

  • Op_Sub - Substracts src2 from src1 operands and stores the result to dst. Modifiers: OverflowModifier, ExceptionModifier

  • Op_TauDiv - Divides src1 by src2 and stores the results to dst. Uses tau operand to ensure that that 0/overflow cases were checked before. Modifiers: SignedModifier

  • Op_TauRem - Computes residue of division of src1 by src2 and stores the results to dst. Uses tau operand to ensure that that 0/overflow cases were checked before. Modifiers: SignedModifier

  • Op_Neg - Negates the src1 operands and stores the result to dst. Modifiers: SignedModifier

  • 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

Bitwise:

  • 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

Selection:

  • Op_Select - Selects a value: (src1 ? src2 : src3).

Conversion:

  • 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.

Shift:

  • Op_Shladd - Shifts 'src1' by src2 bits left, adds src3 to the result of the shift and stores the result to dst. The src2 must be an LdConstant result. Modifiers: none

  • Op_Shl - Shifts 'src1' left by src2 bits left and stores the result in 'dst'. Modifiers: ShiftMaskModifier

  • Op_Shr - Shifts 'src1' left by src2 bits right and stores the result in 'dst'. Modifiers: ShiftMaskModifier

Comparison:

  • Op_Cmp - Compares src1 and src2 and stores the result of comparison to dst. The result of comparision is 32-bit signed integer. Modifiers: ComparisonModifier

  • 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.

Control flow:

  • 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_IndirectMemoryCall - Works the same as Op_IndirectCall. TODO: one of this instructions must be removed or its use clarified.

  • Op_JitHelperCall - A call of an internal JIT helper referenced by JitHelperCallId parameter. Modifiers: ExceptionModifier

  • Op_VMHelperCall - A call of an runtime VM helper referenced by VM_RT_SUPPORT parameter. Modifiers: ExceptionModifier

  • Op_Return - A result of the current method. Uses 1 or no operands as return operands. Modifiers: none.

Exception processing:

Move instruction:

  • Op_Copy - Creates a copy of an operand. No conversion is applied. Modifiers: none.

  • Op_DefArg - Defines an argument of the current method. Usually one the first instructions in entry node. Modifiers: DefArgModifier

Load instructions:

  • Op_LdConstant - Load constant provided as a ConstInst::ConstValue into dst operand.

  • 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_TauLdField - The same as Op_TauLdInd but instead of the address of the field a field handle is provided.

  • 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_LdFunAddrSlot - This opcode is processed the same ways as Op_LdFunAddr today. TODO: remove it or make it other meaning.

  • Op_GetVTableAddr - Obtains the address of the VTable for a particular object type provided as a parameter.

Array manipulation:

  • 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

Store instructions:

  • 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_TauStField - The same as Op_TauStInd but uses field_handle instead of ptr operand. 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

Allocation:

Synchronization:

// this could take an ExceptionModifier

Type checking:

// cast takes an ExceptionModifier

Type initialization:

  • 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:

Special SSA nodes:

  • Op_Phi - A merge point for variables.

  • Op_TauPi - Leverage split based on condition.

Jitrino_OPT/opcodes (last edited 2009-09-20 21:55:21 by localhost)