2
0

paramgr.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  1. {
  2. Copyright (c) 2002 by Florian Klaempfl
  3. Generic calling convention handling
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. ****************************************************************************
  16. }
  17. {# Parameter passing manager. Used to manage how
  18. parameters are passed to routines.
  19. }
  20. unit paramgr;
  21. {$i fpcdefs.inc}
  22. interface
  23. uses
  24. cclasses,globtype,
  25. cpubase,cgbase,cgutils,
  26. parabase,
  27. aasmtai,aasmdata,
  28. symconst,symtype,symsym,symdef;
  29. type
  30. {# This class defines some methods to take care of routine
  31. parameters. It should be overridden for each new processor
  32. }
  33. { tparamanager }
  34. tparamanager = class
  35. { true if the location in paraloc can be reused as localloc }
  36. function param_use_paraloc(const cgpara:tcgpara):boolean;virtual;
  37. { Returns true if the return value is actually a parameter pointer }
  38. function ret_in_param(def:tdef;pd:tabstractprocdef):boolean;virtual;
  39. function push_high_param(varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean;virtual;
  40. function keep_para_array_range(varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean;virtual;
  41. { Returns true if a parameter is too large to copy and only
  42. the address is pushed
  43. }
  44. function push_addr_param(varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean;virtual;abstract;
  45. { returns true if a parameter must be handled via copy-out (construct
  46. a reference, copy the parameter's value there in case of copy-in/out, pass the reference)
  47. }
  48. function push_copyout_param(varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean;virtual;
  49. { return the size of a push }
  50. function push_size(varspez:tvarspez;def : tdef;calloption : tproccalloption) : longint;virtual;
  51. {# Returns a structure giving the information on
  52. the storage of the parameter (which must be
  53. an integer parameter). This is only used when calling
  54. internal routines directly, where all parameters must
  55. be 4-byte values.
  56. In case the location is a register, this register is allocated.
  57. Call freeintparaloc() after the call to free the locations again.
  58. Default implementation: don't do anything at all (in case you don't
  59. use register parameter passing)
  60. @param(list Current assembler list)
  61. @param(nr Parameter number of routine, starting from 1)
  62. }
  63. function get_para_align(calloption : tproccalloption):byte;virtual;
  64. function get_volatile_registers_int(calloption : tproccalloption):tcpuregisterset;virtual;
  65. function get_volatile_registers_address(calloption : tproccalloption):tcpuregisterset;virtual;
  66. function get_volatile_registers_fpu(calloption : tproccalloption):tcpuregisterset;virtual;
  67. function get_volatile_registers_flags(calloption : tproccalloption):tcpuregisterset;virtual;
  68. function get_volatile_registers_mm(calloption : tproccalloption):tcpuregisterset;virtual;
  69. procedure getintparaloc(pd: tabstractprocdef; nr : longint; var cgpara: tcgpara);virtual;
  70. {# allocate an individual pcgparalocation that's part of a tcgpara
  71. @param(list Current assembler list)
  72. @param(loc Parameter location element)
  73. }
  74. procedure allocparaloc(list: TAsmList; const paraloc: pcgparalocation);
  75. {# allocate a parameter location created with create_paraloc_info
  76. @param(list Current assembler list)
  77. @param(loc Parameter location)
  78. }
  79. procedure alloccgpara(list: TAsmList; const cgpara: TCGPara); virtual;
  80. {# free a parameter location allocated with alloccgpara
  81. @param(list Current assembler list)
  82. @param(loc Parameter location)
  83. }
  84. procedure freecgpara(list: TAsmList; const cgpara: TCGPara); virtual;
  85. { This is used to populate the location information on all parameters
  86. for the routine as seen in either the caller or the callee. It returns
  87. the size allocated on the stack
  88. }
  89. function create_paraloc_info(p : tabstractprocdef; side: tcallercallee):longint;virtual;abstract;
  90. { Returns the location of the function result if p had def as
  91. function result instead of its actual result. Used if the compiler
  92. forces the function result to something different than the real
  93. result. }
  94. function get_funcretloc(p : tabstractprocdef; side: tcallercallee; forcetempdef: tdef): tcgpara;virtual;abstract;
  95. procedure create_funcretloc_info(p : tabstractprocdef; side: tcallercallee);
  96. { This is used to populate the location information on all parameters
  97. for the routine when it is being inlined. It returns
  98. the size allocated on the stack
  99. }
  100. function create_inline_paraloc_info(p : tabstractprocdef):longint;virtual;
  101. { This is used to populate the location information on all parameters
  102. for the routine that are passed as varargs. It returns
  103. the size allocated on the stack (including the normal parameters)
  104. }
  105. function create_varargs_paraloc_info(p : tabstractprocdef; varargspara:tvarargsparalist):longint;virtual;abstract;
  106. function is_stack_paraloc(paraloc: pcgparalocation): boolean;virtual;
  107. procedure createtempparaloc(list: TAsmList;calloption : tproccalloption;parasym : tparavarsym;can_use_final_stack_loc : boolean;var cgpara:TCGPara);virtual;
  108. procedure duplicatecgparaloc(const orgparaloc: pcgparalocation; intonewparaloc: pcgparalocation);
  109. procedure duplicateparaloc(list: TAsmList;calloption : tproccalloption;parasym : tparavarsym;var cgpara:TCGPara);
  110. function parseparaloc(parasym : tparavarsym;const s : string) : boolean;virtual;
  111. function parsefuncretloc(p : tabstractprocdef; const s : string) : boolean;virtual;
  112. { allocate room for parameters on the stack in the entry code? }
  113. function use_fixed_stack: boolean;
  114. { whether stack pointer can be changed in the middle of procedure }
  115. function use_stackalloc: boolean;
  116. strict protected
  117. { common part of get_funcretloc; returns true if retloc is completely
  118. initialized afterwards }
  119. function set_common_funcretloc_info(p : tabstractprocdef; forcetempdef: tdef; out retcgsize: tcgsize; out retloc: tcgpara): boolean;
  120. { common part of ret_in_param; is called by ret_in_param at the
  121. beginning and every tparamanager descendant can decide to call it
  122. itself as well; parameter retinparam is only valid if function
  123. returns true }
  124. function handle_common_ret_in_param(def:tdef;pd:tabstractprocdef;out retinparam:boolean):boolean;
  125. { returns the def to use for a tparalocation part of a cgpara for paradef,
  126. for which the def is paradef and the integer length is restlen.
  127. fullsize is true if restlen equals the full paradef size }
  128. function get_paraloc_def(paradef: tdef; restlen: aint; fullsize: boolean): tdef;
  129. end;
  130. var
  131. paramanager : tparamanager;
  132. implementation
  133. uses
  134. systems,
  135. cgobj,tgobj,
  136. defutil,verbose;
  137. { true if the location in paraloc can be reused as localloc }
  138. function tparamanager.param_use_paraloc(const cgpara:tcgpara):boolean;
  139. begin
  140. result:=false;
  141. end;
  142. { true if uses a parameter as return value }
  143. function tparamanager.ret_in_param(def:tdef;pd:tabstractprocdef):boolean;
  144. begin
  145. if handle_common_ret_in_param(def,pd,result) then
  146. exit;
  147. ret_in_param:=(def.typ=arraydef) or
  148. (def.typ=recorddef) or
  149. (def.typ=stringdef) or
  150. ((def.typ=procvardef) and not tprocvardef(def).is_addressonly) or
  151. { interfaces are also passed by reference to be compatible with delphi and COM }
  152. ((def.typ=objectdef) and (is_object(def) or is_interface(def) or is_dispinterface(def))) or
  153. (def.typ=variantdef) or
  154. ((def.typ=setdef) and not is_smallset(def));
  155. end;
  156. function tparamanager.push_high_param(varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean;
  157. begin
  158. push_high_param:=not(calloption in cdecl_pocalls) and
  159. (
  160. is_open_array(def) or
  161. is_open_string(def) or
  162. is_array_of_const(def)
  163. );
  164. end;
  165. function tparamanager.keep_para_array_range(varspez: tvarspez; def: tdef; calloption: tproccalloption): boolean;
  166. begin
  167. result:=push_high_param(varspez,def,calloption);
  168. end;
  169. function tparamanager.push_copyout_param(varspez: tvarspez; def: tdef; calloption: tproccalloption): boolean;
  170. begin
  171. push_copyout_param:=false;
  172. end;
  173. { return the size of a push }
  174. function tparamanager.push_size(varspez:tvarspez;def : tdef;calloption : tproccalloption) : longint;
  175. begin
  176. push_size:=-1;
  177. case varspez of
  178. vs_constref,
  179. vs_out,
  180. vs_var :
  181. push_size:=voidpointertype.size;
  182. vs_value,
  183. vs_const :
  184. begin
  185. if push_addr_param(varspez,def,calloption) then
  186. push_size:=voidpointertype.size
  187. else
  188. begin
  189. { special array are normally pushed by addr, only for
  190. cdecl array of const it comes here and the pushsize
  191. is unknown }
  192. if is_array_of_const(def) then
  193. push_size:=0
  194. else
  195. push_size:=def.size;
  196. end;
  197. end;
  198. end;
  199. end;
  200. function tparamanager.get_para_align(calloption : tproccalloption):byte;
  201. begin
  202. result:=std_param_align;
  203. end;
  204. function tparamanager.get_volatile_registers_int(calloption : tproccalloption):tcpuregisterset;
  205. begin
  206. result:=[];
  207. end;
  208. function tparamanager.get_volatile_registers_address(calloption : tproccalloption):tcpuregisterset;
  209. begin
  210. result:=[];
  211. end;
  212. function tparamanager.get_volatile_registers_fpu(calloption : tproccalloption):tcpuregisterset;
  213. begin
  214. result:=[];
  215. end;
  216. function tparamanager.get_volatile_registers_flags(calloption : tproccalloption):tcpuregisterset;
  217. begin
  218. result:=[];
  219. end;
  220. function tparamanager.get_volatile_registers_mm(calloption : tproccalloption):tcpuregisterset;
  221. begin
  222. result:=[];
  223. end;
  224. {$if first_mm_imreg = 0}
  225. {$WARN 4044 OFF} { Comparison might be always false ... }
  226. {$endif}
  227. procedure tparamanager.allocparaloc(list: TAsmList; const paraloc: pcgparalocation);
  228. begin
  229. case paraloc^.loc of
  230. LOC_REGISTER,
  231. LOC_CREGISTER:
  232. begin
  233. if getsupreg(paraloc^.register)<first_int_imreg then
  234. cg.getcpuregister(list,paraloc^.register);
  235. end;
  236. {$ifndef x86}
  237. { don't allocate ST(x), they're not handled by the register allocator }
  238. LOC_FPUREGISTER,
  239. LOC_CFPUREGISTER:
  240. begin
  241. if getsupreg(paraloc^.register)<first_fpu_imreg then
  242. cg.getcpuregister(list,paraloc^.register);
  243. end;
  244. {$endif not x86}
  245. LOC_MMREGISTER,
  246. LOC_CMMREGISTER :
  247. begin
  248. if getsupreg(paraloc^.register)<first_mm_imreg then
  249. cg.getcpuregister(list,paraloc^.register);
  250. end;
  251. end;
  252. end;
  253. procedure tparamanager.alloccgpara(list: TAsmList; const cgpara: TCGPara);
  254. var
  255. paraloc : pcgparalocation;
  256. begin
  257. paraloc:=cgpara.location;
  258. while assigned(paraloc) do
  259. begin
  260. allocparaloc(list,paraloc);
  261. paraloc:=paraloc^.next;
  262. end;
  263. end;
  264. procedure tparamanager.freecgpara(list: TAsmList; const cgpara: TCGPara);
  265. var
  266. paraloc : Pcgparalocation;
  267. href : treference;
  268. begin
  269. paraloc:=cgpara.location;
  270. while assigned(paraloc) do
  271. begin
  272. case paraloc^.loc of
  273. LOC_VOID:
  274. ;
  275. LOC_REGISTER,
  276. LOC_CREGISTER:
  277. begin
  278. if getsupreg(paraloc^.register)<first_int_imreg then
  279. cg.ungetcpuregister(list,paraloc^.register);
  280. end;
  281. LOC_FPUREGISTER,
  282. LOC_CFPUREGISTER:
  283. begin
  284. if getsupreg(paraloc^.register)<first_fpu_imreg then
  285. cg.ungetcpuregister(list,paraloc^.register);
  286. end;
  287. LOC_MMREGISTER,
  288. LOC_CMMREGISTER :
  289. begin
  290. if getsupreg(paraloc^.register)<first_mm_imreg then
  291. cg.ungetcpuregister(list,paraloc^.register);
  292. end;
  293. LOC_REFERENCE,
  294. LOC_CREFERENCE :
  295. begin
  296. if use_fixed_stack then
  297. begin
  298. { don't use reference_reset_base, because that will depend on cgobj }
  299. fillchar(href,sizeof(href),0);
  300. href.base:=paraloc^.reference.index;
  301. href.offset:=paraloc^.reference.offset;
  302. tg.ungetiftemp(list,href);
  303. end;
  304. end;
  305. else
  306. internalerror(2004110212);
  307. end;
  308. paraloc:=paraloc^.next;
  309. end;
  310. end;
  311. function tparamanager.is_stack_paraloc(paraloc: pcgparalocation): boolean;
  312. begin
  313. result:=
  314. assigned(paraloc) and
  315. (paraloc^.loc=LOC_REFERENCE) and
  316. (paraloc^.reference.index=NR_STACK_POINTER_REG);
  317. end;
  318. procedure tparamanager.createtempparaloc(list: TAsmList;calloption : tproccalloption;parasym : tparavarsym;can_use_final_stack_loc : boolean;var cgpara:TCGPara);
  319. var
  320. href : treference;
  321. len : aint;
  322. paraloc,
  323. newparaloc : pcgparalocation;
  324. begin
  325. paraloc:=parasym.paraloc[callerside].location;
  326. cgpara.reset;
  327. cgpara.size:=parasym.paraloc[callerside].size;
  328. cgpara.intsize:=parasym.paraloc[callerside].intsize;
  329. cgpara.alignment:=parasym.paraloc[callerside].alignment;
  330. cgpara.def:=parasym.paraloc[callerside].def;
  331. while assigned(paraloc) do
  332. begin
  333. if paraloc^.size=OS_NO then
  334. len:=push_size(parasym.varspez,parasym.vardef,calloption)
  335. else
  336. len:=tcgsize2size[paraloc^.size];
  337. newparaloc:=cgpara.add_location;
  338. newparaloc^.size:=paraloc^.size;
  339. newparaloc^.def:=paraloc^.def;
  340. newparaloc^.shiftval:=paraloc^.shiftval;
  341. { $warning maybe release this optimization for all targets? }
  342. { released for all CPUs:
  343. i386 isn't affected anyways because it uses the stack to push parameters
  344. on arm it reduces executable size of the compiler by 2.1 per cent (FK) }
  345. { Does it fit a register? }
  346. if ((not can_use_final_stack_loc and
  347. use_fixed_stack) or
  348. not is_stack_paraloc(paraloc)) and
  349. (len<=sizeof(pint)) and
  350. (paraloc^.size in [OS_8,OS_16,OS_32,OS_64,OS_128,OS_S8,OS_S16,OS_S32,OS_S64,OS_S128]) then
  351. newparaloc^.loc:=LOC_REGISTER
  352. else
  353. newparaloc^.loc:=paraloc^.loc;
  354. case newparaloc^.loc of
  355. LOC_REGISTER :
  356. newparaloc^.register:=cg.getintregister(list,paraloc^.size);
  357. LOC_FPUREGISTER :
  358. newparaloc^.register:=cg.getfpuregister(list,paraloc^.size);
  359. LOC_MMREGISTER :
  360. newparaloc^.register:=cg.getmmregister(list,paraloc^.size);
  361. LOC_REFERENCE :
  362. begin
  363. if (can_use_final_stack_loc or
  364. not use_fixed_stack) and
  365. is_stack_paraloc(paraloc) then
  366. duplicatecgparaloc(paraloc,newparaloc)
  367. else
  368. begin
  369. if assigned(cgpara.def) then
  370. tg.gethltemp(list,cgpara.def,len,tt_persistent,href)
  371. else
  372. tg.gettemp(list,len,cgpara.alignment,tt_persistent,href);
  373. newparaloc^.reference.index:=href.base;
  374. newparaloc^.reference.offset:=href.offset;
  375. end;
  376. end;
  377. end;
  378. paraloc:=paraloc^.next;
  379. end;
  380. end;
  381. procedure tparamanager.duplicatecgparaloc(const orgparaloc: pcgparalocation; intonewparaloc: pcgparalocation);
  382. begin
  383. move(orgparaloc^,intonewparaloc^,sizeof(intonewparaloc^));
  384. intonewparaloc^.next:=nil;
  385. end;
  386. procedure tparamanager.duplicateparaloc(list: TAsmList;calloption : tproccalloption;parasym : tparavarsym;var cgpara:TCGPara);
  387. var
  388. paraloc,
  389. newparaloc : pcgparalocation;
  390. begin
  391. cgpara.reset;
  392. cgpara.size:=parasym.paraloc[callerside].size;
  393. cgpara.intsize:=parasym.paraloc[callerside].intsize;
  394. cgpara.alignment:=parasym.paraloc[callerside].alignment;
  395. paraloc:=parasym.paraloc[callerside].location;
  396. while assigned(paraloc) do
  397. begin
  398. newparaloc:=cgpara.add_location;
  399. duplicatecgparaloc(paraloc,newparaloc);
  400. paraloc:=paraloc^.next;
  401. end;
  402. end;
  403. procedure tparamanager.create_funcretloc_info(p : tabstractprocdef; side: tcallercallee);
  404. begin
  405. p.funcretloc[side]:=get_funcretloc(p,side,nil);
  406. end;
  407. function tparamanager.create_inline_paraloc_info(p : tabstractprocdef):longint;
  408. begin
  409. { We need to return the size allocated }
  410. p.init_paraloc_info(callbothsides);
  411. result:=p.calleeargareasize;
  412. end;
  413. function tparamanager.parseparaloc(parasym: tparavarsym; const s: string): boolean;
  414. begin
  415. Result:=False;
  416. internalerror(200807235);
  417. end;
  418. function tparamanager.parsefuncretloc(p: tabstractprocdef; const s: string): boolean;
  419. begin
  420. Result:=False;
  421. internalerror(200807236);
  422. end;
  423. function tparamanager.use_fixed_stack: boolean;
  424. begin
  425. {$ifdef i386}
  426. result := target_info.stackalign > 4;
  427. {$else i386}
  428. {$ifdef cputargethasfixedstack}
  429. result := true;
  430. {$else cputargethasfixedstack}
  431. result := false;
  432. {$endif cputargethasfixedstack}
  433. {$endif i386}
  434. end;
  435. { This is a separate function because at least win64 allows stack allocations
  436. despite of fixed stack semantics (actually supporting it requires generating
  437. a compliant stack frame, not yet possible) }
  438. function tparamanager.use_stackalloc: boolean;
  439. begin
  440. result:=not use_fixed_stack;
  441. end;
  442. function tparamanager.set_common_funcretloc_info(p : tabstractprocdef; forcetempdef: tdef; out retcgsize: tcgsize; out retloc: tcgpara): boolean;
  443. var
  444. paraloc : pcgparalocation;
  445. begin
  446. result:=true;
  447. retloc.init;
  448. if not assigned(forcetempdef) then
  449. retloc.def:=p.returndef
  450. else
  451. begin
  452. retloc.def:=forcetempdef;
  453. retloc.temporary:=true;
  454. end;
  455. retloc.alignment:=get_para_align(p.proccalloption);
  456. { void has no location }
  457. if is_void(retloc.def) then
  458. begin
  459. paraloc:=retloc.add_location;
  460. retloc.size:=OS_NO;
  461. retcgsize:=OS_NO;
  462. retloc.intsize:=0;
  463. paraloc^.def:=retloc.def;
  464. paraloc^.size:=OS_NO;
  465. paraloc^.loc:=LOC_VOID;
  466. exit;
  467. end;
  468. { Constructors return self instead of a boolean }
  469. if p.proctypeoption=potype_constructor then
  470. begin
  471. retloc.def:=tdef(p.owner.defowner);
  472. if not (is_implicit_pointer_object_type(retloc.def) or
  473. (retloc.def.typ<>objectdef)) then
  474. retloc.def:=getpointerdef(retloc.def);
  475. end;
  476. retcgsize:=def_cgsize(retloc.def);
  477. retloc.intsize:=retloc.def.size;
  478. retloc.size:=retcgsize;
  479. { Return is passed as var parameter }
  480. if ret_in_param(retloc.def,p) then
  481. begin
  482. retloc.def:=getpointerdef(retloc.def);
  483. paraloc:=retloc.add_location;
  484. paraloc^.loc:=LOC_REFERENCE;
  485. paraloc^.size:=retcgsize;
  486. paraloc^.def:=retloc.def;
  487. exit;
  488. end;
  489. result:=false;
  490. end;
  491. function tparamanager.handle_common_ret_in_param(def: tdef;
  492. pd: tabstractprocdef; out retinparam: boolean): boolean;
  493. begin
  494. { This must be system independent: safecall and record constructor result
  495. is always returned in param.
  496. Furthermore, any managed type is returned in param, in order to avoid
  497. its finalization on exception at callee side. }
  498. if (tf_safecall_exceptions in target_info.flags) and
  499. (pd.proccalloption=pocall_safecall) or
  500. (
  501. (pd.proctypeoption=potype_constructor)and
  502. (
  503. is_record(def) or
  504. (
  505. (def.typ<>objectdef) and
  506. (pd.owner.symtabletype=objectsymtable) and
  507. is_objectpascal_helper(tdef(pd.owner.defowner))
  508. )
  509. )
  510. ) or is_managed_type(def) then
  511. begin
  512. retinparam:=true;
  513. exit(true);
  514. end;
  515. if pd.proctypeoption=potype_constructor then
  516. begin
  517. retinparam:=false;
  518. exit(true);
  519. end;
  520. result:=false;
  521. end;
  522. function tparamanager.get_paraloc_def(paradef: tdef; restlen: aint; fullsize: boolean): tdef;
  523. begin
  524. if fullsize then
  525. result:=paradef
  526. { no support for 128 bit ints -> tcgsize2orddef can't handle
  527. OS_(S)128 }
  528. else if restlen in [1,2,4,8] then
  529. result:=cgsize_orddef(int_cgsize(restlen))
  530. else
  531. result:=getarraydef(u8inttype,restlen);
  532. end;
  533. procedure tparamanager.getintparaloc(pd: tabstractprocdef; nr : longint; var cgpara: tcgpara);
  534. begin
  535. if (nr<1) or (nr>pd.paras.count) then
  536. InternalError(2013060101);
  537. pd.init_paraloc_info(callerside);
  538. cgpara:=tparavarsym(pd.paras[nr-1]).paraloc[callerside].getcopy;
  539. end;
  540. initialization
  541. ;
  542. finalization
  543. paramanager.free;
  544. end.