-data MethodInfo = MethodInfo {
- methName :: B.ByteString,
- cName :: B.ByteString,
- mSignature :: MethodSignature}
-
-instance Eq MethodInfo where
- (MethodInfo m_a c_a s_a) == (MethodInfo m_b c_b s_b) =
- (m_a == m_b) && (c_a == c_b) && (s_a == s_b)
-
--- TODO(bernhard): not really efficient. also, outsource that to hs-java
-instance Ord MethodSignature where
- compare (MethodSignature args_a ret_a) (MethodSignature args_b ret_b)
- | cmp_args /= EQ = cmp_args
- | otherwise = (show ret_a) `compare` (show ret_b)
- where
- cmp_args = (show args_a) `compare` (show args_b)
-
-instance Ord MethodInfo where
- compare (MethodInfo m_a c_a s_a) (MethodInfo m_b c_b s_b)
- | cmp_m /= EQ = cmp_m
- | cmp_c /= EQ = cmp_c
- | otherwise = s_a `compare` s_b
- where
- cmp_m = m_a `compare` m_b
- cmp_c = c_a `compare` c_b
+-- java strings are allocated only once, therefore we
+-- use a hashmap to store the address for a String
+type StringMap = M.Map B.ByteString Word32