object OpCodes extends ValueCodes
The set of all possible IR graph nodes can be split in two subsets:
1) operations which may appear in ErgoTree (these are defined by OpCodes
below)
2) operations which are not valid to be in ErgoTree, but serve special purposes. (these are defined by OpCodesExtra
)
We can assume they are both Byte-sized codes, and store as a single byte, but as long as we can differentiate them
from context (and where we cannot, we should use special encoding).
The general extended encoding is like the following:
0-255 - range of OpCodes
256-511 - range of OpCodesExtra
Thus, any code in an extended code range of 0-511 can be saved using putUShort
.
We use Byte to represent OpCodes and OpCodesExtra.
We use Short to represent any op code from extended code range.
And we use VLQ to serialize Short values of extended codes.
Examples: 1) For validation rule CheckValidOpCode we use OpCodes range, so we use single byte encoding. 2) For CheckCostFuncOperation we use 1-511 range and extended encoding (see docs)
- Alphabetic
- By Inheritance
- OpCodes
- ValueCodes
- TypeCodes
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- type OpCode = Byte with Tag[Byte, OpCodes.OpCode.Tag]
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val AndCode: OpCode
- val AppendCode: OpCode
- val AtLeastCode: OpCode
- val AvlTreeCode: OpCode
- val AvlTreeGetCode: OpCode
- val BinAndCode: OpCode
- val BinOrCode: OpCode
- val BinXorCode: OpCode
- val BitAndCode: OpCode
- val BitInversionCode: OpCode
- val BitOrCode: OpCode
- val BitShiftLeftCode: OpCode
- val BitShiftRightCode: OpCode
- val BitShiftRightZeroedCode: OpCode
- val BitXorCode: OpCode
- val BlockValueCode: OpCode
- val BoolToSigmaPropCode: OpCode
- val ByIndexCode: OpCode
- val ByteArrayToBigIntCode: OpCode
- val ByteArrayToLongCode: OpCode
- val CalcBlake2b256Code: OpCode
- val CalcSha256Code: OpCode
- val CollRotateLeftCode: OpCode
- val CollRotateRightCode: OpCode
- val CollShiftLeftCode: OpCode
- val CollShiftRightCode: OpCode
- val CollShiftRightZeroedCode: OpCode
- val ConcreteCollectionBooleanConstantCode: OpCode
- val ConcreteCollectionCode: OpCode
-
val
ConstantCode: OpCode
We use optimized encoding of constant values to save space in serialization.
We use optimized encoding of constant values to save space in serialization. Since Box registers are stored as Constant nodes we save 1 byte for each register. This is due to convention that Value.opCode falling in [1..LastDataType] region is a constant. Thus, we can just decode an instance of SType and then decode data using DataSerializer.
Decoding of constants depends on the first byte and in general is a recursive procedure consuming some number of bytes from Reader.
- Definition Classes
- ValueCodes
- val ConstantPlaceholderCode: OpCode
- val ContextCode: OpCode
- val DecodePointCode: OpCode
- val DeserializeContextCode: OpCode
- val DeserializeRegisterCode: OpCode
- val DivisionCode: OpCode
- val DowncastCode: OpCode
- val EqCode: OpCode
- val ExistsCode: OpCode
- val ExponentiateCode: OpCode
- val ExtractAmountCode: OpCode
- val ExtractBytesCode: OpCode
- val ExtractBytesWithNoRefCode: OpCode
- val ExtractCreationInfoCode: OpCode
- val ExtractIdCode: OpCode
- val ExtractRegisterAs: OpCode
- val ExtractScriptBytesCode: OpCode
- val FalseCode: OpCode
- val FilterCode: OpCode
-
val
FirstDataType: OpCode
Decoding of types depends on the first byte and in general is a recursive procedure consuming some number of bytes from Reader.
Decoding of types depends on the first byte and in general is a recursive procedure consuming some number of bytes from Reader. All data types are recognized by the first byte falling in the region [FirstDataType .. LastDataType]
- Definition Classes
- TypeCodes
-
val
FirstFuncType: OpCode
SFunc types occupy remaining space of byte values [FirstFuncType ..
SFunc types occupy remaining space of byte values [FirstFuncType .. 255]
- Definition Classes
- TypeCodes
- val FlatMapCollectionCode: OpCode
- val FoldCode: OpCode
- val ForAllCode: OpCode
- val FunDefCode: OpCode
- val FuncApplyCode: OpCode
- val FuncValueCode: OpCode
- val GeCode: OpCode
- val GetVarCode: OpCode
- val GlobalCode: OpCode
- val GroupGeneratorCode: OpCode
- val GtCode: OpCode
- val HeightCode: OpCode
- val IfCode: OpCode
- val InputsCode: OpCode
- val LastBlockUtxoRootHashCode: OpCode
-
val
LastConstantCode: OpCode
The last constant code is equal to FirstFuncType which represent generic function type.
The last constant code is equal to FirstFuncType which represent generic function type. We use this single code to represent all functional constants, since we don't have enough space in single byte. Subsequent bytes have to be read from Reader in order to decode the type of the function and the corresponding data.
- Definition Classes
- ValueCodes
-
val
LastDataType: OpCode
- Definition Classes
- TypeCodes
-
val
LastFuncType: OpCode
- Definition Classes
- TypeCodes
- val LeCode: OpCode
- val LogicalNotCode: OpCode
- val LongToByteArrayCode: OpCode
- val LtCode: OpCode
- val MapCollectionCode: OpCode
- val MaxCode: OpCode
- val MethodCallCode: OpCode
- val MinCode: OpCode
- val MinerPubkeyCode: OpCode
- val MinusCode: OpCode
- val MinusModQCode: OpCode
- val ModQCode: OpCode
- val ModuloCode: OpCode
- val MultiplyCode: OpCode
- val MultiplyGroupCode: OpCode
- val NegationCode: OpCode
- val NeqCode: OpCode
- val NoneValueCode: OpCode
- val OptionGetCode: OpCode
- val OptionGetOrElseCode: OpCode
- val OptionIsDefinedCode: OpCode
- val OrCode: OpCode
- val OutputsCode: OpCode
- val PlusCode: OpCode
- val PlusModQCode: OpCode
- val PropertyCallCode: OpCode
- val ProveDiffieHellmanTupleCode: OpCode
- val ProveDlogCode: OpCode
- val Select1Code: OpCode
- val Select2Code: OpCode
- val Select3Code: OpCode
- val Select4Code: OpCode
- val Select5Code: OpCode
- val SelectFieldCode: OpCode
- val SelfCode: OpCode
- val SigmaAndCode: OpCode
- val SigmaOrCode: OpCode
- val SigmaPropBytesCode: OpCode
- val SigmaPropIsProvenCode: OpCode
- val SizeOfCode: OpCode
- val SliceCode: OpCode
- val SomeValueCode: OpCode
- val SubstConstantsCode: OpCode
- val TaggedVariableCode: OpCode
- val TrivialPropFalseCode: OpCode
- val TrivialPropTrueCode: OpCode
- val TrueCode: OpCode
- val TupleCode: OpCode
- val Undefined: OpCode
- val UnitConstantCode: OpCode
- val UpcastCode: OpCode
- val ValDefCode: OpCode
- val ValUseCode: OpCode
- val XorCode: OpCode
- val XorOfCode: OpCode
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @IntrinsicCandidate()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- object OpCode extends TaggedType[Byte]
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated