| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
JVM.Data.Raw.Types
Description
Types and type synonyms for raw JVM data
Synopsis
- type U1 = Word8
- type U2 = Word16
- type U4 = Word32
- type U8 = Word64
- type JVMInt = U4
- type JVMFloat = Float
- type JVMLong = U8
- type JVMDouble = Double
- type JVMString = Text
- type InstOffsetBytes = U2
- instOffsetBytesToU2 :: InstOffsetBytes -> (U1, U1)
- type ConstantPoolIndex = U2
- type ArrayType = U1
- class SafeNumConvert a b where
- safeNumConvert :: a -> b
- class (SafeNumConvert b a, Integral a, Integral b) => UnsafeNumConvert a b where
- unsafeNumConvert :: a -> Maybe b
Documentation
type InstOffsetBytes = U2 Source #
An offset for an instruction, used for jumps
instOffsetBytesToU2 :: InstOffsetBytes -> (U1, U1) Source #
Converts an InstOffsetBytes to a pair of bytes, encoding it a way that the JVM will correctly interpret it
In other words, this function does the opposite of (branchbyte1 << 8) | branchbyte2
>>> instOffsetBytesToU2 39
(0,39)
type ConstantPoolIndex = U2 Source #
A constant pool index
class SafeNumConvert a b where Source #
Conversions between numbers that will never overflow or underflow
Methods
safeNumConvert :: a -> b Source #
Instances
| SafeNumConvert U1 U2 Source # | |
Defined in JVM.Data.Raw.Types Methods safeNumConvert :: U1 -> U2 Source # | |
| SafeNumConvert U1 U4 Source # | |
Defined in JVM.Data.Raw.Types Methods safeNumConvert :: U1 -> U4 Source # | |
| SafeNumConvert U1 Int Source # | |
Defined in JVM.Data.Raw.Types Methods safeNumConvert :: U1 -> Int Source # | |
| SafeNumConvert U2 U4 Source # | |
Defined in JVM.Data.Raw.Types Methods safeNumConvert :: U2 -> U4 Source # | |
| SafeNumConvert U2 Int Source # | |
Defined in JVM.Data.Raw.Types Methods safeNumConvert :: U2 -> Int Source # | |
| SafeNumConvert U4 Int Source # | |
Defined in JVM.Data.Raw.Types Methods safeNumConvert :: U4 -> Int Source # | |
class (SafeNumConvert b a, Integral a, Integral b) => UnsafeNumConvert a b where Source #
Minimal complete definition
Nothing
Methods
unsafeNumConvert :: a -> Maybe b Source #
default unsafeNumConvert :: Bounded b => a -> Maybe b Source #
Instances
| UnsafeNumConvert U2 U1 Source # | |
Defined in JVM.Data.Raw.Types | |
| UnsafeNumConvert Int U1 Source # | |
Defined in JVM.Data.Raw.Types | |
| UnsafeNumConvert Int U2 Source # | |
Defined in JVM.Data.Raw.Types | |