codegen: approx. initial codebuffer size according to codesize @ bytecode
[mate.git] / Mate / BasicBlocks.hs
index 996c6728aa92291c6c76910dc05c0d26226b6df0..955f4f51191d1eae16ebef98636f75d4a4a58a22 100644 (file)
@@ -100,6 +100,7 @@ parseMethod cls methodname sig = do
   let mapbb = testCFG decoded
   let locals = fromIntegral (codeMaxLocals decoded)
   let stacks = fromIntegral (codeStackSize decoded)
+  let codelen = fromIntegral (codeLength decoded)
   let methoddirect = methodInfoToMethod (MethodInfo methodname "" sig) cls
   let isStatic = methodIsStatic methoddirect
   let nametype = methodNameType methoddirect
@@ -119,7 +120,7 @@ parseMethod cls methodname sig = do
       printfBb "exception: no handler for this method\n"
     Just exceptionstream ->
       printfBb "exception: \"%s\"\n" (show $ codeExceptions $ decodeMethod exceptionstream)
-  return $ RawMethod mapbb locals stacks argscount
+  return $ RawMethod mapbb locals stacks argscount codelen
 
 
 testCFG :: Code -> MapBB