fixing build
authorBernhard Urban <lewurm@gmail.com>
Sat, 19 May 2012 13:37:54 +0000 (15:37 +0200)
committerIlya Portnov <portnov@iportnov.ru>
Sat, 19 May 2012 14:39:51 +0000 (20:39 +0600)
however, I'm not sure if it's correct :-/

JVM/Builder/Instructions.hs
JVM/Builder/Monad.hs
JVM/ClassFile.hs
Java/IO.hs
Java/Lang.hs

index f74429cecdc57401c6f09417e7c8493b429f701e..10cb6709d550552bb9193283869c50aa01b36b65 100644 (file)
@@ -279,19 +279,19 @@ allocNewArray :: Generator e g => B.ByteString -> g e ()
 allocNewArray cls =
   i1 ANEWARRAY (CClass cls)
 
-invokeVirtual :: Generator e g => B.ByteString -> NameType Method -> g e ()
+invokeVirtual :: Generator e g => B.ByteString -> NameType (Method Direct) -> g e ()
 invokeVirtual cls sig =
   i1 INVOKEVIRTUAL (CMethod cls sig)
 
-invokeStatic :: Generator e g => B.ByteString -> NameType Method -> g e ()
+invokeStatic :: Generator e g => B.ByteString -> NameType (Method Direct) -> g e ()
 invokeStatic cls sig =
   i1 INVOKESTATIC (CMethod cls sig)
 
-invokeSpecial :: Generator e g => B.ByteString -> NameType Method -> g e ()
+invokeSpecial :: Generator e g => B.ByteString -> NameType (Method Direct) -> g e ()
 invokeSpecial cls sig =
   i1 INVOKESPECIAL (CMethod cls sig)
 
-getStaticField :: Generator e g => B.ByteString -> NameType Field -> g e ()
+getStaticField :: Generator e g => B.ByteString -> NameType (Field Direct) -> g e ()
 getStaticField cls sig =
   i1 GETSTATIC (CField cls sig)
 
index b8c74583fc8825b6b4d34f4f0ac70ae4eb5d6702..76426f54be665ebd0d4db8a3624ba74787eec43b 100644 (file)
@@ -247,7 +247,7 @@ newMethod :: (Generator e g, Throws UnexpectedEndMethod e)
           -> [ArgumentSignature] -- ^ Signatures of method arguments
           -> ReturnSignature     -- ^ Method return signature
           -> g e ()                -- ^ Generator for method code
-          -> g e (NameType Method)
+          -> g e (NameType (Method Direct))
 newMethod flags name args ret gen = do
   let sig = MethodSignature args ret
   startMethod flags name sig
@@ -270,7 +270,7 @@ getClass name = do
 
 -- | Get class field signature from current ClassPath
 getClassField :: (Throws ENotFound e, Throws ENotLoaded e)
-              => String -> B.ByteString -> GenerateIO e (NameType Field)
+              => String -> B.ByteString -> GenerateIO e (NameType (Field Direct))
 getClassField clsName fldName = do
   cls <- getClass clsName
   case lookupField fldName cls of
@@ -279,7 +279,7 @@ getClassField clsName fldName = do
 
 -- | Get class method signature from current ClassPath
 getClassMethod :: (Throws ENotFound e, Throws ENotLoaded e)
-               => String -> B.ByteString -> GenerateIO e (NameType Method)
+               => String -> B.ByteString -> GenerateIO e (NameType (Method Direct))
 getClassMethod clsName mName = do
   cls <- getClass clsName
   case lookupMethod mName cls of
index e30eb27abf13ede87d9653c9b5f9af4da38ca082..217e7bcfc7afc6a128a13da1518da0ce3f683be7 100644 (file)
@@ -147,11 +147,11 @@ class (Binary (Signature a), Show (Signature a), Eq (Signature a))
     => HasSignature a where
   type Signature a
 
-instance HasSignature Field where
-  type Signature Field = FieldSignature
+instance HasSignature (Field Direct) where
+  type Signature (Field Direct) = FieldSignature
 
-instance HasSignature Method where
-  type Signature Method = MethodSignature
+instance HasSignature (Method Direct) where
+  type Signature (Method Direct) = MethodSignature
 
 -- | Name and signature pair. Used for methods and fields.
 data NameType a = NameType {
@@ -171,9 +171,9 @@ instance HasSignature a => Binary (NameType a) where
 -- | Constant pool item
 data Constant stage =
     CClass (Link stage B.ByteString)
-  | CField (Link stage B.ByteString) (Link stage (NameType Field))
-  | CMethod (Link stage B.ByteString) (Link stage (NameType Method))
-  | CIfaceMethod (Link stage B.ByteString) (Link stage (NameType Method))
+  | CField (Link stage B.ByteString) (Link stage (NameType (Field stage)))
+  | CMethod (Link stage B.ByteString) (Link stage (NameType (Method stage)))
+  | CIfaceMethod (Link stage B.ByteString) (Link stage (NameType (Method stage)))
   | CString (Link stage B.ByteString)
   | CInteger Word32
   | CFloat Float
@@ -557,7 +557,7 @@ lookupField name cls = look (classFields cls)
       | fieldName f == name = Just f
       | otherwise           = look fs
 
-fieldNameType :: Field Direct -> NameType Field
+fieldNameType :: Field Direct -> NameType (Field Direct)
 fieldNameType f = NameType (fieldName f) (fieldSignature f)
 
 instance Binary (Field File) where
@@ -589,7 +589,7 @@ deriving instance Eq (Method Direct)
 deriving instance Show (Method File)
 deriving instance Show (Method Direct)
 
-methodNameType :: Method Direct -> NameType Method
+methodNameType :: Method Direct -> NameType (Method Direct)
 methodNameType m = NameType (methodName m) (methodSignature m)
 
 lookupMethod :: B.ByteString -> Class Direct -> Maybe (Method Direct)
index 9fd12f4f7dc01ad3da2072c65ca0067b9df7331c..20aeada67077304376660460d748dce43c63e12d 100644 (file)
@@ -17,13 +17,13 @@ printStream = "java/io/PrintStream"
 printStreamClass ::  FieldType
 printStreamClass = ObjectType printStream
 
-println :: NameType Method
+println :: NameType (Method Direct)
 println = NameType "println" $ MethodSignature [Java.Lang.stringClass] ReturnsVoid
 
-out :: NameType Field
+out :: NameType (Field Direct)
 out = NameType "out" printStreamClass
 
-printf :: NameType Method
+printf :: NameType (Method Direct)
 printf =
   NameType "printf" $ MethodSignature [Java.Lang.stringClass,
                                        Array Nothing Java.Lang.objectClass] (Returns printStreamClass)
index 9a929f1281ce8493943c0ee70cf43b0452092f1a..428689ec7356cadab19d9274f13e24d727e72172 100644 (file)
@@ -32,10 +32,10 @@ system :: IsString s => s
 system = "java/lang/System"
 
 -- | java.lang.Object.<init>() method
-objectInit :: NameType Method
+objectInit :: NameType (Method Direct)
 objectInit = NameType "<init>" $ MethodSignature [] ReturnsVoid
 
 -- | java.lang.Integer.valueOf() method
-valueOfInteger :: NameType Method
+valueOfInteger :: NameType (Method Direct)
 valueOfInteger = NameType "valueOf" $ MethodSignature [IntType] (Returns Java.Lang.integerClass)