mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-07 04:02:03 +01:00
* with temp vars now use a reference with a persistant temp instead
of setting datasize
This commit is contained in:
parent
7124cecdd4
commit
12313fbed8
@ -402,40 +402,28 @@ implementation
|
|||||||
if we can init from base class for a child
|
if we can init from base class for a child
|
||||||
class that the wrong VMT will be
|
class that the wrong VMT will be
|
||||||
transfered to constructor !! }
|
transfered to constructor !! }
|
||||||
{$ifdef NODIRECTWITH}
|
|
||||||
p^.methodpointer^.resulttype:=p^.symtable^.defowner;
|
|
||||||
{$else NODIRECTWITH}
|
|
||||||
p^.methodpointer^.resulttype:=
|
p^.methodpointer^.resulttype:=
|
||||||
ptree(pwithsymtable(p^.symtable)^.withnode)^.left^.resulttype;
|
ptree(pwithsymtable(p^.symtable)^.withnode)^.left^.resulttype;
|
||||||
{$endif def NODIRECTWITH}
|
|
||||||
{ change dispose type !! }
|
{ change dispose type !! }
|
||||||
p^.disposetyp:=dt_mbleft_and_method;
|
p^.disposetyp:=dt_mbleft_and_method;
|
||||||
{ make a reference }
|
{ make a reference }
|
||||||
new(r);
|
new(r);
|
||||||
reset_reference(r^);
|
reset_reference(r^);
|
||||||
{$ifndef NODIRECTWITH}
|
{ if assigned(ptree(pwithsymtable(p^.symtable)^.withnode)^.pref) then
|
||||||
if assigned(ptree(pwithsymtable(p^.symtable)^.withnode)^.pref) then
|
|
||||||
begin
|
begin
|
||||||
r^:=ptree(pwithsymtable(p^.symtable)^.withnode)^.pref^;
|
r^:=ptree(pwithsymtable(p^.symtable)^.withnode)^.pref^;
|
||||||
{if assigned(r^.symbol) then
|
|
||||||
r^.symbol:=stringdup(r^.symbol^);}
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
{$endif def NODIRECTWITH}
|
|
||||||
begin
|
begin
|
||||||
r^.offset:=p^.symtable^.datasize;
|
r^.offset:=p^.symtable^.datasize;
|
||||||
r^.base:=procinfo.framepointer;
|
r^.base:=procinfo.framepointer;
|
||||||
end;
|
end; }
|
||||||
{$ifndef NODIRECTWITH}
|
r^:=ptree(pwithsymtable(p^.symtable)^.withnode)^.withreference^;
|
||||||
if (not pwithsymtable(p^.symtable)^.direct_with) or
|
if (not pwithsymtable(p^.symtable)^.direct_with) or
|
||||||
pobjectdef(p^.methodpointer^.resulttype)^.isclass then
|
pobjectdef(p^.methodpointer^.resulttype)^.isclass then
|
||||||
{$endif def NODIRECTWITH}
|
|
||||||
exprasmlist^.concat(new(pai386,op_ref_reg(A_MOV,S_L,r,R_ESI)))
|
exprasmlist^.concat(new(pai386,op_ref_reg(A_MOV,S_L,r,R_ESI)))
|
||||||
{$ifndef NODIRECTWITH}
|
|
||||||
else
|
else
|
||||||
exprasmlist^.concat(new(pai386,op_ref_reg(A_LEA,S_L,r,R_ESI)))
|
exprasmlist^.concat(new(pai386,op_ref_reg(A_LEA,S_L,r,R_ESI)));
|
||||||
{$endif def NODIRECTWITH}
|
|
||||||
;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ push self }
|
{ push self }
|
||||||
@ -803,8 +791,7 @@ implementation
|
|||||||
{ process the inlinecode }
|
{ process the inlinecode }
|
||||||
secondpass(inlinecode);
|
secondpass(inlinecode);
|
||||||
{ free the args }
|
{ free the args }
|
||||||
ungetpersistanttemp(p^.procdefinition^.parast^.address_fixup,
|
ungetpersistanttemp(p^.procdefinition^.parast^.address_fixup);
|
||||||
p^.procdefinition^.parast^.datasize);
|
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -1102,7 +1089,7 @@ implementation
|
|||||||
pp:=pp^.right;
|
pp:=pp^.right;
|
||||||
end;
|
end;
|
||||||
if inlined then
|
if inlined then
|
||||||
ungetpersistanttemp(inlinecode^.retoffset,4);
|
ungetpersistanttemp(inlinecode^.retoffset);
|
||||||
disposetree(params);
|
disposetree(params);
|
||||||
|
|
||||||
|
|
||||||
@ -1183,7 +1170,7 @@ implementation
|
|||||||
{we can free the local data now, reset also the fixup address }
|
{we can free the local data now, reset also the fixup address }
|
||||||
if st^.datasize>0 then
|
if st^.datasize>0 then
|
||||||
begin
|
begin
|
||||||
ungetpersistanttemp(st^.address_fixup,st^.datasize);
|
ungetpersistanttemp(st^.address_fixup);
|
||||||
st^.address_fixup:=0;
|
st^.address_fixup:=0;
|
||||||
end;
|
end;
|
||||||
aktprocsym:=oldprocsym;
|
aktprocsym:=oldprocsym;
|
||||||
@ -1200,7 +1187,11 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.79 1999-05-17 21:56:59 florian
|
Revision 1.80 1999-05-17 23:51:37 peter
|
||||||
|
* with temp vars now use a reference with a persistant temp instead
|
||||||
|
of setting datasize
|
||||||
|
|
||||||
|
Revision 1.79 1999/05/17 21:56:59 florian
|
||||||
* new temporary ansistring handling
|
* new temporary ansistring handling
|
||||||
|
|
||||||
Revision 1.78 1999/05/01 13:24:02 peter
|
Revision 1.78 1999/05/01 13:24:02 peter
|
||||||
|
|||||||
@ -196,19 +196,28 @@ implementation
|
|||||||
end;
|
end;
|
||||||
withsymtable:
|
withsymtable:
|
||||||
begin
|
begin
|
||||||
hregister:=getregister32;
|
|
||||||
p^.location.reference.base:=hregister;
|
|
||||||
{ make a reference }
|
{ make a reference }
|
||||||
{ symtable datasize field
|
{ symtable datasize field
|
||||||
contains the offset of the temp
|
contains the offset of the temp
|
||||||
stored }
|
stored }
|
||||||
hp:=new_reference(procinfo.framepointer,
|
{ hp:=new_reference(procinfo.framepointer,
|
||||||
p^.symtable^.datasize);
|
p^.symtable^.datasize);
|
||||||
|
|
||||||
exprasmlist^.concat(new(pai386,op_ref_reg(A_MOV,S_L,hp,hregister)));
|
exprasmlist^.concat(new(pai386,op_ref_reg(A_MOV,S_L,hp,hregister)));}
|
||||||
|
|
||||||
p^.location.reference.offset:=
|
if ptree(pwithsymtable(p^.symtable)^.withnode)^.islocal then
|
||||||
pvarsym(p^.symtableentry)^.address;
|
begin
|
||||||
|
p^.location.reference:=ptree(pwithsymtable(p^.symtable)^.withnode)^.withreference^;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
hregister:=getregister32;
|
||||||
|
p^.location.reference.base:=hregister;
|
||||||
|
exprasmlist^.concat(new(pai386,op_ref_reg(A_MOV,S_L,
|
||||||
|
newreference(ptree(pwithsymtable(p^.symtable)^.withnode)^.withreference^),
|
||||||
|
hregister)));
|
||||||
|
end;
|
||||||
|
inc(p^.location.reference.offset,pvarsym(p^.symtableentry)^.address);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -845,7 +854,11 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.55 1999-05-17 21:57:04 florian
|
Revision 1.56 1999-05-17 23:51:38 peter
|
||||||
|
* with temp vars now use a reference with a persistant temp instead
|
||||||
|
of setting datasize
|
||||||
|
|
||||||
|
Revision 1.55 1999/05/17 21:57:04 florian
|
||||||
* new temporary ansistring handling
|
* new temporary ansistring handling
|
||||||
|
|
||||||
Revision 1.54 1999/05/12 00:19:43 peter
|
Revision 1.54 1999/05/12 00:19:43 peter
|
||||||
|
|||||||
@ -827,56 +827,67 @@ implementation
|
|||||||
ref : treference;
|
ref : treference;
|
||||||
symtable : psymtable;
|
symtable : psymtable;
|
||||||
i : longint;
|
i : longint;
|
||||||
load : boolean;
|
usetemp : boolean;
|
||||||
begin
|
begin
|
||||||
if assigned(p^.left) then
|
if assigned(p^.left) then
|
||||||
begin
|
begin
|
||||||
secondpass(p^.left);
|
secondpass(p^.left);
|
||||||
load:=true;
|
|
||||||
if p^.left^.location.reference.segment<>R_NO then
|
if p^.left^.location.reference.segment<>R_NO then
|
||||||
message(parser_e_no_with_for_variable_in_other_segments);
|
message(parser_e_no_with_for_variable_in_other_segments);
|
||||||
ref.symbol:=nil;
|
|
||||||
gettempofsizereference(4,ref);
|
new(p^.withreference);
|
||||||
|
|
||||||
|
usetemp:=false;
|
||||||
if (p^.left^.treetype=loadn) and
|
if (p^.left^.treetype=loadn) and
|
||||||
(p^.left^.symtable=aktprocsym^.definition^.localst) then
|
(p^.left^.symtable=aktprocsym^.definition^.localst) then
|
||||||
begin
|
begin
|
||||||
{ for local class just use the local storage }
|
{ for locals use the local storage }
|
||||||
ungetiftemp(ref);
|
p^.withreference^:=p^.left^.location.reference;
|
||||||
new(p^.pref);
|
p^.islocal:=true;
|
||||||
p^.pref^:=p^.left^.location.reference;
|
|
||||||
{ don't discard symbol if in main procedure }
|
|
||||||
p^.left^.location.reference.symbol:=nil;
|
|
||||||
load:=false;
|
|
||||||
end
|
|
||||||
else if (p^.left^.resulttype^.deftype=objectdef) and
|
|
||||||
pobjectdef(p^.left^.resulttype)^.isclass then
|
|
||||||
begin
|
|
||||||
exprasmlist^.concat(new(pai386,op_ref_reg(A_MOV,S_L,
|
|
||||||
newreference(p^.left^.location.reference),R_EDI)))
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
exprasmlist^.concat(new(pai386,op_ref_reg(A_LEA,S_L,
|
if (p^.left^.resulttype^.deftype=objectdef) and
|
||||||
newreference(p^.left^.location.reference),R_EDI)));
|
pobjectdef(p^.left^.resulttype)^.isclass then
|
||||||
if load then
|
begin
|
||||||
exprasmlist^.concat(new(pai386,op_reg_ref(A_MOV,S_L,
|
exprasmlist^.concat(new(pai386,op_ref_reg(A_MOV,S_L,
|
||||||
R_EDI,newreference(ref))));
|
newreference(p^.left^.location.reference),R_EDI)));
|
||||||
del_reference(p^.left^.location.reference);
|
usetemp:=true;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
exprasmlist^.concat(new(pai386,op_ref_reg(A_LEA,S_L,
|
||||||
|
newreference(p^.left^.location.reference),R_EDI)));
|
||||||
|
usetemp:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ if usetemp is set the value must be in %edi }
|
||||||
|
if usetemp then
|
||||||
|
begin
|
||||||
|
gettempofsizereference(4,p^.withreference^);
|
||||||
|
normaltemptopersistant(p^.withreference^.offset);
|
||||||
|
{ move to temp reference }
|
||||||
|
exprasmlist^.concat(new(pai386,op_reg_ref(A_MOV,S_L,
|
||||||
|
R_EDI,newreference(p^.withreference^))));
|
||||||
|
del_reference(p^.left^.location.reference);
|
||||||
|
end;
|
||||||
|
|
||||||
{ the offset relative to (%ebp) is only needed here! }
|
{ the offset relative to (%ebp) is only needed here! }
|
||||||
symtable:=p^.withsymtable;
|
{ symtable:=p^.withsymtable;
|
||||||
for i:=1 to p^.tablecount do
|
for i:=1 to p^.tablecount do
|
||||||
begin
|
begin
|
||||||
symtable^.datasize:=ref.offset;
|
symtable^.datasize:=ref.offset;
|
||||||
symtable:=symtable^.next;
|
symtable:=symtable^.next;
|
||||||
end;
|
end; }
|
||||||
|
|
||||||
{ p^.right can be optimize out !!! }
|
{ p^.right can be optimize out !!! }
|
||||||
if p^.right<>nil then
|
if assigned(p^.right) then
|
||||||
secondpass(p^.right);
|
secondpass(p^.right);
|
||||||
{ clear some stuff }
|
|
||||||
if assigned(p^.pref) then
|
if usetemp then
|
||||||
dispose(p^.pref);
|
ungetpersistanttemp(p^.withreference^.offset);
|
||||||
if load then
|
|
||||||
ungetiftemp(ref);
|
dispose(p^.withreference);
|
||||||
|
p^.withreference:=nil;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -884,7 +895,11 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.38 1999-05-17 21:57:05 florian
|
Revision 1.39 1999-05-17 23:51:39 peter
|
||||||
|
* with temp vars now use a reference with a persistant temp instead
|
||||||
|
of setting datasize
|
||||||
|
|
||||||
|
Revision 1.38 1999/05/17 21:57:05 florian
|
||||||
* new temporary ansistring handling
|
* new temporary ansistring handling
|
||||||
|
|
||||||
Revision 1.37 1999/05/17 14:14:14 pierre
|
Revision 1.37 1999/05/17 14:14:14 pierre
|
||||||
|
|||||||
@ -376,13 +376,11 @@ unit pstatmnt;
|
|||||||
withsymtable^.symsearch:=obj^.publicsyms^.symsearch;
|
withsymtable^.symsearch:=obj^.publicsyms^.symsearch;
|
||||||
withsymtable^.defowner:=obj;
|
withsymtable^.defowner:=obj;
|
||||||
symtab:=withsymtable;
|
symtab:=withsymtable;
|
||||||
{$ifndef NODIRECTWITH}
|
|
||||||
if (p^.treetype=loadn) and
|
if (p^.treetype=loadn) and
|
||||||
(p^.symtable=aktprocsym^.definition^.localst) then
|
(p^.symtable=aktprocsym^.definition^.localst) then
|
||||||
pwithsymtable(symtab)^.direct_with:=true;
|
pwithsymtable(symtab)^.direct_with:=true;
|
||||||
{symtab^.withnode:=p; not yet allocated !! }
|
{symtab^.withnode:=p; not yet allocated !! }
|
||||||
pwithsymtable(symtab)^.withrefnode:=p;
|
pwithsymtable(symtab)^.withrefnode:=p;
|
||||||
{$endif ndef NODIRECTWITH}
|
|
||||||
levelcount:=1;
|
levelcount:=1;
|
||||||
obj:=obj^.childof;
|
obj:=obj^.childof;
|
||||||
while assigned(obj) do
|
while assigned(obj) do
|
||||||
@ -390,13 +388,11 @@ unit pstatmnt;
|
|||||||
symtab^.next:=new(pwithsymtable,init);
|
symtab^.next:=new(pwithsymtable,init);
|
||||||
symtab:=symtab^.next;
|
symtab:=symtab^.next;
|
||||||
symtab^.symsearch:=obj^.publicsyms^.symsearch;
|
symtab^.symsearch:=obj^.publicsyms^.symsearch;
|
||||||
{$ifndef NODIRECTWITH}
|
|
||||||
if (p^.treetype=loadn) and
|
if (p^.treetype=loadn) and
|
||||||
(p^.symtable=aktprocsym^.definition^.localst) then
|
(p^.symtable=aktprocsym^.definition^.localst) then
|
||||||
pwithsymtable(symtab)^.direct_with:=true;
|
pwithsymtable(symtab)^.direct_with:=true;
|
||||||
{symtab^.withnode:=p; not yet allocated !! }
|
{symtab^.withnode:=p; not yet allocated !! }
|
||||||
pwithsymtable(symtab)^.withrefnode:=p;
|
pwithsymtable(symtab)^.withrefnode:=p;
|
||||||
{$endif ndef NODIRECTWITH}
|
|
||||||
symtab^.defowner:=obj;
|
symtab^.defowner:=obj;
|
||||||
obj:=obj^.childof;
|
obj:=obj^.childof;
|
||||||
inc(levelcount);
|
inc(levelcount);
|
||||||
@ -410,13 +406,11 @@ unit pstatmnt;
|
|||||||
withsymtable:=new(pwithsymtable,init);
|
withsymtable:=new(pwithsymtable,init);
|
||||||
withsymtable^.symsearch:=symtab^.symsearch;
|
withsymtable^.symsearch:=symtab^.symsearch;
|
||||||
withsymtable^.next:=symtablestack;
|
withsymtable^.next:=symtablestack;
|
||||||
{$ifndef NODIRECTWITH}
|
|
||||||
if (p^.treetype=loadn) and
|
if (p^.treetype=loadn) and
|
||||||
(p^.symtable=aktprocsym^.definition^.localst) then
|
(p^.symtable=aktprocsym^.definition^.localst) then
|
||||||
pwithsymtable(withsymtable)^.direct_with:=true;
|
pwithsymtable(withsymtable)^.direct_with:=true;
|
||||||
{symtab^.withnode:=p; not yet allocated !! }
|
{symtab^.withnode:=p; not yet allocated !! }
|
||||||
pwithsymtable(withsymtable)^.withrefnode:=p;
|
pwithsymtable(withsymtable)^.withrefnode:=p;
|
||||||
{$endif ndef NODIRECTWITH}
|
|
||||||
withsymtable^.defowner:=obj;
|
withsymtable^.defowner:=obj;
|
||||||
symtablestack:=withsymtable;
|
symtablestack:=withsymtable;
|
||||||
end;
|
end;
|
||||||
@ -1273,7 +1267,11 @@ unit pstatmnt;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.84 1999-05-13 21:59:38 peter
|
Revision 1.85 1999-05-17 23:51:40 peter
|
||||||
|
* with temp vars now use a reference with a persistant temp instead
|
||||||
|
of setting datasize
|
||||||
|
|
||||||
|
Revision 1.84 1999/05/13 21:59:38 peter
|
||||||
* removed oldppu code
|
* removed oldppu code
|
||||||
* warning if objpas is loaded from uses
|
* warning if objpas is loaded from uses
|
||||||
* first things for new deref writing
|
* first things for new deref writing
|
||||||
|
|||||||
@ -226,7 +226,6 @@ unit symtable;
|
|||||||
|
|
||||||
pwithsymtable = ^twithsymtable;
|
pwithsymtable = ^twithsymtable;
|
||||||
twithsymtable = object(tsymtable)
|
twithsymtable = object(tsymtable)
|
||||||
{$ifndef NODIRECTWITH}
|
|
||||||
{ used for withsymtable for allowing constructors }
|
{ used for withsymtable for allowing constructors }
|
||||||
direct_with : boolean;
|
direct_with : boolean;
|
||||||
{ in fact it is a ptree }
|
{ in fact it is a ptree }
|
||||||
@ -235,7 +234,6 @@ unit symtable;
|
|||||||
{ already usable before firstwith
|
{ already usable before firstwith
|
||||||
needed for firstpass of function parameters PM }
|
needed for firstpass of function parameters PM }
|
||||||
withrefnode : pointer;
|
withrefnode : pointer;
|
||||||
{$endif def NODIRECTWITH}
|
|
||||||
constructor init;
|
constructor init;
|
||||||
destructor done;virtual;
|
destructor done;virtual;
|
||||||
end;
|
end;
|
||||||
@ -1041,11 +1039,9 @@ const localsymtablestack : psymtable = nil;
|
|||||||
constructor twithsymtable.init;
|
constructor twithsymtable.init;
|
||||||
begin
|
begin
|
||||||
inherited init(withsymtable);
|
inherited init(withsymtable);
|
||||||
{$ifndef NODIRECTWITH}
|
|
||||||
direct_with:=false;
|
direct_with:=false;
|
||||||
withnode:=nil;
|
withnode:=nil;
|
||||||
withrefnode:=nil;
|
withrefnode:=nil;
|
||||||
{$endif def NODIRECTWITH}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -2349,7 +2345,11 @@ const localsymtablestack : psymtable = nil;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.14 1999-05-14 17:52:29 peter
|
Revision 1.15 1999-05-17 23:51:41 peter
|
||||||
|
* with temp vars now use a reference with a persistant temp instead
|
||||||
|
of setting datasize
|
||||||
|
|
||||||
|
Revision 1.14 1999/05/14 17:52:29 peter
|
||||||
* new deref code
|
* new deref code
|
||||||
|
|
||||||
Revision 1.13 1999/05/13 21:59:48 peter
|
Revision 1.13 1999/05/13 21:59:48 peter
|
||||||
|
|||||||
@ -1073,7 +1073,6 @@ implementation
|
|||||||
typen,hnewn : ;
|
typen,hnewn : ;
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{$ifndef NODIRECTWITH}
|
|
||||||
if ((p^.procdefinition^.options and (poconstructor or podestructor)) <> 0) and
|
if ((p^.procdefinition^.options and (poconstructor or podestructor)) <> 0) and
|
||||||
assigned(p^.symtable) and (p^.symtable^.symtabletype=withsymtable) and
|
assigned(p^.symtable) and (p^.symtable^.symtabletype=withsymtable) and
|
||||||
not pwithsymtable(p^.symtable)^.direct_with then
|
not pwithsymtable(p^.symtable)^.direct_with then
|
||||||
@ -1082,7 +1081,6 @@ implementation
|
|||||||
end; { Is accepted by Delphi !! }
|
end; { Is accepted by Delphi !! }
|
||||||
{ this is not a good reason to accept it in FPC if we produce
|
{ this is not a good reason to accept it in FPC if we produce
|
||||||
wrong code for it !!! (PM) }
|
wrong code for it !!! (PM) }
|
||||||
{$endif ndef NODIRECTWITH}
|
|
||||||
|
|
||||||
{ R.Assign is not a constructor !!! }
|
{ R.Assign is not a constructor !!! }
|
||||||
{ but for R^.Assign, R must be valid !! }
|
{ but for R^.Assign, R must be valid !! }
|
||||||
@ -1149,7 +1147,11 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.41 1999-05-13 21:59:50 peter
|
Revision 1.42 1999-05-17 23:51:43 peter
|
||||||
|
* with temp vars now use a reference with a persistant temp instead
|
||||||
|
of setting datasize
|
||||||
|
|
||||||
|
Revision 1.41 1999/05/13 21:59:50 peter
|
||||||
* removed oldppu code
|
* removed oldppu code
|
||||||
* warning if objpas is loaded from uses
|
* warning if objpas is loaded from uses
|
||||||
* first things for new deref writing
|
* first things for new deref writing
|
||||||
|
|||||||
@ -63,10 +63,8 @@ implementation
|
|||||||
p1 : ptree;
|
p1 : ptree;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
{$ifndef NODIRECTWITH}
|
|
||||||
if (p^.symtable^.symtabletype=withsymtable) and
|
if (p^.symtable^.symtabletype=withsymtable) and
|
||||||
(pwithsymtable(p^.symtable)^.direct_with) and
|
(pwithsymtable(p^.symtable)^.direct_with) then
|
||||||
(p^.symtableentry^.typ=varsym) then
|
|
||||||
begin
|
begin
|
||||||
p1:=getcopy(ptree(pwithsymtable(p^.symtable)^.withrefnode));
|
p1:=getcopy(ptree(pwithsymtable(p^.symtable)^.withrefnode));
|
||||||
p1:=gensubscriptnode(pvarsym(p^.symtableentry),p1);
|
p1:=gensubscriptnode(pvarsym(p^.symtableentry),p1);
|
||||||
@ -75,7 +73,6 @@ implementation
|
|||||||
firstpass(p);
|
firstpass(p);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
{$endif ndef NODIRECTWITH}
|
|
||||||
|
|
||||||
p^.location.loc:=LOC_REFERENCE;
|
p^.location.loc:=LOC_REFERENCE;
|
||||||
p^.registers32:=0;
|
p^.registers32:=0;
|
||||||
@ -452,8 +449,9 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.28 1999-05-16 17:04:39 peter
|
Revision 1.29 1999-05-17 23:51:45 peter
|
||||||
* fixed with and procsym
|
* with temp vars now use a reference with a persistant temp instead
|
||||||
|
of setting datasize
|
||||||
|
|
||||||
Revision 1.27 1999/05/12 00:20:02 peter
|
Revision 1.27 1999/05/12 00:20:02 peter
|
||||||
* removed R_DEFAULT_SEG
|
* removed R_DEFAULT_SEG
|
||||||
|
|||||||
@ -525,7 +525,6 @@ implementation
|
|||||||
firstpass(p^.left);
|
firstpass(p^.left);
|
||||||
if codegenerror then
|
if codegenerror then
|
||||||
exit;
|
exit;
|
||||||
{$ifndef NODIRECTWITH}
|
|
||||||
symtable:=p^.withsymtable;
|
symtable:=p^.withsymtable;
|
||||||
for i:=1 to p^.tablecount do
|
for i:=1 to p^.tablecount do
|
||||||
begin
|
begin
|
||||||
@ -535,7 +534,6 @@ implementation
|
|||||||
symtable^.withnode:=p;
|
symtable^.withnode:=p;
|
||||||
symtable:=pwithsymtable(symtable^.next);
|
symtable:=pwithsymtable(symtable^.next);
|
||||||
end;
|
end;
|
||||||
{$endif ndef NODIRECTWITH}
|
|
||||||
firstpass(p^.right);
|
firstpass(p^.right);
|
||||||
if codegenerror then
|
if codegenerror then
|
||||||
exit;
|
exit;
|
||||||
@ -555,7 +553,11 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.14 1999-05-01 13:24:57 peter
|
Revision 1.15 1999-05-17 23:51:46 peter
|
||||||
|
* with temp vars now use a reference with a persistant temp instead
|
||||||
|
of setting datasize
|
||||||
|
|
||||||
|
Revision 1.14 1999/05/01 13:24:57 peter
|
||||||
* merged nasm compiler
|
* merged nasm compiler
|
||||||
* old asm moved to oldasm/
|
* old asm moved to oldasm/
|
||||||
|
|
||||||
|
|||||||
@ -72,9 +72,10 @@ unit temp_gen;
|
|||||||
{ special call for inlined procedures }
|
{ special call for inlined procedures }
|
||||||
function gettempofsizepersistant(size : longint) : longint;
|
function gettempofsizepersistant(size : longint) : longint;
|
||||||
{ for parameter func returns }
|
{ for parameter func returns }
|
||||||
|
procedure normaltemptopersistant(pos : longint);
|
||||||
procedure persistanttemptonormal(pos : longint);
|
procedure persistanttemptonormal(pos : longint);
|
||||||
{procedure ungettemp(pos : longint;size : longint);}
|
{procedure ungettemp(pos : longint;size : longint);}
|
||||||
procedure ungetpersistanttemp(pos : longint;size : longint);
|
procedure ungetpersistanttemp(pos : longint);
|
||||||
procedure gettempofsizereference(l : longint;var ref : treference);
|
procedure gettempofsizereference(l : longint;var ref : treference);
|
||||||
function istemp(const ref : treference) : boolean;
|
function istemp(const ref : treference) : boolean;
|
||||||
procedure ungetiftemp(const ref : treference);
|
procedure ungetiftemp(const ref : treference);
|
||||||
@ -394,6 +395,30 @@ unit temp_gen;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure normaltemptopersistant(pos : longint);
|
||||||
|
var
|
||||||
|
hp : ptemprecord;
|
||||||
|
begin
|
||||||
|
hp:=templist;
|
||||||
|
while assigned(hp) do
|
||||||
|
if (hp^.pos=pos) and (hp^.temptype=tt_normal) then
|
||||||
|
begin
|
||||||
|
{$ifdef EXTDEBUG}
|
||||||
|
Comment(V_Debug,'temp managment : normaltemptopersistant()'+
|
||||||
|
' at pos '+tostr(pos)+ ' found !');
|
||||||
|
{$endif}
|
||||||
|
hp^.temptype:=tt_persistant;
|
||||||
|
exit;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
hp:=hp^.next;
|
||||||
|
{$ifdef EXTDEBUG}
|
||||||
|
Comment(V_Debug,'temp managment problem : normaltemptopersistant()'+
|
||||||
|
' at pos '+tostr(pos)+ ' not found !');
|
||||||
|
{$endif}
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
function ungettemp(pos:longint;allowtype:ttemptype):ttemptype;
|
function ungettemp(pos:longint;allowtype:ttemptype):ttemptype;
|
||||||
var
|
var
|
||||||
hp,hnext,hprev,hprevfree : ptemprecord;
|
hp,hnext,hprev,hprevfree : ptemprecord;
|
||||||
@ -454,7 +479,7 @@ unit temp_gen;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure ungetpersistanttemp(pos : longint;size : longint);
|
procedure ungetpersistanttemp(pos : longint);
|
||||||
begin
|
begin
|
||||||
{$ifdef EXTDEBUG}
|
{$ifdef EXTDEBUG}
|
||||||
if ungettemp(pos,tt_persistant)<>tt_persistant then
|
if ungettemp(pos,tt_persistant)<>tt_persistant then
|
||||||
@ -497,7 +522,11 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.24 1999-05-17 21:57:17 florian
|
Revision 1.25 1999-05-17 23:51:47 peter
|
||||||
|
* with temp vars now use a reference with a persistant temp instead
|
||||||
|
of setting datasize
|
||||||
|
|
||||||
|
Revision 1.24 1999/05/17 21:57:17 florian
|
||||||
* new temporary ansistring handling
|
* new temporary ansistring handling
|
||||||
|
|
||||||
Revision 1.23 1999/05/17 12:49:16 pierre
|
Revision 1.23 1999/05/17 12:49:16 pierre
|
||||||
|
|||||||
@ -240,8 +240,7 @@ unit tree;
|
|||||||
asmn : (p_asm : paasmoutput;object_preserved : boolean);
|
asmn : (p_asm : paasmoutput;object_preserved : boolean);
|
||||||
casen : (nodes : pcaserecord;elseblock : ptree);
|
casen : (nodes : pcaserecord;elseblock : ptree);
|
||||||
labeln,goton : (labelnr : plabel);
|
labeln,goton : (labelnr : plabel);
|
||||||
withn : (withsymtable : pwithsymtable;tablecount : longint;
|
withn : (withsymtable : pwithsymtable;tablecount : longint;withreference:preference;islocal:boolean);
|
||||||
pref : preference);
|
|
||||||
onn : (exceptsymtable : psymtable;excepttype : pobjectdef);
|
onn : (exceptsymtable : psymtable;excepttype : pobjectdef);
|
||||||
arrayconstructn : (cargs,cargswap: boolean);
|
arrayconstructn : (cargs,cargswap: boolean);
|
||||||
end;
|
end;
|
||||||
@ -600,7 +599,8 @@ unit tree;
|
|||||||
p^.resulttype:=nil;
|
p^.resulttype:=nil;
|
||||||
p^.withsymtable:=symtable;
|
p^.withsymtable:=symtable;
|
||||||
p^.tablecount:=count;
|
p^.tablecount:=count;
|
||||||
p^.pref:=nil;
|
p^.withreference:=nil;
|
||||||
|
p^.islocal:=false;
|
||||||
set_file_line(l,p);
|
set_file_line(l,p);
|
||||||
genwithnode:=p;
|
genwithnode:=p;
|
||||||
end;
|
end;
|
||||||
@ -1708,7 +1708,11 @@ unit tree;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.79 1999-05-17 13:00:36 pierre
|
Revision 1.80 1999-05-17 23:51:48 peter
|
||||||
|
* with temp vars now use a reference with a persistant temp instead
|
||||||
|
of setting datasize
|
||||||
|
|
||||||
|
Revision 1.79 1999/05/17 13:00:36 pierre
|
||||||
* old field suppressed was still in debug code
|
* old field suppressed was still in debug code
|
||||||
|
|
||||||
Revision 1.78 1999/05/12 00:20:03 peter
|
Revision 1.78 1999/05/12 00:20:03 peter
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user