mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-12 01:59:30 +01:00
* new temporary ansistring handling
This commit is contained in:
parent
e905aeea04
commit
8706cd801f
@ -45,4 +45,10 @@ Changes in the syntax or semantic of FPC:
|
|||||||
13/05/99 Classes are now only allowed in the ObjFpc or Delphi mode. Use
|
13/05/99 Classes are now only allowed in the ObjFpc or Delphi mode. Use
|
||||||
{$mode objfpc} or {$mode delphi}. Or from commandline -S2 or -Sd
|
{$mode objfpc} or {$mode delphi}. Or from commandline -S2 or -Sd
|
||||||
16/05/99 Remove options -Up (use now -Fu) and -Fg (use now -Fl)
|
16/05/99 Remove options -Up (use now -Fu) and -Fg (use now -Fl)
|
||||||
|
17/05/99 Redesign of ansistring temporary handling, please report
|
||||||
|
any problems
|
||||||
|
17/05/99 Most stuff of the objpas unit is now in the system unit
|
||||||
|
because the new temporary ansistring handling support
|
||||||
|
exceptions and exceptions need the class OOP model
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -146,9 +146,7 @@ implementation
|
|||||||
href : treference;
|
href : treference;
|
||||||
pushed,
|
pushed,
|
||||||
cmpop : boolean;
|
cmpop : boolean;
|
||||||
savedunused : tregisterset;
|
|
||||||
hr : treference;
|
hr : treference;
|
||||||
oldrl : plinkedlist;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
{ string operations are not commutative }
|
{ string operations are not commutative }
|
||||||
@ -160,8 +158,6 @@ implementation
|
|||||||
case p^.treetype of
|
case p^.treetype of
|
||||||
addn:
|
addn:
|
||||||
begin
|
begin
|
||||||
oldrl:=temptoremove;
|
|
||||||
temptoremove:=new(plinkedlist,init);
|
|
||||||
cmpop:=false;
|
cmpop:=false;
|
||||||
secondpass(p^.left);
|
secondpass(p^.left);
|
||||||
|
|
||||||
@ -184,41 +180,24 @@ implementation
|
|||||||
ungetregister32(p^.left^.location.register);
|
ungetregister32(p^.left^.location.register);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
savedunused:=unused;
|
|
||||||
{ push the still used registers }
|
{ push the still used registers }
|
||||||
pushusedregisters(pushedregs,$ff);
|
pushusedregisters(pushedregs,$ff);
|
||||||
{ push data }
|
{ push data }
|
||||||
|
clear_location(p^.location);
|
||||||
|
p^.location.loc:=LOC_MEM;
|
||||||
|
gettempansistringreference(p^.location.reference);
|
||||||
|
emitpushreferenceaddr(exprasmlist,p^.location.reference);
|
||||||
emit_push_loc(p^.right^.location);
|
emit_push_loc(p^.right^.location);
|
||||||
emit_push_loc(p^.left^.location);
|
emit_push_loc(p^.left^.location);
|
||||||
emitcall('FPC_ANSISTR_CONCAT',true);
|
emitcall('FPC_ANSISTR_CONCAT',true);
|
||||||
unused:=savedunused;
|
|
||||||
clear_location(p^.location);
|
|
||||||
p^.location.register:=getexplicitregister32(R_EAX);
|
|
||||||
p^.location.loc:=LOC_REGISTER;
|
|
||||||
emit_reg_reg(A_MOV,S_L,R_EAX,p^.location.register);
|
|
||||||
|
|
||||||
{ unused:=unused-[R_EAX]; }
|
|
||||||
removetemps(exprasmlist,temptoremove);
|
|
||||||
dispose(temptoremove,done);
|
|
||||||
temptoremove:=oldrl;
|
|
||||||
{ unused:=unused+[R_EAX]; }
|
|
||||||
|
|
||||||
popusedregisters(pushedregs);
|
popusedregisters(pushedregs);
|
||||||
maybe_loadesi;
|
maybe_loadesi;
|
||||||
{ done with temptoremove !! (PM)
|
ungetiftempansi(p^.left^.location.reference);
|
||||||
ungetiftemp(p^.left^.location.reference);
|
ungetiftempansi(p^.right^.location.reference);
|
||||||
ungetiftemp(p^.right^.location.reference); }
|
|
||||||
reset_reference(hr);
|
|
||||||
gettempansistringreference(hr);
|
|
||||||
addtemptodestroy(p^.resulttype,hr);
|
|
||||||
exprasmlist^.concat(new(pai386,op_reg_ref(A_MOV,S_L,p^.location.register,
|
|
||||||
newreference(hr))));
|
|
||||||
end;
|
end;
|
||||||
ltn,lten,gtn,gten,
|
ltn,lten,gtn,gten,
|
||||||
equaln,unequaln:
|
equaln,unequaln:
|
||||||
begin
|
begin
|
||||||
oldrl:=temptoremove;
|
|
||||||
temptoremove:=new(plinkedlist,init);
|
|
||||||
secondpass(p^.left);
|
secondpass(p^.left);
|
||||||
pushed:=maybe_push(p^.right^.registers32,p);
|
pushed:=maybe_push(p^.right^.registers32,p);
|
||||||
secondpass(p^.right);
|
secondpass(p^.right);
|
||||||
@ -252,11 +231,6 @@ implementation
|
|||||||
exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,p^.left^.location.register)));
|
exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,p^.left^.location.register)));
|
||||||
end;
|
end;
|
||||||
emitcall('FPC_ANSISTR_COMPARE',true);
|
emitcall('FPC_ANSISTR_COMPARE',true);
|
||||||
unused:=unused-[R_EAX];
|
|
||||||
removetemps(exprasmlist,temptoremove);
|
|
||||||
dispose(temptoremove,done);
|
|
||||||
temptoremove:=oldrl;
|
|
||||||
unused:=unused+[R_EAX];
|
|
||||||
emit_reg_reg(A_OR,S_L,R_EAX,R_EAX);
|
emit_reg_reg(A_OR,S_L,R_EAX,R_EAX);
|
||||||
popusedregisters(pushedregs);
|
popusedregisters(pushedregs);
|
||||||
maybe_loadesi;
|
maybe_loadesi;
|
||||||
@ -2056,7 +2030,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.55 1999-05-10 14:37:49 pierre
|
Revision 1.56 1999-05-17 21:56:58 florian
|
||||||
|
* new temporary ansistring handling
|
||||||
|
|
||||||
|
Revision 1.55 1999/05/10 14:37:49 pierre
|
||||||
problem with EAX being overwritten before used in A_MULL code fixed
|
problem with EAX being overwritten before used in A_MULL code fixed
|
||||||
|
|
||||||
Revision 1.54 1999/05/09 17:58:42 jonas
|
Revision 1.54 1999/05/09 17:58:42 jonas
|
||||||
|
|||||||
@ -228,7 +228,6 @@ implementation
|
|||||||
{ we must pop this size also after !! }
|
{ we must pop this size also after !! }
|
||||||
{ must_pop : boolean; }
|
{ must_pop : boolean; }
|
||||||
pop_size : longint;
|
pop_size : longint;
|
||||||
oldrl : plinkedlist;
|
|
||||||
|
|
||||||
label
|
label
|
||||||
dont_call;
|
dont_call;
|
||||||
@ -243,10 +242,6 @@ implementation
|
|||||||
no_virtual_call:=false;
|
no_virtual_call:=false;
|
||||||
unusedregisters:=unused;
|
unusedregisters:=unused;
|
||||||
|
|
||||||
{ save old ansi string release list }
|
|
||||||
oldrl:=temptoremove;
|
|
||||||
temptoremove:=new(plinkedlist,init);
|
|
||||||
|
|
||||||
if not assigned(p^.procdefinition) then
|
if not assigned(p^.procdefinition) then
|
||||||
exit;
|
exit;
|
||||||
if (p^.procdefinition^.options and poinline)<>0 then
|
if (p^.procdefinition^.options and poinline)<>0 then
|
||||||
@ -1017,29 +1012,14 @@ implementation
|
|||||||
else
|
else
|
||||||
p^.location.loc:=LOC_FPU;
|
p^.location.loc:=LOC_FPU;
|
||||||
end
|
end
|
||||||
else
|
else if is_ansistring(p^.resulttype) or
|
||||||
begin
|
|
||||||
p^.location.loc:=LOC_REGISTER;
|
|
||||||
{$ifdef test_dest_loc}
|
|
||||||
if dest_loc_known and (dest_loc_tree=p) then
|
|
||||||
mov_reg_to_dest(p,S_L,R_EAX)
|
|
||||||
else
|
|
||||||
{$endif test_dest_loc}
|
|
||||||
begin
|
|
||||||
hregister:=getexplicitregister32(R_EAX);
|
|
||||||
emit_reg_reg(A_MOV,S_L,R_EAX,hregister);
|
|
||||||
p^.location.register:=hregister;
|
|
||||||
if is_ansistring(p^.resulttype) or
|
|
||||||
is_widestring(p^.resulttype) then
|
is_widestring(p^.resulttype) then
|
||||||
begin
|
begin
|
||||||
gettempansistringreference(hr);
|
gettempansistringreference(hr);
|
||||||
exprasmlist^.concat(new(pai386,op_reg_ref(A_MOV,S_L,p^.location.register,
|
exprasmlist^.concat(new(pai386,op_reg_ref(A_MOV,S_L,R_EAX,
|
||||||
newreference(hr))));
|
newreference(hr))));
|
||||||
{$ifdef AnsiStrRef}
|
|
||||||
ungetregister(hregister);
|
|
||||||
p^.location.loc:=LOC_REFERENCE;
|
p^.location.loc:=LOC_REFERENCE;
|
||||||
p^.location.reference:=hr;
|
p^.location.reference:=hr;
|
||||||
{$endif}
|
|
||||||
{ unnessary ansi/wide strings are imm. disposed }
|
{ unnessary ansi/wide strings are imm. disposed }
|
||||||
if not(p^.return_value_used) then
|
if not(p^.return_value_used) then
|
||||||
begin
|
begin
|
||||||
@ -1061,10 +1041,20 @@ implementation
|
|||||||
end;
|
end;
|
||||||
ungetiftemp(hr);
|
ungetiftemp(hr);
|
||||||
popusedregisters(pushedregs);
|
popusedregisters(pushedregs);
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
oldrl^.concat(new(ptemptodestroy,init(hr,p^.resulttype)));
|
begin
|
||||||
end;
|
p^.location.loc:=LOC_REGISTER;
|
||||||
|
{$ifdef test_dest_loc}
|
||||||
|
if dest_loc_known and (dest_loc_tree=p) then
|
||||||
|
mov_reg_to_dest(p,S_L,R_EAX)
|
||||||
|
else
|
||||||
|
{$endif test_dest_loc}
|
||||||
|
begin
|
||||||
|
hregister:=getexplicitregister32(R_EAX);
|
||||||
|
emit_reg_reg(A_MOV,S_L,R_EAX,hregister);
|
||||||
|
p^.location.register:=hregister;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1079,11 +1069,6 @@ implementation
|
|||||||
if pop_size>0 then
|
if pop_size>0 then
|
||||||
exprasmlist^.concat(new(pai386,op_const_reg(A_ADD,S_L,pop_size,R_ESP)));
|
exprasmlist^.concat(new(pai386,op_const_reg(A_ADD,S_L,pop_size,R_ESP)));
|
||||||
|
|
||||||
{ release temp. ansi strings }
|
|
||||||
removetemps(exprasmlist,temptoremove);
|
|
||||||
dispose(temptoremove,done);
|
|
||||||
temptoremove:=oldrl;
|
|
||||||
|
|
||||||
{ restore registers }
|
{ restore registers }
|
||||||
popusedregisters(pushed);
|
popusedregisters(pushed);
|
||||||
|
|
||||||
@ -1215,7 +1200,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.78 1999-05-01 13:24:02 peter
|
Revision 1.79 1999-05-17 21:56:59 florian
|
||||||
|
* new temporary ansistring handling
|
||||||
|
|
||||||
|
Revision 1.78 1999/05/01 13:24:02 peter
|
||||||
* merged nasm compiler
|
* merged nasm compiler
|
||||||
* old asm moved to oldasm/
|
* old asm moved to oldasm/
|
||||||
|
|
||||||
|
|||||||
@ -250,9 +250,6 @@ implementation
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
|
||||||
ltemptoremove : plinkedlist;
|
|
||||||
|
|
||||||
procedure second_string_to_string(pto,pfrom : ptree;convtyp : tconverttype);
|
procedure second_string_to_string(pto,pfrom : ptree;convtyp : tconverttype);
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -320,8 +317,6 @@ implementation
|
|||||||
clear_location(pto^.location);
|
clear_location(pto^.location);
|
||||||
pto^.location.loc:=LOC_REFERENCE;
|
pto^.location.loc:=LOC_REFERENCE;
|
||||||
gettempansistringreference(pto^.location.reference);
|
gettempansistringreference(pto^.location.reference);
|
||||||
ltemptoremove^.concat(new(ptemptodestroy,init(pto^.location.reference,pto^.resulttype)));
|
|
||||||
exprasmlist^.concat(new(pai386,op_const_ref(A_MOV,S_L,0,newreference(pto^.location.reference))));
|
|
||||||
pushusedregisters(pushed,$ff);
|
pushusedregisters(pushed,$ff);
|
||||||
emit_push_lea_loc(pfrom^.location);
|
emit_push_lea_loc(pfrom^.location);
|
||||||
emit_push_lea_loc(pto^.location);
|
emit_push_lea_loc(pto^.location);
|
||||||
@ -499,8 +494,6 @@ implementation
|
|||||||
st_ansistring :
|
st_ansistring :
|
||||||
begin
|
begin
|
||||||
gettempansistringreference(pto^.location.reference);
|
gettempansistringreference(pto^.location.reference);
|
||||||
ltemptoremove^.concat(new(ptemptodestroy,init(pto^.location.reference,pto^.resulttype)));
|
|
||||||
exprasmlist^.concat(new(pai386,op_const_ref(A_MOV,S_L,0,newreference(pto^.location.reference))));
|
|
||||||
release_loc(pfrom^.location);
|
release_loc(pfrom^.location);
|
||||||
pushusedregisters(pushed,$ff);
|
pushusedregisters(pushed,$ff);
|
||||||
push_int(l);
|
push_int(l);
|
||||||
@ -546,8 +539,6 @@ implementation
|
|||||||
st_ansistring :
|
st_ansistring :
|
||||||
begin
|
begin
|
||||||
gettempansistringreference(pto^.location.reference);
|
gettempansistringreference(pto^.location.reference);
|
||||||
ltemptoremove^.concat(new(ptemptodestroy,init(pto^.location.reference,pto^.resulttype)));
|
|
||||||
exprasmlist^.concat(new(pai386,op_const_ref(A_MOV,S_L,0,newreference(pto^.location.reference))));
|
|
||||||
release_loc(pfrom^.location);
|
release_loc(pfrom^.location);
|
||||||
pushusedregisters(pushed,$ff);
|
pushusedregisters(pushed,$ff);
|
||||||
emit_pushw_loc(pfrom^.location);
|
emit_pushw_loc(pfrom^.location);
|
||||||
@ -1066,8 +1057,6 @@ implementation
|
|||||||
begin
|
begin
|
||||||
pto^.location.loc:=LOC_REFERENCE;
|
pto^.location.loc:=LOC_REFERENCE;
|
||||||
gettempansistringreference(pto^.location.reference);
|
gettempansistringreference(pto^.location.reference);
|
||||||
ltemptoremove^.concat(new(ptemptodestroy,init(pto^.location.reference,pto^.resulttype)));
|
|
||||||
exprasmlist^.concat(new(pai386,op_const_ref(A_MOV,S_L,0,newreference(pto^.location.reference))));
|
|
||||||
case pfrom^.location.loc of
|
case pfrom^.location.loc of
|
||||||
LOC_REFERENCE,LOC_MEM:
|
LOC_REFERENCE,LOC_MEM:
|
||||||
begin
|
begin
|
||||||
@ -1146,26 +1135,16 @@ implementation
|
|||||||
second_nothing, {arrayconstructor_to_set}
|
second_nothing, {arrayconstructor_to_set}
|
||||||
second_load_smallset
|
second_load_smallset
|
||||||
);
|
);
|
||||||
var
|
|
||||||
oldrl,oldlrl : plinkedlist;
|
|
||||||
{$ifdef TESTOBJEXT2}
|
{$ifdef TESTOBJEXT2}
|
||||||
var
|
var
|
||||||
r : preference;
|
r : preference;
|
||||||
nillabel : plabel;
|
nillabel : plabel;
|
||||||
{$endif TESTOBJEXT2}
|
{$endif TESTOBJEXT2}
|
||||||
begin
|
begin
|
||||||
{ the ansi string disposing is a little bit hairy: }
|
|
||||||
oldrl:=temptoremove;
|
|
||||||
temptoremove:=new(plinkedlist,init);
|
|
||||||
|
|
||||||
{ this isn't good coding, I think tc_bool_2_int, shouldn't be }
|
{ this isn't good coding, I think tc_bool_2_int, shouldn't be }
|
||||||
{ type conversion (FK) }
|
{ type conversion (FK) }
|
||||||
|
|
||||||
{ this is necessary, because second_bool_2_int, have to change }
|
|
||||||
{ true- and false label before calling secondpass }
|
|
||||||
{ the helper routines need access to the release list }
|
|
||||||
oldlrl:=ltemptoremove;
|
|
||||||
ltemptoremove:=oldrl;
|
|
||||||
if not(p^.convtyp in [tc_bool_2_int,tc_bool_2_bool]) then
|
if not(p^.convtyp in [tc_bool_2_int,tc_bool_2_bool]) then
|
||||||
begin
|
begin
|
||||||
secondpass(p^.left);
|
secondpass(p^.left);
|
||||||
@ -1213,11 +1192,6 @@ implementation
|
|||||||
exprasmlist^.concat(new(pai_label,init(nillabel)));
|
exprasmlist^.concat(new(pai_label,init(nillabel)));
|
||||||
end;
|
end;
|
||||||
{$endif TESTOBJEXT2}
|
{$endif TESTOBJEXT2}
|
||||||
{ clean up all temp. objects (ansi/widestrings) }
|
|
||||||
removetemps(exprasmlist,temptoremove);
|
|
||||||
dispose(temptoremove,done);
|
|
||||||
temptoremove:=oldrl;
|
|
||||||
ltemptoremove:=oldlrl;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -1331,7 +1305,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.71 1999-05-12 00:19:40 peter
|
Revision 1.72 1999-05-17 21:57:00 florian
|
||||||
|
* new temporary ansistring handling
|
||||||
|
|
||||||
|
Revision 1.71 1999/05/12 00:19:40 peter
|
||||||
* removed R_DEFAULT_SEG
|
* removed R_DEFAULT_SEG
|
||||||
* uniform float names
|
* uniform float names
|
||||||
|
|
||||||
|
|||||||
@ -717,6 +717,10 @@ do_jmp:
|
|||||||
|
|
||||||
if assigned(p^.right) then
|
if assigned(p^.right) then
|
||||||
secondpass(p^.right);
|
secondpass(p^.right);
|
||||||
|
exprasmlist^.concat(new(pai386,op_ref(A_PUSH,S_L,
|
||||||
|
newreference(ref))));
|
||||||
|
emitcall('FPC_DESTROYEXCEPTION',true);
|
||||||
|
|
||||||
{ clear some stuff }
|
{ clear some stuff }
|
||||||
ungetiftemp(ref);
|
ungetiftemp(ref);
|
||||||
emitjmp(C_None,endexceptlabel);
|
emitjmp(C_None,endexceptlabel);
|
||||||
@ -733,7 +737,7 @@ do_jmp:
|
|||||||
procedure secondtryfinally(var p : ptree);
|
procedure secondtryfinally(var p : ptree);
|
||||||
|
|
||||||
var
|
var
|
||||||
finallylabel,noreraiselabel,endfinallylabel : plabel;
|
finallylabel,noreraiselabel : plabel;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
{ we modify EAX }
|
{ we modify EAX }
|
||||||
@ -741,7 +745,6 @@ do_jmp:
|
|||||||
|
|
||||||
getlabel(finallylabel);
|
getlabel(finallylabel);
|
||||||
getlabel(noreraiselabel);
|
getlabel(noreraiselabel);
|
||||||
getlabel(endfinallylabel);
|
|
||||||
push_int(1); { Type of stack-frame must be pushed}
|
push_int(1); { Type of stack-frame must be pushed}
|
||||||
emitcall('FPC_PUSHEXCEPTADDR',true);
|
emitcall('FPC_PUSHEXCEPTADDR',true);
|
||||||
exprasmlist^.concat(new(pai386,
|
exprasmlist^.concat(new(pai386,
|
||||||
@ -772,7 +775,6 @@ do_jmp:
|
|||||||
emitcall('FPC_RERAISE',true);
|
emitcall('FPC_RERAISE',true);
|
||||||
emitlab(noreraiselabel);
|
emitlab(noreraiselabel);
|
||||||
emitcall('FPC_POPADDRSTACK',true);
|
emitcall('FPC_POPADDRSTACK',true);
|
||||||
emitlab(endfinallylabel);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -798,7 +800,10 @@ do_jmp:
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.36 1999-05-13 21:59:21 peter
|
Revision 1.37 1999-05-17 21:57:01 florian
|
||||||
|
* new temporary ansistring handling
|
||||||
|
|
||||||
|
Revision 1.36 1999/05/13 21:59:21 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
|
||||||
|
|||||||
@ -1231,9 +1231,6 @@ implementation
|
|||||||
end;
|
end;
|
||||||
else internalerror(9);
|
else internalerror(9);
|
||||||
end;
|
end;
|
||||||
{ remove temp. objects, we don't generate them here }
|
|
||||||
removetemps(exprasmlist,temptoremove);
|
|
||||||
temptoremove^.clear;
|
|
||||||
{ reset pushedparasize }
|
{ reset pushedparasize }
|
||||||
pushedparasize:=oldpushedparasize;
|
pushedparasize:=oldpushedparasize;
|
||||||
end;
|
end;
|
||||||
@ -1241,7 +1238,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.49 1999-05-12 15:46:26 pierre
|
Revision 1.50 1999-05-17 21:57:03 florian
|
||||||
|
* new temporary ansistring handling
|
||||||
|
|
||||||
|
Revision 1.49 1999/05/12 15:46:26 pierre
|
||||||
* handle_str disposetree was badly placed
|
* handle_str disposetree was badly placed
|
||||||
|
|
||||||
Revision 1.48 1999/05/12 00:19:42 peter
|
Revision 1.48 1999/05/12 00:19:42 peter
|
||||||
|
|||||||
@ -356,13 +356,10 @@ implementation
|
|||||||
hregister : tregister;
|
hregister : tregister;
|
||||||
loc : tloc;
|
loc : tloc;
|
||||||
r : preference;
|
r : preference;
|
||||||
oldrl : plinkedlist;
|
|
||||||
{$ifndef OLDASM}
|
{$ifndef OLDASM}
|
||||||
ai : pai386;
|
ai : pai386;
|
||||||
{$endif}
|
{$endif}
|
||||||
begin
|
begin
|
||||||
oldrl:=temptoremove;
|
|
||||||
temptoremove:=new(plinkedlist,init);
|
|
||||||
otlabel:=truelabel;
|
otlabel:=truelabel;
|
||||||
oflabel:=falselabel;
|
oflabel:=falselabel;
|
||||||
getlabel(truelabel);
|
getlabel(truelabel);
|
||||||
@ -672,9 +669,6 @@ implementation
|
|||||||
{$EndIf regallocfix}
|
{$EndIf regallocfix}
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
removetemps(exprasmlist,temptoremove);
|
|
||||||
dispose(temptoremove,done);
|
|
||||||
temptoremove:=oldrl;
|
|
||||||
freelabel(truelabel);
|
freelabel(truelabel);
|
||||||
freelabel(falselabel);
|
freelabel(falselabel);
|
||||||
truelabel:=otlabel;
|
truelabel:=otlabel;
|
||||||
@ -851,7 +845,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.54 1999-05-12 00:19:43 peter
|
Revision 1.55 1999-05-17 21:57:04 florian
|
||||||
|
* new temporary ansistring handling
|
||||||
|
|
||||||
|
Revision 1.54 1999/05/12 00:19:43 peter
|
||||||
* removed R_DEFAULT_SEG
|
* removed R_DEFAULT_SEG
|
||||||
* uniform float names
|
* uniform float names
|
||||||
|
|
||||||
|
|||||||
@ -787,9 +787,6 @@ implementation
|
|||||||
reset_reference(p^.location.reference);
|
reset_reference(p^.location.reference);
|
||||||
p^.location.loc:=LOC_REGISTER;
|
p^.location.loc:=LOC_REGISTER;
|
||||||
p^.location.register:=hr;
|
p^.location.register:=hr;
|
||||||
{ we can remove all temps }
|
|
||||||
removetemps(exprasmlist,temptoremove);
|
|
||||||
temptoremove^.clear;
|
|
||||||
end;
|
end;
|
||||||
st_widestring:
|
st_widestring:
|
||||||
begin
|
begin
|
||||||
@ -799,9 +796,6 @@ implementation
|
|||||||
newreference(p^.location.reference),hr))); reset_reference(p^.location.reference);
|
newreference(p^.location.reference),hr))); reset_reference(p^.location.reference);
|
||||||
p^.location.loc:=LOC_REGISTER;
|
p^.location.loc:=LOC_REGISTER;
|
||||||
p^.location.register:=hr;
|
p^.location.register:=hr;
|
||||||
{ we can remove all temps }
|
|
||||||
removetemps(exprasmlist,temptoremove);
|
|
||||||
temptoremove^.clear;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -890,7 +884,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.37 1999-05-17 14:14:14 pierre
|
Revision 1.38 1999-05-17 21:57:05 florian
|
||||||
|
* new temporary ansistring handling
|
||||||
|
|
||||||
|
Revision 1.37 1999/05/17 14:14:14 pierre
|
||||||
+ -gc for check pointer with heaptrc
|
+ -gc for check pointer with heaptrc
|
||||||
|
|
||||||
Revision 1.36 1999/05/12 00:19:44 peter
|
Revision 1.36 1999/05/12 00:19:44 peter
|
||||||
|
|||||||
@ -169,7 +169,7 @@ implementation
|
|||||||
procedure writenames(p : pprocdeftree);
|
procedure writenames(p : pprocdeftree);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
getlabel(p^.nl);
|
getdatalabel(p^.nl);
|
||||||
if assigned(p^.l) then
|
if assigned(p^.l) then
|
||||||
writenames(p^.l);
|
writenames(p^.l);
|
||||||
datasegment^.concat(new(pai_label,init(p^.nl)));
|
datasegment^.concat(new(pai_label,init(p^.nl)));
|
||||||
@ -211,7 +211,7 @@ implementation
|
|||||||
writenames(root);
|
writenames(root);
|
||||||
|
|
||||||
{ now start writing of the message string table }
|
{ now start writing of the message string table }
|
||||||
getlabel(r);
|
getdatalabel(r);
|
||||||
datasegment^.concat(new(pai_label,init(r)));
|
datasegment^.concat(new(pai_label,init(r)));
|
||||||
genstrmsgtab:=r;
|
genstrmsgtab:=r;
|
||||||
datasegment^.concat(new(pai_const,init_32bit(count)));
|
datasegment^.concat(new(pai_const,init_32bit(count)));
|
||||||
@ -250,7 +250,7 @@ implementation
|
|||||||
_class^.publicsyms^.foreach(insertmsgint);
|
_class^.publicsyms^.foreach(insertmsgint);
|
||||||
|
|
||||||
{ now start writing of the message string table }
|
{ now start writing of the message string table }
|
||||||
getlabel(r);
|
getdatalabel(r);
|
||||||
datasegment^.concat(new(pai_label,init(r)));
|
datasegment^.concat(new(pai_label,init(r)));
|
||||||
genintmsgtab:=r;
|
genintmsgtab:=r;
|
||||||
datasegment^.concat(new(pai_const,init_32bit(count)));
|
datasegment^.concat(new(pai_const,init_32bit(count)));
|
||||||
@ -566,7 +566,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.4 1999-05-13 21:59:27 peter
|
Revision 1.5 1999-05-17 21:57:07 florian
|
||||||
|
* new temporary ansistring handling
|
||||||
|
|
||||||
|
Revision 1.4 1999/05/13 21:59:27 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
|
||||||
|
|||||||
@ -50,6 +50,8 @@ unit hcodegen;
|
|||||||
{ no register variables }
|
{ no register variables }
|
||||||
pi_is_assembler = $40; { set if the procedure is declared as ASSEMBLER
|
pi_is_assembler = $40; { set if the procedure is declared as ASSEMBLER
|
||||||
=> don't optimize}
|
=> don't optimize}
|
||||||
|
pi_needs_implicit_finally = $80; { set, if the procedure contains data which }
|
||||||
|
{ needs to be finalized }
|
||||||
type
|
type
|
||||||
pprocinfo = ^tprocinfo;
|
pprocinfo = ^tprocinfo;
|
||||||
tprocinfo = record
|
tprocinfo = record
|
||||||
@ -142,7 +144,6 @@ unit hcodegen;
|
|||||||
pushedparasize : longint;
|
pushedparasize : longint;
|
||||||
|
|
||||||
make_const_global : boolean;
|
make_const_global : boolean;
|
||||||
temptoremove : plinkedlist;
|
|
||||||
|
|
||||||
{ message calls with codegenerror support }
|
{ message calls with codegenerror support }
|
||||||
procedure cgmessage(const t : tmsgconst);
|
procedure cgmessage(const t : tmsgconst);
|
||||||
@ -321,7 +322,10 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.30 1999-05-01 13:24:22 peter
|
Revision 1.31 1999-05-17 21:57:08 florian
|
||||||
|
* new temporary ansistring handling
|
||||||
|
|
||||||
|
Revision 1.30 1999/05/01 13:24:22 peter
|
||||||
* merged nasm compiler
|
* merged nasm compiler
|
||||||
* old asm moved to oldasm/
|
* old asm moved to oldasm/
|
||||||
|
|
||||||
|
|||||||
@ -305,6 +305,7 @@ uses
|
|||||||
opcode:=op;
|
opcode:=op;
|
||||||
opsize:=_size;
|
opsize:=_size;
|
||||||
ops:=0;
|
ops:=0;
|
||||||
|
condition:=c_none;
|
||||||
fillchar(oper,sizeof(oper),0);
|
fillchar(oper,sizeof(oper),0);
|
||||||
{$ifndef NOAG386BIN}
|
{$ifndef NOAG386BIN}
|
||||||
insentry:=nil;
|
insentry:=nil;
|
||||||
@ -1573,7 +1574,10 @@ end;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.7 1999-05-16 17:00:45 peter
|
Revision 1.8 1999-05-17 21:57:09 florian
|
||||||
|
* new temporary ansistring handling
|
||||||
|
|
||||||
|
Revision 1.7 1999/05/16 17:00:45 peter
|
||||||
* fixed sym_ofs_ref op loading
|
* fixed sym_ofs_ref op loading
|
||||||
|
|
||||||
Revision 1.6 1999/05/12 00:19:50 peter
|
Revision 1.6 1999/05/12 00:19:50 peter
|
||||||
|
|||||||
@ -98,13 +98,17 @@ implementation
|
|||||||
if assigned(hp^.right) then
|
if assigned(hp^.right) then
|
||||||
begin
|
begin
|
||||||
cleartempgen;
|
cleartempgen;
|
||||||
|
{!!!!!!
|
||||||
oldrl:=temptoremove;
|
oldrl:=temptoremove;
|
||||||
temptoremove:=new(plinkedlist,init);
|
temptoremove:=new(plinkedlist,init);
|
||||||
|
}
|
||||||
secondpass(hp^.right);
|
secondpass(hp^.right);
|
||||||
{ release temp. ansi strings }
|
{ !!!!!!!
|
||||||
|
some temporary data which can't be released elsewhere
|
||||||
removetemps(exprasmlist,temptoremove);
|
removetemps(exprasmlist,temptoremove);
|
||||||
dispose(temptoremove,done);
|
dispose(temptoremove,done);
|
||||||
temptoremove:=oldrl;
|
temptoremove:=oldrl;
|
||||||
|
}
|
||||||
end;
|
end;
|
||||||
hp:=hp^.left;
|
hp:=hp^.left;
|
||||||
end;
|
end;
|
||||||
@ -359,7 +363,7 @@ implementation
|
|||||||
label
|
label
|
||||||
nextreg;
|
nextreg;
|
||||||
begin
|
begin
|
||||||
temptoremove:=nil;
|
{!!!!!!!! temptoremove:=nil; }
|
||||||
cleartempgen;
|
cleartempgen;
|
||||||
{ when size optimization only count occurrence }
|
{ when size optimization only count occurrence }
|
||||||
if cs_littlesize in aktglobalswitches then
|
if cs_littlesize in aktglobalswitches then
|
||||||
@ -553,7 +557,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.20 1999-05-02 21:33:54 florian
|
Revision 1.21 1999-05-17 21:57:11 florian
|
||||||
|
* new temporary ansistring handling
|
||||||
|
|
||||||
|
Revision 1.20 1999/05/02 21:33:54 florian
|
||||||
* several bugs regarding -Or fixed
|
* several bugs regarding -Or fixed
|
||||||
|
|
||||||
Revision 1.19 1999/05/01 13:24:28 peter
|
Revision 1.19 1999/05/01 13:24:28 peter
|
||||||
|
|||||||
@ -1527,7 +1527,7 @@ unit pdecl;
|
|||||||
if (aktclass^.options and oo_can_have_published)<>0 then
|
if (aktclass^.options and oo_can_have_published)<>0 then
|
||||||
aktclass^.generate_rtti;
|
aktclass^.generate_rtti;
|
||||||
{ write class name }
|
{ write class name }
|
||||||
getlabel(classnamelabel);
|
getdatalabel(classnamelabel);
|
||||||
datasegment^.concat(new(pai_label,init(classnamelabel)));
|
datasegment^.concat(new(pai_label,init(classnamelabel)));
|
||||||
datasegment^.concat(new(pai_const,init_8bit(length(aktclass^.objname^))));
|
datasegment^.concat(new(pai_const,init_8bit(length(aktclass^.objname^))));
|
||||||
datasegment^.concat(new(pai_string,init(aktclass^.objname^)));
|
datasegment^.concat(new(pai_string,init(aktclass^.objname^)));
|
||||||
@ -2230,7 +2230,10 @@ unit pdecl;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.116 1999-05-13 21:59:34 peter
|
Revision 1.117 1999-05-17 21:57:12 florian
|
||||||
|
* new temporary ansistring handling
|
||||||
|
|
||||||
|
Revision 1.116 1999/05/13 21:59:34 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
|
||||||
|
|||||||
@ -372,7 +372,7 @@
|
|||||||
procedure tdef.generate_rtti;
|
procedure tdef.generate_rtti;
|
||||||
begin
|
begin
|
||||||
has_rtti:=true;
|
has_rtti:=true;
|
||||||
getlabel(rtti_label);
|
getdatalabel(rtti_label);
|
||||||
write_child_rtti_data;
|
write_child_rtti_data;
|
||||||
rttilist^.concat(new(pai_label,init(rtti_label)));
|
rttilist^.concat(new(pai_label,init(rtti_label)));
|
||||||
write_rtti_data;
|
write_rtti_data;
|
||||||
@ -397,7 +397,7 @@
|
|||||||
procedure tdef.generate_inittable;
|
procedure tdef.generate_inittable;
|
||||||
begin
|
begin
|
||||||
has_inittable:=true;
|
has_inittable:=true;
|
||||||
getlabel(inittable_label);
|
getdatalabel(inittable_label);
|
||||||
write_child_init_data;
|
write_child_init_data;
|
||||||
rttilist^.concat(new(pai_label,init(inittable_label)));
|
rttilist^.concat(new(pai_label,init(inittable_label)));
|
||||||
write_init_data;
|
write_init_data;
|
||||||
@ -3271,7 +3271,7 @@ Const local_symtable_index : longint = $8001;
|
|||||||
procedure tobjectdef.generate_rtti;
|
procedure tobjectdef.generate_rtti;
|
||||||
begin
|
begin
|
||||||
has_rtti:=true;
|
has_rtti:=true;
|
||||||
getlabel(rtti_label);
|
getdatalabel(rtti_label);
|
||||||
write_child_rtti_data;
|
write_child_rtti_data;
|
||||||
rttilist^.concat(new(pai_symbol,init_global(rtti_name)));
|
rttilist^.concat(new(pai_symbol,init_global(rtti_name)));
|
||||||
rttilist^.concat(new(pai_label,init(rtti_label)));
|
rttilist^.concat(new(pai_label,init(rtti_label)));
|
||||||
@ -3380,7 +3380,10 @@ Const local_symtable_index : longint = $8001;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.116 1999-05-16 02:26:51 peter
|
Revision 1.117 1999-05-17 21:57:15 florian
|
||||||
|
* new temporary ansistring handling
|
||||||
|
|
||||||
|
Revision 1.116 1999/05/16 02:26:51 peter
|
||||||
* fixed loading of classrefdef
|
* fixed loading of classrefdef
|
||||||
|
|
||||||
Revision 1.115 1999/05/14 17:52:26 peter
|
Revision 1.115 1999/05/14 17:52:26 peter
|
||||||
|
|||||||
@ -81,7 +81,6 @@ unit temp_gen;
|
|||||||
function ungetiftempansi(const ref : treference) : boolean;
|
function ungetiftempansi(const ref : treference) : boolean;
|
||||||
procedure gettempansistringreference(var ref : treference);
|
procedure gettempansistringreference(var ref : treference);
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
@ -359,8 +358,8 @@ unit temp_gen;
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function istemp(const ref : treference) : boolean;
|
function istemp(const ref : treference) : boolean;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
{ ref.index = R_NO was missing
|
{ ref.index = R_NO was missing
|
||||||
led to problems with local arrays
|
led to problems with local arrays
|
||||||
@ -498,7 +497,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.23 1999-05-17 12:49:16 pierre
|
Revision 1.24 1999-05-17 21:57:17 florian
|
||||||
|
* new temporary ansistring handling
|
||||||
|
|
||||||
|
Revision 1.23 1999/05/17 12:49:16 pierre
|
||||||
* several problems with EXTDEBUG fixed
|
* several problems with EXTDEBUG fixed
|
||||||
|
|
||||||
Revision 1.22 1999/05/15 21:33:21 peter
|
Revision 1.22 1999/05/15 21:33:21 peter
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user