codegen: get full jnmap in patcher
[mate.git] / Mate / X86CodeGen.hs
index 03333ce0d35d5163a3b31da763a60eb3d20b6ad6..79586ef02dd49ab33e512484d7d9c86558844201 100644 (file)
@@ -45,8 +45,8 @@ type BBStarts = M.Map BlockID Int
 type CompileInfo = (EntryPoint, Int, TrapMap)
 
 
 type CompileInfo = (EntryPoint, Int, TrapMap)
 
 
-emitFromBB :: Class Direct -> RawMethod -> CodeGen e JpcNpcMap (CompileInfo, [Instruction])
-emitFromBB cls method = do
+emitFromBB :: Class Direct -> MethodInfo -> RawMethod -> CodeGen e JpcNpcMap (CompileInfo, [Instruction])
+emitFromBB cls miThis method = do
     let keys = M.keys hmap
     llmap <- mapM (newNamedLabel . (++) "bb_" . show) keys
     let lmap = zip keys llmap
     let keys = M.keys hmap
     llmap <- mapM (newNamedLabel . (++) "bb_" . show) keys
     let lmap = zip keys llmap
@@ -218,6 +218,7 @@ emitFromBB cls method = do
     emit' ATHROW = do
       trapaddr <- emitSigIllTrap 2
       let patcher resp reip = do
     emit' ATHROW = do
       trapaddr <- emitSigIllTrap 2
       let patcher resp reip = do
+            (_, jnmap) <- liftIO $ getMethodEntry miThis
             error "no athrow for you, sorry"
             emitSigIllTrap 2
             return reip
             error "no athrow for you, sorry"
             emitSigIllTrap 2
             return reip