diff options
author | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2015-08-27 18:28:57 +0000 |
---|---|---|
committer | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2015-08-27 18:28:57 +0000 |
commit | 56488c46072b8a568198eb90f033beb982ec371a (patch) | |
tree | 8cf971b75ef94fdec16b1e8bc9c13eccca433d00 /compiler/procinfo.pas | |
parent | 7a40d09b2e46459806c0c6f7fee35b22f12a410e (diff) | |
download | fpc-56488c46072b8a568198eb90f033beb982ec371a.tar.gz |
* replaced current_procinfo.currtrue/falselabel with storing the true/false
labels of LOC_JUMP in the node's location. This generates some extra jumps
for short circuit boolean and/or-expressions if optimizations are off, but
with optimisations enabled the generated code is the same (except for JVM
because the jump threading optimisation isn't enabled there yet).
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@31431 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/procinfo.pas')
-rw-r--r-- | compiler/procinfo.pas | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/compiler/procinfo.pas b/compiler/procinfo.pas index e3b0f64c61..88eca2a4da 100644 --- a/compiler/procinfo.pas +++ b/compiler/procinfo.pas @@ -108,9 +108,7 @@ unit procinfo; { Labels for TRUE/FALSE condition, BREAK and CONTINUE } CurrBreakLabel, - CurrContinueLabel, - CurrTrueLabel, - CurrFalseLabel : tasmlabel; + CurrContinueLabel : tasmlabel; { label to leave the sub routine } CurrExitLabel : tasmlabel; @@ -160,12 +158,6 @@ unit procinfo; { Destroy the entire procinfo tree, starting from the outermost parent } procedure destroy_tree; - { Store CurrTrueLabel and CurrFalseLabel to saved and generate new ones } - procedure save_jump_labels(out saved: tsavedlabels); - - { Restore CurrTrueLabel and CurrFalseLabel from saved } - procedure restore_jump_labels(const saved: tsavedlabels); - function get_first_nestedproc: tprocinfo; function has_nestedprocs: boolean; function get_normal_proc: tprocinfo; @@ -216,8 +208,6 @@ implementation current_asmdata.getjumplabel(CurrGOTLabel); CurrBreakLabel:=nil; CurrContinueLabel:=nil; - CurrTrueLabel:=nil; - CurrFalseLabel:=nil; if Assigned(parent) and (parent.procdef.parast.symtablelevel>=normal_function_level) then parent.addnestedproc(Self); end; @@ -277,20 +267,6 @@ implementation result:=result.parent; end; - procedure tprocinfo.save_jump_labels(out saved: tsavedlabels); - begin - saved[false]:=CurrFalseLabel; - saved[true]:=CurrTrueLabel; - current_asmdata.getjumplabel(CurrTrueLabel); - current_asmdata.getjumplabel(CurrFalseLabel); - end; - - procedure tprocinfo.restore_jump_labels(const saved: tsavedlabels); - begin - CurrFalseLabel:=saved[false]; - CurrTrueLabel:=saved[true]; - end; - procedure tprocinfo.allocate_push_parasize(size:longint); begin if size>maxpushedparasize then |