methodlookup: unique identifier for methods are name+signature
[mate.git] / Mate / X86CodeGen.hs
index 724cfc4a8ffacc9d6bb6e469bc862da8c62e9ba8..42ee6620232fd4450b81157db8fbf4e0b739906d 100644 (file)
@@ -46,8 +46,8 @@ type BBStarts = M.Map BlockID Int
 type CompileInfo = (EntryPoint, BBStarts, Int, TrapMap)
 
 
-emitFromBB :: B.ByteString -> Class Direct -> MapBB -> CodeGen e s (CompileInfo, [Instruction])
-emitFromBB method cls hmap =  do
+emitFromBB :: B.ByteString -> MethodSignature -> Class Direct -> MapBB -> CodeGen e s (CompileInfo, [Instruction])
+emitFromBB method sig cls hmap =  do
         llmap <- sequence [newNamedLabel ("bb_" ++ show x) | (x,_) <- M.toList hmap]
         let lmap = zip (Prelude.fst $ unzip $ M.toList hmap) llmap
         ep <- getEntryPoint
@@ -336,8 +336,8 @@ emitFromBB method cls hmap =  do
   thisMethodArgCnt :: Word32
   thisMethodArgCnt = isNonStatic + fromIntegral (length args)
     where
-    (Just m) = lookupMethod method cls
-    (MethodSignature args _) = methodSignature m
+    (Just m) = lookupMethodSig method sig cls
+    (MethodSignature args _) = sig
     isNonStatic = if S.member ACC_STATIC (methodAccessFlags m)
         then 0 else 1 -- one argument for the this pointer