* removed repetitive pass counting

* display heapsize also for extdebug
This commit is contained in:
peter 2002-09-05 19:28:29 +00:00
parent 37bb42694b
commit 8b5e92cb3c
3 changed files with 37 additions and 60 deletions

View File

@ -179,6 +179,13 @@ implementation
uses uses
aasmcpu; aasmcpu;
{$ifdef EXTDEBUG}
{$define SHOWUSEDMEM}
{$endif}
{$ifdef MEMDEBUG}
{$define SHOWUSEDMEM}
{$endif}
var var
CompilerInitedAfterArgs, CompilerInitedAfterArgs,
CompilerInited : boolean; CompilerInited : boolean;
@ -194,22 +201,7 @@ begin
end; end;
{$endif USEEXCEPT} {$endif USEEXCEPT}
{$ifdef EXTDEBUG}
{$ifdef FPC}
Var
LostMemory : longint;
Procedure CheckMemory(LostMemory : longint);
begin
if LostMemory<>0 then
begin
Writeln('Memory Lost = '+tostr(LostMemory));
{$ifdef DEBUG}
def_gdb_stop(V_Warning);
{$endif DEBUG}
end;
end;
{$endif FPC}
{$endif EXTDEBUG}
{**************************************************************************** {****************************************************************************
Compiler Compiler
****************************************************************************} ****************************************************************************}
@ -374,17 +366,9 @@ begin
Compile:=1; Compile:=1;
DoneVerbose; DoneVerbose;
{$ifdef EXTDEBUG} {$ifdef SHOWUSEDMEM}
{$ifdef FPC} Writeln('Memory used (heapsize): ',DStr(system.Heapsize shr 10),' Kb');
LostMemory:=system.HeapSize-MemAvail-EntryMemUsed; {$endif SHOWUSEDMEM}
CheckMemory(LostMemory);
{$endif FPC}
Writeln('Repetitive firstpass = '+tostr(firstpass_several)+'/'+tostr(total_of_firstpass));
Writeln('Repetitive resulttypepass = ',multiresulttypepasscnt,'/',resulttypepasscnt);
{$endif EXTDEBUG}
{$ifdef MEMDEBUG}
Writeln('Memory used: ',system.Heapsize);
{$endif}
{$ifdef fixLeaksOnError} {$ifdef fixLeaksOnError}
do_stop{$ifdef FPCPROCVAR}(){$endif}; do_stop{$ifdef FPCPROCVAR}(){$endif};
{$endif fixLeaksOnError} {$endif fixLeaksOnError}
@ -393,7 +377,11 @@ end;
end. end.
{ {
$Log$ $Log$
Revision 1.34 2002-08-17 09:23:34 florian Revision 1.35 2002-09-05 19:28:31 peter
* removed repetitive pass counting
* display heapsize also for extdebug
Revision 1.34 2002/08/17 09:23:34 florian
* first part of procinfo rewrite * first part of procinfo rewrite
Revision 1.33 2002/07/26 21:15:37 florian Revision 1.33 2002/07/26 21:15:37 florian

View File

@ -200,11 +200,9 @@ interface
stacksize : longint; stacksize : longint;
{$Ifdef EXTDEBUG} {$Ifdef EXTDEBUG}
total_of_firstpass, {$ifdef FPC}
firstpass_several : longint;
{$ifdef FPC}
EntryMemUsed : longint; EntryMemUsed : longint;
{$endif FPC} {$endif FPC}
{ parameter switches } { parameter switches }
debugstop : boolean; debugstop : boolean;
{$EndIf EXTDEBUG} {$EndIf EXTDEBUG}
@ -1479,7 +1477,11 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.65 2002-08-19 19:36:42 peter Revision 1.66 2002-09-05 19:28:29 peter
* removed repetitive pass counting
* display heapsize also for extdebug
Revision 1.65 2002/08/19 19:36:42 peter
* More fixes for cross unit inlining, all tnodes are now implemented * More fixes for cross unit inlining, all tnodes are now implemented
* Moved pocall_internconst to po_internconst because it is not a * Moved pocall_internconst to po_internconst because it is not a
calling type at all and it conflicted when inlining of these small calling type at all and it conflicted when inlining of these small

View File

@ -29,10 +29,6 @@ interface
uses uses
node; node;
var
resulttypepasscnt,
multiresulttypepasscnt : longint;
procedure resulttypepass(var p : tnode); procedure resulttypepass(var p : tnode);
function do_resulttypepass(var p : tnode) : boolean; function do_resulttypepass(var p : tnode) : boolean;
@ -69,7 +65,6 @@ implementation
oldpos : tfileposinfo; oldpos : tfileposinfo;
hp : tnode; hp : tnode;
begin begin
inc(resulttypepasscnt);
if (p.resulttype.def=nil) then if (p.resulttype.def=nil) then
begin begin
oldcodegenerror:=codegenerror; oldcodegenerror:=codegenerror;
@ -104,7 +99,6 @@ implementation
{ update the codegenerror boolean with the previous result of this node } { update the codegenerror boolean with the previous result of this node }
if (nf_error in p.flags) then if (nf_error in p.flags) then
codegenerror:=true; codegenerror:=true;
inc(multiresulttypepasscnt);
end; end;
end; end;
@ -124,18 +118,11 @@ implementation
oldpos : tfileposinfo; oldpos : tfileposinfo;
hp : tnode; hp : tnode;
begin begin
{$ifdef extdebug}
{ inc(total_of_firstpass);}
{$endif extdebug}
oldcodegenerror:=codegenerror;
oldpos:=aktfilepos;
oldlocalswitches:=aktlocalswitches;
{$ifdef extdebug}
{ if p.firstpasscount>0 then
inc(firstpass_several);}
{$endif extdebug}
if not(nf_error in p.flags) then if not(nf_error in p.flags) then
begin begin
oldcodegenerror:=codegenerror;
oldpos:=aktfilepos;
oldlocalswitches:=aktlocalswitches;
codegenerror:=false; codegenerror:=false;
aktfilepos:=p.fileinfo; aktfilepos:=p.fileinfo;
aktlocalswitches:=p.localswitches; aktlocalswitches:=p.localswitches;
@ -186,10 +173,6 @@ implementation
end end
else else
codegenerror:=true; codegenerror:=true;
{$ifdef extdebug}
{ if count_ref then
inc(p.firstpasscount);}
{$endif extdebug}
end; end;
@ -199,12 +182,12 @@ implementation
firstpass(p); firstpass(p);
{$ifdef state_tracking} {$ifdef state_tracking}
writeln('TRACKSTART'); writeln('TRACKSTART');
writeln('before'); writeln('before');
writenode(p); writenode(p);
do_track_state_pass(p); do_track_state_pass(p);
writeln('after'); writeln('after');
writenode(p); writenode(p);
writeln('TRACKDONE'); writeln('TRACKDONE');
{$endif} {$endif}
do_firstpass:=codegenerror; do_firstpass:=codegenerror;
end; end;
@ -215,14 +198,18 @@ implementation
begin begin
aktstate:=Tstate_storage.create; aktstate:=Tstate_storage.create;
p.track_state_pass(true); p.track_state_pass(true);
aktstate.destroy; aktstate.destroy;
end; end;
{$endif} {$endif}
end. end.
{ {
$Log$ $Log$
Revision 1.27 2002-07-19 12:55:27 daniel Revision 1.28 2002-09-05 19:28:30 peter
* removed repetitive pass counting
* display heapsize also for extdebug
Revision 1.27 2002/07/19 12:55:27 daniel
* Further developed state tracking in whilerepeatn * Further developed state tracking in whilerepeatn
Revision 1.26 2002/07/19 11:41:36 daniel Revision 1.26 2002/07/19 11:41:36 daniel