-- Represents a CFG node
data BasicBlock = BasicBlock {
code :: [Instruction],
+ exception :: B.ByteString,
successor :: BBEnd }
-- describes (leaving) edges of a CFG node
type TrapMap = M.Map NativeWord TrapCause
type TrapPatcher = CPtrdiff -> CodeGen () () CPtrdiff
+type TrapPatcherEax = CPtrdiff -> CPtrdiff -> CodeGen () () CPtrdiff
+type TrapPatcherEsp = TrapPatcherEax
data TrapCause
- = StaticMethod MethodInfo -- for static calls
+ = StaticMethod TrapPatcher -- for static calls
| VirtualCall Bool MethodInfo (IO NativeWord) -- for invoke{interface,virtual}
- | InstanceOf B.ByteString -- class name
- | NewObject B.ByteString -- class name
+ | InstanceOf TrapPatcherEax
+ | ThrowException TrapPatcherEsp
+ | NewObject TrapPatcher
| StaticField StaticFieldInfo
| ObjectField TrapPatcher