Enum Class DOpcodeType
- All Implemented Interfaces:
Serializable,Comparable<DOpcodeType>,Constable
This enumeration defines the opcode types of the intermediate representation (IR)
instructions used by dexdec. An IR instruction has two optional
operands, noted opnd1 and opnd2.
Note that the IR_STORE_EXCEPTION opcode can only be the first instruction of an
exception handler block. The IR_JUMP, IR_JCOND, IR_SWITCH,
IR_RETURN, IR_THROW can only be the last instruction of a basic block.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAssignment.
- opnd1: destination (left) member,IDExpression
- opnd2: source (right) member,IDExpressionGeneral method invocation
- opnd1: null
- opnd2: anIDInvokeInfoexpression (call,new,new-array,alloc-object)Conditional jump
- opnd1: theIDTarget, branched to if the conditional expression is true
- opnd2: the predicate, anIDExpressiontyped asbooleanNotify the beginning of a synchronized block of code.
Ideally, should not be translated to opcodes: instead the structurer should combine these opcodes with try-catch block to build synchronized code blocks.
However, if this is not possible, invalid statements (similar to 'goto') should be issued.
- opnd1: null
- opnd2: the lock objectIDExpressionNotify the end of a synchronized block of code.
Ideally, should not be translated to opcodes: instead the structurer should combine these opcodes with try-catch block to build synchronized code blocks.
However, if this is not possible, invalid statements (similar to 'goto') should be issued.
- opnd1: null
- opnd2: the lock objectIDExpressionNo-operation instruction
- opnd1: null
- opnd2: nullStore a caught typed exception to a variable
Very restrictive opcode, to be used only at the beginning of exception handlers blocks.Raise an error or exception
- opnd1: null
- opnd2: non-null throwable, anIDExpression(should be typed asjava.lang.Throwableor any of its sub-types) -
Method Summary
Modifier and TypeMethodDescriptionfinal intindexOf(DOpcodeType... candidates) Determine whether this opcode matches one of the provided candidate opcodes.final booleanisAnyOf(DOpcodeType... candidates) Determine whether this opcode matches one of the provided candidate opcodes.static DOpcodeTypeReturns the enum constant of this class with the specified name.static DOpcodeType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
IR_NOP
No-operation instruction
- opnd1: null
- opnd2: null -
IR_ASSIGN
Assignment.
- opnd1: destination (left) member,IDExpression
- opnd2: source (right) member,IDExpression -
IR_INVOKE
General method invocation
- opnd1: null
- opnd2: anIDInvokeInfoexpression (call,new,new-array,alloc-object) -
IR_JUMP
-
IR_JCOND
Conditional jump
- opnd1: theIDTarget, branched to if the conditional expression is true
- opnd2: the predicate, anIDExpressiontyped asboolean -
IR_SWITCH
-
IR_RETURN
-
IR_THROW
Raise an error or exception
- opnd1: null
- opnd2: non-null throwable, anIDExpression(should be typed asjava.lang.Throwableor any of its sub-types) -
IR_STORE_EXCEPTION
Store a caught typed exception to a variable
Very restrictive opcode, to be used only at the beginning of exception handlers blocks. (equivalent to Dalvik'smove-exception.)
- opnd1:IDVar
- opnd2: null -
IR_MONITOR_ENTER
Notify the beginning of a synchronized block of code.
Ideally, should not be translated to opcodes: instead the structurer should combine these opcodes with try-catch block to build synchronized code blocks.
However, if this is not possible, invalid statements (similar to 'goto') should be issued.
- opnd1: null
- opnd2: the lock objectIDExpression -
IR_MONITOR_EXIT
Notify the end of a synchronized block of code.
Ideally, should not be translated to opcodes: instead the structurer should combine these opcodes with try-catch block to build synchronized code blocks.
However, if this is not possible, invalid statements (similar to 'goto') should be issued.
- opnd1: null
- opnd2: the lock objectIDExpression
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
isAnyOf
Determine whether this opcode matches one of the provided candidate opcodes.- Parameters:
candidates- candidate opcodes- Returns:
-
indexOf
Determine whether this opcode matches one of the provided candidate opcodes.- Parameters:
candidates- candidate opcodes- Returns:
- an index, -1 if not found
-