public final class Rop
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BRANCH_GOTO
indicates an unconditional goto
|
static int |
BRANCH_IF
indicates a two-way branch
|
static int |
BRANCH_MAX
maximum
BRANCH_* value |
static int |
BRANCH_MIN
minimum
BRANCH_* value |
static int |
BRANCH_NONE
indicates a non-branching op
|
static int |
BRANCH_RETURN
indicates a function/method return
|
static int |
BRANCH_SWITCH
indicates a switch-style branch
|
static int |
BRANCH_THROW
indicates a throw-style branch (both always-throws and may-throw)
|
| Constructor and Description |
|---|
Rop(int opcode,
TypeList sources,
TypeList exceptions)
Constructs a non-nicknamed instance with non-empty exceptions, which
is always a call-like op (see
isCallLike). |
Rop(int opcode,
Type result,
TypeList sources,
int branchingness,
java.lang.String nickname)
Constructs a no-exception instance.
|
Rop(int opcode,
Type result,
TypeList sources,
java.lang.String nickname)
Constructs a non-branching no-exception instance.
|
Rop(int opcode,
Type result,
TypeList sources,
TypeList exceptions,
int branchingness,
boolean isCallLike,
java.lang.String nickname)
Constructs an instance.
|
Rop(int opcode,
Type result,
TypeList sources,
TypeList exceptions,
int branchingness,
java.lang.String nickname)
Constructs an instance.
|
Rop(int opcode,
Type result,
TypeList sources,
TypeList exceptions,
java.lang.String nickname)
Constructs a non-empty exceptions instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canThrow()
Gets whether this operation can possibly throw an exception.
|
boolean |
equals(java.lang.Object other) |
int |
getBranchingness()
Gets the branchingness of this instance.
|
TypeList |
getExceptions()
Gets the list of exception types that might be thrown.
|
java.lang.String |
getNickname()
Gets the nickname.
|
int |
getOpcode()
Gets the opcode.
|
Type |
getResult()
Gets the result type.
|
TypeList |
getSources()
Gets the source types.
|
int |
hashCode() |
boolean |
isCallLike()
Gets whether this opcode is a function/method call or similar.
|
boolean |
isCommutative()
Gets whether this opcode is commutative (the order of its sources are
unimportant) or not.
|
java.lang.String |
toString() |
public static final int BRANCH_MIN
BRANCH_* valuepublic static final int BRANCH_NONE
public static final int BRANCH_RETURN
public static final int BRANCH_GOTO
public static final int BRANCH_IF
public static final int BRANCH_SWITCH
public static final int BRANCH_THROW
public static final int BRANCH_MAX
BRANCH_* valuepublic Rop(int opcode,
Type result,
TypeList sources,
TypeList exceptions,
int branchingness,
boolean isCallLike,
java.lang.String nickname)
opcode - the opcode; one of the constants in RegOpsresult - non-null; result type of this operation; Type.VOID for no-result operationssources - non-null; types of all the sources of this operationexceptions - non-null; list of possible types thrown by this
operationbranchingness - the branchingness of this op; one of the
BRANCH_* constantsisCallLike - whether the op is a function/method call or similarnickname - null-ok; optional nickname (used for debugging)public Rop(int opcode,
Type result,
TypeList sources,
TypeList exceptions,
int branchingness,
java.lang.String nickname)
isCallLike).opcode - the opcode; one of the constants in RegOpsresult - non-null; result type of this operation; Type.VOID for no-result operationssources - non-null; types of all the sources of this operationexceptions - non-null; list of possible types thrown by this
operationbranchingness - the branchingness of this op; one of the
BRANCH_* constantsnickname - null-ok; optional nickname (used for debugging)public Rop(int opcode,
Type result,
TypeList sources,
int branchingness,
java.lang.String nickname)
isCallLike).opcode - the opcode; one of the constants in RegOpsresult - non-null; result type of this operation; Type.VOID for no-result operationssources - non-null; types of all the sources of this operationbranchingness - the branchingness of this op; one of the
BRANCH_* constantsnickname - null-ok; optional nickname (used for debugging)public Rop(int opcode,
Type result,
TypeList sources,
java.lang.String nickname)
branchingness is always BRANCH_NONE,
and it is never a call-like op (see isCallLike).public Rop(int opcode,
Type result,
TypeList sources,
TypeList exceptions,
java.lang.String nickname)
branchingness is always BRANCH_THROW,
but it is never a call-like op (see isCallLike).opcode - the opcode; one of the constants in RegOpsresult - non-null; result type of this operation; Type.VOID for no-result operationssources - non-null; types of all the sources of this operationexceptions - non-null; list of possible types thrown by this
operationnickname - null-ok; optional nickname (used for debugging)public Rop(int opcode,
TypeList sources,
TypeList exceptions)
isCallLike). Its
branchingness is always BRANCH_THROW.opcode - the opcode; one of the constants in RegOpssources - non-null; types of all the sources of this operationexceptions - non-null; list of possible types thrown by this
operationpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic int getOpcode()
public Type getResult()
Type.VOID
means this operation returns nothing.null-ok; the result specpublic TypeList getSources()
non-null; the source typespublic TypeList getExceptions()
non-null; the list of exception typespublic int getBranchingness()
public boolean isCallLike()
true iff this opcode is call-likepublic boolean isCommutative()
public java.lang.String getNickname()
toString().non-null; the nicknamepublic final boolean canThrow()
getExceptions().size() != 0.true iff this operation can possibly throwCopyright © 2020. All Rights Reserved.