mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-09 02:49:35 +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}
|
{$endif Test_Double_checksum}
|
||||||
|
|
||||||
const
|
const
|
||||||
CurrentPPUVersion = 129;
|
CurrentPPUVersion = 130;
|
||||||
|
|
||||||
{ buffer sizes }
|
{ buffer sizes }
|
||||||
maxentrysize = 1024;
|
maxentrysize = 1024;
|
||||||
|
|||||||
@ -2080,6 +2080,7 @@ In case not, the value returned can be arbitrary.
|
|||||||
t : ttoken;
|
t : ttoken;
|
||||||
s : tspecialgenerictoken;
|
s : tspecialgenerictoken;
|
||||||
len : sizeint;
|
len : sizeint;
|
||||||
|
b : byte;
|
||||||
begin
|
begin
|
||||||
if not assigned(recordtokenbuf) then
|
if not assigned(recordtokenbuf) then
|
||||||
internalerror(200511176);
|
internalerror(200511176);
|
||||||
@ -2108,8 +2109,17 @@ In case not, the value returned can be arbitrary.
|
|||||||
begin
|
begin
|
||||||
s:=ST_COLUMN;
|
s:=ST_COLUMN;
|
||||||
writetoken(t);
|
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(s,1);
|
||||||
recordtokenbuf.write(current_tokenpos.column,sizeof(current_tokenpos.column));
|
recordtokenbuf.write(current_tokenpos.column,sizeof(current_tokenpos.column));
|
||||||
|
end;
|
||||||
last_filepos.column:=current_tokenpos.column;
|
last_filepos.column:=current_tokenpos.column;
|
||||||
end;
|
end;
|
||||||
if current_tokenpos.fileindex<>last_filepos.fileindex then
|
if current_tokenpos.fileindex<>last_filepos.fileindex then
|
||||||
@ -2258,6 +2268,18 @@ In case not, the value returned can be arbitrary.
|
|||||||
_GENERICSPECIALTOKEN:
|
_GENERICSPECIALTOKEN:
|
||||||
begin
|
begin
|
||||||
replaytokenbuf.read(specialtoken,1);
|
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
|
case specialtoken of
|
||||||
ST_LOADSETTINGS:
|
ST_LOADSETTINGS:
|
||||||
replaytokenbuf.read(current_settings,sizeof(current_settings));
|
replaytokenbuf.read(current_settings,sizeof(current_settings));
|
||||||
|
|||||||
@ -1081,6 +1081,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
_GENERICSPECIALTOKEN:
|
_GENERICSPECIALTOKEN:
|
||||||
begin
|
begin
|
||||||
|
if (tokenbuf[i] and $80)<>0 then
|
||||||
|
begin
|
||||||
|
write('Col: ',tokenbuf[i] and $7f);
|
||||||
|
inc(i);
|
||||||
|
end
|
||||||
|
else
|
||||||
case tspecialgenerictoken(tokenbuf[i]) of
|
case tspecialgenerictoken(tokenbuf[i]) of
|
||||||
ST_LOADSETTINGS:
|
ST_LOADSETTINGS:
|
||||||
begin
|
begin
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user