projects
/
hs-java.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use type families: done.
[hs-java.git]
/
JVM
/
Assembler.hs
diff --git
a/JVM/Assembler.hs
b/JVM/Assembler.hs
index 31e00fea6ff1678c86bed9e76ef8cd10d7c962a3..b29eae847cdeb293dacb72c96b2da62db883e248 100644
(file)
--- a/
JVM/Assembler.hs
+++ b/
JVM/Assembler.hs
@@
-53,7
+53,7
@@
data Code = Code {
codeExceptionsN :: Word16,
codeExceptions :: [CodeException],
codeAttrsN :: Word16,
codeExceptionsN :: Word16,
codeExceptions :: [CodeException],
codeAttrsN :: Word16,
- codeAttributes ::
[AttributeInfo]
}
+ codeAttributes ::
Attributes Pointers
}
deriving (Eq, Show)
-- | Exception descriptor
deriving (Eq, Show)
-- | Exception descriptor
@@
-73,7
+73,7
@@
instance BinaryState Integer CodeException where
get = CodeException <$> get <*> get <*> get <*> get
get = CodeException <$> get <*> get <*> get <*> get
-instance BinaryState Integer Attribute
Info
where
+instance BinaryState Integer Attribute where
put a = do
let sz = 6 + attributeLength a -- full size of AttributeInfo structure
liftOffset (fromIntegral sz) Binary.put a
put a = do
let sz = 6 + attributeLength a -- full size of AttributeInfo structure
liftOffset (fromIntegral sz) Binary.put a
@@
-89,7
+89,7
@@
instance BinaryState Integer Code where
put codeExceptionsN
forM_ codeExceptions put
put codeAttrsN
put codeExceptionsN
forM_ codeExceptions put
put codeAttrsN
- forM_
codeAttributes
put
+ forM_
(attributesList codeAttributes)
put
get = do
stackSz <- get
get = do
stackSz <- get
@@
-102,7
+102,7
@@
instance BinaryState Integer Code where
excs <- replicateM (fromIntegral excn) get
nAttrs <- get
attrs <- replicateM (fromIntegral nAttrs) get
excs <- replicateM (fromIntegral excn) get
nAttrs <- get
attrs <- replicateM (fromIntegral nAttrs) get
- return $ Code stackSz locals len code excn excs nAttrs
attrs
+ return $ Code stackSz locals len code excn excs nAttrs
(AP attrs)
-- | Read sequence of instructions (to end of stream)
readInstructions :: GetState Integer [Instruction]
-- | Read sequence of instructions (to end of stream)
readInstructions :: GetState Integer [Instruction]