From e27d6f67daf0634f5756a899e45993a00c86c35e Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 7 Oct 2003 15:17:07 +0000 Subject: [PATCH] * inline supported again, LOC_REFERENCEs are used to pass the parameters * inlineparasymtable,inlinelocalsymtable removed * exitlabel inserting fixed --- compiler/i386/cpupara.pas | 16 +- compiler/ncgcal.pas | 343 ++++++++------------------------------ compiler/ncgld.pas | 14 +- compiler/ncgutil.pas | 295 ++++++++++++++++++++------------ compiler/psub.pas | 36 +++- compiler/symconst.pas | 12 +- compiler/symsym.pas | 20 ++- compiler/symtable.pas | 11 +- compiler/x86/cgx86.pas | 241 +++++++++++++------------- 9 files changed, 459 insertions(+), 529 deletions(-) diff --git a/compiler/i386/cpupara.pas b/compiler/i386/cpupara.pas index 25feefebba..e2192619fe 100644 --- a/compiler/i386/cpupara.pas +++ b/compiler/i386/cpupara.pas @@ -208,15 +208,15 @@ unit cpupara; else begin result.loc:=LOC_REFERENCE; - result.reference.index:=NR_EBP; - result.reference.offset:=4*nr; + result.reference.index:=NR_STACK_POINTER_REG; + result.reference.offset:=POINTER_SIZE*nr; end; end else begin result.loc:=LOC_REFERENCE; - result.reference.index:=NR_EBP; - result.reference.offset:=4*nr; + result.reference.index:=NR_STACK_POINTER_REG; + result.reference.offset:=POINTER_SIZE*nr; end; end; @@ -440,7 +440,13 @@ begin end. { $Log$ - Revision 1.37 2003-10-05 21:21:52 peter + Revision 1.38 2003-10-07 15:17:07 peter + * inline supported again, LOC_REFERENCEs are used to pass the + parameters + * inlineparasymtable,inlinelocalsymtable removed + * exitlabel inserting fixed + + Revision 1.37 2003/10/05 21:21:52 peter * c style array of const generates callparanodes * varargs paraloc fixes diff --git a/compiler/ncgcal.pas b/compiler/ncgcal.pas index 71ba724057..8c8711ce1c 100644 --- a/compiler/ncgcal.pas +++ b/compiler/ncgcal.pas @@ -76,7 +76,7 @@ implementation uses systems, cutils,verbose,globals, - symconst,symbase,symsym,symtable,defutil,paramgr, + symconst,symsym,symtable,defutil,paramgr, {$ifdef GDB} {$ifdef delphi} sysutils, @@ -86,18 +86,13 @@ implementation gdb, {$endif GDB} cgbase,pass_2, - cpuinfo,aasmbase,aasmtai,aasmcpu, + cpuinfo,aasmbase,aasmtai, nbas,nmem,nld,ncnv, {$ifdef x86} cga, {$endif x86} -{$ifdef cpu64bit} - cg64f64, -{$else cpu64bit} - cg64f32, -{$endif cpu64bit} ncgutil,cgobj,tgobj, - regvars,rgobj,rgcpu, + rgobj,rgcpu, procinfo; @@ -148,82 +143,61 @@ implementation { Handle Floating point types differently } if left.resulttype.def.deftype=floatdef then begin -(* - if calloption=pocall_inline then - begin - size:=align(tfloatdef(p.resulttype.def).size,alignment); - inc(pushedparasize,size); - reference_reset_base(href,current_procinfo.framepointer,para_offset-pushedparasize); - case left.location.loc of - LOC_FPUREGISTER, - LOC_CFPUREGISTER: - cg.a_loadfpu_reg_ref(exprasmlist,def_cgsize(p.resulttype.def),left.location.register,href); - LOC_REFERENCE, - LOC_CREFERENCE : - cg.g_concatcopy(exprasmlist,left.location.reference,href,size,false,false); - else - internalerror(200204243); - end; - end - else -*) - begin - location_release(exprasmlist,left.location); - allocate_tempparaloc; + location_release(exprasmlist,left.location); + allocate_tempparaloc; {$ifdef i386} - case left.location.loc of - LOC_FPUREGISTER, - LOC_CFPUREGISTER: - begin - if tempparaloc.loc<>LOC_REFERENCE then - internalerror(200309291); - size:=align(tfloatdef(left.resulttype.def).size,tempparaloc.alignment); - inc(tcgcallnode(aktcallnode).pushedparasize,size); - cg.g_stackpointer_alloc(exprasmlist,size); - reference_reset_base(href,NR_STACK_POINTER_REG,0); - cg.a_loadfpu_reg_ref(exprasmlist,def_cgsize(left.resulttype.def),left.location.register,href); - end; - LOC_REFERENCE, - LOC_CREFERENCE : - begin - sizetopush:=align(left.resulttype.def.size,tempparaloc.alignment); - tempreference:=left.location.reference; - inc(tempreference.offset,sizetopush); - while (sizetopush>0) do - begin - if (sizetopush>=4) or (tempparaloc.alignment>=4) then - begin - cgsize:=OS_32; - inc(tcgcallnode(aktcallnode).pushedparasize,4); - dec(tempreference.offset,4); - dec(sizetopush,4); - end - else - begin - cgsize:=OS_16; - inc(tcgcallnode(aktcallnode).pushedparasize,2); - dec(tempreference.offset,2); - dec(sizetopush,2); - end; - cg.a_param_ref(exprasmlist,cgsize,tempreference,tempparaloc); - end; - end; - else - internalerror(200204243); + case left.location.loc of + LOC_FPUREGISTER, + LOC_CFPUREGISTER: + begin + if tempparaloc.loc<>LOC_REFERENCE then + internalerror(200309291); + size:=align(tfloatdef(left.resulttype.def).size,tempparaloc.alignment); + inc(tcgcallnode(aktcallnode).pushedparasize,size); + cg.g_stackpointer_alloc(exprasmlist,size); + reference_reset_base(href,NR_STACK_POINTER_REG,0); + cg.a_loadfpu_reg_ref(exprasmlist,def_cgsize(left.resulttype.def),left.location.register,href); end; + LOC_REFERENCE, + LOC_CREFERENCE : + begin + sizetopush:=align(left.resulttype.def.size,tempparaloc.alignment); + tempreference:=left.location.reference; + inc(tempreference.offset,sizetopush); + while (sizetopush>0) do + begin + if (sizetopush>=4) or (tempparaloc.alignment>=4) then + begin + cgsize:=OS_32; + inc(tcgcallnode(aktcallnode).pushedparasize,4); + dec(tempreference.offset,4); + dec(sizetopush,4); + end + else + begin + cgsize:=OS_16; + inc(tcgcallnode(aktcallnode).pushedparasize,2); + dec(tempreference.offset,2); + dec(sizetopush,2); + end; + cg.a_param_ref(exprasmlist,cgsize,tempreference,tempparaloc); + end; + end; + else + internalerror(200204243); + end; {$else i386} - case left.location.loc of - LOC_FPUREGISTER, - LOC_CFPUREGISTER: - cg.a_paramfpu_reg(exprasmlist,def_cgsize(left.resulttype.def),left.location.register,tempparaloc); - LOC_REFERENCE, - LOC_CREFERENCE : - cg.a_paramfpu_ref(exprasmlist,def_cgsize(left.resulttype.def),left.location.reference,tempparaloc) - else - internalerror(200204243); - end; + case left.location.loc of + LOC_FPUREGISTER, + LOC_CFPUREGISTER: + cg.a_paramfpu_reg(exprasmlist,def_cgsize(left.resulttype.def),left.location.register,tempparaloc); + LOC_REFERENCE, + LOC_CREFERENCE : + cg.a_paramfpu_ref(exprasmlist,def_cgsize(left.resulttype.def),left.location.reference,tempparaloc) + else + internalerror(200204243); + end; {$endif i386} - end; end else begin @@ -263,44 +237,16 @@ implementation if cgsize in [OS_64,OS_S64] then begin inc(tcgcallnode(aktcallnode).pushedparasize,8); -(* - if calloption=pocall_inline then - begin - reference_reset_base(href,current_procinfo.framepointer,para_offset-pushedparasize); - if left.location.loc in [LOC_REFERENCE,LOC_CREFERENCE] then - begin - size:=align(p.resulttype.def.size,alignment); - cg.g_concatcopy(exprasmlist,left.location.reference,href,size,false,false) - end - else - cg64.a_load64_loc_ref(exprasmlist,left.location,href); - end - else -*) - allocate_tempparaloc; - cg64.a_param64_loc(exprasmlist,left.location,tempparaloc); - location_release(exprasmlist,left.location); + allocate_tempparaloc; + cg64.a_param64_loc(exprasmlist,left.location,tempparaloc); + location_release(exprasmlist,left.location); end else begin location_release(exprasmlist,left.location); allocate_tempparaloc; inc(tcgcallnode(aktcallnode).pushedparasize,align(tcgsize2size[tempparaloc.size],tempparaloc.alignment)); -(* - if calloption=pocall_inline then - begin - reference_reset_base(href,current_procinfo.framepointer,para_offset-pushedparasize); - if left.location.loc in [LOC_REFERENCE,LOC_CREFERENCE] then - begin - size:=align(p.resulttype.def.size,alignment); - cg.g_concatcopy(exprasmlist,left.location.reference,href,size,false,false) - end - else - cg.a_load_loc_ref(exprasmlist,left.location.size,left.location,href); - end - else -*) - cg.a_param_loc(exprasmlist,left.location,tempparaloc); + cg.a_param_loc(exprasmlist,left.location,tempparaloc); end; end; {$ifdef SUPPORT_MMX} @@ -310,15 +256,7 @@ implementation location_release(exprasmlist,left.location); allocate_tempparaloc; inc(tcgcallnode(aktcallnode).pushedparasize,8); -(* - if calloption=pocall_inline then - begin - reference_reset_base(href,current_procinfo.framepointer,para_offset-pushedparasize); - cg.a_loadmm_reg_ref(exprasmlist,left.location.register,href); - end - else -*) - cg.a_parammm_reg(exprasmlist,left.location.register); + cg.a_parammm_reg(exprasmlist,left.location.register); end; {$endif SUPPORT_MMX} else @@ -639,12 +577,11 @@ implementation pushedother : tpushedsavedother; oldpushedparasize : longint; { adress returned from an I/O-error } - iolabel : tasmlabel; { help reference pointer } href : treference; pop_size : longint; pvreg, - vmtreg,vmtreg2 : tregister; + vmtreg : tregister; oldaktcallnode : tcallnode; procedure pushparas; @@ -714,7 +651,6 @@ implementation if assigned(varargsparas) then paramanager.create_varargs_paraloc_info(procdefinition,varargsparas); - iolabel:=nil; rg.saveunusedstate(unusedstate); if not assigned(funcretnode) then @@ -805,13 +741,6 @@ implementation { release self } rg.ungetaddressregister(exprasmlist,vmtreg); -(* - vmtreg2:=rg.getabtregisterint(exprasmlist,OS_ADDR); - cg.a_load_reg_reg(exprasmlist,OS_ADDR,OS_ADDR,vmtreg,vmtreg2); - - { load virtual method (procvar) } - rg.ungetregisterint(exprasmlist,vmtreg2); -*) pvreg:=rg.getabtregisterint(exprasmlist,OS_ADDR); reference_reset_base(href,vmtreg, tprocdef(procdefinition)._class.vmtmethodoffset(tprocdef(procdefinition).extnumber)); @@ -988,32 +917,18 @@ implementation procedure tcgcallnode.inlined_pass_2; var - regs_to_push_int : Tsuperregisterset; - regs_to_push_other : totherregisterset; unusedstate: pointer; - pushedother : tpushedsavedother; - oldpushedparasize : longint; oldaktcallnode : tcallnode; - i : longint; oldprocinfo : tprocinfo; oldinlining_procedure : boolean; inlineentrycode,inlineexitcode : TAAsmoutput; - oldregstate: pointer; - old_local_fixup, - old_para_fixup : longint; usesacc,usesacchi,usesfpu : boolean; - pararef, - localsref : treference; {$ifdef GDB} startlabel,endlabel : tasmlabel; pp : pchar; mangled_length : longint; {$endif GDB} begin - -{$warning TODO Fix inlining} - internalerror(200309211); - if not(assigned(procdefinition) and (procdefinition.deftype=procdef)) then internalerror(200305262); @@ -1025,69 +940,10 @@ implementation { calculate registers to pass the parameters } paramanager.create_inline_paraloc_info(procdefinition); -(* - { deallocate the registers used for the current procedure's regvars } - if assigned(current_procinfo.procdef.regvarinfo) then - begin - with pregvarinfo(current_procinfo.procdef.regvarinfo)^ do - for i := 1 to maxvarregs do - if assigned(regvars[i]) then - store_regvar(exprasmlist,regvars[i].localloc.register); - rg.saveStateForInline(oldregstate); - { make sure the register allocator knows what the regvars in the } - { inlined code block are (JM) } - rg.resetusableregisters; - rg.clearregistercount; - if assigned(tprocdef(procdefinition).regvarinfo) then - with pregvarinfo(tprocdef(procdefinition).regvarinfo)^ do - for i := 1 to maxvarregs do - if assigned(regvars[i]) then - begin - {Fix me!!} - {tmpreg:=rg.makeregsize(regvars[i].reg,OS_INT); - rg.makeregvar(tmpreg);} - internalerror(200301232); - end; - end; -*) - { create temp procinfo } current_procinfo:=cprocinfo.create(nil); current_procinfo.procdef:=tprocdef(procdefinition); -(* - { Localsymtable } - current_procinfo.procdef.localst.symtablelevel:=oldprocdef.localst.symtablelevel; - if current_procinfo.procdef.localst.datasize>0 then - begin - old_local_fixup:=current_procinfo.procdef.localst.address_fixup; - tg.GetTemp(exprasmlist,current_procinfo.procdef.localst.datasize,tt_persistent,localsref); - if tg.direction>0 then - current_procinfo.procdef.localst.address_fixup:=localsref.offset - else - current_procinfo.procdef.localst.address_fixup:=localsref.offset+current_procinfo.procdef.localst.datasize; -{$ifdef extdebug} - Comment(V_debug,'inlined local symtable ('+tostr(current_procinfo.procdef.localst.datasize)+' bytes) is at offset '+tostr(current_procinfo.procdef.localst.address_fixup)); - exprasmList.concat(tai_comment.Create(strpnew( - 'inlined local symtable ('+tostr(current_procinfo.procdef.localst.datasize)+' bytes) is at offset '+tostr(current_procinfo.procdef.localst.address_fixup)))); -{$endif extdebug} - end; - - { Parasymtable } - current_procinfo.procdef.parast.symtablelevel:=oldprocdef.localst.symtablelevel; - if current_procinfo.procdef.parast.datasize>0 then - begin - old_para_fixup:=current_procinfo.procdef.parast.address_fixup; - tg.GetTemp(exprasmlist,current_procinfo.procdef.parast.datasize,tt_persistent,pararef); - current_procinfo.procdef.parast.address_fixup:=pararef.offset; -{$ifdef extdebug} - Comment(V_debug,'inlined para symtable ('+tostr(current_procinfo.procdef.parast.datasize)+' bytes) is at offset '+tostr(current_procinfo.procdef.parast.address_fixup)); - exprasmList.concat(tai_comment.Create(strpnew( - 'inlined para symtable ('+tostr(current_procinfo.procdef.parast.datasize)+' bytes) is at offset '+tostr(current_procinfo.procdef.parast.address_fixup)))); -{$endif extdebug} - end; -*) - { Add inling start } exprasmList.concat(Tai_Marker.Create(InlineStart)); {$ifdef extdebug} @@ -1095,7 +951,7 @@ implementation {$endif extdebug} { Allocate parameters and locals } - gen_alloc_parast(exprasmlist,tparasymtable(current_procinfo.procdef.parast)); + gen_alloc_inline_parast(exprasmlist,tparasymtable(current_procinfo.procdef.parast)); if current_procinfo.procdef.localst.symtabletype=localsymtable then gen_alloc_localst(exprasmlist,tlocalsymtable(current_procinfo.procdef.localst)); @@ -1105,16 +961,10 @@ implementation objectlibrary.getaddrlabel(startlabel); objectlibrary.getaddrlabel(endlabel); cg.a_label(exprasmlist,startlabel); -// tprocdef(procdefinition).localst.symtabletype:=inlinelocalsymtable; -// procdefinition.parast.symtabletype:=inlineparasymtable; { Here we must include the para and local symtable info } procdefinition.concatstabto(withdebuglist); - { set it back for safety } -// tprocdef(procdefinition).localst.symtabletype:=localsymtable; -// procdefinition.parast.symtabletype:=parasymtable; - mangled_length:=length(oldprocinfo.procdef.mangledname); getmem(pp,mangled_length+50); strpcopy(pp,'192,0,0,'+startlabel.name); @@ -1142,36 +992,6 @@ implementation cg.g_decrrefcount(exprasmlist,resulttype.def,refcountedtemp,false); end; -(* - { save all used registers and possible registers - used for the return value } - regs_to_push_int:=paramanager.get_volatile_registers_int(procdefinition.proccalloption); - regs_to_push_other:=paramanager.get_volatile_registers_fpu(procdefinition.proccalloption); - if (not is_void(resulttype.def)) then - begin - case procdefinition.funcret_paraloc[callerside].loc of - LOC_REGISTER,LOC_CREGISTER: - begin -{$ifndef cpu64bit} - if procdefinition.funcret_paraloc[callerside].size in [OS_S64,OS_64] then - begin - include(regs_to_push_int,getsupreg(procdefinition.funcret_paraloc[callerside].registerlow)); - include(regs_to_push_int,getsupreg(procdefinition.funcret_paraloc[callerside].registerhigh)); - end - else -{$endif cpu64bit} - include(regs_to_push_int,getsupreg(procdefinition.funcret_paraloc[callerside].register)); - end; - end; - end; - - rg.saveusedotherregisters(exprasmlist,pushedother,regs_to_push_other); -*) - - { Initialize for pushing the parameters } -// oldpushedparasize:=pushedparasize; -// pushedparasize:=0; - { Push parameters } oldaktcallnode:=aktcallnode; aktcallnode:=self; @@ -1179,12 +999,11 @@ implementation tcallparanode(left).secondcallparan; aktcallnode:=oldaktcallnode; -// rg.saveotherregvars(exprasmlist,regs_to_push_other); - { takes care of local data initialization } inlineentrycode:=TAAsmoutput.Create; inlineexitcode:=TAAsmoutput.Create; + gen_load_para_value(inlineentrycode); gen_initialize_code(inlineentrycode,true); if po_assembler in current_procinfo.procdef.procoptions then inlineentrycode.insert(Tai_marker.Create(asmblockstart)); @@ -1193,13 +1012,6 @@ implementation { process the inline code } secondpass(inlinecode); - { Reserve space for storing parameters that will be pushed } -// current_procinfo.allocate_push_parasize(pushedparasize); - - { Restore } -// pushedparasize:=oldpushedparasize; -// rg.restoreunusedstate(unusedstate); - gen_finalize_code(inlineexitcode,true); gen_load_return_value(inlineexitcode,usesacc,usesacchi,usesfpu); if po_assembler in current_procinfo.procdef.procoptions then @@ -1213,21 +1025,6 @@ implementation {$endif extdebug} exprasmList.concat(Tai_Marker.Create(InlineEnd)); -(* - {we can free the local data now, reset also the fixup address } - if current_procinfo.procdef.localst.datasize>0 then - begin - tg.UnGetTemp(exprasmlist,localsref); - current_procinfo.procdef.localst.address_fixup:=old_local_fixup; - end; - {we can free the para data now, reset also the fixup address } - if current_procinfo.procdef.parast.datasize>0 then - begin - tg.UnGetTemp(exprasmlist,pararef); - current_procinfo.procdef.parast.address_fixup:=old_para_fixup; - end; -*) - { handle function results } if (not is_void(resulttype.def)) then handle_return_value @@ -1247,9 +1044,6 @@ implementation rg.deallocexplicitregistersint(exprasmlist,paramanager.get_volatile_registers_int(pocall_default)); end; - { restore registers } -// rg.restoreusedotherregisters(exprasmlist,pushedother); - { release temps of paras } release_para_temps; @@ -1278,6 +1072,11 @@ implementation end; end; + { Release parameters and locals } + gen_free_parast(exprasmlist,tparasymtable(current_procinfo.procdef.parast)); + if current_procinfo.procdef.localst.symtabletype=localsymtable then + gen_free_localst(exprasmlist,tlocalsymtable(current_procinfo.procdef.localst)); + { release procinfo } current_procinfo.free; current_procinfo:=oldprocinfo; @@ -1324,7 +1123,13 @@ begin end. { $Log$ - Revision 1.125 2003-10-05 21:21:52 peter + Revision 1.126 2003-10-07 15:17:07 peter + * inline supported again, LOC_REFERENCEs are used to pass the + parameters + * inlineparasymtable,inlinelocalsymtable removed + * exitlabel inserting fixed + + Revision 1.125 2003/10/05 21:21:52 peter * c style array of const generates callparanodes * varargs paraloc fixes diff --git a/compiler/ncgld.pas b/compiler/ncgld.pas index b0200aebae..578ff524a7 100644 --- a/compiler/ncgld.pas +++ b/compiler/ncgld.pas @@ -216,9 +216,7 @@ implementation begin case symtabletype of localsymtable, - parasymtable, - inlinelocalsymtable, - inlineparasymtable : + parasymtable : begin if tvarsym(symtableentry).localloc.loc<>LOC_REFERENCE then internalerror(2003091816); @@ -246,7 +244,7 @@ implementation { handle call by reference variables when they are not alreayd copied to local copies. Also ignore the reference when we need to load the self pointer for objects } - if (symtabletype in [parasymtable,inlineparasymtable]) and + if (symtabletype=parasymtable) and not(vo_has_local_copy in tvarsym(symtableentry).varoptions) and not(nf_load_self_pointer in flags) and paramanager.push_addr_param(tvarsym(symtableentry).varspez,tvarsym(symtableentry).vartype.def,tprocdef(symtable.defowner).proccalloption) then @@ -885,7 +883,13 @@ begin end. { $Log$ - Revision 1.90 2003-10-05 21:21:52 peter + Revision 1.91 2003-10-07 15:17:07 peter + * inline supported again, LOC_REFERENCEs are used to pass the + parameters + * inlineparasymtable,inlinelocalsymtable removed + * exitlabel inserting fixed + + Revision 1.90 2003/10/05 21:21:52 peter * c style array of const generates callparanodes * varargs paraloc fixes diff --git a/compiler/ncgutil.pas b/compiler/ncgutil.pas index 00f43a6630..346049bf46 100644 --- a/compiler/ncgutil.pas +++ b/compiler/ncgutil.pas @@ -44,9 +44,9 @@ interface procedure maketojumpbool(list:TAAsmoutput; p : tnode; loadregvars: tloadregvars); procedure remove_non_regvars_from_loc(const t: tlocation; var regs:Tsuperregisterset); - procedure location_force_reg(list: TAAsmoutput;var l:tlocation;dst_size:TCGSize;maybeconst:boolean); - procedure location_force_fpureg(list: TAAsmoutput;var l: tlocation;maybeconst:boolean); - procedure location_force_mem(list: TAAsmoutput;var l:tlocation); + procedure location_force_reg(list:TAAsmoutput;var l:tlocation;dst_size:TCGSize;maybeconst:boolean); + procedure location_force_fpureg(list:TAAsmoutput;var l: tlocation;maybeconst:boolean); + procedure location_force_mem(list:TAAsmoutput;var l:tlocation); function maybe_pushfpu(list:taasmoutput;needed : byte;var l:tlocation) : boolean; @@ -54,16 +54,18 @@ interface procedure gen_proc_symbol_end(list:Taasmoutput); procedure gen_stackalloc_code(list:Taasmoutput); procedure gen_stackfree_code(list:Taasmoutput;usesacc,usesacchi:boolean); - procedure gen_save_used_regs(list : TAAsmoutput); - procedure gen_restore_used_regs(list : TAAsmoutput;usesacc,usesacchi,usesfpu:boolean); + procedure gen_save_used_regs(list:TAAsmoutput); + procedure gen_restore_used_regs(list:TAAsmoutput;usesacc,usesacchi,usesfpu:boolean); procedure gen_initialize_code(list:TAAsmoutput;inlined:boolean); - procedure gen_finalize_code(list : TAAsmoutput;inlined:boolean); + procedure gen_finalize_code(list:TAAsmoutput;inlined:boolean); + procedure gen_entry_code(list:TAAsmoutput); + procedure gen_exit_code(list:TAAsmoutput); procedure gen_load_para_value(list:TAAsmoutput); procedure gen_load_return_value(list:TAAsmoutput; var uses_acc,uses_acchi,uses_fpu : boolean); (* - procedure geninlineentrycode(list : TAAsmoutput;stackframe:longint); - procedure geninlineexitcode(list : TAAsmoutput;inlined:boolean); + procedure geninlineentrycode(list:TAAsmoutput;stackframe:longint); + procedure geninlineexitcode(list:TAAsmoutput;inlined:boolean); *) {# @@ -81,18 +83,19 @@ interface be modified, all temps should be allocated on the heap instead of the stack. } - procedure new_exception(list : taasmoutput;const jmpbuf,envbuf, href : treference; + procedure new_exception(list:TAAsmoutput;const jmpbuf,envbuf, href : treference; a : aword; exceptlabel : tasmlabel); - procedure free_exception(list : taasmoutput;const jmpbuf, envbuf, href : treference; + procedure free_exception(list:TAAsmoutput;const jmpbuf, envbuf, href : treference; a : aword ; endexceptlabel : tasmlabel; onlyfree : boolean); procedure insertconstdata(sym : ttypedconstsym); procedure insertbssdata(sym : tvarsym); - procedure gen_alloc_localst(list: taasmoutput;st:tlocalsymtable); - procedure gen_free_localst(list: taasmoutput;st:tlocalsymtable); - procedure gen_alloc_parast(list: taasmoutput;st:tparasymtable); - procedure gen_free_parast(list: taasmoutput;st:tparasymtable); + procedure gen_alloc_localst(list:TAAsmoutput;st:tlocalsymtable); + procedure gen_free_localst(list:TAAsmoutput;st:tlocalsymtable); + procedure gen_alloc_parast(list:TAAsmoutput;st:tparasymtable); + procedure gen_alloc_inline_parast(list:TAAsmoutput;st:tparasymtable); + procedure gen_free_parast(list:TAAsmoutput;st:tparasymtable); implementation @@ -259,7 +262,7 @@ implementation EXCEPTION MANAGEMENT *****************************************************************************} - procedure new_exception(list : taasmoutput;const jmpbuf,envbuf, href : treference; + procedure new_exception(list:TAAsmoutput;const jmpbuf,envbuf, href : treference; a : aword; exceptlabel : tasmlabel); var @@ -294,7 +297,7 @@ implementation end; - procedure free_exception(list : taasmoutput;const jmpbuf, envbuf, href : treference; + procedure free_exception(list:TAAsmoutput;const jmpbuf, envbuf, href : treference; a : aword ; endexceptlabel : tasmlabel; onlyfree : boolean); begin @@ -316,7 +319,7 @@ implementation {$ifndef cpu64bit} { 32-bit version } - procedure location_force_reg(list: TAAsmoutput;var l:tlocation;dst_size:TCGSize;maybeconst:boolean); + procedure location_force_reg(list:TAAsmoutput;var l:tlocation;dst_size:TCGSize;maybeconst:boolean); var hregister, hregisterhi : tregister; @@ -479,7 +482,7 @@ implementation {$else cpu64bit} { 64-bit version } - procedure location_force_reg(list: TAAsmoutput;var l:tlocation;dst_size:TCGSize;maybeconst:boolean); + procedure location_force_reg(list:TAAsmoutput;var l:tlocation;dst_size:TCGSize;maybeconst:boolean); var hregister : tregister; hl : tasmlabel; @@ -597,7 +600,7 @@ implementation {$endif cpu64bit} - procedure location_force_fpureg(list: TAAsmoutput;var l: tlocation;maybeconst:boolean); + procedure location_force_fpureg(list:TAAsmoutput;var l: tlocation;maybeconst:boolean); var reg : tregister; begin @@ -614,7 +617,7 @@ implementation end; - procedure location_force_mem(list: TAAsmoutput;var l:tlocation); + procedure location_force_mem(list:TAAsmoutput;var l:tlocation); var r : treference; begin @@ -678,7 +681,7 @@ implementation procedure copyvalueparas(p : tnamedindexitem;arg:pointer); var href1,href2 : treference; - list : taasmoutput; + list:TAAsmoutput; hsym : tvarsym; l : longint; loadref : boolean; @@ -750,7 +753,7 @@ implementation procedure initialize_data(p : tnamedindexitem;arg:pointer); var href : treference; - list : taasmoutput; + list:TAAsmoutput; begin list:=taasmoutput(arg); if (tsym(p).typ=varsym) and @@ -761,7 +764,7 @@ implementation begin if (cs_implicit_exceptions in aktmoduleswitches) then include(current_procinfo.flags,pi_needs_implicit_finally); - if tvarsym(p).owner.symtabletype in [localsymtable,inlinelocalsymtable] then + if tvarsym(p).owner.symtabletype=localsymtable then begin case tvarsym(p).localloc.loc of LOC_REFERENCE : @@ -781,7 +784,7 @@ implementation procedure finalize_data(p : tnamedindexitem;arg:pointer); var href : treference; - list : taasmoutput; + list:TAAsmoutput; begin list:=taasmoutput(arg); case tsym(p).typ of @@ -793,7 +796,7 @@ implementation not(is_class(tvarsym(p).vartype.def)) and tvarsym(p).vartype.def.needs_inittable then begin - if tvarsym(p).owner.symtabletype in [localsymtable,inlinelocalsymtable] then + if tvarsym(p).owner.symtabletype=localsymtable then begin case tvarsym(p).localloc.loc of LOC_REFERENCE : @@ -826,7 +829,7 @@ implementation var href : treference; tmpreg : tregister; - list : taasmoutput; + list:TAAsmoutput; begin list:=taasmoutput(arg); if (tsym(p).typ=varsym) and @@ -866,7 +869,7 @@ implementation procedure final_paras(p : tnamedindexitem;arg:pointer); var href : treference; - list : taasmoutput; + list:TAAsmoutput; begin list:=taasmoutput(arg); if (tsym(p).typ=varsym) and @@ -1116,6 +1119,28 @@ implementation begin if hp.paraloc[calleeside].loc<>LOC_REFERENCE then begin + if getsupreg(hp.paraloc[calleeside].register)