mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 08:19:27 +02:00
* better execution weighting for while loops: the condition must be evaluated with an increased execution weight as well
* ensure that the weight is always increased git-svn-id: trunk@34799 -
This commit is contained in:
parent
64e2c2b914
commit
834d58f54c
@ -88,6 +88,7 @@ interface
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
cutils,
|
||||||
verbose,globals,systems,globtype,constexp,
|
verbose,globals,systems,globtype,constexp,
|
||||||
symconst,symdef,symsym,symtable,symtype,aasmtai,aasmdata,aasmcpu,defutil,
|
symconst,symdef,symsym,symtable,symtype,aasmtai,aasmdata,aasmcpu,defutil,
|
||||||
procinfo,cgbase,pass_2,parabase,
|
procinfo,cgbase,pass_2,parabase,
|
||||||
@ -168,14 +169,12 @@ implementation
|
|||||||
current_procinfo.CurrContinueLabel:=lcont;
|
current_procinfo.CurrContinueLabel:=lcont;
|
||||||
current_procinfo.CurrBreakLabel:=lbreak;
|
current_procinfo.CurrBreakLabel:=lbreak;
|
||||||
|
|
||||||
|
{ calc register weight }
|
||||||
|
oldexecutionweight:=cg.executionweight;
|
||||||
|
cg.executionweight:=max(cg.executionweight,1)*8;
|
||||||
|
|
||||||
if assigned(right) then
|
if assigned(right) then
|
||||||
begin
|
secondpass(right);
|
||||||
{ calc register weight }
|
|
||||||
oldexecutionweight:=cg.executionweight;
|
|
||||||
cg.executionweight:=cg.executionweight*8;
|
|
||||||
secondpass(right);
|
|
||||||
cg.executionweight:=oldexecutionweight;
|
|
||||||
end;
|
|
||||||
|
|
||||||
{$ifdef OLDREGVARS}
|
{$ifdef OLDREGVARS}
|
||||||
load_all_regvars(current_asmdata.CurrAsmList);
|
load_all_regvars(current_asmdata.CurrAsmList);
|
||||||
@ -195,6 +194,7 @@ implementation
|
|||||||
secondpass(left);
|
secondpass(left);
|
||||||
|
|
||||||
hlcg.maketojumpboollabels(current_asmdata.CurrAsmList,left,truelabel,falselabel);
|
hlcg.maketojumpboollabels(current_asmdata.CurrAsmList,left,truelabel,falselabel);
|
||||||
|
cg.executionweight:=oldexecutionweight;
|
||||||
hlcg.a_label(current_asmdata.CurrAsmList,lbreak);
|
hlcg.a_label(current_asmdata.CurrAsmList,lbreak);
|
||||||
|
|
||||||
sync_regvars(false);
|
sync_regvars(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user