where val = fromIntegral (mmap M.! key) :: NativeWord
printfCp $ printf "%s\n" header
mapM_ printValue (M.keys mmap)
- if mateDEBUG
- then do
- let strpath = toString path
- hexDumpMap ("staticmap @ " ++ strpath) staticmap
- hexDumpMap ("fieldmap @ " ++ strpath) fieldmap
- hexDumpMap ("methodmap @ " ++ strpath) methodmap
- hexDumpMap ("interfacemap @ " ++ strpath) immap
- printfCp $ printf "mbase: 0x%08x\n" mbase
- printfCp $ printf "iftable: 0x%08x\n" wn_iftable
- else return ()
+ when mateDEBUG $ do
+ let strpath = toString path
+ hexDumpMap ("staticmap @ " ++ strpath) staticmap
+ hexDumpMap ("fieldmap @ " ++ strpath) fieldmap
+ hexDumpMap ("methodmap @ " ++ strpath) methodmap
+ hexDumpMap ("interfacemap @ " ++ strpath) immap
+ printfCp $ printf "mbase: 0x%08x\n" mbase
+ printfCp $ printf "iftable: 0x%08x\n" wn_iftable
virtual_map <- getVirtualMap
setVirtualMap $ M.insert mbase path virtual_map
super_mtable <- case superclass of
Nothing -> return 0
Just x -> getMethodTable $ ciName x
- addClassEntry mbase super_mtable
+ addClassEntry mbase super_mtable (interfaces cfile)
return new_ci
-- create index of methods by this interface
let mm = zipbase max_off (classMethods cfile)
- -- create for each method from *every* superinterface a entry to,
+ -- create for each method from *every* superinterface an entry too,
-- but just put in the same offset as it is already in the map
let (ifnames, methodnames) = unzip $ concat
[ zip (repeat ifname) (classMethods $ imap' M.! ifname)
-- merge all offset tables
setInterfaceMethodMap $ M.fromList sm `M.union` M.fromList mm `M.union` immap
setInterfaceMap $ M.insert path cfile imap'
+
+ -- add Interface to Hierarchy
+ addInterfaceEntry path (interfaces cfile)
where
zipbase base = zipWith (\x y -> (entry y, x + base)) [0,ptrSize..]
entry = getname path