* fixed inline-related problems (partially "merges")

This commit is contained in:
Jonas Maebe 2000-11-22 15:12:06 +00:00
parent ba5d436620
commit cc5b2c5709
3 changed files with 26 additions and 20 deletions

View File

@ -2197,7 +2197,8 @@ implementation
end; end;
{ omit stack frame ? } { omit stack frame ? }
if (not inlined) and (procinfo^.framepointer=stack_pointer) then if (not inlined) then
if (procinfo^.framepointer=stack_pointer) then
begin begin
CGMessage(cg_d_stackframe_omited); CGMessage(cg_d_stackframe_omited);
nostackframe:=true; nostackframe:=true;
@ -2209,7 +2210,7 @@ implementation
exprasmlist^.insert(new(paicpu, exprasmlist^.insert(new(paicpu,
op_const_reg(A_SUB,S_L,stackframe,R_ESP))); op_const_reg(A_SUB,S_L,stackframe,R_ESP)));
end end
else else
begin begin
alignstack(alist); alignstack(alist);
if (aktprocsym^.definition^.proctypeoption in [potype_unitinit,potype_proginit,potype_unitfinalize]) then if (aktprocsym^.definition^.proctypeoption in [potype_unitinit,potype_proginit,potype_unitfinalize]) then
@ -2936,7 +2937,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.11 2000-11-17 10:30:24 florian Revision 1.12 2000-11-22 15:12:06 jonas
* fixed inline-related problems (partially "merges")
Revision 1.11 2000/11/17 10:30:24 florian
* passing interfaces as parameters fixed * passing interfaces as parameters fixed
Revision 1.10 2000/11/07 23:40:48 florian Revision 1.10 2000/11/07 23:40:48 florian

View File

@ -294,13 +294,12 @@ implementation
exit; exit;
{ Deciding whether we may still need the parameters happens next (JM) } { Deciding whether we may still need the parameters happens next (JM) }
params:=left; if assigned(left) then
params:=left.getcopy
else params := nil;
if (pocall_inline in procdefinition^.proccalloptions) then if (pocall_inline in procdefinition^.proccalloptions) then
begin begin
{ make a copy for the next time the procedure is inlined (JM) }
if assigned(left) then
left:=left.getcopy;
inlined:=true; inlined:=true;
inlinecode:=tprocinlinenode(right); inlinecode:=tprocinlinenode(right);
{ set it to the same lexical level as the local symtable, becuase { set it to the same lexical level as the local symtable, becuase
@ -317,16 +316,10 @@ implementation
strpnew('inlined parasymtable is at offset ' strpnew('inlined parasymtable is at offset '
+tostr(pprocdef(procdefinition)^.parast^.address_fixup))))); +tostr(pprocdef(procdefinition)^.parast^.address_fixup)))));
{$endif extdebug} {$endif extdebug}
{ copy for the next time the procedure is inlined (JM) }
if assigned(right) then
right:=right.getcopy;
{ disable further inlining of the same proc { disable further inlining of the same proc
in the args } in the args }
exclude(procdefinition^.proccalloptions,pocall_inline); exclude(procdefinition^.proccalloptions,pocall_inline);
end end;
else
{ parameters not necessary anymore (JM) }
left := nil;
{ only if no proc var } { only if no proc var }
if inlined or if inlined or
not(assigned(right)) then not(assigned(right)) then
@ -1340,8 +1333,8 @@ implementation
end; end;
if inlined then if inlined then
ungetpersistanttemp(inlinecode.retoffset); ungetpersistanttemp(inlinecode.retoffset);
inlinecode.free; if assigned(params) then
params.free; params.free;
{ from now on the result can be freed normally } { from now on the result can be freed normally }
@ -1592,7 +1585,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.8 2000-11-17 09:54:58 florian Revision 1.9 2000-11-22 15:12:06 jonas
* fixed inline-related problems (partially "merges")
Revision 1.8 2000/11/17 09:54:58 florian
* INT_CHECK_OBJECT_* isn't applied to interfaces anymore * INT_CHECK_OBJECT_* isn't applied to interfaces anymore
Revision 1.7 2000/11/12 23:24:14 florian Revision 1.7 2000/11/12 23:24:14 florian

View File

@ -1485,7 +1485,9 @@ interface
if ret_in_param(inlineprocsym^.definition^.rettype.def) then if ret_in_param(inlineprocsym^.definition^.rettype.def) then
para_size:=para_size+target_os.size_of_pointer; para_size:=para_size+target_os.size_of_pointer;
{ copy args } { copy args }
inlinetree:=code; if assigned(code) then
inlinetree:=code.getcopy
else inlinetree := nil;
registers32:=code.registers32; registers32:=code.registers32;
registersfpu:=code.registersfpu; registersfpu:=code.registersfpu;
{$ifdef SUPPORT_MMX} {$ifdef SUPPORT_MMX}
@ -1496,7 +1498,8 @@ interface
destructor tprocinlinenode.destroy; destructor tprocinlinenode.destroy;
begin begin
inlinetree.free; if assigned(inlinetree) then
inlinetree.free;
inherited destroy; inherited destroy;
end; end;
@ -1539,7 +1542,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.16 2000-11-11 16:14:52 peter Revision 1.17 2000-11-22 15:12:06 jonas
* fixed inline-related problems (partially "merges")
Revision 1.16 2000/11/11 16:14:52 peter
* fixed crash with settextbuf,ptr * fixed crash with settextbuf,ptr
Revision 1.15 2000/11/06 21:36:25 peter Revision 1.15 2000/11/06 21:36:25 peter