bytecode #6

Merged
mrab merged 11 commits from bytecode into master 2024-06-21 07:06:07 +00:00
Showing only changes of commit ee302bb245 - Show all commits

View File

@ -69,18 +69,19 @@ methodAssembler (MethodDeclaration returntype name parameters statement) input =
in case (splitAt index (methods input)) of in case (splitAt index (methods input)) of
(pre, []) -> input (pre, []) -> input
(pre, method : post) -> let (pre, method : post) -> let
(_, bytecode, _) = assembleMethod (constantPool input, [], paramNames) declaration (constants, bytecode, aParamNames) = assembleMethod (constantPool input, [], paramNames) declaration
assembledMethod = method { assembledMethod = method {
memberAttributes = [ memberAttributes = [
CodeAttribute { CodeAttribute {
attributeMaxStack = 420, attributeMaxStack = 420,
attributeMaxLocals = 420, attributeMaxLocals = fromIntegral $ length aParamNames,
attributeCode = bytecode attributeCode = bytecode
} }
] ]
} }
in in
input { input {
constantPool = constants,
methods = pre ++ (assembledMethod : post) methods = pre ++ (assembledMethod : post)
} }