mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-22 12:29:23 +02:00
* first load para's to temps before calling entry code (profile
This commit is contained in:
parent
71280bedad
commit
1bcda5c022
@ -1265,12 +1265,13 @@ implementation
|
|||||||
not(po_assembler in current_procinfo.procdef.procoptions) then
|
not(po_assembler in current_procinfo.procdef.procoptions) then
|
||||||
begin
|
begin
|
||||||
{ non-win32 can call mcout even in main }
|
{ non-win32 can call mcout even in main }
|
||||||
if not (target_info.system in [system_i386_win32,system_i386_wdosx]) then
|
if not (target_info.system in [system_i386_win32,system_i386_wdosx]) or
|
||||||
cg.g_profilecode(list)
|
not (current_procinfo.procdef.proctypeoption=potype_proginit) then
|
||||||
else
|
begin
|
||||||
{ wdosx, and win32 should not call mcount before monstartup has been called }
|
cg.allocexplicitregisters(list,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_cdecl));
|
||||||
if not (current_procinfo.procdef.proctypeoption=potype_proginit) then
|
cg.g_profilecode(list);
|
||||||
cg.g_profilecode(list);
|
cg.deallocexplicitregisters(list,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_cdecl));
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ call startup helpers from main program }
|
{ call startup helpers from main program }
|
||||||
@ -2133,7 +2134,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.202 2004-05-23 15:23:30 peter
|
Revision 1.203 2004-05-28 21:14:13 peter
|
||||||
|
* first load para's to temps before calling entry code (profile
|
||||||
|
|
||||||
|
Revision 1.202 2004/05/23 15:23:30 peter
|
||||||
* fixed qword(longint) that removed sign from the number
|
* fixed qword(longint) that removed sign from the number
|
||||||
* removed code in the compiler that relied on wrong qword(longint)
|
* removed code in the compiler that relied on wrong qword(longint)
|
||||||
code generation
|
code generation
|
||||||
|
@ -570,8 +570,8 @@ implementation
|
|||||||
addstatement(codestatement,bodyexitcode);
|
addstatement(codestatement,bodyexitcode);
|
||||||
addstatement(codestatement,final_asmnode);
|
addstatement(codestatement,final_asmnode);
|
||||||
{ Initialize before try...finally...end frame }
|
{ Initialize before try...finally...end frame }
|
||||||
addstatement(newstatement,entry_asmnode);
|
|
||||||
addstatement(newstatement,loadpara_asmnode);
|
addstatement(newstatement,loadpara_asmnode);
|
||||||
|
addstatement(newstatement,entry_asmnode);
|
||||||
addstatement(newstatement,init_asmnode);
|
addstatement(newstatement,init_asmnode);
|
||||||
addstatement(newstatement,bodyentrycode);
|
addstatement(newstatement,bodyentrycode);
|
||||||
aktfilepos:=entrypos;
|
aktfilepos:=entrypos;
|
||||||
@ -585,8 +585,8 @@ implementation
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
addstatement(newstatement,entry_asmnode);
|
|
||||||
addstatement(newstatement,loadpara_asmnode);
|
addstatement(newstatement,loadpara_asmnode);
|
||||||
|
addstatement(newstatement,entry_asmnode);
|
||||||
addstatement(newstatement,init_asmnode);
|
addstatement(newstatement,init_asmnode);
|
||||||
addstatement(newstatement,bodyentrycode);
|
addstatement(newstatement,bodyentrycode);
|
||||||
addstatement(newstatement,code);
|
addstatement(newstatement,code);
|
||||||
@ -1001,7 +1001,6 @@ implementation
|
|||||||
|
|
||||||
{ parse the code ... }
|
{ parse the code ... }
|
||||||
code:=block(current_module.islibrary);
|
code:=block(current_module.islibrary);
|
||||||
|
|
||||||
{ save exit info }
|
{ save exit info }
|
||||||
exitswitches:=aktlocalswitches;
|
exitswitches:=aktlocalswitches;
|
||||||
exitpos:=last_endtoken_filepos;
|
exitpos:=last_endtoken_filepos;
|
||||||
@ -1009,8 +1008,18 @@ implementation
|
|||||||
{ the procedure is now defined }
|
{ the procedure is now defined }
|
||||||
procdef.forwarddef:=false;
|
procdef.forwarddef:=false;
|
||||||
|
|
||||||
|
if assigned(code) then
|
||||||
|
begin
|
||||||
|
{ get a better entry point }
|
||||||
|
entrypos:=code.fileinfo;
|
||||||
|
|
||||||
|
{ Finish type checking pass }
|
||||||
|
do_resulttypepass(code);
|
||||||
|
end;
|
||||||
|
|
||||||
{ Check for unused labels, forwards, symbols for procedures. Static
|
{ Check for unused labels, forwards, symbols for procedures. Static
|
||||||
symtable is checked in pmodules }
|
symtable is checked in pmodules.
|
||||||
|
The check must be done after the resulttypepass }
|
||||||
if (Errorcount=0) and
|
if (Errorcount=0) and
|
||||||
(tstoredsymtable(procdef.localst).symtabletype<>staticsymtable) then
|
(tstoredsymtable(procdef.localst).symtabletype<>staticsymtable) then
|
||||||
begin
|
begin
|
||||||
@ -1028,15 +1037,6 @@ implementation
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if assigned(code) then
|
|
||||||
begin
|
|
||||||
{ get a better entry point }
|
|
||||||
entrypos:=code.fileinfo;
|
|
||||||
|
|
||||||
{ Finish type checking pass }
|
|
||||||
do_resulttypepass(code);
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ store a copy of the original tree for inline, for
|
{ store a copy of the original tree for inline, for
|
||||||
normal procedures only store a reference to the
|
normal procedures only store a reference to the
|
||||||
current tree }
|
current tree }
|
||||||
@ -1389,7 +1389,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.193 2004-05-24 17:31:12 peter
|
Revision 1.194 2004-05-28 21:14:13 peter
|
||||||
|
* first load para's to temps before calling entry code (profile
|
||||||
|
|
||||||
|
Revision 1.193 2004/05/24 17:31:12 peter
|
||||||
* also check local typed const
|
* also check local typed const
|
||||||
|
|
||||||
Revision 1.192 2004/05/23 18:28:41 peter
|
Revision 1.192 2004/05/23 18:28:41 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user