mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-09 00:29:32 +01:00
* packed column writing/reading for token recorder, reduces size of fgl.ppu by approx. 10%
git-svn-id: trunk@17512 -
This commit is contained in:
parent
120d9a7a4a
commit
d19d8de8fe
@ -43,7 +43,7 @@ type
|
||||
{$endif Test_Double_checksum}
|
||||
|
||||
const
|
||||
CurrentPPUVersion = 129;
|
||||
CurrentPPUVersion = 130;
|
||||
|
||||
{ buffer sizes }
|
||||
maxentrysize = 1024;
|
||||
|
||||
@ -2080,6 +2080,7 @@ In case not, the value returned can be arbitrary.
|
||||
t : ttoken;
|
||||
s : tspecialgenerictoken;
|
||||
len : sizeint;
|
||||
b : byte;
|
||||
begin
|
||||
if not assigned(recordtokenbuf) then
|
||||
internalerror(200511176);
|
||||
@ -2108,8 +2109,17 @@ In case not, the value returned can be arbitrary.
|
||||
begin
|
||||
s:=ST_COLUMN;
|
||||
writetoken(t);
|
||||
{ can the column be written packed? }
|
||||
if current_tokenpos.column<$80 then
|
||||
begin
|
||||
b:=$80 or current_tokenpos.column;
|
||||
recordtokenbuf.write(b,1);
|
||||
end
|
||||
else
|
||||
begin
|
||||
recordtokenbuf.write(s,1);
|
||||
recordtokenbuf.write(current_tokenpos.column,sizeof(current_tokenpos.column));
|
||||
end;
|
||||
last_filepos.column:=current_tokenpos.column;
|
||||
end;
|
||||
if current_tokenpos.fileindex<>last_filepos.fileindex then
|
||||
@ -2258,6 +2268,18 @@ In case not, the value returned can be arbitrary.
|
||||
_GENERICSPECIALTOKEN:
|
||||
begin
|
||||
replaytokenbuf.read(specialtoken,1);
|
||||
{ packed column? }
|
||||
if (ord(specialtoken) and $80)<>0 then
|
||||
begin
|
||||
current_tokenpos.column:=ord(specialtoken) and $7f;
|
||||
|
||||
{ don't generate invalid line info if no sources are available for the current module }
|
||||
if not(get_module(current_filepos.moduleindex).sources_avail) then
|
||||
current_tokenpos.column:=0;
|
||||
|
||||
current_filepos:=current_tokenpos;
|
||||
end
|
||||
else
|
||||
case specialtoken of
|
||||
ST_LOADSETTINGS:
|
||||
replaytokenbuf.read(current_settings,sizeof(current_settings));
|
||||
|
||||
@ -1081,6 +1081,12 @@ begin
|
||||
end;
|
||||
_GENERICSPECIALTOKEN:
|
||||
begin
|
||||
if (tokenbuf[i] and $80)<>0 then
|
||||
begin
|
||||
write('Col: ',tokenbuf[i] and $7f);
|
||||
inc(i);
|
||||
end
|
||||
else
|
||||
case tspecialgenerictoken(tokenbuf[i]) of
|
||||
ST_LOADSETTINGS:
|
||||
begin
|
||||
|
||||
Loading…
Reference in New Issue
Block a user