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

git-svn-id: trunk@33665 -
This commit is contained in:
Károly Balogh 2016-05-10 13:03:17 +00:00
parent e4baf67722
commit 3e2319ff3a
3 changed files with 10 additions and 21 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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);