瀏覽代碼

* moved jvm-specific exprasm field from tprocdef to jvm-specific descendant

git-svn-id: trunk@27394 -
Jonas Maebe 11 年之前
父節點
當前提交
f4c0daddb4
共有 6 個文件被更改,包括 26 次插入22 次删除
  1. 3 3
      compiler/agjasmin.pas
  2. 4 4
      compiler/jvm/dbgjasm.pas
  3. 2 2
      compiler/jvm/hlcgcpu.pas
  4. 2 2
      compiler/jvm/njvmutil.pas
  5. 15 0
      compiler/jvm/symcpu.pas
  6. 0 11
      compiler/symdef.pas

+ 3 - 3
compiler/agjasmin.pas

@@ -100,7 +100,7 @@ implementation
       SysUtils,
       cutils,cfileutl,systems,script,
       fmodule,finput,verbose,
-      symtype,symtable,jvmdef,
+      symtype,symcpu,symtable,jvmdef,
       itcpujas,cpubase,cpuinfo,cgutils,
       widestr
       ;
@@ -913,7 +913,7 @@ implementation
 
     procedure TJasminAssembler.WriteProcDef(pd: tprocdef);
       begin
-        if not assigned(pd.exprasmlist) and
+        if not assigned(tcpuprocdef(pd).exprasmlist) and
            not(po_abstractmethod in pd.procoptions) and
            (not is_javainterface(pd.struct) or
             (pd.proctypeoption in [potype_unitinit,potype_unitfinalize])) then
@@ -926,7 +926,7 @@ implementation
             AsmWrite(pd.jvmmangledbasename(true));
             AsmWriteln('"');
           end;
-        WriteTree(pd.exprasmlist);
+        WriteTree(tcpuprocdef(pd).exprasmlist);
         AsmWriteln('.end method');
         AsmLn;
       end;

+ 4 - 4
compiler/jvm/dbgjasm.pas

@@ -58,7 +58,7 @@ implementation
       version,globals,verbose,systems,
       cpubase,cpuinfo,cgbase,paramgr,
       fmodule,
-      defutil,symtable,jvmdef,ppu
+      defutil,symtable,symcpu,jvmdef,ppu
       ;
 
 {****************************************************************************
@@ -76,7 +76,7 @@ implementation
         exit;
       proc:=tprocdef(sym.owner.defowner);
       jvar:=tai_jvar.create(sym.localloc.reference.offset,jvmmangledbasename(sym,true),fcurrprocstart,fcurrprocend);
-      proc.exprasmlist.InsertAfter(jvar,proc.procstarttai);
+      tcpuprocdef(proc).exprasmlist.InsertAfter(jvar,proc.procstarttai);
     end;
 
 
@@ -109,8 +109,8 @@ implementation
 
       current_asmdata.getlabel(procstartlabel,alt_dbgtype);
       current_asmdata.getlabel(procendlabel,alt_dbgtype);
-      def.exprasmlist.insertafter(tai_label.create(procstartlabel),def.procstarttai);
-      def.exprasmlist.insertbefore(tai_label.create(procendlabel),def.procendtai);
+      tcpuprocdef(def).exprasmlist.insertafter(tai_label.create(procstartlabel),def.procstarttai);
+      tcpuprocdef(def).exprasmlist.insertbefore(tai_label.create(procendlabel),def.procendtai);
 
       fcurrprocstart:=procstartlabel;
       fcurrprocend:=procendlabel;

+ 2 - 2
compiler/jvm/hlcgcpu.pas

@@ -1627,8 +1627,8 @@ implementation
       if not code.empty and
          current_asmdata.asmlists[al_procedures].empty then
         current_asmdata.asmlists[al_procedures].concat(tai_align.Create(4));
-      pd.exprasmlist:=TAsmList.create;
-      pd.exprasmlist.concatlist(code);
+      tcpuprocdef(pd).exprasmlist:=TAsmList.create;
+      tcpuprocdef(pd).exprasmlist.concatlist(code);
       if assigned(data) and
          not data.empty then
         internalerror(2010122801);

+ 2 - 2
compiler/jvm/njvmutil.pas

@@ -61,7 +61,7 @@ implementation
     uses
       verbose,cutils,globtype,globals,constexp,fmodule,
       aasmdata,aasmtai,cpubase,aasmcpu,
-      symbase,symtable,defutil,jvmdef,
+      symbase,symcpu,symtable,defutil,jvmdef,
       ncnv,ncon,ninl,ncal,nld,nmem,
       ppu,
       pass_1;
@@ -413,7 +413,7 @@ implementation
       mainpd:=tprocsym(mainpsym).find_procdef_bytype(potype_proginit);
       if not assigned(mainpd) then
         internalerror(2011041902);
-      mainpd.exprasmlist.insertList(unitinits);
+      tcpuprocdef(mainpd).exprasmlist.insertList(unitinits);
       unitinits.free;
     end;
 

+ 15 - 0
compiler/jvm/symcpu.pas

@@ -27,6 +27,7 @@ interface
 
 uses
   globtype,
+  aasmdata,
   symtype,
   symdef,symsym;
 
@@ -88,6 +89,10 @@ type
   end;
 
   tcpuprocdef = class(tprocdef)
+    { generated assembler code; used by JVM backend so it can afterwards
+      easily write out all methods grouped per class }
+    exprasmlist      : TAsmList;
+    destructor destroy; override;
   end;
 
   tcpustringdef = class(tstringdef)
@@ -154,6 +159,16 @@ implementation
     symconst,
     jvmdef;
 
+{****************************************************************************
+                             tcpuprocdef
+****************************************************************************}
+
+  destructor tcpuprocdef.destroy;
+    begin
+      exprasmlist.free;
+      inherited destroy;
+    end;
+
 {****************************************************************************
                              tcpuprocvardef
 ****************************************************************************}

+ 0 - 11
compiler/symdef.pas

@@ -37,9 +37,6 @@ interface
        node,
        { aasm }
        aasmbase,aasmtai,
-{$ifdef jvm}
-       aasmdata,
-{$endif}
        cpubase,cpuinfo,
        cgbase,
        parabase
@@ -718,11 +715,6 @@ interface
           { info for inlining the subroutine, if this pointer is nil,
             the procedure can't be inlined }
           inlininginfo : pinlininginfo;
-{$ifdef jvm}
-          { generated assembler code; used by JVM backend so it can afterwards
-            easily write out all methods grouped per class }
-          exprasmlist      : TAsmList;
-{$endif jvm}
 {$ifdef oldregvars}
           regvarinfo: pregvarinfo;
 {$endif oldregvars}
@@ -5011,9 +5003,6 @@ implementation
             dispose(inlininginfo);
             inlininginfo:=nil;
           end;
-{$ifdef jvm}
-         exprasmlist.free;
-{$endif}
          if assigned(implprocdefinfo) then
            begin
             stringdispose(implprocdefinfo^.resultname);