X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=Mate%2FMethodPool.hs;h=762e787f609dc8b76bd675e0821aebbc755bc6fe;hb=dedebead7a042963f8445ecd23858418b0f8c573;hp=2cd739e54f383a5e719d9b9af68e5a51cdf19b67;hpb=e9bbf51a0b41aee0b904936c4f1b69ca555d2648;p=mate.git diff --git a/Mate/MethodPool.hs b/Mate/MethodPool.hs index 2cd739e..762e787 100644 --- a/Mate/MethodPool.hs +++ b/Mate/MethodPool.hs @@ -19,8 +19,8 @@ import Harpy import Harpy.X86Disassembler import Mate.BasicBlocks +import Mate.Types import Mate.X86CodeGen -import Mate.Utilities foreign import ccall "get_mmap" @@ -29,11 +29,6 @@ foreign import ccall "get_mmap" foreign import ccall "set_mmap" set_mmap :: Ptr () -> IO () - --- B.ByteString = name of method --- Word32 = entrypoint of method -type MMap = M.Map MethodInfo Word32 - foreign export ccall getMethodEntry :: CUInt -> Ptr () -> Ptr () -> IO CUInt getMethodEntry :: CUInt -> Ptr () -> Ptr () -> IO CUInt getMethodEntry signal_from ptr_mmap ptr_cmap = do @@ -41,7 +36,7 @@ getMethodEntry signal_from ptr_mmap ptr_cmap = do cmap <- ptr2cmap ptr_cmap let w32_from = fromIntegral signal_from - let mi@(MethodInfo method cm sig cpidx) = cmap M.! w32_from + let mi@(MethodInfo method cm _ cpidx) = cmap M.! w32_from -- TODO(bernhard): replace parsing with some kind of classpool cls <- parseClassFile $ toString $ cm `B.append` ".class" case M.lookup mi mmap of @@ -79,7 +74,7 @@ compileBB hmap methodinfo = do cmap <- get_cmap >>= ptr2cmap -- TODO(bernhard): replace parsing with some kind of classpool - cls <- parseClassFile $ toString $ (classname methodinfo) `B.append` ".class" + cls <- parseClassFile $ toString $ (cName methodinfo) `B.append` ".class" let ebb = emitFromBB cls hmap (_, Right ((entry, _, _, new_cmap), disasm)) <- runCodeGen ebb () () let w32_entry = ((fromIntegral $ ptrToIntPtr entry) :: Word32)