basicblock: annotate BBs with exceptions
[mate.git] / Mate / Types.hs
index 7de8493a8523dddf9c8b6084e42e238a26d0fe22..de17e3780aa4cf8c695e72ce4a6891fb505a64e8 100644 (file)
@@ -42,6 +42,7 @@ type BlockID = Int
 -- Represents a CFG node
 data BasicBlock = BasicBlock {
   code :: [Instruction],
+  exception :: B.ByteString,
   successor :: BBEnd }
 
 -- describes (leaving) edges of a CFG node
@@ -68,11 +69,13 @@ type TrapMap = M.Map NativeWord TrapCause
 
 type TrapPatcher = CPtrdiff -> CodeGen () () CPtrdiff
 type TrapPatcherEax = CPtrdiff -> CPtrdiff -> CodeGen () () CPtrdiff
+type TrapPatcherEsp = TrapPatcherEax
 
 data TrapCause
   = StaticMethod TrapPatcher -- for static calls
   | VirtualCall Bool MethodInfo (IO NativeWord) -- for invoke{interface,virtual}
   | InstanceOf TrapPatcherEax
+  | ThrowException TrapPatcherEsp
   | NewObject TrapPatcher
   | StaticField StaticFieldInfo
   | ObjectField TrapPatcher