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
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
cls <- getClassFile (methClassName methodinfo)
let ebb = emitFromBB cls rawmethod
- (_, Right right) <- runCodeGen ebb () ()
+ let cgconfig = defaultCodeGenConfig { codeBufferSize = fromIntegral $ (rawCodeLength rawmethod) * 32 }
+ (_, Right right) <- runCodeGenWithConfig ebb () () cgconfig
let ((entry, _, _, new_tmap), _) = right
setTrapMap $ tmap `M.union` new_tmap -- prefers elements in tmap
rawMapBB :: MapBB,
rawLocals :: Int,
rawStackSize :: Int,
- rawArgCount :: NativeWord }
+ rawArgCount :: NativeWord,
+ rawCodeLength :: NativeWord }
-- NativeWord = point of method call in generated code