From bf735c7e5820f49d9dce90404d6b3ff8fbd7c942 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Thu, 7 Jan 2016 22:04:44 +0000 Subject: [PATCH] * cleanup git-svn-id: trunk@32877 - --- compiler/jvm/agjasmin.pas | 49 ++++++++++++++------------------------- 1 file changed, 18 insertions(+), 31 deletions(-) diff --git a/compiler/jvm/agjasmin.pas b/compiler/jvm/agjasmin.pas index 7420183d4f..d0007cf2b6 100644 --- a/compiler/jvm/agjasmin.pas +++ b/compiler/jvm/agjasmin.pas @@ -1098,39 +1098,26 @@ implementation procedure TJasminAssembler.WriteAsmList; - begin -{$ifdef EXTDEBUG} - if assigned(current_module.mainsource) then - Comment(V_Debug,'Start writing Jasmin-styled assembler output for '+current_module.mainsource); -{$endif} + begin + { the code for Java methods needs to be emitted class per class, + so instead of iterating over all asmlists, we iterate over all types + and global variables (a unit becomes a class, with its global + variables static fields) } + writer.MarkEmpty; + WriteExtraHeader(nil); + { print all global variables } + WriteSymtableVarSyms(current_module.globalsymtable); + WriteSymtableVarSyms(current_module.localsymtable); + writer.AsmLn; + { print all global procedures/functions } + WriteSymtableProcdefs(current_module.globalsymtable); + WriteSymtableProcdefs(current_module.localsymtable); - writer.MarkEmpty; - WriteExtraHeader(nil); -(* - for hal:=low(TasmlistType) to high(TasmlistType) do - begin - writer.AsmWriteLn(asminfo^.comment+'Begin asmlist '+AsmlistTypeStr[hal]); - writetree(current_asmdata.asmlists[hal]); - writer.AsmWriteLn(asminfo^.comment+'End asmlist '+AsmlistTypeStr[hal]); - end; -*) - { print all global variables } - WriteSymtableVarSyms(current_module.globalsymtable); - WriteSymtableVarSyms(current_module.localsymtable); - writer.AsmLn; - { print all global procedures/functions } - WriteSymtableProcdefs(current_module.globalsymtable); - WriteSymtableProcdefs(current_module.localsymtable); + WriteSymtableStructDefs(current_module.globalsymtable); + WriteSymtableStructDefs(current_module.localsymtable); - WriteSymtableStructDefs(current_module.globalsymtable); - WriteSymtableStructDefs(current_module.localsymtable); - - writer.AsmLn; -{$ifdef EXTDEBUG} - if assigned(current_module.mainsource) then - Comment(V_Debug,'Done writing gas-styled assembler output for '+current_module.mainsource); -{$endif EXTDEBUG} - end; + writer.AsmLn; + end; {****************************************************************************}