h2jvm
Safe HaskellNone
LanguageGHC2021

H2JVM.ConstantPool

Description

Provides a monadic interface to the constant pool. This aims to eliminate the need to manually specify the index of the constant

Synopsis

Documentation

data ConstantPoolEntry Source #

High-level, type-safe representation of a constant pool entry This tries to hide indexes as much as possible, instead just allowing the values to be provided directly. These are transformed into the correct indexes when the constant pool is built, which uses a state monad to avoid repeating entries.

data MethodHandleEntry Source #

A Method Handle type entry in the constant pool (§4.4.8).

Constructors

MHGetField FieldRef

read field

MHGetStatic FieldRef

read static field

MHPutField FieldRef

write field

MHPutStatic FieldRef

write static field

MHInvokeVirtual MethodRef

invoke virtual method

MHNewInvokeSpecial MethodRef

invoke special method (e.g. init)

MHInvokeStatic MethodRef

invoke static method

MHInvokeSpecial MethodRef

invoke private/super method

MHInvokeInterface MethodRef

invoke interface method

Instances

Instances details
Data MethodHandleEntry Source # 
Instance details

Defined in H2JVM.ConstantPool

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MethodHandleEntry -> c MethodHandleEntry #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MethodHandleEntry #

toConstr :: MethodHandleEntry -> Constr #

dataTypeOf :: MethodHandleEntry -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MethodHandleEntry) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MethodHandleEntry) #

gmapT :: (forall b. Data b => b -> b) -> MethodHandleEntry -> MethodHandleEntry #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MethodHandleEntry -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MethodHandleEntry -> r #

gmapQ :: (forall d. Data d => d -> u) -> MethodHandleEntry -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> MethodHandleEntry -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> MethodHandleEntry -> m MethodHandleEntry #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MethodHandleEntry -> m MethodHandleEntry #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MethodHandleEntry -> m MethodHandleEntry #

Show MethodHandleEntry Source # 
Instance details

Defined in H2JVM.ConstantPool

Eq MethodHandleEntry Source # 
Instance details

Defined in H2JVM.ConstantPool

Ord MethodHandleEntry Source # 
Instance details

Defined in H2JVM.ConstantPool

Pretty MethodHandleEntry Source # 
Instance details

Defined in H2JVM.ConstantPool

data FieldRef Source #

A reference to a field, consisting of the containing class type, field name, and field type.

Instances

Instances details
Data FieldRef Source # 
Instance details

Defined in H2JVM.ConstantPool

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FieldRef -> c FieldRef #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FieldRef #

toConstr :: FieldRef -> Constr #

dataTypeOf :: FieldRef -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FieldRef) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FieldRef) #

gmapT :: (forall b. Data b => b -> b) -> FieldRef -> FieldRef #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FieldRef -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FieldRef -> r #

gmapQ :: (forall d. Data d => d -> u) -> FieldRef -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> FieldRef -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> FieldRef -> m FieldRef #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FieldRef -> m FieldRef #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FieldRef -> m FieldRef #

Show FieldRef Source # 
Instance details

Defined in H2JVM.ConstantPool

Eq FieldRef Source # 
Instance details

Defined in H2JVM.ConstantPool

Ord FieldRef Source # 
Instance details

Defined in H2JVM.ConstantPool

Pretty FieldRef Source # 
Instance details

Defined in H2JVM.ConstantPool

Methods

pretty :: FieldRef -> Doc ann Source #

prettyList :: [FieldRef] -> Doc ann Source #

data MethodRef Source #

A reference to a method, consisting of the containing class type, method name, and descriptor signature.

Constructors

MethodRef 

Fields

Instances

Instances details
Data MethodRef Source # 
Instance details

Defined in H2JVM.ConstantPool

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MethodRef -> c MethodRef #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MethodRef #

toConstr :: MethodRef -> Constr #

dataTypeOf :: MethodRef -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MethodRef) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MethodRef) #

gmapT :: (forall b. Data b => b -> b) -> MethodRef -> MethodRef #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MethodRef -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MethodRef -> r #

gmapQ :: (forall d. Data d => d -> u) -> MethodRef -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> MethodRef -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> MethodRef -> m MethodRef #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MethodRef -> m MethodRef #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MethodRef -> m MethodRef #

Show MethodRef Source # 
Instance details

Defined in H2JVM.ConstantPool

Eq MethodRef Source # 
Instance details

Defined in H2JVM.ConstantPool

Ord MethodRef Source # 
Instance details

Defined in H2JVM.ConstantPool

Pretty MethodRef Source # 
Instance details

Defined in H2JVM.ConstantPool

Methods

pretty :: MethodRef -> Doc ann Source #

prettyList :: [MethodRef] -> Doc ann Source #

data BootstrapMethod Source #

A Bootstrap Method specification, used in invokedynamic call sites (§4.7.23).

Constructors

BootstrapMethod MethodHandleEntry [BootstrapArgument]

Construct a bootstrap method referencing a method handle and its static arguments.

Instances

Instances details
Data BootstrapMethod Source # 
Instance details

Defined in H2JVM.ConstantPool

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BootstrapMethod -> c BootstrapMethod #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BootstrapMethod #

toConstr :: BootstrapMethod -> Constr #

dataTypeOf :: BootstrapMethod -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BootstrapMethod) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BootstrapMethod) #

gmapT :: (forall b. Data b => b -> b) -> BootstrapMethod -> BootstrapMethod #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BootstrapMethod -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BootstrapMethod -> r #

gmapQ :: (forall d. Data d => d -> u) -> BootstrapMethod -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BootstrapMethod -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BootstrapMethod -> m BootstrapMethod #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BootstrapMethod -> m BootstrapMethod #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BootstrapMethod -> m BootstrapMethod #

Show BootstrapMethod Source # 
Instance details

Defined in H2JVM.ConstantPool

Eq BootstrapMethod Source # 
Instance details

Defined in H2JVM.ConstantPool

Ord BootstrapMethod Source # 
Instance details

Defined in H2JVM.ConstantPool

Pretty BootstrapMethod Source # 
Instance details

Defined in H2JVM.ConstantPool

data BootstrapArgument Source #

A static argument for a bootstrap method.

Constructors

BMClassArg ClassInfoType

A Class reference argument.

BMStringArg Text

A String constant argument.

BMIntArg Int32

An integer constant argument.

BMMethodArg MethodDescriptor

A Method type descriptor argument.

BMMethodHandleArg MethodHandleEntry

A Method handle argument.

Instances

Instances details
Data BootstrapArgument Source # 
Instance details

Defined in H2JVM.ConstantPool

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BootstrapArgument -> c BootstrapArgument #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BootstrapArgument #

toConstr :: BootstrapArgument -> Constr #

dataTypeOf :: BootstrapArgument -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BootstrapArgument) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BootstrapArgument) #

gmapT :: (forall b. Data b => b -> b) -> BootstrapArgument -> BootstrapArgument #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BootstrapArgument -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BootstrapArgument -> r #

gmapQ :: (forall d. Data d => d -> u) -> BootstrapArgument -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BootstrapArgument -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BootstrapArgument -> m BootstrapArgument #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BootstrapArgument -> m BootstrapArgument #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BootstrapArgument -> m BootstrapArgument #

Show BootstrapArgument Source # 
Instance details

Defined in H2JVM.ConstantPool

Eq BootstrapArgument Source # 
Instance details

Defined in H2JVM.ConstantPool

Ord BootstrapArgument Source # 
Instance details

Defined in H2JVM.ConstantPool

Pretty BootstrapArgument Source # 
Instance details

Defined in H2JVM.ConstantPool

bmArgToCPEntry :: BootstrapArgument -> ConstantPoolEntry Source #

Convert a bootstrap argument to its equivalent constant pool entry.