ncgmem.pas 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. Generate assembler for memory related nodes which are
  5. the same for all (most?) processors
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ****************************************************************************
  18. }
  19. { This unit generate assembler for memory related nodes.
  20. }
  21. unit ncgmem;
  22. {$i fpcdefs.inc}
  23. interface
  24. uses
  25. cgbase,cpuinfo,cpubase,
  26. node,nmem;
  27. type
  28. tcgloadvmtaddrnode = class(tloadvmtaddrnode)
  29. procedure pass_2;override;
  30. end;
  31. tcgloadparentfpnode = class(tloadparentfpnode)
  32. procedure pass_2;override;
  33. end;
  34. tcgaddrnode = class(taddrnode)
  35. procedure pass_2;override;
  36. end;
  37. tcgderefnode = class(tderefnode)
  38. procedure pass_2;override;
  39. end;
  40. tcgsubscriptnode = class(tsubscriptnode)
  41. procedure pass_2;override;
  42. end;
  43. tcgwithnode = class(twithnode)
  44. procedure pass_2;override;
  45. end;
  46. tcgvecnode = class(tvecnode)
  47. private
  48. procedure rangecheck_array;
  49. protected
  50. function get_mul_size : longint;
  51. {# This routine is used to calculate the address of the reference.
  52. On entry reg contains the index in the array,
  53. and l contains the size of each element in the array.
  54. This routine should update location.reference correctly,
  55. so it points to the correct address.
  56. }
  57. procedure update_reference_reg_mul(reg:tregister;l:aword);virtual;
  58. procedure second_wideansistring;virtual;
  59. procedure second_dynamicarray;virtual;
  60. public
  61. procedure pass_2;override;
  62. end;
  63. implementation
  64. uses
  65. {$ifdef delphi}
  66. sysutils,
  67. {$else}
  68. strings,
  69. {$endif}
  70. {$ifdef GDB}
  71. gdb,
  72. {$endif GDB}
  73. globtype,systems,
  74. cutils,verbose,globals,
  75. symconst,symdef,symsym,defutil,paramgr,
  76. aasmbase,aasmtai,
  77. procinfo,pass_2,
  78. pass_1,nld,ncon,nadd,
  79. cgobj,tgobj,ncgutil,symbase
  80. ;
  81. {*****************************************************************************
  82. TCGLOADVMTADDRNODE
  83. *****************************************************************************}
  84. procedure tcgloadvmtaddrnode.pass_2;
  85. var
  86. href : treference;
  87. begin
  88. location_reset(location,LOC_REGISTER,OS_ADDR);
  89. if (left.nodetype<>typen) then
  90. begin
  91. { left contains self, load vmt from self }
  92. secondpass(left);
  93. if is_object(left.resulttype.def) then
  94. begin
  95. case left.location.loc of
  96. LOC_CREFERENCE,
  97. LOC_REFERENCE:
  98. begin
  99. location_release(exprasmlist,left.location);
  100. reference_reset_base(href,cg.getaddressregister(exprasmlist),tobjectdef(left.resulttype.def).vmt_offset);
  101. cg.a_loadaddr_ref_reg(exprasmlist,left.location.reference,href.base);
  102. end;
  103. else
  104. internalerror(200305056);
  105. end;
  106. end
  107. else
  108. begin
  109. case left.location.loc of
  110. LOC_REGISTER:
  111. begin
  112. {$ifdef cpu_uses_separate_address_registers}
  113. if getregtype(left.location.register)<>R_ADDRESSREGISTER then
  114. begin
  115. location_release(exprasmlist,left.location);
  116. reference_reset_base(href,cg.getaddressregister(exprasmlist),tobjectdef(left.resulttype.def).vmt_offset);
  117. cg.a_load_reg_reg(exprasmlist,OS_ADDR,OS_ADDR,left.location.register,href.base);
  118. end
  119. else
  120. {$endif}
  121. reference_reset_base(href,left.location.register,tobjectdef(left.resulttype.def).vmt_offset);
  122. end;
  123. LOC_CREGISTER,
  124. LOC_CREFERENCE,
  125. LOC_REFERENCE:
  126. begin
  127. location_release(exprasmlist,left.location);
  128. reference_reset_base(href,cg.getaddressregister(exprasmlist),tobjectdef(left.resulttype.def).vmt_offset);
  129. cg.a_load_loc_reg(exprasmlist,OS_ADDR,left.location,href.base);
  130. end;
  131. else
  132. internalerror(200305057);
  133. end;
  134. end;
  135. reference_release(exprasmlist,href);
  136. location.register:=cg.getaddressregister(exprasmlist);
  137. cg.g_maybe_testself(exprasmlist,href.base);
  138. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,href,location.register);
  139. end
  140. else
  141. begin
  142. reference_reset_symbol(href,
  143. objectlibrary.newasmsymboldata(tobjectdef(tclassrefdef(resulttype.def).pointertype.def).vmt_mangledname),0);
  144. location.register:=cg.getaddressregister(exprasmlist);
  145. cg.a_loadaddr_ref_reg(exprasmlist,href,location.register);
  146. end;
  147. end;
  148. {*****************************************************************************
  149. TCGLOADPARENTFPNODE
  150. *****************************************************************************}
  151. procedure tcgloadparentfpnode.pass_2;
  152. var
  153. currpi : tprocinfo;
  154. hsym : tvarsym;
  155. href : treference;
  156. begin
  157. if (current_procinfo.procdef.parast.symtablelevel=parentpd.parast.symtablelevel) then
  158. begin
  159. location_reset(location,LOC_REGISTER,OS_ADDR);
  160. location.register:=current_procinfo.framepointer;
  161. end
  162. else
  163. begin
  164. currpi:=current_procinfo;
  165. location_reset(location,LOC_REGISTER,OS_ADDR);
  166. location.register:=cg.getaddressregister(exprasmlist);
  167. { load framepointer of current proc }
  168. hsym:=tvarsym(currpi.procdef.parast.search('parentfp'));
  169. if not assigned(hsym) then
  170. internalerror(200309281);
  171. case hsym.localloc.loc of
  172. LOC_REFERENCE :
  173. begin
  174. reference_reset_base(href,hsym.localloc.reference.index,hsym.localloc.reference.offset);
  175. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,href,location.register);
  176. end;
  177. LOC_REGISTER :
  178. cg.a_load_reg_reg(exprasmlist,OS_ADDR,OS_ADDR,hsym.localloc.register,location.register);
  179. end;
  180. { walk parents }
  181. while (currpi.procdef.owner.symtablelevel>parentpd.parast.symtablelevel) do
  182. begin
  183. currpi:=currpi.parent;
  184. if not assigned(currpi) then
  185. internalerror(200311201);
  186. hsym:=tvarsym(currpi.procdef.parast.search('parentfp'));
  187. if not assigned(hsym) then
  188. internalerror(200309282);
  189. if hsym.localloc.loc<>LOC_REFERENCE then
  190. internalerror(200309283);
  191. reference_reset_base(href,location.register,hsym.localloc.reference.offset);
  192. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,href,location.register);
  193. end;
  194. end;
  195. end;
  196. {*****************************************************************************
  197. TCGADDRNODE
  198. *****************************************************************************}
  199. procedure tcgaddrnode.pass_2;
  200. begin
  201. secondpass(left);
  202. { when loading procvar we do nothing with this node, so load the
  203. location of left }
  204. if nf_procvarload in flags then
  205. begin
  206. location_copy(location,left.location);
  207. exit;
  208. end;
  209. location_release(exprasmlist,left.location);
  210. location_reset(location,LOC_REGISTER,OS_ADDR);
  211. location.register:=cg.getaddressregister(exprasmlist);
  212. { @ on a procvar means returning an address to the procedure that
  213. is stored in it }
  214. if (m_tp_procvar in aktmodeswitches) and
  215. (left.nodetype=loadn) and
  216. (tloadnode(left).resulttype.def.deftype=procvardef) and
  217. assigned(tloadnode(left).symtableentry) and
  218. (tloadnode(left).symtableentry.typ=varsym) then
  219. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,left.location.reference,location.register)
  220. else
  221. cg.a_loadaddr_ref_reg(exprasmlist,left.location.reference,location.register);
  222. end;
  223. {*****************************************************************************
  224. TCGDEREFNODE
  225. *****************************************************************************}
  226. procedure tcgderefnode.pass_2;
  227. var
  228. paraloc1 : tparalocation;
  229. begin
  230. secondpass(left);
  231. location_reset(location,LOC_REFERENCE,def_cgsize(resulttype.def));
  232. case left.location.loc of
  233. LOC_REGISTER:
  234. begin
  235. {$ifdef cpu_uses_separate_address_registers}
  236. if getregtype(left.location.register)<>R_ADDRESSREGISTER then
  237. begin
  238. location_release(exprasmlist,left.location);
  239. location.reference.base := cg.getaddressregister(exprasmlist);
  240. cg.a_load_reg_reg(exprasmlist,OS_ADDR,OS_ADDR,left.location.register,
  241. location.reference.base);
  242. end
  243. else
  244. {$endif}
  245. location.reference.base := left.location.register;
  246. end;
  247. LOC_CREGISTER,
  248. LOC_CREFERENCE,
  249. LOC_REFERENCE:
  250. begin
  251. location_release(exprasmlist,left.location);
  252. location.reference.base:=cg.getaddressregister(exprasmlist);
  253. cg.a_load_loc_reg(exprasmlist,OS_ADDR,left.location,location.reference.base);
  254. end;
  255. end;
  256. if (cs_gdb_heaptrc in aktglobalswitches) and
  257. (cs_checkpointer in aktglobalswitches) and
  258. not(cs_compilesystem in aktmoduleswitches) and
  259. (not tpointerdef(left.resulttype.def).is_far) then
  260. begin
  261. paraloc1:=paramanager.getintparaloc(pocall_default,1);
  262. paramanager.allocparaloc(exprasmlist,paraloc1);
  263. cg.a_param_reg(exprasmlist, OS_ADDR,location.reference.base,paraloc1);
  264. paramanager.freeparaloc(exprasmlist,paraloc1);
  265. { FPC_CHECKPOINTER uses saveregisters }
  266. cg.a_call_name(exprasmlist,'FPC_CHECKPOINTER');
  267. end;
  268. end;
  269. {*****************************************************************************
  270. TCGSUBSCRIPTNODE
  271. *****************************************************************************}
  272. procedure tcgsubscriptnode.pass_2;
  273. var
  274. paraloc1 : tparalocation;
  275. begin
  276. secondpass(left);
  277. if codegenerror then
  278. exit;
  279. { classes and interfaces must be dereferenced implicit }
  280. if is_class_or_interface(left.resulttype.def) then
  281. begin
  282. location_reset(location,LOC_REFERENCE,def_cgsize(resulttype.def));
  283. case left.location.loc of
  284. LOC_CREGISTER,
  285. LOC_REGISTER:
  286. begin
  287. {$ifdef cpu_uses_separate_address_registers}
  288. if getregtype(left.location.register)<>R_ADDRESSREGISTER then
  289. begin
  290. location_release(exprasmlist,left.location);
  291. location.reference.base:=rg.getaddressregister(exprasmlist);
  292. cg.a_load_reg_reg(exprasmlist,OS_ADDR,OS_ADDR,
  293. left.location.register,location.reference.base);
  294. end
  295. else
  296. {$endif}
  297. location.reference.base := left.location.register;
  298. end;
  299. LOC_CREFERENCE,
  300. LOC_REFERENCE:
  301. begin
  302. location_release(exprasmlist,left.location);
  303. location.reference.base:=cg.getaddressregister(exprasmlist);
  304. cg.a_load_loc_reg(exprasmlist,OS_ADDR,left.location,location.reference.base);
  305. end;
  306. end;
  307. { implicit deferencing }
  308. if (cs_gdb_heaptrc in aktglobalswitches) and
  309. (cs_checkpointer in aktglobalswitches) and
  310. not(cs_compilesystem in aktmoduleswitches) then
  311. begin
  312. paraloc1:=paramanager.getintparaloc(pocall_default,1);
  313. paramanager.allocparaloc(exprasmlist,paraloc1);
  314. cg.a_param_reg(exprasmlist, OS_ADDR,location.reference.base,paraloc1);
  315. paramanager.freeparaloc(exprasmlist,paraloc1);
  316. { FPC_CHECKPOINTER uses saveregisters }
  317. cg.a_call_name(exprasmlist,'FPC_CHECKPOINTER');
  318. end;
  319. end
  320. else if is_interfacecom(left.resulttype.def) then
  321. begin
  322. tg.GetTempTyped(exprasmlist,left.resulttype.def,tt_normal,location.reference);
  323. cg.a_load_loc_ref(exprasmlist,OS_ADDR,left.location,location.reference);
  324. { implicit deferencing also for interfaces }
  325. if (cs_gdb_heaptrc in aktglobalswitches) and
  326. (cs_checkpointer in aktglobalswitches) and
  327. not(cs_compilesystem in aktmoduleswitches) then
  328. begin
  329. paraloc1:=paramanager.getintparaloc(pocall_default,1);
  330. paramanager.allocparaloc(exprasmlist,paraloc1);
  331. cg.a_param_reg(exprasmlist, OS_ADDR,location.reference.base,paraloc1);
  332. paramanager.freeparaloc(exprasmlist,paraloc1);
  333. { FPC_CHECKPOINTER uses saveregisters }
  334. cg.a_call_name(exprasmlist,'FPC_CHECKPOINTER');
  335. end;
  336. end
  337. else
  338. location_copy(location,left.location);
  339. inc(location.reference.offset,vs.fieldoffset);
  340. { also update the size of the location }
  341. location.size:=def_cgsize(resulttype.def);
  342. end;
  343. {*****************************************************************************
  344. TCGWITHNODE
  345. *****************************************************************************}
  346. procedure tcgwithnode.pass_2;
  347. {$ifdef GDB}
  348. const
  349. withlevel : longint = 0;
  350. var
  351. withstartlabel,withendlabel : tasmlabel;
  352. pp : pchar;
  353. mangled_length : longint;
  354. refnode : tnode;
  355. {$endif GDB}
  356. begin
  357. location_reset(location,LOC_VOID,OS_NO);
  358. {$ifdef GDB}
  359. if (cs_debuginfo in aktmoduleswitches) then
  360. begin
  361. { load reference }
  362. if (withrefnode.nodetype=derefn) and
  363. (tderefnode(withrefnode).left.nodetype=temprefn) then
  364. refnode:=tderefnode(withrefnode).left
  365. else
  366. refnode:=withrefnode;
  367. secondpass(refnode);
  368. location_release(exprasmlist,refnode.location);
  369. location_freetemp(exprasmlist,refnode.location);
  370. if not(refnode.location.loc in [LOC_REFERENCE,LOC_CREFERENCE]) then
  371. internalerror(2003092810);
  372. inc(withlevel);
  373. objectlibrary.getaddrlabel(withstartlabel);
  374. objectlibrary.getaddrlabel(withendlabel);
  375. cg.a_label(exprasmlist,withstartlabel);
  376. withdebugList.concat(Tai_stabs.Create(strpnew(
  377. '"with'+tostr(withlevel)+':'+tostr(symtablestack.getnewtypecount)+
  378. '=*'+tstoreddef(left.resulttype.def).numberstring+'",'+
  379. tostr(N_LSYM)+',0,0,'+tostr(refnode.location.reference.offset))));
  380. mangled_length:=length(current_procinfo.procdef.mangledname);
  381. getmem(pp,mangled_length+50);
  382. strpcopy(pp,'192,0,0,'+withstartlabel.name);
  383. if (target_info.use_function_relative_addresses) then
  384. begin
  385. strpcopy(strend(pp),'-');
  386. strpcopy(strend(pp),current_procinfo.procdef.mangledname);
  387. end;
  388. withdebugList.concat(Tai_stabn.Create(strnew(pp)));
  389. end;
  390. {$endif GDB}
  391. if assigned(left) then
  392. secondpass(left);
  393. {$ifdef GDB}
  394. if (cs_debuginfo in aktmoduleswitches) then
  395. begin
  396. cg.a_label(exprasmlist,withendlabel);
  397. strpcopy(pp,'224,0,0,'+withendlabel.name);
  398. if (target_info.use_function_relative_addresses) then
  399. begin
  400. strpcopy(strend(pp),'-');
  401. strpcopy(strend(pp),current_procinfo.procdef.mangledname);
  402. end;
  403. withdebugList.concat(Tai_stabn.Create(strnew(pp)));
  404. freemem(pp,mangled_length+50);
  405. dec(withlevel);
  406. end;
  407. {$endif GDB}
  408. end;
  409. {*****************************************************************************
  410. TCGVECNODE
  411. *****************************************************************************}
  412. function tcgvecnode.get_mul_size : longint;
  413. begin
  414. if nf_memindex in flags then
  415. get_mul_size:=1
  416. else
  417. begin
  418. if (left.resulttype.def.deftype=arraydef) then
  419. get_mul_size:=tarraydef(left.resulttype.def).elesize
  420. else
  421. get_mul_size:=resulttype.def.size;
  422. end
  423. end;
  424. procedure tcgvecnode.update_reference_reg_mul(reg:tregister;l:aword);
  425. var
  426. hreg: tregister;
  427. begin
  428. if location.reference.base=NR_NO then
  429. begin
  430. cg.a_op_const_reg(exprasmlist,OP_IMUL,OS_ADDR,l,reg);
  431. location.reference.base:=reg;
  432. end
  433. else if location.reference.index=NR_NO then
  434. begin
  435. cg.a_op_const_reg(exprasmlist,OP_IMUL,OS_ADDR,l,reg);
  436. location.reference.index:=reg;
  437. end
  438. else
  439. begin
  440. cg.ungetreference(exprasmlist,location.reference);
  441. hreg := cg.getaddressregister(exprasmlist);
  442. cg.a_loadaddr_ref_reg(exprasmlist,location.reference,hreg);
  443. reference_reset_base(location.reference,hreg,0);
  444. { insert new index register }
  445. cg.a_op_const_reg(exprasmlist,OP_IMUL,OS_ADDR,l,reg);
  446. location.reference.index:=reg;
  447. end;
  448. end;
  449. procedure tcgvecnode.second_wideansistring;
  450. begin
  451. end;
  452. procedure tcgvecnode.second_dynamicarray;
  453. begin
  454. end;
  455. procedure tcgvecnode.rangecheck_array;
  456. var
  457. freereg : boolean;
  458. hightree : tnode;
  459. poslabel,
  460. neglabel : tasmlabel;
  461. hreg : tregister;
  462. paraloc1,paraloc2 : tparalocation;
  463. begin
  464. if is_open_array(left.resulttype.def) or
  465. is_array_of_const(left.resulttype.def) then
  466. begin
  467. { cdecl functions don't have high() so we can not check the range }
  468. if not(current_procinfo.procdef.proccalloption in [pocall_cdecl,pocall_cppdecl]) then
  469. begin
  470. { Get high value }
  471. hightree:=load_high_value_node(tvarsym(tloadnode(left).symtableentry));
  472. { it must be available }
  473. if not assigned(hightree) then
  474. internalerror(200212201);
  475. firstpass(hightree);
  476. secondpass(hightree);
  477. { generate compares }
  478. freereg:=false;
  479. if (right.location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
  480. hreg:=right.location.register
  481. else
  482. begin
  483. hreg:=cg.getintregister(exprasmlist,OS_INT);
  484. freereg:=true;
  485. cg.a_load_loc_reg(exprasmlist,OS_INT,right.location,hreg);
  486. end;
  487. objectlibrary.getlabel(neglabel);
  488. objectlibrary.getlabel(poslabel);
  489. cg.a_cmp_const_reg_label(exprasmlist,OS_INT,OC_LT,0,hreg,poslabel);
  490. location_release(exprasmlist,hightree.location);
  491. cg.a_cmp_loc_reg_label(exprasmlist,OS_INT,OC_BE,hightree.location,hreg,neglabel);
  492. if freereg then
  493. cg.ungetregister(exprasmlist,hreg);
  494. cg.a_label(exprasmlist,poslabel);
  495. cg.a_call_name(exprasmlist,'FPC_RANGEERROR');
  496. cg.a_label(exprasmlist,neglabel);
  497. { release hightree }
  498. hightree.free;
  499. end;
  500. end
  501. else
  502. if is_dynamic_array(left.resulttype.def) then
  503. begin
  504. paraloc1:=paramanager.getintparaloc(pocall_default,1);
  505. paraloc2:=paramanager.getintparaloc(pocall_default,2);
  506. paramanager.allocparaloc(exprasmlist,paraloc2);
  507. cg.a_param_loc(exprasmlist,right.location,paraloc2);
  508. paramanager.allocparaloc(exprasmlist,paraloc1);
  509. cg.a_param_loc(exprasmlist,left.location,paraloc1);
  510. paramanager.freeparaloc(exprasmlist,paraloc1);
  511. paramanager.freeparaloc(exprasmlist,paraloc2);
  512. cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  513. cg.a_call_name(exprasmlist,'FPC_DYNARRAY_RANGECHECK');
  514. cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  515. end
  516. else
  517. cg.g_rangecheck(exprasmlist,right.location,right.resulttype.def,left.resulttype.def);
  518. end;
  519. procedure tcgvecnode.pass_2;
  520. var
  521. extraoffset : longint;
  522. t : tnode;
  523. href : treference;
  524. otl,ofl : tasmlabel;
  525. newsize : tcgsize;
  526. mulsize: longint;
  527. isjump : boolean;
  528. paraloc1,paraloc2 : tparalocation;
  529. begin
  530. mulsize := get_mul_size;
  531. newsize:=def_cgsize(resulttype.def);
  532. secondpass(left);
  533. if left.location.loc=LOC_CREFERENCE then
  534. location_reset(location,LOC_CREFERENCE,newsize)
  535. else
  536. location_reset(location,LOC_REFERENCE,newsize);
  537. { an ansistring needs to be dereferenced }
  538. if is_ansistring(left.resulttype.def) or
  539. is_widestring(left.resulttype.def) then
  540. begin
  541. if nf_callunique in flags then
  542. internalerror(200304236);
  543. case left.location.loc of
  544. LOC_REGISTER,
  545. LOC_CREGISTER :
  546. location.reference.base:=left.location.register;
  547. LOC_CREFERENCE,
  548. LOC_REFERENCE :
  549. begin
  550. location_release(exprasmlist,left.location);
  551. location.reference.base:=cg.getaddressregister(exprasmlist);
  552. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,left.location.reference,location.reference.base);
  553. end;
  554. else
  555. internalerror(2002032218);
  556. end;
  557. { check for a zero length string,
  558. we can use the ansistring routine here }
  559. if (cs_check_range in aktlocalswitches) then
  560. begin
  561. paraloc1:=paramanager.getintparaloc(pocall_default,1);
  562. paramanager.allocparaloc(exprasmlist,paraloc1);
  563. cg.a_param_reg(exprasmlist,OS_ADDR,location.reference.base,paraloc1);
  564. paramanager.freeparaloc(exprasmlist,paraloc1);
  565. cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  566. cg.a_call_name(exprasmlist,'FPC_'+upper(tstringdef(left.resulttype.def).stringtypname)+'_CHECKZERO');
  567. cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  568. end;
  569. { in ansistrings/widestrings S[1] is p<w>char(S)[0] !! }
  570. if is_ansistring(left.resulttype.def) then
  571. dec(location.reference.offset)
  572. else
  573. dec(location.reference.offset,2);
  574. end
  575. else if is_dynamic_array(left.resulttype.def) then
  576. begin
  577. case left.location.loc of
  578. LOC_REGISTER,
  579. LOC_CREGISTER :
  580. location.reference.base:=left.location.register;
  581. LOC_REFERENCE,
  582. LOC_CREFERENCE :
  583. begin
  584. location_release(exprasmlist,left.location);
  585. location.reference.base:=cg.getaddressregister(exprasmlist);
  586. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,
  587. left.location.reference,location.reference.base);
  588. end;
  589. else
  590. internalerror(2002032219);
  591. end;
  592. end
  593. else
  594. location_copy(location,left.location);
  595. { offset can only differ from 0 if arraydef }
  596. if (left.resulttype.def.deftype=arraydef) and
  597. not(is_dynamic_array(left.resulttype.def)) then
  598. dec(location.reference.offset,mulsize*tarraydef(left.resulttype.def).lowrange);
  599. if right.nodetype=ordconstn then
  600. begin
  601. { offset can only differ from 0 if arraydef }
  602. case left.resulttype.def.deftype of
  603. arraydef :
  604. begin
  605. if not(is_open_array(left.resulttype.def)) and
  606. not(is_array_of_const(left.resulttype.def)) and
  607. not(is_dynamic_array(left.resulttype.def)) then
  608. begin
  609. if (tordconstnode(right).value>tarraydef(left.resulttype.def).highrange) or
  610. (tordconstnode(right).value<tarraydef(left.resulttype.def).lowrange) then
  611. begin
  612. { this should be caught in the resulttypepass! (JM) }
  613. if (cs_check_range in aktlocalswitches) then
  614. CGMessage(parser_e_range_check_error)
  615. else
  616. CGMessage(parser_w_range_check_error);
  617. end;
  618. end
  619. else
  620. begin
  621. { range checking for open and dynamic arrays needs
  622. runtime code }
  623. secondpass(right);
  624. if (cs_check_range in aktlocalswitches) then
  625. rangecheck_array;
  626. end;
  627. end;
  628. stringdef :
  629. begin
  630. if (cs_check_range in aktlocalswitches) then
  631. begin
  632. case tstringdef(left.resulttype.def).string_typ of
  633. { it's the same for ansi- and wide strings }
  634. st_widestring,
  635. st_ansistring:
  636. begin
  637. paraloc1:=paramanager.getintparaloc(pocall_default,1);
  638. paraloc2:=paramanager.getintparaloc(pocall_default,2);
  639. paramanager.allocparaloc(exprasmlist,paraloc2);
  640. cg.a_param_const(exprasmlist,OS_INT,tordconstnode(right).value,paraloc2);
  641. href:=location.reference;
  642. dec(href.offset,7);
  643. paramanager.allocparaloc(exprasmlist,paraloc1);
  644. cg.a_param_ref(exprasmlist,OS_INT,href,paraloc1);
  645. paramanager.freeparaloc(exprasmlist,paraloc1);
  646. paramanager.freeparaloc(exprasmlist,paraloc2);
  647. cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  648. cg.a_call_name(exprasmlist,'FPC_'+upper(tstringdef(left.resulttype.def).stringtypname)+'_RANGECHECK');
  649. cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  650. end;
  651. st_shortstring:
  652. begin
  653. {!!!!!!!!!!!!!!!!!}
  654. end;
  655. st_longstring:
  656. begin
  657. {!!!!!!!!!!!!!!!!!}
  658. end;
  659. end;
  660. end;
  661. end;
  662. end;
  663. inc(location.reference.offset,
  664. mulsize*tordconstnode(right).value);
  665. end
  666. else
  667. { not nodetype=ordconstn }
  668. begin
  669. if (cs_regvars in aktglobalswitches) and
  670. { if we do range checking, we don't }
  671. { need that fancy code (it would be }
  672. { buggy) }
  673. not(cs_check_range in aktlocalswitches) and
  674. (left.resulttype.def.deftype=arraydef) then
  675. begin
  676. extraoffset:=0;
  677. if (right.nodetype=addn) then
  678. begin
  679. if taddnode(right).right.nodetype=ordconstn then
  680. begin
  681. extraoffset:=tordconstnode(taddnode(right).right).value;
  682. t:=taddnode(right).left;
  683. { First pass processed this with the assumption }
  684. { that there was an add node which may require an }
  685. { extra register. Fake it or die with IE10 (JM) }
  686. t.registers32 := taddnode(right).registers32;
  687. taddnode(right).left:=nil;
  688. right.free;
  689. right:=t;
  690. end
  691. else if taddnode(right).left.nodetype=ordconstn then
  692. begin
  693. extraoffset:=tordconstnode(taddnode(right).left).value;
  694. t:=taddnode(right).right;
  695. t.registers32 := right.registers32;
  696. taddnode(right).right:=nil;
  697. right.free;
  698. right:=t;
  699. end;
  700. end
  701. else if (right.nodetype=subn) then
  702. begin
  703. if taddnode(right).right.nodetype=ordconstn then
  704. begin
  705. extraoffset:=-tordconstnode(taddnode(right).right).value;
  706. t:=taddnode(right).left;
  707. t.registers32 := right.registers32;
  708. taddnode(right).left:=nil;
  709. right.free;
  710. right:=t;
  711. end
  712. { You also have to negate right.right in this case! I can't add an
  713. unaryminusn without causing a crash, so I've disabled it (JM)
  714. else if right.left.nodetype=ordconstn then
  715. begin
  716. extraoffset:=right.left.value;
  717. t:=right.right;
  718. t^.registers32 := right.registers32;
  719. putnode(right);
  720. putnode(right.left);
  721. right:=t;
  722. end;}
  723. end;
  724. inc(location.reference.offset,
  725. mulsize*extraoffset);
  726. end;
  727. { calculate from left to right }
  728. if not(location.loc in [LOC_CREFERENCE,LOC_REFERENCE]) then
  729. internalerror(200304237);
  730. isjump:=(right.location.loc=LOC_JUMP);
  731. if isjump then
  732. begin
  733. otl:=truelabel;
  734. objectlibrary.getlabel(truelabel);
  735. ofl:=falselabel;
  736. objectlibrary.getlabel(falselabel);
  737. end;
  738. secondpass(right);
  739. if cs_check_range in aktlocalswitches then
  740. begin
  741. if left.resulttype.def.deftype=arraydef then
  742. rangecheck_array;
  743. end;
  744. { if mulsize = 1, we won't have to modify the index }
  745. location_force_reg(exprasmlist,right.location,OS_32,mulsize = 1);
  746. if isjump then
  747. begin
  748. truelabel:=otl;
  749. falselabel:=ofl;
  750. end;
  751. { produce possible range check code: }
  752. if cs_check_range in aktlocalswitches then
  753. begin
  754. if left.resulttype.def.deftype=arraydef then
  755. begin
  756. { done defore (PM) }
  757. end
  758. else if (left.resulttype.def.deftype=stringdef) then
  759. begin
  760. case tstringdef(left.resulttype.def).string_typ of
  761. { it's the same for ansi- and wide strings }
  762. st_widestring,
  763. st_ansistring:
  764. begin
  765. paraloc1:=paramanager.getintparaloc(pocall_default,1);
  766. paraloc2:=paramanager.getintparaloc(pocall_default,2);
  767. paramanager.allocparaloc(exprasmlist,paraloc2);
  768. cg.a_param_reg(exprasmlist,OS_INT,right.location.register,paraloc2);
  769. href:=location.reference;
  770. dec(href.offset,7);
  771. paramanager.allocparaloc(exprasmlist,paraloc1);
  772. cg.a_param_ref(exprasmlist,OS_INT,href,paraloc1);
  773. paramanager.freeparaloc(exprasmlist,paraloc1);
  774. paramanager.freeparaloc(exprasmlist,paraloc2);
  775. cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  776. cg.a_call_name(exprasmlist,'FPC_'+upper(tstringdef(left.resulttype.def).stringtypname)+'_RANGECHECK');
  777. cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  778. end;
  779. st_shortstring:
  780. begin
  781. {!!!!!!!!!!!!!!!!!}
  782. end;
  783. st_longstring:
  784. begin
  785. {!!!!!!!!!!!!!!!!!}
  786. end;
  787. end;
  788. end;
  789. end;
  790. { insert the register and the multiplication factor in the
  791. reference }
  792. update_reference_reg_mul(right.location.register,mulsize);
  793. end;
  794. location.size:=newsize;
  795. end;
  796. begin
  797. cloadvmtaddrnode:=tcgloadvmtaddrnode;
  798. cloadparentfpnode:=tcgloadparentfpnode;
  799. caddrnode:=tcgaddrnode;
  800. cderefnode:=tcgderefnode;
  801. csubscriptnode:=tcgsubscriptnode;
  802. cwithnode:=tcgwithnode;
  803. cvecnode:=tcgvecnode;
  804. end.
  805. {
  806. $Log$
  807. Revision 1.81 2003-11-23 17:03:35 peter
  808. * fixed parentfp loading, it was using the offset of the current
  809. nested proc instead of the parent
  810. Revision 1.80 2003/11/04 15:35:13 peter
  811. * fix for referencecounted temps
  812. Revision 1.79 2003/10/10 17:48:13 peter
  813. * old trgobj moved to x86/rgcpu and renamed to trgx86fpu
  814. * tregisteralloctor renamed to trgobj
  815. * removed rgobj from a lot of units
  816. * moved location_* and reference_* to cgobj
  817. * first things for mmx register allocation
  818. Revision 1.78 2003/10/09 21:31:37 daniel
  819. * Register allocator splitted, ans abstract now
  820. Revision 1.77 2003/10/01 20:34:48 peter
  821. * procinfo unit contains tprocinfo
  822. * cginfo renamed to cgbase
  823. * moved cgmessage to verbose
  824. * fixed ppc and sparc compiles
  825. Revision 1.76 2003/09/29 20:58:56 peter
  826. * optimized releasing of registers
  827. Revision 1.75 2003/09/28 21:45:52 peter
  828. * fix register leak in with debug
  829. Revision 1.74 2003/09/28 17:55:03 peter
  830. * parent framepointer changed to hidden parameter
  831. * tloadparentfpnode added
  832. Revision 1.73 2003/09/23 17:56:05 peter
  833. * locals and paras are allocated in the code generation
  834. * tvarsym.localloc contains the location of para/local when
  835. generating code for the current procedure
  836. Revision 1.72 2003/09/10 08:31:47 marco
  837. * Patch from Peter for paraloc
  838. Revision 1.71 2003/09/07 22:09:35 peter
  839. * preparations for different default calling conventions
  840. * various RA fixes
  841. Revision 1.70 2003/09/03 15:55:00 peter
  842. * NEWRA branch merged
  843. Revision 1.69.2.1 2003/08/29 17:28:59 peter
  844. * next batch of updates
  845. Revision 1.69 2003/08/10 17:25:23 peter
  846. * fixed some reported bugs
  847. Revision 1.68 2003/08/09 18:56:54 daniel
  848. * cs_regalloc renamed to cs_regvars to avoid confusion with register
  849. allocator
  850. * Some preventive changes to i386 spillinh code
  851. Revision 1.67 2003/07/23 11:01:14 jonas
  852. * several rg.allocexplicitregistersint/rg.deallocexplicitregistersint
  853. pairs round calls to helpers
  854. Revision 1.66 2003/07/06 21:50:33 jonas
  855. * fixed ppc compilation problems and changed VOLATILE_REGISTERS for x86
  856. so that it doesn't include ebp and esp anymore
  857. Revision 1.65 2003/07/06 15:31:20 daniel
  858. * Fixed register allocator. *Lots* of fixes.
  859. Revision 1.64 2003/06/17 19:24:08 jonas
  860. * fixed conversion of fpc_*str_unique to compilerproc
  861. Revision 1.63 2003/06/17 16:34:44 jonas
  862. * lots of newra fixes (need getfuncretparaloc implementation for i386)!
  863. * renamed all_intregisters to paramanager.get_volatile_registers_int(pocall_default) and made it
  864. processor dependent
  865. Revision 1.62 2003/06/13 21:19:30 peter
  866. * current_procdef removed, use current_procinfo.procdef instead
  867. Revision 1.61 2003/06/09 16:45:41 jonas
  868. * fixed update_reference_reg_mul() so that it won't modify CREGISTERs
  869. in a reference
  870. * cache value of get_mul_size()
  871. * if get_mul_size = 1, the index can be a CREGISTER since it won't be
  872. modified
  873. Revision 1.60 2003/06/07 18:57:04 jonas
  874. + added freeintparaloc
  875. * ppc get/freeintparaloc now check whether the parameter regs are
  876. properly allocated/deallocated (and get an extra list para)
  877. * ppc a_call_* now internalerrors if pi_do_call is not yet set
  878. * fixed lot of missing pi_do_call's
  879. Revision 1.59 2003/06/03 21:11:09 peter
  880. * cg.a_load_* get a from and to size specifier
  881. * makeregsize only accepts newregister
  882. * i386 uses generic tcgnotnode,tcgunaryminus
  883. Revision 1.58 2003/06/03 13:01:59 daniel
  884. * Register allocator finished
  885. Revision 1.57 2003/06/02 22:35:45 florian
  886. * better handling of CREGISTER in subscript nodes
  887. Revision 1.56 2003/06/01 21:38:06 peter
  888. * getregisterfpu size parameter added
  889. * op_const_reg size parameter added
  890. * sparc updates
  891. Revision 1.55 2003/05/30 23:49:18 jonas
  892. * a_load_loc_reg now has an extra size parameter for the destination
  893. register (properly fixes what I worked around in revision 1.106 of
  894. ncgutil.pas)
  895. Revision 1.54 2003/05/15 16:10:37 florian
  896. * fixed getintparaloc call for ansi- and widestring range checking
  897. Revision 1.53 2003/05/11 21:37:03 peter
  898. * moved implicit exception frame from ncgutil to psub
  899. * constructor/destructor helpers moved from cobj/ncgutil to psub
  900. Revision 1.52 2003/05/11 14:45:12 peter
  901. * tloadnode does not support objectsymtable,withsymtable anymore
  902. * withnode cleanup
  903. * direct with rewritten to use temprefnode
  904. Revision 1.51 2003/05/09 17:47:02 peter
  905. * self moved to hidden parameter
  906. * removed hdisposen,hnewn,selfn
  907. Revision 1.50 2003/05/07 09:16:23 mazen
  908. - non used units removed from uses clause
  909. Revision 1.49 2003/04/27 11:21:33 peter
  910. * aktprocdef renamed to current_procinfo.procdef
  911. * procinfo renamed to current_procinfo
  912. * procinfo will now be stored in current_module so it can be
  913. cleaned up properly
  914. * gen_main_procsym changed to create_main_proc and release_main_proc
  915. to also generate a tprocinfo structure
  916. * fixed unit implicit initfinal
  917. Revision 1.48 2003/04/22 23:50:22 peter
  918. * firstpass uses expectloc
  919. * checks if there are differences between the expectloc and
  920. location.loc from secondpass in EXTDEBUG
  921. Revision 1.47 2003/04/22 13:47:08 peter
  922. * fixed C style array of const
  923. * fixed C array passing
  924. * fixed left to right with high parameters
  925. Revision 1.46 2003/04/22 10:09:35 daniel
  926. + Implemented the actual register allocator
  927. + Scratch registers unavailable when new register allocator used
  928. + maybe_save/maybe_restore unavailable when new register allocator used
  929. Revision 1.45 2003/04/06 21:11:23 olle
  930. * changed newasmsymbol to newasmsymboldata for data symbols
  931. Revision 1.44 2003/03/28 19:16:56 peter
  932. * generic constructor working for i386
  933. * remove fixed self register
  934. * esi added as address register for i386
  935. Revision 1.43 2003/03/12 22:43:38 jonas
  936. * more powerpc and generic fixes related to the new register allocator
  937. Revision 1.42 2003/02/19 22:00:14 daniel
  938. * Code generator converted to new register notation
  939. - Horribily outdated todo.txt removed
  940. Revision 1.41 2003/01/30 21:46:57 peter
  941. * self fixes for static methods (merged)
  942. Revision 1.40 2003/01/08 18:43:56 daniel
  943. * Tregister changed into a record
  944. Revision 1.39 2002/12/20 18:13:19 peter
  945. * no rangecheck for openarrays with cdecl
  946. Revision 1.38 2002/12/17 22:19:33 peter
  947. * fixed pushing of records>8 bytes with stdcall
  948. * simplified hightree loading
  949. Revision 1.37 2002/12/08 13:39:03 carl
  950. + some documentation added
  951. Revision 1.36 2002/12/07 14:14:19 carl
  952. * bugfix on invalid typecast
  953. Revision 1.35 2002/11/25 17:43:18 peter
  954. * splitted defbase in defutil,symutil,defcmp
  955. * merged isconvertable and is_equal into compare_defs(_ext)
  956. * made operator search faster by walking the list only once
  957. Revision 1.34 2002/11/24 18:19:20 carl
  958. + checkpointer for interfaces also
  959. Revision 1.33 2002/11/23 22:50:06 carl
  960. * some small speed optimizations
  961. + added several new warnings/hints
  962. Revision 1.32 2002/11/15 01:58:51 peter
  963. * merged changes from 1.0.7 up to 04-11
  964. - -V option for generating bug report tracing
  965. - more tracing for option parsing
  966. - errors for cdecl and high()
  967. - win32 import stabs
  968. - win32 records<=8 are returned in eax:edx (turned off by default)
  969. - heaptrc update
  970. - more info for temp management in .s file with EXTDEBUG
  971. Revision 1.31 2002/10/09 20:24:47 florian
  972. + range checking for dyn. arrays
  973. Revision 1.30 2002/10/07 21:30:45 peter
  974. * rangecheck for open arrays added
  975. Revision 1.29 2002/10/05 12:43:25 carl
  976. * fixes for Delphi 6 compilation
  977. (warning : Some features do not work under Delphi)
  978. Revision 1.28 2002/09/17 18:54:02 jonas
  979. * a_load_reg_reg() now has two size parameters: source and dest. This
  980. allows some optimizations on architectures that don't encode the
  981. register size in the register name.
  982. Revision 1.27 2002/09/07 15:25:03 peter
  983. * old logs removed and tabs fixed
  984. Revision 1.26 2002/09/01 18:46:01 peter
  985. * fixed generic tcgvecnode
  986. * move code that updates a reference with index register and multiplier
  987. to separate method so it can be overriden for scaled indexing
  988. * i386 uses generic tcgvecnode
  989. Revision 1.25 2002/08/23 16:14:48 peter
  990. * tempgen cleanup
  991. * tt_noreuse temp type added that will be used in genentrycode
  992. Revision 1.24 2002/08/15 08:13:54 carl
  993. - a_load_sym_ofs_reg removed
  994. * loadvmt now calls loadaddr_ref_reg instead
  995. Revision 1.23 2002/08/11 14:32:26 peter
  996. * renamed current_library to objectlibrary
  997. Revision 1.22 2002/08/11 13:24:12 peter
  998. * saving of asmsymbols in ppu supported
  999. * asmsymbollist global is removed and moved into a new class
  1000. tasmlibrarydata that will hold the info of a .a file which
  1001. corresponds with a single module. Added librarydata to tmodule
  1002. to keep the library info stored for the module. In the future the
  1003. objectfiles will also be stored to the tasmlibrarydata class
  1004. * all getlabel/newasmsymbol and friends are moved to the new class
  1005. Revision 1.21 2002/08/11 11:36:57 jonas
  1006. * always first try to use base and only then index
  1007. Revision 1.20 2002/08/11 06:14:40 florian
  1008. * fixed powerpc compilation problems
  1009. Revision 1.19 2002/08/10 14:46:29 carl
  1010. + moved target_cpu_string to cpuinfo
  1011. * renamed asmmode enum.
  1012. * assembler reader has now less ifdef's
  1013. * move from nppcmem.pas -> ncgmem.pas vec. node.
  1014. Revision 1.18 2002/07/28 21:34:31 florian
  1015. * more powerpc fixes
  1016. + dummy tcgvecnode
  1017. Revision 1.17 2002/07/11 14:41:28 florian
  1018. * start of the new generic parameter handling
  1019. Revision 1.16 2002/07/07 09:52:32 florian
  1020. * powerpc target fixed, very simple units can be compiled
  1021. * some basic stuff for better callparanode handling, far from being finished
  1022. Revision 1.15 2002/07/01 18:46:23 peter
  1023. * internal linker
  1024. * reorganized aasm layer
  1025. Revision 1.14 2002/07/01 16:23:53 peter
  1026. * cg64 patch
  1027. * basics for currency
  1028. * asnode updates for class and interface (not finished)
  1029. Revision 1.13 2002/05/20 13:30:40 carl
  1030. * bugfix of hdisponen (base must be set, not index)
  1031. * more portability fixes
  1032. Revision 1.12 2002/05/18 13:34:09 peter
  1033. * readded missing revisions
  1034. Revision 1.11 2002/05/16 19:46:37 carl
  1035. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  1036. + try to fix temp allocation (still in ifdef)
  1037. + generic constructor calls
  1038. + start of tassembler / tmodulebase class cleanup
  1039. Revision 1.9 2002/05/12 16:53:07 peter
  1040. * moved entry and exitcode to ncgutil and cgobj
  1041. * foreach gets extra argument for passing local data to the
  1042. iterator function
  1043. * -CR checks also class typecasts at runtime by changing them
  1044. into as
  1045. * fixed compiler to cycle with the -CR option
  1046. * fixed stabs with elf writer, finally the global variables can
  1047. be watched
  1048. * removed a lot of routines from cga unit and replaced them by
  1049. calls to cgobj
  1050. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  1051. u32bit then the other is typecasted also to u32bit without giving
  1052. a rangecheck warning/error.
  1053. * fixed pascal calling method with reversing also the high tree in
  1054. the parast, detected by tcalcst3 test
  1055. Revision 1.8 2002/04/20 21:32:23 carl
  1056. + generic FPC_CHECKPOINTER
  1057. + first parameter offset in stack now portable
  1058. * rename some constants
  1059. + move some cpu stuff to other units
  1060. - remove unused constents
  1061. * fix stacksize for some targets
  1062. * fix generic size problems which depend now on EXTEND_SIZE constant
  1063. Revision 1.7 2002/04/15 18:58:47 carl
  1064. + target_info.size_of_pointer -> pointer_Size
  1065. Revision 1.6 2002/04/04 19:05:57 peter
  1066. * removed unused units
  1067. * use tlocation.size in cg.a_*loc*() routines
  1068. }