mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 16:09:17 +02:00
- moved new_exception and free_exception to ncgutils
This commit is contained in:
parent
528d042442
commit
1b79ac2058
@ -249,25 +249,6 @@ unit cgobj;
|
|||||||
procedure g_flags2reg(list: taasmoutput; size: TCgSize; const f: tresflags; reg: TRegister); virtual; abstract;
|
procedure g_flags2reg(list: taasmoutput; size: TCgSize; const f: tresflags; reg: TRegister); virtual; abstract;
|
||||||
procedure g_flags2ref(list: taasmoutput; size: TCgSize; const f: tresflags; const ref:TReference); virtual;
|
procedure g_flags2ref(list: taasmoutput; size: TCgSize; const f: tresflags; const ref:TReference); virtual;
|
||||||
|
|
||||||
{#
|
|
||||||
Allocate the buffers for exception management and setjmp environment.
|
|
||||||
Return a pointer to these buffers, send them to the utility routine
|
|
||||||
so they are registered, and then call setjmp.
|
|
||||||
|
|
||||||
Then compare the result of setjmp with 0, and if not equal
|
|
||||||
to zero, then jump to exceptlabel.
|
|
||||||
|
|
||||||
Also store the result of setjmp to a temporary space by calling g_save_exception_reason
|
|
||||||
|
|
||||||
It is to note that this routine may be called *after* the stackframe of a
|
|
||||||
routine has been called, therefore on machines where the stack cannot
|
|
||||||
be modified, all temps should be allocated on the heap instead of the
|
|
||||||
stack.
|
|
||||||
}
|
|
||||||
procedure g_new_exception(list : taasmoutput;var jmpbuf,envbuf, href : treference;
|
|
||||||
a : aword; exceptlabel : tasmlabel);virtual;
|
|
||||||
procedure g_free_exception(list : taasmoutput;var jmpbuf, envbuf, href : treference;
|
|
||||||
a : aword ; endexceptlabel : tasmlabel; onlyfree : boolean);virtual;
|
|
||||||
|
|
||||||
{#
|
{#
|
||||||
This routine is used in exception management nodes. It should
|
This routine is used in exception management nodes. It should
|
||||||
@ -1464,39 +1445,6 @@ unit cgobj;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure tcg.g_new_exception(list : taasmoutput;var jmpbuf,envbuf, href : treference;
|
|
||||||
a : aword; exceptlabel : tasmlabel);
|
|
||||||
begin
|
|
||||||
tg.gettempofsizereferencepersistant(exprasmlist,24,jmpbuf);
|
|
||||||
tg.gettempofsizereferencepersistant(exprasmlist,12,envbuf);
|
|
||||||
a_paramaddr_ref(exprasmlist,envbuf,paramanager.getintparaloc(3));
|
|
||||||
a_paramaddr_ref(exprasmlist,jmpbuf,paramanager.getintparaloc(2));
|
|
||||||
{ push type of exceptionframe }
|
|
||||||
a_param_const(exprasmlist,OS_S32,1,paramanager.getintparaloc(1));
|
|
||||||
a_call_name(exprasmlist,'FPC_PUSHEXCEPTADDR');
|
|
||||||
|
|
||||||
a_param_reg(exprasmlist,OS_ADDR,accumulator,paramanager.getintparaloc(1));
|
|
||||||
a_call_name(exprasmlist,'FPC_SETJMP');
|
|
||||||
|
|
||||||
tg.gettempofsizereferencepersistant(exprasmlist,sizeof(aword),href);
|
|
||||||
g_exception_reason_save(list, href);
|
|
||||||
a_cmp_const_reg_label(exprasmlist,OS_S32,OC_NE,0,accumulator,exceptlabel);
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
procedure tcg.g_free_exception(list : taasmoutput;var jmpbuf, envbuf, href : treference;
|
|
||||||
a : aword ; endexceptlabel : tasmlabel; onlyfree : boolean);
|
|
||||||
begin
|
|
||||||
cg.a_call_name(exprasmlist,'FPC_POPADDRSTACK');
|
|
||||||
tg.ungetpersistanttempreference(exprasmlist,jmpbuf);
|
|
||||||
tg.ungetpersistanttempreference(exprasmlist,envbuf);
|
|
||||||
|
|
||||||
if not onlyfree then
|
|
||||||
begin
|
|
||||||
g_exception_reason_load(list, href);
|
|
||||||
cg.a_cmp_const_reg_label(exprasmlist,OS_S32,OC_EQ,a,accumulator,endexceptlabel);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1522,7 +1470,10 @@ finalization
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.43 2002-08-05 18:27:48 carl
|
Revision 1.44 2002-08-09 19:10:05 carl
|
||||||
|
- moved new_exception and free_exception to ncgutils
|
||||||
|
|
||||||
|
Revision 1.43 2002/08/05 18:27:48 carl
|
||||||
+ more more more documentation
|
+ more more more documentation
|
||||||
+ first version include/exclude (can't test though, not enough scratch for i386 :()...
|
+ first version include/exclude (can't test though, not enough scratch for i386 :()...
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user