From: Bernhard Urban Date: Sat, 19 May 2012 13:37:54 +0000 (+0200) Subject: fixing build X-Git-Tag: v0.3.2~9 X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=hs-java.git;a=commitdiff_plain;h=312938f1af414da6443d21246e51a55e4457a885 fixing build however, I'm not sure if it's correct :-/ --- diff --git a/JVM/Builder/Instructions.hs b/JVM/Builder/Instructions.hs index f74429c..10cb670 100644 --- a/JVM/Builder/Instructions.hs +++ b/JVM/Builder/Instructions.hs @@ -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) diff --git a/JVM/Builder/Monad.hs b/JVM/Builder/Monad.hs index b8c7458..76426f5 100644 --- a/JVM/Builder/Monad.hs +++ b/JVM/Builder/Monad.hs @@ -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 diff --git a/JVM/ClassFile.hs b/JVM/ClassFile.hs index e30eb27..217e7bc 100644 --- a/JVM/ClassFile.hs +++ b/JVM/ClassFile.hs @@ -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) diff --git a/Java/IO.hs b/Java/IO.hs index 9fd12f4..20aeada 100644 --- a/Java/IO.hs +++ b/Java/IO.hs @@ -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) diff --git a/Java/Lang.hs b/Java/Lang.hs index 9a929f1..428689e 100644 --- a/Java/Lang.hs +++ b/Java/Lang.hs @@ -32,10 +32,10 @@ system :: IsString s => s system = "java/lang/System" -- | java.lang.Object.() method -objectInit :: NameType Method +objectInit :: NameType (Method Direct) objectInit = NameType "" $ MethodSignature [] ReturnsVoid -- | java.lang.Integer.valueOf() method -valueOfInteger :: NameType Method +valueOfInteger :: NameType (Method Direct) valueOfInteger = NameType "valueOf" $ MethodSignature [IntType] (Returns Java.Lang.integerClass)