projects
/
mate.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7e77d50
)
codegen: factor i{load,store} shortcuts
author
Bernhard Urban
<lewurm@gmail.com>
Tue, 31 Jul 2012 20:22:28 +0000
(22:22 +0200)
committer
Bernhard Urban
<lewurm@gmail.com>
Tue, 31 Jul 2012 15:51:22 +0000
(17:51 +0200)
Mate/X86CodeGen.hs
patch
|
blob
|
history
diff --git
a/Mate/X86CodeGen.hs
b/Mate/X86CodeGen.hs
index e3fa8d6cc67436b6f84dd65f7082af86bd72b8a6..8b3c39f49d94b14c3953e6641c673b8a418fbcd4 100644
(file)
--- a/
Mate/X86CodeGen.hs
+++ b/
Mate/X86CodeGen.hs
@@
-257,14
+257,14
@@
emitFromBB method sig cls hmap = do
emit (ICONST_3) = push (3 :: Word32)
emit (ICONST_4) = push (4 :: Word32)
emit (ICONST_5) = push (5 :: 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)
emit (ALOAD_ x) = emit (ILOAD_ x)
- emit (ILOAD_ x) =
push (Disp (cArgs_ x), ebp
)
+ emit (ILOAD_ x) =
emit (ILOAD $ cArgs_ x
)
emit (ALOAD x) = emit (ILOAD x)
emit (ILOAD x) = push (Disp (cArgs x), ebp)
emit (ALOAD x) = emit (ILOAD x)
emit (ILOAD x) = push (Disp (cArgs x), ebp)
+
emit (ASTORE_ x) = emit (ISTORE_ x)
emit (ASTORE_ x) = emit (ISTORE_ x)
- emit (ISTORE_ x) = do
- pop eax
- mov (Disp (cArgs_ x), ebp) eax
+ emit (ISTORE_ x) = emit (ISTORE $ cArgs_ x)
emit (ASTORE x) = emit (ISTORE x)
emit (ISTORE x) = do
pop eax
emit (ASTORE x) = emit (ISTORE x)
emit (ISTORE x) = do
pop eax
@@
-355,8
+355,8
@@
emitFromBB method sig cls hmap = do
else 4 + (thisMethodArgCnt * 4) - (4 * x')
where x' = fromIntegral x
else 4 + (thisMethodArgCnt * 4) - (4 * x')
where x' = fromIntegral x
- cArgs_ :: IMM -> Word
32
- cArgs_ x = c
Args $ c
ase x of I0 -> 0; I1 -> 1; I2 -> 2; I3 -> 3
+ cArgs_ :: IMM -> Word
8
+ cArgs_ x = case x of I0 -> 0; I1 -> 1; I2 -> 2; I3 -> 3
thisMethodArgCnt :: Word32
thisMethodArgCnt = isNonStatic + fromIntegral (length args)
thisMethodArgCnt :: Word32
thisMethodArgCnt = isNonStatic + fromIntegral (length args)