tgobj.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. This unit implements the base object for temp. generator
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. {#@abstract(Temporary reference allocator unit)
  19. Temporary reference allocator unit. This unit contains
  20. all which is related to allocating temporary memory
  21. space on the stack, as required, by the code generator.
  22. }
  23. unit tgobj;
  24. {$i fpcdefs.inc}
  25. interface
  26. uses
  27. globals,
  28. cpubase,
  29. cpuinfo,
  30. cclasses,globtype,cgbase,aasmbase,aasmtai,aasmcpu;
  31. type
  32. ttemptype = (tt_none,
  33. tt_free,tt_normal,tt_persistent,
  34. tt_noreuse,tt_freenoreuse,
  35. tt_ansistring,tt_freeansistring,
  36. tt_widestring,tt_freewidestring,
  37. tt_interfacecom,tt_freeinterfacecom);
  38. ttemptypeset = set of ttemptype;
  39. ptemprecord = ^ttemprecord;
  40. ttemprecord = record
  41. temptype : ttemptype;
  42. pos : longint;
  43. size : longint;
  44. next : ptemprecord;
  45. nextfree : ptemprecord; { for faster freeblock checking }
  46. {$ifdef EXTDEBUG}
  47. posinfo,
  48. releaseposinfo : tfileposinfo;
  49. {$endif}
  50. end;
  51. {# Generates temporary variables }
  52. ttgobj = class
  53. private
  54. { contains all free temps using nextfree links }
  55. tempfreelist : ptemprecord;
  56. function alloctemp(list: taasmoutput; size : longint; temptype : ttemptype) : longint;
  57. procedure freetemp(list: taasmoutput; pos:longint;temptypes:ttemptypeset);
  58. public
  59. { contains all temps }
  60. templist : ptemprecord;
  61. { Offsets of the first/last temp }
  62. firsttemp,
  63. lasttemp : longint;
  64. direction : shortint;
  65. constructor create;
  66. {# Clear and free the complete linked list of temporary memory
  67. locations. The list is set to nil.}
  68. procedure resettempgen;
  69. {# Sets the first offset from the frame pointer or stack pointer where
  70. the temporary references will be allocated. It is to note that this
  71. value should always be negative.
  72. @param(l start offset where temps will start in stack)
  73. }
  74. procedure setfirsttemp(l : longint);
  75. function gettempsize : longint;
  76. procedure gettemp(list: taasmoutput; size : longint;temptype:ttemptype;var ref : treference);
  77. procedure ungettemp(list: taasmoutput; const ref : treference);
  78. function sizeoftemp(list: taasmoutput; const ref: treference): longint;
  79. function changetemptype(list: taasmoutput; const ref:treference;temptype:ttemptype):boolean;
  80. {# Returns TRUE if the reference ref is allocated in temporary volatile memory space,
  81. otherwise returns FALSE.
  82. @param(ref reference to verify)
  83. }
  84. function istemp(const ref : treference) : boolean;
  85. {# Frees a reference @var(ref) which was allocated in the volatile temporary memory space.
  86. The freed space can later be reallocated and reused. If this reference
  87. is not in the temporary memory, it is simply not freed.
  88. }
  89. procedure ungetiftemp(list: taasmoutput; const ref : treference);
  90. end;
  91. var
  92. tg: ttgobj;
  93. implementation
  94. uses
  95. systems,
  96. verbose,cutils,rgobj;
  97. const
  98. FreeTempTypes = [tt_free,tt_freenoreuse,tt_freeansistring,
  99. tt_freewidestring,tt_freeinterfacecom];
  100. {$ifdef EXTDEBUG}
  101. TempTypeStr : array[ttemptype] of string[18] = (
  102. '<none>',
  103. 'free','normal','persistant',
  104. 'noreuse','freenoreuse',
  105. 'ansistring','freeansistring',
  106. 'widestring','freewidestring',
  107. 'interfacecom','freeinterfacecom'
  108. );
  109. {$endif EXTDEBUG}
  110. Used2Free : array[ttemptype] of ttemptype = (
  111. tt_none,
  112. tt_none,tt_free,tt_free,
  113. tt_freenoreuse,tt_none,
  114. tt_freeansistring,tt_none,
  115. tt_freewidestring,tt_none,
  116. tt_freeinterfacecom,tt_none);
  117. {*****************************************************************************
  118. TTGOBJ
  119. *****************************************************************************}
  120. constructor ttgobj.create;
  121. begin
  122. tempfreelist:=nil;
  123. templist:=nil;
  124. { we could create a new child class for this but I don't if it is worth the effort (FK) }
  125. {$ifdef powerpc}
  126. direction:=1;
  127. {$else powerpc}
  128. direction:=-1;
  129. {$endif powerpc}
  130. end;
  131. procedure ttgobj.resettempgen;
  132. var
  133. hp : ptemprecord;
  134. begin
  135. { Clear the old templist }
  136. while assigned(templist) do
  137. begin
  138. {$ifdef EXTDEBUG}
  139. if not(templist^.temptype in FreeTempTypes) then
  140. begin
  141. Comment(V_Warning,'tgobj: (ResetTempgen) temp at pos '+tostr(templist^.pos)+
  142. ' with size '+tostr(templist^.size)+' and type '+TempTypeStr[templist^.temptype]+
  143. ' from pos '+tostr(templist^.posinfo.line)+':'+tostr(templist^.posinfo.column)+
  144. ' not freed at the end of the procedure');
  145. end;
  146. {$endif}
  147. hp:=templist;
  148. templist:=hp^.next;
  149. dispose(hp);
  150. end;
  151. templist:=nil;
  152. tempfreelist:=nil;
  153. firsttemp:=0;
  154. lasttemp:=0;
  155. end;
  156. procedure ttgobj.setfirsttemp(l : longint);
  157. begin
  158. { this is a negative value normally }
  159. if l*direction>=0 then
  160. begin
  161. if odd(l) then
  162. inc(l,direction);
  163. end
  164. else
  165. internalerror(200204221);
  166. firsttemp:=l;
  167. lasttemp:=l;
  168. end;
  169. function ttgobj.gettempsize : longint;
  170. var
  171. _align : longint;
  172. begin
  173. { align to 4 bytes at least
  174. otherwise all those subl $2,%esp are meaningless PM }
  175. _align:=target_info.alignment.localalignmin;
  176. if _align<4 then
  177. _align:=4;
  178. gettempsize:=Align(direction*lasttemp,_align);
  179. end;
  180. function ttgobj.AllocTemp(list: taasmoutput; size : longint; temptype : ttemptype) : longint;
  181. var
  182. tl,
  183. bestslot,bestprev,
  184. hprev,hp : ptemprecord;
  185. bestsize : longint;
  186. freetype : ttemptype;
  187. begin
  188. AllocTemp:=0;
  189. bestprev:=nil;
  190. bestslot:=nil;
  191. tl:=nil;
  192. bestsize:=0;
  193. if size=0 then
  194. begin
  195. {$ifdef EXTDEBUG}
  196. Comment(V_Warning,'tgobj: (AllocTemp) temp of size 0 requested, allocating 4 bytes');
  197. {$endif}
  198. size:=4;
  199. end;
  200. freetype:=Used2Free[temptype];
  201. if freetype=tt_none then
  202. internalerror(200208201);
  203. { Align needed size on 4 bytes }
  204. size:=align(size,4);
  205. { First check the tmpfreelist, but not when
  206. we don't want to reuse an already allocated block }
  207. if assigned(tempfreelist) and
  208. (temptype<>tt_noreuse) then
  209. begin
  210. { Check for a slot with the same size first }
  211. hprev:=nil;
  212. hp:=tempfreelist;
  213. while assigned(hp) do
  214. begin
  215. {$ifdef EXTDEBUG}
  216. if not(hp^.temptype in FreeTempTypes) then
  217. Comment(V_Warning,'tgobj: (AllocTemp) temp at pos '+tostr(hp^.pos)+ ' in freelist is not set to tt_free !');
  218. {$endif}
  219. if (hp^.temptype=freetype) and
  220. (hp^.size>=size) then
  221. begin
  222. { Slot is the same size, then leave immediatly }
  223. if hp^.size=size then
  224. begin
  225. bestprev:=hprev;
  226. bestslot:=hp;
  227. bestsize:=size;
  228. break;
  229. end
  230. else
  231. begin
  232. if (bestsize=0) or (hp^.size<bestsize) then
  233. begin
  234. bestprev:=hprev;
  235. bestslot:=hp;
  236. bestsize:=hp^.size;
  237. end;
  238. end;
  239. end;
  240. hprev:=hp;
  241. hp:=hp^.nextfree;
  242. end;
  243. end;
  244. { Reuse an old temp ? }
  245. if assigned(bestslot) then
  246. begin
  247. if bestsize=size then
  248. begin
  249. tl:=bestslot;
  250. tl^.temptype:=temptype;
  251. { Remove from the tempfreelist }
  252. if assigned(bestprev) then
  253. bestprev^.nextfree:=tl^.nextfree
  254. else
  255. tempfreelist:=tl^.nextfree;
  256. tl^.nextfree:=nil;
  257. end
  258. else
  259. begin
  260. { Resize the old block }
  261. dec(bestslot^.size,size);
  262. { Create new block and link after bestslot }
  263. new(tl);
  264. tl^.temptype:=temptype;
  265. if direction=1 then
  266. begin
  267. tl^.pos:=bestslot^.pos;
  268. inc(bestslot^.pos,size);
  269. end
  270. else
  271. tl^.pos:=bestslot^.pos+bestslot^.size;
  272. tl^.size:=size;
  273. tl^.nextfree:=nil;
  274. { link the new block }
  275. tl^.next:=bestslot^.next;
  276. bestslot^.next:=tl;
  277. end;
  278. end
  279. else
  280. begin
  281. { create a new temp, we need to allocate at least a minimum of
  282. 4 bytes, else we get two temps at the same position resulting
  283. in problems when finding the corresponding temprecord }
  284. if size<4 then
  285. size:=4;
  286. { now we can create the templist entry }
  287. new(tl);
  288. tl^.temptype:=temptype;
  289. if direction=-1 then
  290. begin
  291. { Extend the temp }
  292. dec(lasttemp,size);
  293. tl^.pos:=lasttemp;
  294. end
  295. else
  296. begin
  297. tl^.pos:=lasttemp;
  298. { Extend the temp }
  299. inc(lasttemp,size);
  300. end;
  301. tl^.size:=size;
  302. tl^.next:=templist;
  303. tl^.nextfree:=nil;
  304. templist:=tl;
  305. end;
  306. {$ifdef EXTDEBUG}
  307. tl^.posinfo:=aktfilepos;
  308. list.concat(tai_tempalloc.allocinfo(tl^.pos,tl^.size,'allocated with type '+TempTypeStr[tl^.temptype]));
  309. {$else}
  310. list.concat(tai_tempalloc.alloc(tl^.pos,tl^.size));
  311. {$endif}
  312. AllocTemp:=tl^.pos;
  313. end;
  314. procedure ttgobj.FreeTemp(list: taasmoutput; pos:longint;temptypes:ttemptypeset);
  315. var
  316. hp,hnext,hprev,hprevfree : ptemprecord;
  317. begin
  318. hp:=templist;
  319. hprev:=nil;
  320. hprevfree:=nil;
  321. while assigned(hp) do
  322. begin
  323. if (hp^.pos=pos) then
  324. begin
  325. { check if already freed }
  326. if hp^.temptype in FreeTempTypes then
  327. begin
  328. {$ifdef EXTDEBUG}
  329. Comment(V_Warning,'tgobj: (FreeTemp) temp at pos '+tostr(pos)+ ' is already free !');
  330. list.concat(tai_tempalloc.allocinfo(hp^.pos,hp^.size,'temp is already freed'));
  331. {$endif}
  332. exit;
  333. end;
  334. { check type that are allowed to be released }
  335. if not(hp^.temptype in temptypes) then
  336. begin
  337. {$ifdef EXTDEBUG}
  338. Comment(V_Debug,'tgobj: (Freetemp) temp at pos '+tostr(pos)+ ' has different type ('+TempTypeStr[hp^.temptype]+'), not releasing');
  339. list.concat(tai_tempalloc.allocinfo(hp^.pos,hp^.size,'temp has wrong type ('+TempTypeStr[hp^.temptype]+') not releasing'));
  340. {$endif}
  341. exit;
  342. end;
  343. list.concat(tai_tempalloc.dealloc(hp^.pos,hp^.size));
  344. { set this block to free }
  345. hp^.temptype:=Used2Free[hp^.temptype];
  346. { Update tempfreelist }
  347. if assigned(hprevfree) then
  348. begin
  349. { Connect With previous tt_free block? }
  350. if assigned(hprev) and
  351. (hp^.temptype=tt_free) and
  352. (hprev^.temptype=tt_free) then
  353. begin
  354. inc(hprev^.size,hp^.size);
  355. if direction=1 then
  356. hprev^.pos:=hp^.pos;
  357. hprev^.next:=hp^.next;
  358. dispose(hp);
  359. hp:=hprev;
  360. end
  361. else
  362. hprevfree^.nextfree:=hp;
  363. end
  364. else
  365. begin
  366. hp^.nextfree:=tempfreelist;
  367. tempfreelist:=hp;
  368. end;
  369. { Next block tt_free ? Yes, then concat }
  370. hnext:=hp^.next;
  371. if assigned(hnext) and
  372. (hp^.temptype=tt_free) and
  373. (hnext^.temptype=tt_free) then
  374. begin
  375. inc(hp^.size,hnext^.size);
  376. if direction=1 then
  377. hp^.pos:=hnext^.pos;
  378. hp^.nextfree:=hnext^.nextfree;
  379. hp^.next:=hnext^.next;
  380. dispose(hnext);
  381. end;
  382. { Stop }
  383. exit;
  384. end;
  385. if (hp^.temptype=tt_free) then
  386. hprevfree:=hp;
  387. hprev:=hp;
  388. hp:=hp^.next;
  389. end;
  390. end;
  391. procedure ttgobj.gettemp(list: taasmoutput; size : longint;temptype:ttemptype;var ref : treference);
  392. begin
  393. reference_reset_base(ref,current_procinfo.framepointer,alloctemp(list,size,temptype));
  394. end;
  395. function ttgobj.istemp(const ref : treference) : boolean;
  396. begin
  397. { ref.index = R_NO was missing
  398. led to problems with local arrays
  399. with lower bound > 0 (PM) }
  400. if (ref.base.enum<>R_NO) and (ref.base.enum<>R_INTREGISTER) then
  401. internalerror(200301225);
  402. if (ref.index.enum<>R_NO) and (ref.index.enum<>R_INTREGISTER) then
  403. internalerror(200301225);
  404. if current_procinfo.framepointer.enum<>R_INTREGISTER then
  405. internalerror(200301225);
  406. if direction = 1 then
  407. begin
  408. istemp:=((ref.base.number=current_procinfo.framepointer.number) and
  409. (ref.index.number=NR_NO) and
  410. (ref.offset>=firsttemp));
  411. end
  412. else
  413. begin
  414. istemp:=((ref.base.number=current_procinfo.framepointer.number) and
  415. (ref.index.number=NR_NO) and
  416. (ref.offset<firsttemp));
  417. end;
  418. end;
  419. function ttgobj.sizeoftemp(list: taasmoutput; const ref: treference): longint;
  420. var
  421. hp : ptemprecord;
  422. begin
  423. SizeOfTemp := -1;
  424. hp:=templist;
  425. while assigned(hp) do
  426. begin
  427. if (hp^.pos=ref.offset) then
  428. begin
  429. sizeoftemp := hp^.size;
  430. exit;
  431. end;
  432. hp := hp^.next;
  433. end;
  434. {$ifdef EXTDEBUG}
  435. comment(v_debug,'tgobj: (SizeOfTemp) temp at pos '+tostr(ref.offset)+' not found !');
  436. list.concat(tai_tempalloc.allocinfo(ref.offset,0,'temp not found'));
  437. {$endif}
  438. end;
  439. function ttgobj.ChangeTempType(list: taasmoutput; const ref:treference;temptype:ttemptype):boolean;
  440. var
  441. hp : ptemprecord;
  442. begin
  443. ChangeTempType:=false;
  444. hp:=templist;
  445. while assigned(hp) do
  446. begin
  447. if (hp^.pos=ref.offset) then
  448. begin
  449. if not(hp^.temptype in [tt_free,tt_freeansistring,tt_freewidestring,tt_freeinterfacecom]) then
  450. begin
  451. {$ifdef EXTDEBUG}
  452. if hp^.temptype=temptype then
  453. Comment(V_Warning,'tgobj: (ChangeTempType) temp'+
  454. ' at pos '+tostr(ref.offset)+ ' is already of the correct type !');
  455. list.concat(tai_tempalloc.allocinfo(hp^.pos,hp^.size,'type changed to '+TempTypeStr[temptype]));
  456. {$endif}
  457. ChangeTempType:=true;
  458. hp^.temptype:=temptype;
  459. end
  460. else
  461. begin
  462. {$ifdef EXTDEBUG}
  463. Comment(V_Warning,'tgobj: (ChangeTempType) temp'+
  464. ' at pos '+tostr(ref.offset)+ ' is already freed !');
  465. list.concat(tai_tempalloc.allocinfo(hp^.pos,hp^.size,'temp is already freed'));
  466. {$endif}
  467. end;
  468. exit;
  469. end;
  470. hp:=hp^.next;
  471. end;
  472. {$ifdef EXTDEBUG}
  473. Comment(V_Warning,'tgobj: (ChangeTempType) temp'+
  474. ' at pos '+tostr(ref.offset)+ ' not found !');
  475. list.concat(tai_tempalloc.allocinfo(ref.offset,0,'temp not found'));
  476. {$endif}
  477. end;
  478. procedure ttgobj.UnGetTemp(list: taasmoutput; const ref : treference);
  479. begin
  480. FreeTemp(list,ref.offset,[tt_normal,tt_noreuse,tt_persistent,tt_ansistring,tt_widestring,tt_interfacecom]);
  481. end;
  482. procedure ttgobj.UnGetIfTemp(list: taasmoutput; const ref : treference);
  483. begin
  484. if istemp(ref) then
  485. FreeTemp(list,ref.offset,[tt_normal,tt_ansistring,tt_widestring,tt_interfacecom]);
  486. end;
  487. initialization
  488. tg := ttgobj.create;
  489. finalization
  490. tg.free;
  491. end.
  492. {
  493. $Log$
  494. Revision 1.36 2003-07-06 17:58:22 peter
  495. * framepointer fixes for sparc
  496. * parent framepointer code more generic
  497. Revision 1.35 2003/06/03 13:01:59 daniel
  498. * Register allocator finished
  499. Revision 1.34 2003/05/17 13:30:08 jonas
  500. * changed tt_persistant to tt_persistent :)
  501. * tempcreatenode now doesn't accept a boolean anymore for persistent
  502. temps, but a ttemptype, so you can also create ansistring temps etc
  503. Revision 1.33 2003/05/13 20:13:41 florian
  504. * fixed temp. management for CPUs were the temp. space grows upwards
  505. Revision 1.32 2003/05/12 21:29:59 peter
  506. * extdebug info temp alloc type was wrong
  507. Revision 1.31 2003/04/27 11:21:35 peter
  508. * aktprocdef renamed to current_procdef
  509. * procinfo renamed to current_procinfo
  510. * procinfo will now be stored in current_module so it can be
  511. cleaned up properly
  512. * gen_main_procsym changed to create_main_proc and release_main_proc
  513. to also generate a tprocinfo structure
  514. * fixed unit implicit initfinal
  515. Revision 1.30 2003/04/25 20:59:35 peter
  516. * removed funcretn,funcretsym, function result is now in varsym
  517. and aliases for result and function name are added using absolutesym
  518. * vs_hidden parameter for funcret passed in parameter
  519. * vs_hidden fixes
  520. * writenode changed to printnode and released from extdebug
  521. * -vp option added to generate a tree.log with the nodetree
  522. * nicer printnode for statements, callnode
  523. Revision 1.29 2003/04/23 08:40:39 jonas
  524. * fixed istemp() when tg.direction = 1
  525. Revision 1.28 2003/04/22 09:46:17 peter
  526. * always allocate 4 bytes when 0 bytes are asked
  527. Revision 1.27 2003/03/11 21:46:24 jonas
  528. * lots of new regallocator fixes, both in generic and ppc-specific code
  529. (ppc compiler still can't compile the linux system unit though)
  530. Revision 1.26 2003/02/19 22:00:15 daniel
  531. * Code generator converted to new register notation
  532. - Horribily outdated todo.txt removed
  533. Revision 1.25 2003/02/03 23:10:39 daniel
  534. * Fixed last commit
  535. Revision 1.24 2003/02/03 23:07:39 daniel
  536. * Made gettemp use intended procedure for setting reference
  537. Revision 1.23 2003/01/08 18:43:57 daniel
  538. * Tregister changed into a record
  539. Revision 1.22 2002/12/01 18:58:26 carl
  540. * fix bugs with istemp() was wrong, and every reference was a temp
  541. Revision 1.21 2002/11/24 18:18:04 carl
  542. - remove some unused defines
  543. Revision 1.20 2002/11/17 17:49:08 mazen
  544. + return_result_reg and function_result_reg are now used, in all plateforms, to pass functions result between called function and its caller. See the explanation of each one
  545. Revision 1.19 2002/11/15 01:58:54 peter
  546. * merged changes from 1.0.7 up to 04-11
  547. - -V option for generating bug report tracing
  548. - more tracing for option parsing
  549. - errors for cdecl and high()
  550. - win32 import stabs
  551. - win32 records<=8 are returned in eax:edx (turned off by default)
  552. - heaptrc update
  553. - more info for temp management in .s file with EXTDEBUG
  554. Revision 1.18 2002/10/11 11:57:43 florian
  555. *** empty log message ***
  556. Revision 1.16 2002/09/07 18:25:00 florian
  557. + added tcg.direction to allow upwards growing temp areas
  558. i.e. temps with positive index
  559. Revision 1.15 2002/09/01 18:42:50 peter
  560. * reduced level of comment that type is wrong for release
  561. Revision 1.14 2002/09/01 12:14:53 peter
  562. * fixed some wrong levels in extdebug comments
  563. Revision 1.13 2002/08/24 18:35:04 peter
  564. * when reusing a block also update the temptype instead of forcing it
  565. to tt_normal
  566. Revision 1.12 2002/08/23 16:14:49 peter
  567. * tempgen cleanup
  568. * tt_noreuse temp type added that will be used in genentrycode
  569. Revision 1.11 2002/08/17 09:23:44 florian
  570. * first part of procinfo rewrite
  571. Revision 1.10 2002/07/01 18:46:29 peter
  572. * internal linker
  573. * reorganized aasm layer
  574. Revision 1.9 2002/05/18 13:34:21 peter
  575. * readded missing revisions
  576. Revision 1.8 2002/05/16 19:46:45 carl
  577. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  578. + try to fix temp allocation (still in ifdef)
  579. + generic constructor calls
  580. + start of tassembler / tmodulebase class cleanup
  581. Revision 1.7 2002/05/14 19:34:52 peter
  582. * removed old logs and updated copyright year
  583. Revision 1.6 2002/04/15 19:08:22 carl
  584. + target_info.size_of_pointer -> pointer_size
  585. + some cleanup of unused types/variables
  586. Revision 1.5 2002/04/07 13:38:48 carl
  587. + update documentation
  588. Revision 1.4 2002/04/07 09:17:17 carl
  589. + documentation
  590. - clean-up
  591. Revision 1.3 2002/04/04 19:06:06 peter
  592. * removed unused units
  593. * use tlocation.size in cg.a_*loc*() routines
  594. Revision 1.2 2002/04/02 17:11:32 peter
  595. * tlocation,treference update
  596. * LOC_CONSTANT added for better constant handling
  597. * secondadd splitted in multiple routines
  598. * location_force_reg added for loading a location to a register
  599. of a specified size
  600. * secondassignment parses now first the right and then the left node
  601. (this is compatible with Kylix). This saves a lot of push/pop especially
  602. with string operations
  603. * adapted some routines to use the new cg methods
  604. Revision 1.1 2002/03/31 20:26:37 jonas
  605. + a_loadfpu_* and a_loadmm_* methods in tcg
  606. * register allocation is now handled by a class and is mostly processor
  607. independent (+rgobj.pas and i386/rgcpu.pas)
  608. * temp allocation is now handled by a class (+tgobj.pas, -i386\tgcpu.pas)
  609. * some small improvements and fixes to the optimizer
  610. * some register allocation fixes
  611. * some fpuvaroffset fixes in the unary minus node
  612. * push/popusedregisters is now called rg.save/restoreusedregisters and
  613. (for i386) uses temps instead of push/pop's when using -Op3 (that code is
  614. also better optimizable)
  615. * fixed and optimized register saving/restoring for new/dispose nodes
  616. * LOC_FPU locations now also require their "register" field to be set to
  617. R_ST, not R_ST0 (the latter is used for LOC_CFPUREGISTER locations only)
  618. - list field removed of the tnode class because it's not used currently
  619. and can cause hard-to-find bugs
  620. }