Explorar el Código

m68k: do not allocate/free the regset dynamically having it as a normal field is perfectly fine

git-svn-id: trunk@33665 -
Károly Balogh hace 9 años
padre
commit
3e2319ff3a
Se han modificado 3 ficheros con 10 adiciones y 21 borrados
  1. 1 9
      compiler/aasmtai.pas
  2. 6 9
      compiler/m68k/aasmcpu.pas
  3. 3 3
      compiler/m68k/ag68kgas.pas

+ 1 - 9
compiler/aasmtai.pas

@@ -419,7 +419,7 @@ interface
             top_conditioncode : (cc : TAsmCond);
         {$endif defined(arm) or defined(aarch64)}
         {$ifdef m68k}
-            top_regset : (dataregset,addrregset,fpuregset:^tcpuregisterset);
+            top_regset : (dataregset,addrregset,fpuregset: tcpuregisterset);
         {$endif m68k}
         {$ifdef jvm}
             top_single : (sval:single);
@@ -2686,14 +2686,6 @@ implementation
               top_regset:
                 dispose(regset);
 {$endif ARM}
-{$ifdef m68k}
-              top_regset:
-                begin
-                  dispose(dataregset);
-                  dispose(addrregset);
-                  dispose(fpuregset);
-                end;
-{$endif m68k}
 {$ifdef jvm}
               top_string:
                 freemem(pcval);

+ 6 - 9
compiler/m68k/aasmcpu.pas

@@ -125,26 +125,23 @@ type
          begin
            if typ<>top_regset then
              clearop(opidx);
-           new(dataregset);
-           new(addrregset);
-           new(fpuregset);
-           dataregset^:=dataregs;
-           addrregset^:=addrregs;
-           fpuregset^:=fpuregs;
+           dataregset:=dataregs;
+           addrregset:=addrregs;
+           fpuregset:=fpuregs;
            typ:=top_regset;
            for i:=RS_D0 to RS_D7 do
              begin
-               if assigned(add_reg_instruction_hook) and (i in dataregset^) then
+               if assigned(add_reg_instruction_hook) and (i in dataregset) then
                  add_reg_instruction_hook(self,newreg(R_INTREGISTER,i,R_SUBWHOLE));
              end;
            for i:=RS_A0 to RS_SP do
              begin
-               if assigned(add_reg_instruction_hook) and (i in addrregset^) then
+               if assigned(add_reg_instruction_hook) and (i in addrregset) then
                  add_reg_instruction_hook(self,newreg(R_ADDRESSREGISTER,i,R_SUBWHOLE));
              end;
            for i:=RS_FP0 to RS_FP7 do
              begin
-               if assigned(add_reg_instruction_hook) and (i in fpuregset^) then
+               if assigned(add_reg_instruction_hook) and (i in fpuregset) then
                  add_reg_instruction_hook(self,newreg(R_FPUREGISTER,i,R_SUBWHOLE));
              end;
          end;

+ 3 - 3
compiler/m68k/ag68kgas.pas

@@ -163,17 +163,17 @@ interface
               getopstr:='';
               for i:=RS_D0 to RS_D7 do
                 begin
-                  if i in o.dataregset^ then
+                  if i in o.dataregset then
                    getopstr:=getopstr+gas_regname(newreg(R_INTREGISTER,i,R_SUBWHOLE))+'/';
                 end;
               for i:=RS_A0 to RS_SP do
                 begin
-                  if i in o.addrregset^ then
+                  if i in o.addrregset then
                    getopstr:=getopstr+gas_regname(newreg(R_ADDRESSREGISTER,i,R_SUBWHOLE))+'/';
                 end;
               for i:=RS_FP0 to RS_FP7 do
                 begin
-                  if i in o.fpuregset^ then
+                  if i in o.fpuregset then
                    getopstr:=getopstr+gas_regname(newreg(R_FPUREGISTER,i,R_SUBNONE))+'/';
                 end;
               delete(getopstr,length(getopstr),1);