jvm-binary-0.0.2: A library for reading Java class-files

Copyright(c) Christian Gram Kalhauge 2017
LicenseMIT
Maintainerkalhuage@cs.ucla.edu
Safe HaskellNone
LanguageHaskell2010

Language.JVM.Attribute.Code

Description

 

Documentation

data Code a Source #

Instances

IsAttribute Code Source #

Code is an Attribute.

Eq a => Eq (Code a) Source # 

Methods

(==) :: Code a -> Code a -> Bool #

(/=) :: Code a -> Code a -> Bool #

Show a => Show (Code a) Source # 

Methods

showsPrec :: Int -> Code a -> ShowS #

show :: Code a -> String #

showList :: [Code a] -> ShowS #

Generic (Code a) Source # 

Associated Types

type Rep (Code a) :: * -> * #

Methods

from :: Code a -> Rep (Code a) x #

to :: Rep (Code a) x -> Code a #

Binary a => Binary (Code a) Source # 

Methods

put :: Code a -> Put #

get :: Get (Code a) #

putList :: [Code a] -> Put #

type Rep (Code a) Source # 

data ExceptionTable Source #

Constructors

ExceptionTable 

Fields

data ByteCodeOpr Source #

Constructors

ArrayLoad (ArrayType ())

aaload baload ...

ArrayStore (ArrayType ())

aastore bastore ...

Push Constant 
Load LocalType LocalAddress

aload_0, bload_2, iload 5 ...

Store LocalType LocalAddress

aload, bload ...

BinaryOpr BinOpr ArithmeticType

iadd ...

Neg ArithmeticType

ineg ...

BitOpr BitOpr WordSize

Exclusively on int and long, identified by the word-size

IncrLocal !LocalAddress !IncrementAmount

Only works on ints, increment local 2

Cast ArithmeticType ArithmeticType

Only valid on different types

CastDown SmallArithmeticType

Only valid on different types

CompareLongs 
CompareFloating Bool WordSize

Compare two floating values, 2 is if float or double should be used.

If CmpOpr OneOrTwo Offset

compare with 0 if #2 is False, and two ints from the stack if True. the last value is the offset

IfRef Bool OneOrTwo Offset

check if two objects are equal, or not equal. If #2 is True, compare with null.

Goto LongOffset 
Jsr LongOffset 
Ret LocalAddress 
TableSwitch Int32 Int32 Int32 (Vector Int32)

a table switch has 3 values `default` low high and a list of offets.

LookupSwitch Int32 (Vector (Int32, Int32))

a lookup switch has a `default` value and a list of pairs.

Get FieldAccess ConstantRef 
Put FieldAccess ConstantRef 
Invoke Invokation ConstantRef 
New ConstantRef 
NewArray (ArrayType ConstantRef) 
ArrayLength 
Throw 
CheckCast ConstantRef 
InstanceOf ConstantRef 
Monitor Bool

True => Enter, False => Exit

MultiNewArray ConstantRef Word8

Create a new multi array of 2 dimensions

Return (Maybe LocalType) 
Nop 
Pop WordSize 
Dup WordSize 
DupX1 WordSize 
DupX2 WordSize 
Swap 

data BinOpr Source #

Constructors

Add 
Sub 
Mul 
Div 
Rem 

Instances

data ArrayType a Source #

Instances

Eq a => Eq (ArrayType a) Source # 

Methods

(==) :: ArrayType a -> ArrayType a -> Bool #

(/=) :: ArrayType a -> ArrayType a -> Bool #

Show a => Show (ArrayType a) Source # 

data CmpOpr Source #

Constructors

CEq 
CNe 
CLt 
CGe 
CGt 
CLe 

Instances

data BitOpr Source #

Constructors

ShL 
ShR 
UShR 
And 
Or 
XOr 

Instances