X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=Mate%2FX86CodeGen.hs;h=1eb9057f7eb1dd559f67a6631b90841dd26ced1b;hb=1675296109f7d45f42b2100cb70a4edb314fe6d6;hp=59ccb420d4a6cd929c8bb31f7780740c2d519275;hpb=571767aab9622f896c38fb82d1820cfe4ae04dea;p=mate.git diff --git a/Mate/X86CodeGen.hs b/Mate/X86CodeGen.hs index 59ccb42..1eb9057 100644 --- a/Mate/X86CodeGen.hs +++ b/Mate/X86CodeGen.hs @@ -234,12 +234,14 @@ emitFromBB method cls hmap = do call (trapaddr - w32_calladdr) add esp (4 :: Word32) emit DUP = push (Disp 0, esp) + emit AASTORE = emit IASTORE emit IASTORE = do pop eax -- value pop ebx -- offset add ebx (1 :: Word32) pop ecx -- aref mov (ecx, ebx, S4) eax + emit AALOAD = emit IALOAD emit IALOAD = do pop ebx -- offset add ebx (1 :: Word32) @@ -248,6 +250,7 @@ emitFromBB method cls hmap = do emit ARRAYLENGTH = do pop eax push (Disp 0, eax) + emit (ANEWARRAY _) = emit (NEWARRAY 10) -- 10 == T_INT emit (NEWARRAY typ) = do let tsize = case decodeS (0 :: Integer) (B.pack [typ]) of T_INT -> 4 @@ -280,6 +283,7 @@ emitFromBB method cls hmap = do emit (ICONST_0) = push (0 :: Word32) emit (ICONST_1) = push (1 :: Word32) emit (ICONST_2) = push (2 :: Word32) + emit (ICONST_3) = push (3 :: Word32) emit (ICONST_4) = push (4 :: Word32) emit (ICONST_5) = push (5 :: Word32) emit (ALOAD_ x) = emit (ILOAD_ x)