X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mate.git;a=blobdiff_plain;f=Mate%2FX86CodeGen.hs;h=f1f9969da9237e802697d7890eeffa923993d577;hp=448c966e19d5f41e51003e39685ac0a21f7e2601;hb=8981d77c48cc12673620159b4f6b8274b07abddf;hpb=717a866d25642626b22b9b3abbd8f98ce95c5e10 diff --git a/Mate/X86CodeGen.hs b/Mate/X86CodeGen.hs index 448c966..f1f9969 100644 --- a/Mate/X86CodeGen.hs +++ b/Mate/X86CodeGen.hs @@ -91,6 +91,13 @@ emitFromBB cls method = do -- TODO(bernhard): implement `emit' as function which accepts a list of -- instructions, so we can use patterns for optimizations where + forceRegDump :: CodeGen e s () + forceRegDump = do + push esi + mov esi (0x13371234 :: Word32) + mov esi (Addr 0) + pop esi + getCurrentOffset :: CodeGen e s Word32 getCurrentOffset = do ep <- getEntryPoint @@ -183,6 +190,7 @@ emitFromBB cls method = do sete al movzxb eax al push eax + forceRegDump return $ Just (trapaddr, InstanceOf $ buildClassID cls cpidx) emit' insn = emit insn >> return Nothing