public interface Bytecode
Each bytecode has a binary format which identifies the opcode, operand registers, operand groups, blocks and other items used (e.g. names, constants, etc). The generic organisation of a bytecode is as follows:
+--------+----------+----------------+--------+-------------+ | opcode | operands | operand groups | blocks | other items | +--------+----------+----------------+--------+-------------+
The opcode is currently always 1 byte, whilst the remainder varies between instructions. The opcode itself splits into two components:
7 6 5 0 +-----+-----------+ | fmt | operation | +-----+-----------+
Here, operation identifies the bytecode operation (e.g. add, invoke, etc), whilst fmt identifies the bytecode format.
| Modifier and Type | Interface and Description |
|---|---|
static class |
Bytecode.AliasDeclaration
An alias declaration bytecode has the following form:
|
static class |
Bytecode.Assert
An assert bytecode has the following layout:
|
static class |
Bytecode.AssertOrAssume
An abstract class representing either an
assert or
assume bytecode. |
static class |
Bytecode.Assign
An assignment bytecode has the following layout:
|
static class |
Bytecode.Assume
An assume bytecode has the following layout:
|
static class |
Bytecode.Block |
static class |
Bytecode.Blocks |
static class |
Bytecode.Break
A break bytecode has the following layout:
|
static class |
Bytecode.Case |
static class |
Bytecode.Const
A constant bytecode has the following layout:
|
static class |
Bytecode.Continue
A continue bytecode has the following layout:
|
static class |
Bytecode.Convert
A convert bytecode has the following layout:
|
static class |
Bytecode.Debug
A debug bytecode has the following layout:
|
static class |
Bytecode.DoWhile
A Do While bytecode has the same format as the underlying loop bytecode.
|
static interface |
Bytecode.Expr
Represents the class of bytecodes which correspond to expressions in the
source language.
|
static class |
Bytecode.Extras |
static class |
Bytecode.Fail
A panic bytecode has the following layout:
|
static class |
Bytecode.FieldLoad
A field load bytecode has the following layout:
|
static class |
Bytecode.If
An if bytecode has one of the the following layouts:
|
static class |
Bytecode.Index
Represents a bytecode location within a code forest.
|
static class |
Bytecode.IndirectInvoke
An indirect invocation bytecode has the following layout:
|
static class |
Bytecode.Invoke
An indirect invocation bytecode has the following layout:
|
static class |
Bytecode.Lambda
A lambda bytecode has the following layout:
|
static class |
Bytecode.Loop
A loop bytecode has the following layout:
|
static class |
Bytecode.NamedBlock |
static class |
Bytecode.OperandGroups |
static class |
Bytecode.Operands |
static class |
Bytecode.Operator
An operator bytecode has the following layout:
|
static class |
Bytecode.OperatorKind
Represents the set of valid operators (e.g.
|
static class |
Bytecode.Quantifier
A quantifier bytecode has the following layout:
|
static class |
Bytecode.QuantifierKind |
static class |
Bytecode.Range |
static class |
Bytecode.Return
A return bytecode has the following layout:
|
static class |
Bytecode.Schema |
static class |
Bytecode.Skip
A skip bytecode has the following layout:
|
static interface |
Bytecode.Stmt
A statement bytecode represents a bytecode that contains a sequence of
zero or more bytecodes.
|
static interface |
Bytecode.StmtExpr
A "statement expression" is a rather unusual beast.
|
static class |
Bytecode.Switch
A switch bytecode has the following layout:
|
static class |
Bytecode.Util |
static class |
Bytecode.VariableAccess
A variable access bytecode represents a specific read of a given variable.
|
static class |
Bytecode.VariableDeclaration
A variable declaration bytecode has one of the following two layouts:
|
static class |
Bytecode.While
A While bytecode has the same format as the underlying loop bytecode.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getOpcode()
Return the opcode value of this bytecode.
|
int |
getOperand(int i)
Return the ith top-level operand in this bytecode.
|
int[] |
getOperandGroup(int i)
Get the ith operand group in this bytecode
|
int[] |
getOperands()
Return the top-level operands in this bytecode.
|
int |
numberOfOperandGroups()
Get the number of operand groups in this bytecode
|
int |
numberOfOperands()
Get the number of operands in this bytecode
|
static final int OPCODE_vardecl
static final int OPCODE_fail
static final int OPCODE_assert
static final int OPCODE_assume
static final int OPCODE_break
static final int OPCODE_continue
static final int OPCODE_vardeclinit
static final int OPCODE_aliasdecl
static final int UNARY_OPERATOR
static final int OPCODE_return
static final int OPCODE_ifis
static final int OPCODE_switch
static final int OPCODE_skip
static final int OPCODE_debug
static final int UNARY_ASSIGNABLE
static final int OPCODE_fieldload
static final int OPCODE_convert
static final int OPCODE_const
static final int BINARY_OPERATOR
static final int OPCODE_if
static final int OPCODE_ifelse
static final int BINARY_ASSIGNABLE
static final int OPCODE_neg
static final int OPCODE_add
static final int OPCODE_sub
static final int OPCODE_mul
static final int OPCODE_div
static final int OPCODE_rem
static final int OPCODE_eq
static final int OPCODE_ne
static final int OPCODE_lt
static final int OPCODE_le
static final int OPCODE_gt
static final int OPCODE_ge
static final int OPCODE_logicalnot
static final int OPCODE_logicaland
static final int OPCODE_logicalor
static final int OPCODE_bitwiseinvert
static final int OPCODE_bitwiseor
static final int OPCODE_bitwisexor
static final int OPCODE_bitwiseand
static final int OPCODE_shl
static final int OPCODE_shr
static final int OPCODE_arraylength
static final int OPCODE_arrayindex
static final int OPCODE_arraygen
static final int OPCODE_array
static final int OPCODE_record
static final int OPCODE_is
static final int OPCODE_dereference
static final int OPCODE_newobject
static final int OPCODE_varcopy
static final int OPCODE_varmove
static final int NARY_ASSIGNABLE
static final int OPCODE_invoke
static final int OPCODE_indirectinvoke
static final int OPCODE_lambda
static final int OPCODE_while
static final int OPCODE_dowhile
static final int OPCODE_some
static final int OPCODE_all
static final int OPCODE_assign
static final int OPCODE_block
static final int OPCODE_namedblock
int[] getOperands()
int numberOfOperands()
int getOperand(int i)
i - int numberOfOperandGroups()
int[] getOperandGroup(int i)
i - int getOpcode()
Copyright © 2017. All rights reserved.