-data TrapType =
- StaticMethodCall
- | StaticFieldAccess
- | VirtualMethodCall Bool
- | InterfaceMethodCall Bool
-
-getTrapType :: TrapMap -> CUInt -> CUInt -> TrapType
-getTrapType tmap signal_from from2 =
- case M.lookup (fromIntegral signal_from) tmap of
- (Just (StaticMethod _)) -> StaticMethodCall
- (Just (StaticField _)) -> StaticFieldAccess
- (Just _) -> error "getTrapMap: doesn't happen"
- -- maybe we've a hit on the second `from' value
- Nothing -> case M.lookup (fromIntegral from2) tmap of
- (Just (VirtualMethod imm8 _)) -> VirtualMethodCall imm8
- (Just (InterfaceMethod imm8 _)) -> InterfaceMethodCall imm8
- (Just _) -> error "getTrapType: abort #1 :-("
- Nothing -> error $ "getTrapType: abort #2 :-(" ++ show signal_from ++ ", " ++ show from2 ++ ", " ++ show tmap
-
-foreign export ccall mateHandler :: CUInt -> CUInt -> CUInt -> CUInt -> IO CUInt
-mateHandler :: CUInt -> CUInt -> CUInt -> CUInt -> IO CUInt
-mateHandler eip eax ebx esp = do
- callerAddr <- callerAddrFromStack esp
+foreign export ccall mateHandler :: CPtrdiff -> CPtrdiff -> CPtrdiff -> CPtrdiff -> IO CPtrdiff
+mateHandler :: CPtrdiff -> CPtrdiff -> CPtrdiff -> CPtrdiff -> IO CPtrdiff
+mateHandler eip eax ebx esi = do