psystem.pas 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949
  1. {
  2. Copyright (c) 1998-2002 by Florian Klaempfl
  3. Load the system unit, create required defs for systemunit
  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. unit psystem;
  18. {$i fpcdefs.inc}
  19. interface
  20. uses
  21. symbase;
  22. procedure create_intern_symbols;
  23. procedure create_intern_types;
  24. procedure load_intern_types;
  25. procedure registernodes;
  26. procedure registertais;
  27. implementation
  28. uses
  29. globals,globtype,verbose,constexp,cpuinfo,compinnr,
  30. systems,
  31. symconst,symtype,symsym,symdef,symcpu,symtable,
  32. aasmtai,aasmcpu,
  33. fmodule,
  34. node,nbas,nflw,nset,ncon,ncnv,nld,nmem,ncal,nmat,nadd,ninl;
  35. procedure create_intern_symbols;
  36. {
  37. all intern procedures for the system unit
  38. }
  39. begin
  40. systemunit.insertsym(csyssym.create('Concat',in_concat_x));
  41. systemunit.insertsym(csyssym.create('Write',in_write_x));
  42. systemunit.insertsym(csyssym.create('WriteLn',in_writeln_x));
  43. systemunit.insertsym(csyssym.create('WriteStr',in_writestr_x));
  44. systemunit.insertsym(csyssym.create('Assigned',in_assigned_x));
  45. systemunit.insertsym(csyssym.create('Read',in_read_x));
  46. systemunit.insertsym(csyssym.create('ReadLn',in_readln_x));
  47. systemunit.insertsym(csyssym.create('ReadStr',in_readstr_x));
  48. systemunit.insertsym(csyssym.create('Ofs',in_ofs_x));
  49. systemunit.insertsym(csyssym.create('SizeOf',in_sizeof_x));
  50. systemunit.insertsym(csyssym.create('BitSizeOf',in_bitsizeof_x));
  51. systemunit.insertsym(csyssym.create('TypeOf',in_typeof_x));
  52. systemunit.insertsym(csyssym.create('Low',in_low_x));
  53. systemunit.insertsym(csyssym.create('High',in_high_x));
  54. systemunit.insertsym(csyssym.create('Slice',in_slice_x));
  55. systemunit.insertsym(csyssym.create('Seg',in_seg_x));
  56. systemunit.insertsym(csyssym.create('Ord',in_ord_x));
  57. systemunit.insertsym(csyssym.create('Chr',in_chr_byte));
  58. systemunit.insertsym(csyssym.create('Pred',in_pred_x));
  59. systemunit.insertsym(csyssym.create('Succ',in_succ_x));
  60. systemunit.insertsym(csyssym.create('Exclude',in_exclude_x_y));
  61. systemunit.insertsym(csyssym.create('Include',in_include_x_y));
  62. systemunit.insertsym(csyssym.create('Pack',in_pack_x_y_z));
  63. systemunit.insertsym(csyssym.create('Unpack',in_unpack_x_y_z));
  64. systemunit.insertsym(csyssym.create('Break',in_break));
  65. systemunit.insertsym(csyssym.create('Exit',in_exit));
  66. systemunit.insertsym(csyssym.create('Continue',in_continue));
  67. systemunit.insertsym(csyssym.create('Leave',in_leave)); {macpas only}
  68. systemunit.insertsym(csyssym.create('Cycle',in_cycle)); {macpas only}
  69. systemunit.insertsym(csyssym.create('Dec',in_dec_x));
  70. systemunit.insertsym(csyssym.create('Inc',in_inc_x));
  71. systemunit.insertsym(csyssym.create('Str',in_str_x_string));
  72. systemunit.insertsym(csyssym.create('Assert',in_assert_x_y));
  73. systemunit.insertsym(csyssym.create('Val',in_val_x));
  74. systemunit.insertsym(csyssym.create('Addr',in_addr_x));
  75. {$ifdef i8086}
  76. systemunit.insertsym(csyssym.create('FarAddr',in_faraddr_x));
  77. {$endif i8086}
  78. systemunit.insertsym(csyssym.create('TypeInfo',in_typeinfo_x));
  79. systemunit.insertsym(csyssym.create('SetLength',in_setlength_x));
  80. systemunit.insertsym(csyssym.create('Copy',in_copy_x));
  81. systemunit.insertsym(csyssym.create('Initialize',in_initialize_x));
  82. systemunit.insertsym(csyssym.create('Finalize',in_finalize_x));
  83. systemunit.insertsym(csyssym.create('Length',in_length_x));
  84. systemunit.insertsym(csyssym.create('New',in_new_x));
  85. systemunit.insertsym(csyssym.create('Dispose',in_dispose_x));
  86. {$ifdef SUPPORT_GET_FRAME}
  87. systemunit.insertsym(csyssym.create('Get_Frame',in_get_frame));
  88. {$endif SUPPORT_GET_FRAME}
  89. systemunit.insertsym(csyssym.create('Unaligned',in_unaligned_x));
  90. systemunit.insertsym(csyssym.create('Aligned',in_aligned_x));
  91. systemunit.insertsym(csyssym.create('Volatile',in_volatile_x));
  92. systemunit.insertsym(csyssym.create('ObjCSelector',in_objc_selector_x)); { objc only }
  93. systemunit.insertsym(csyssym.create('ObjCEncode',in_objc_encode_x)); { objc only }
  94. systemunit.insertsym(csyssym.create('Default',in_default_x));
  95. systemunit.insertsym(csyssym.create('SetString',in_setstring_x_y_z));
  96. systemunit.insertsym(csyssym.create('Insert',in_insert_x_y_z));
  97. systemunit.insertsym(csyssym.create('Delete',in_delete_x_y_z));
  98. systemunit.insertsym(csyssym.create('GetTypeKind',in_gettypekind_x));
  99. systemunit.insertsym(csyssym.create('IsManagedType',in_ismanagedtype_x));
  100. systemunit.insertsym(csyssym.create('IsConstValue',in_isconstvalue_x));
  101. systemunit.insertsym(csyssym.create('fpc_eh_return_data_regno', in_const_eh_return_data_regno));
  102. systemunit.insertsym(csyssym.create('AtomicIncrement',in_atomic_inc));
  103. systemunit.insertsym(csyssym.create('AtomicDecrement',in_atomic_dec));
  104. systemunit.insertsym(csyssym.create('AtomicExchange',in_atomic_xchg));
  105. systemunit.insertsym(csyssym.create('AtomicCmpExchange',in_atomic_cmp_xchg));
  106. systemunit.insertsym(cconstsym.create_ord('False',constord,0,pasbool1type));
  107. systemunit.insertsym(cconstsym.create_ord('True',constord,1,pasbool1type));
  108. end;
  109. procedure set_default_int_types;
  110. begin
  111. {$ifdef cpu64bitalu}
  112. aluuinttype:=u64inttype;
  113. alusinttype:=s64inttype;
  114. {$endif cpu64bitalu}
  115. {$ifdef cpu64bitaddr}
  116. sizeuinttype:=u64inttype;
  117. sizesinttype:=s64inttype;
  118. uinttype:=u64inttype;
  119. sinttype:=s64inttype;
  120. {$endif cpu64bitaddr}
  121. {$ifdef cpu32bitaddr}
  122. sizeuinttype:=u32inttype;
  123. sizesinttype:=s32inttype;
  124. uinttype:=u32inttype;
  125. sinttype:=s32inttype;
  126. {$endif cpu32bitaddr}
  127. {$ifdef cpu32bitalu}
  128. uinttype:=u32inttype;
  129. sinttype:=s32inttype;
  130. aluuinttype:=u32inttype;
  131. alusinttype:=s32inttype;
  132. {$endif cpu32bitalu}
  133. {$ifdef cpu16bitaddr}
  134. sizeuinttype:=u16inttype;
  135. sizesinttype:=s16inttype;
  136. {$endif cpu16bitaddr}
  137. {$ifdef cpu16bitalu}
  138. uinttype:=u16inttype;
  139. sinttype:=s16inttype;
  140. aluuinttype:=u16inttype;
  141. alusinttype:=s16inttype;
  142. {$endif cpu16bitalu}
  143. {$ifdef cpu8bitalu}
  144. uinttype:=u8inttype;
  145. sinttype:=s8inttype;
  146. aluuinttype:=u8inttype;
  147. alusinttype:=s8inttype;
  148. {$endif cpu8bitalu}
  149. osuinttype:=uinttype;
  150. ossinttype:=sinttype;
  151. end;
  152. procedure set_default_ptr_types;
  153. begin
  154. {$ifdef i8086}
  155. if current_settings.x86memorymodel in x86_far_code_models then
  156. voidcodepointertype:=voidfarpointertype
  157. else if current_settings.x86memorymodel=mm_tiny then
  158. voidcodepointertype:=voidnearpointertype
  159. else
  160. voidcodepointertype:=voidnearcspointertype;
  161. voidstackpointertype:=voidnearsspointertype;
  162. {$else i8086}
  163. voidcodepointertype:=voidpointertype;
  164. voidstackpointertype:=voidpointertype;
  165. {$endif i8086}
  166. case voidcodepointertype.size of
  167. 2:
  168. begin
  169. codeptruinttype:=u16inttype;
  170. codeptrsinttype:=s16inttype;
  171. end;
  172. 4:
  173. begin
  174. codeptruinttype:=u32inttype;
  175. codeptrsinttype:=s32inttype;
  176. end;
  177. 8:
  178. begin
  179. codeptruinttype:=u64inttype;
  180. codeptrsinttype:=s64inttype;
  181. end;
  182. else
  183. Internalerror(2015112106);
  184. end;
  185. case voidpointertype.size of
  186. 2:
  187. begin
  188. ptruinttype:=u16inttype;
  189. ptrsinttype:=s16inttype;
  190. end;
  191. 4:
  192. begin
  193. ptruinttype:=u32inttype;
  194. ptrsinttype:=s32inttype;
  195. end;
  196. 8:
  197. begin
  198. ptruinttype:=u64inttype;
  199. ptrsinttype:=s64inttype;
  200. end;
  201. else
  202. Internalerror(2016100301);
  203. end;
  204. end;
  205. procedure create_intern_types;
  206. {
  207. all the types inserted into the system unit
  208. }
  209. function addtype(const s:string;def:tdef):ttypesym;
  210. begin
  211. result:=ctypesym.create(s,def);
  212. systemunit.insertsym(result);
  213. end;
  214. procedure addfield(recst:tabstractrecordsymtable;sym:tfieldvarsym);
  215. begin
  216. recst.insertsym(sym);
  217. recst.addfield(sym,vis_hidden);
  218. end;
  219. procedure create_fpu_types;
  220. begin
  221. if init_settings.fputype<>fpu_none then
  222. begin
  223. s32floattype:=cfloatdef.create(s32real,true);
  224. s64floattype:=cfloatdef.create(s64real,true);
  225. s80floattype:=cfloatdef.create(s80real,true);
  226. sc80floattype:=cfloatdef.create(sc80real,true);
  227. end
  228. else
  229. begin
  230. s32floattype:=nil;
  231. s64floattype:=nil;
  232. s80floattype:=nil;
  233. sc80floattype:=nil;
  234. end;
  235. end;
  236. var
  237. hrecst : trecordsymtable;
  238. pvmt_name : shortstring;
  239. begin
  240. symtablestack.push(systemunit);
  241. cundefinedtype:=cundefineddef.create(true);
  242. cformaltype:=cformaldef.create(false);
  243. ctypedformaltype:=cformaldef.create(true);
  244. voidtype:=corddef.create(uvoid,0,0,true);
  245. voidpointertype:=cpointerdef.create(voidtype);
  246. u8inttype:=corddef.create(u8bit,0,255,true);
  247. s8inttype:=corddef.create(s8bit,int64(-128),127,true);
  248. u16inttype:=corddef.create(u16bit,0,65535,true);
  249. s16inttype:=corddef.create(s16bit,int64(-32768),32767,true);
  250. s24inttype:=corddef.create(customint,-(int64(1) shl 23),1 shl 23 - 1,true);
  251. u24inttype:=corddef.create(customint,0,1 shl 24 - 1,true);
  252. u32inttype:=corddef.create(u32bit,0,high(longword),true);
  253. s32inttype:=corddef.create(s32bit,int64(low(longint)),int64(high(longint)),true);
  254. s40inttype:=corddef.create(customint,-(int64(1) shl 39),int64(1) shl 39 - 1,true);
  255. u40inttype:=corddef.create(customint,0,int64(1) shl 40 - 1,true);
  256. s48inttype:=corddef.create(customint,-(int64(1) shl 47),int64(1) shl 47 - 1,true);
  257. u48inttype:=corddef.create(customint,0,int64(1) shl 48 - 1,true);
  258. s56inttype:=corddef.create(customint,-(int64(1) shl 55),int64(1) shl 55 - 1,true);
  259. u56inttype:=corddef.create(customint,0,int64(1) shl 56 - 1,true);
  260. u64inttype:=corddef.create(u64bit,low(qword),high(qword),true);
  261. s64inttype:=corddef.create(s64bit,low(int64),high(int64),true);
  262. { upper/lower bound not yet properly set for 128 bit types, as we don't
  263. support them yet at the Pascal level (nor for tconstexprint); they're
  264. only used internally by the high level code generator for LLVM to
  265. implement overflow checking }
  266. u128inttype:=corddef.create(u128bit,0,0,true);
  267. s128inttype:=corddef.create(s128bit,0,0,true);
  268. pasbool1type:=corddef.create(pasbool1,0,1,true);
  269. pasbool8type:=corddef.create(pasbool8,0,1,true);
  270. pasbool16type:=corddef.create(pasbool16,0,1,true);
  271. pasbool32type:=corddef.create(pasbool32,0,1,true);
  272. pasbool64type:=corddef.create(pasbool64,0,1,true);
  273. bool8type:=corddef.create(bool8bit,low(int64),high(int64),true);
  274. bool16type:=corddef.create(bool16bit,low(int64),high(int64),true);
  275. bool32type:=corddef.create(bool32bit,low(int64),high(int64),true);
  276. bool64type:=corddef.create(bool64bit,low(int64),high(int64),true);
  277. {$ifdef llvm}
  278. llvmbool1type:=corddef.create(pasbool1,0,1,true);
  279. {$endif llvm}
  280. cansichartype:=corddef.create(uchar,0,255,true);
  281. cwidechartype:=corddef.create(uwidechar,0,65535,true);
  282. cshortstringtype:=cstringdef.createshort(255,true);
  283. { should we give a length to the default long and ansi string definition ?? }
  284. clongstringtype:=cstringdef.createlong(-1,true);
  285. cansistringtype:=cstringdef.createansi(0,true);
  286. if target_info.system in systems_windows then
  287. cwidestringtype:=cstringdef.createwide(true)
  288. else
  289. cwidestringtype:=cstringdef.createunicode(true);
  290. cunicodestringtype:=cstringdef.createunicode(true);
  291. { length=0 for shortstring is open string (needed for readln(string) }
  292. openshortstringtype:=cstringdef.createshort(0,true);
  293. if target_info.system=system_i386_watcom then
  294. pvmt_name:='lower__pvmt'
  295. else
  296. pvmt_name:='pvmt';
  297. {$ifdef x86}
  298. create_fpu_types;
  299. {$ifndef FPC_SUPPORT_X87_TYPES_ON_WIN64}
  300. if target_info.system=system_x86_64_win64 then
  301. begin
  302. s64currencytype:=corddef.create(scurrency,low(int64),high(int64),true);
  303. pbestrealtype:=@s64floattype;
  304. end
  305. else
  306. {$endif FPC_SUPPORT_X87_TYPES_ON_WIN64}
  307. s64currencytype:=cfloatdef.create(s64currency,true);
  308. {$endif x86}
  309. {$ifdef powerpc}
  310. create_fpu_types;
  311. s64currencytype:=corddef.create(scurrency,low(int64),high(int64),true);
  312. {$endif powerpc}
  313. {$ifdef POWERPC64}
  314. create_fpu_types;
  315. s64currencytype:=corddef.create(scurrency,low(int64),high(int64),true);
  316. {$endif POWERPC64}
  317. {$ifdef sparc}
  318. create_fpu_types;
  319. s64currencytype:=corddef.create(scurrency,low(int64),high(int64),true);
  320. {$endif sparc}
  321. {$ifdef sparc64}
  322. create_fpu_types;
  323. s64currencytype:=corddef.create(scurrency,low(int64),high(int64),true);
  324. {$endif sparc64}
  325. {$ifdef m68k}
  326. create_fpu_types;
  327. s64currencytype:=corddef.create(scurrency,low(int64),high(int64),true);
  328. {$endif}
  329. {$ifdef arm}
  330. create_fpu_types;
  331. s64currencytype:=corddef.create(scurrency,low(int64),high(int64),true);
  332. {$endif arm}
  333. {$ifdef aarch64}
  334. create_fpu_types;
  335. s64currencytype:=corddef.create(scurrency,low(int64),high(int64),true);
  336. {$endif aarch64}
  337. {$ifdef avr}
  338. s32floattype:=cfloatdef.create(s32real,true);
  339. s64floattype:=cfloatdef.create(s64real,true);
  340. s80floattype:=cfloatdef.create(s80real,true);
  341. sc80floattype:=cfloatdef.create(sc80real,true);
  342. s64currencytype:=corddef.create(scurrency,low(int64),high(int64),true);
  343. {$endif avr}
  344. {$ifdef z80}
  345. s32floattype:=cfloatdef.create(s32real,true);
  346. s64floattype:=cfloatdef.create(s64real,true);
  347. s80floattype:=cfloatdef.create(s80real,true);
  348. sc80floattype:=cfloatdef.create(sc80real,true);
  349. s64currencytype:=corddef.create(scurrency,low(int64),high(int64),true);
  350. {$endif z80}
  351. {$ifdef mips}
  352. create_fpu_types;
  353. s64currencytype:=corddef.create(scurrency,low(int64),high(int64),true);
  354. {$endif mips}
  355. {$ifdef riscv32}
  356. create_fpu_types;
  357. s64currencytype:=corddef.create(scurrency,low(int64),high(int64),true);
  358. {$endif riscv32}
  359. {$ifdef riscv64}
  360. create_fpu_types;
  361. s64currencytype:=corddef.create(scurrency,low(int64),high(int64),true);
  362. {$endif riscv64}
  363. {$ifdef jvm}
  364. create_fpu_types;
  365. s64currencytype:=corddef.create(scurrency,low(int64),high(int64),true);
  366. {$endif jvm}
  367. {$ifdef wasm}
  368. create_fpu_types;
  369. s64currencytype:=corddef.create(scurrency,low(int64),high(int64),true);
  370. {$endif wasm}
  371. {$ifdef xtensa}
  372. create_fpu_types;
  373. s64currencytype:=corddef.create(scurrency,low(int64),high(int64),true);
  374. {$endif xtensa}
  375. {$ifdef loongarch64}
  376. create_fpu_types;
  377. s64currencytype:=corddef.create(scurrency,low(int64),high(int64),true);
  378. {$endif loongarch64}
  379. set_default_int_types;
  380. { some other definitions }
  381. charpointertype:=cpointerdef.create(cansichartype);
  382. widecharpointertype:=cpointerdef.create(cwidechartype);
  383. {$ifdef i8086}
  384. parentfpvoidpointertype:=tcpupointerdefclass(cpointerdef).createx86(voidtype,x86pt_near_ss);
  385. {$else i8086}
  386. parentfpvoidpointertype:=cpointerdef.create(voidtype);
  387. {$endif i8086}
  388. {$ifdef x86}
  389. voidnearpointertype:=tcpupointerdefclass(cpointerdef).createx86(voidtype,x86pt_near);
  390. voidnearcspointertype:=tcpupointerdefclass(cpointerdef).createx86(voidtype,x86pt_near_cs);
  391. voidneardspointertype:=tcpupointerdefclass(cpointerdef).createx86(voidtype,x86pt_near_ds);
  392. voidnearsspointertype:=tcpupointerdefclass(cpointerdef).createx86(voidtype,x86pt_near_ss);
  393. voidnearespointertype:=tcpupointerdefclass(cpointerdef).createx86(voidtype,x86pt_near_es);
  394. voidnearfspointertype:=tcpupointerdefclass(cpointerdef).createx86(voidtype,x86pt_near_fs);
  395. voidneargspointertype:=tcpupointerdefclass(cpointerdef).createx86(voidtype,x86pt_near_gs);
  396. {$ifdef i8086}
  397. voidfarpointertype:=tcpupointerdefclass(cpointerdef).createx86(voidtype,x86pt_far);
  398. voidhugepointertype:=tcpupointerdefclass(cpointerdef).createx86(voidtype,x86pt_huge);
  399. charnearpointertype:=tcpupointerdefclass(cpointerdef).createx86(cansichartype,x86pt_near);
  400. charfarpointertype:=tcpupointerdefclass(cpointerdef).createx86(cansichartype,x86pt_far);
  401. charhugepointertype:=tcpupointerdefclass(cpointerdef).createx86(cansichartype,x86pt_huge);
  402. bytefarpointertype:=tcpupointerdefclass(cpointerdef).createx86(u8inttype,x86pt_far);
  403. wordfarpointertype:=tcpupointerdefclass(cpointerdef).createx86(u16inttype,x86pt_far);
  404. longintfarpointertype:=tcpupointerdefclass(cpointerdef).createx86(s32inttype,x86pt_far);
  405. {$endif i8086}
  406. x86_m64type:=carraydef.create_vector(0,1,s32inttype);
  407. x86_m128type:=carraydef.create_vector(0,3,s32inttype);
  408. x86_m128dtype:=carraydef.create_vector(0,1,s32inttype);
  409. x86_m128itype:=carraydef.create_vector(0,3,s32inttype);
  410. x86_m256type:=carraydef.create_vector(0,7,s32inttype);
  411. x86_m256dtype:=carraydef.create_vector(0,3,s32inttype);
  412. x86_m256itype:=carraydef.create_vector(0,7,s32inttype);
  413. tarraydef(x86_m64type).elementdef:=s32floattype;
  414. tarraydef(x86_m128type).elementdef:=s32floattype;
  415. tarraydef(x86_m128dtype).elementdef:=s64floattype;
  416. tarraydef(x86_m128itype).elementdef:=s32floattype;
  417. tarraydef(x86_m256type).elementdef:=s32floattype;
  418. tarraydef(x86_m256dtype).elementdef:=s64floattype;
  419. tarraydef(x86_m256itype).elementdef:=s32floattype;
  420. {$endif x86}
  421. {$ifdef wasm}
  422. wasmvoidexternreftype:=tcpupointerdefclass.create_externref(voidtype);
  423. {$endif wasm}
  424. set_default_ptr_types;
  425. openchararraytype:=carraydef.create_openarray;
  426. tarraydef(openchararraytype).elementdef:=cansichartype;
  427. cfiletype:=cfiledef.createuntyped;
  428. if f_variants in features then
  429. begin
  430. cvarianttype:=cvariantdef.create(vt_normalvariant);
  431. colevarianttype:=cvariantdef.create(vt_olevariant);
  432. end;
  433. {$ifdef cpufpemu}
  434. { Normal types }
  435. (* we use the same types as without emulator, the only
  436. difference is that direct calls to the emulator are generated
  437. if (cs_fp_emulation in current_settings.moduleswitches) then
  438. begin
  439. addtype('Single',s32floattype);
  440. { extended size is the best real type for the target }
  441. addtype('Real',s32floattype);
  442. pbestrealtype:=@s32floattype;
  443. { extended size is the best real type for the target }
  444. addtype('Extended',pbestrealtype^);
  445. end
  446. else
  447. *)
  448. {$endif cpufpemu}
  449. if init_settings.fputype<>fpu_none then
  450. begin
  451. addtype('Single',s32floattype);
  452. addtype('Double',s64floattype);
  453. { extended size is the best real type for the target }
  454. addtype('Extended',pbestrealtype^);
  455. { CExtended corresponds to the C version of the Extended type
  456. (either "long double" or "double") }
  457. if target_info.system in systems_android then
  458. { Android has "long double"="double" even for x86 }
  459. addtype('CExtended',s64floattype)
  460. else
  461. if tfloatdef(pbestrealtype^).floattype=s80real then
  462. addtype('CExtended',sc80floattype)
  463. else
  464. addtype('CExtended',pbestrealtype^);
  465. end;
  466. {$ifdef x86}
  467. {$ifndef FPC_SUPPORT_X87_TYPES_ON_WIN64}
  468. if target_info.system<>system_x86_64_win64 then
  469. {$endif FPC_SUPPORT_X87_TYPES_ON_WIN64}
  470. addtype('Comp',cfloatdef.create(s64comp,true));
  471. {$endif x86}
  472. addtype('Currency',s64currencytype);
  473. addtype('Pointer',voidpointertype);
  474. {$ifdef x86}
  475. addtype('NearPointer',voidnearpointertype);
  476. addtype('NearCsPointer',voidnearcspointertype);
  477. addtype('NearDsPointer',voidneardspointertype);
  478. addtype('NearSsPointer',voidnearsspointertype);
  479. addtype('NearEsPointer',voidnearespointertype);
  480. addtype('NearFsPointer',voidnearfspointertype);
  481. addtype('NearGsPointer',voidneargspointertype);
  482. {$ifdef i8086}
  483. addtype('FarPointer',voidfarpointertype);
  484. addtype('HugePointer',voidhugepointertype);
  485. {$endif i8086}
  486. addtype('__m64',x86_m64type);
  487. addtype('__m128', x86_m128type);
  488. addtype('__m128d',x86_m128dtype);
  489. addtype('__m128i',x86_m128itype);
  490. addtype('__m256', x86_m256type);
  491. addtype('__m256d',x86_m256dtype);
  492. addtype('__m256i',x86_m256itype);
  493. {$endif x86}
  494. addtype('ShortString',cshortstringtype);
  495. {$ifdef support_longstring}
  496. addtype('LongString',clongstringtype);
  497. {$endif support_longstring}
  498. addtype('AnsiString',cansistringtype);
  499. addtype('WideString',cwidestringtype);
  500. addtype('UnicodeString',cunicodestringtype);
  501. addtype('OpenString',openshortstringtype);
  502. addtype('Boolean',pasbool1type);
  503. addtype('Boolean8',pasbool8type);
  504. addtype('Boolean16',pasbool16type);
  505. addtype('Boolean32',pasbool32type);
  506. addtype('Boolean64',pasbool64type);
  507. addtype('ByteBool',bool8type);
  508. addtype('WordBool',bool16type);
  509. addtype('LongBool',bool32type);
  510. addtype('QWordBool',bool64type);
  511. {$ifdef llvm}
  512. addtype('LLVMBool1',llvmbool1type);
  513. {$endif llvm}
  514. addtype('Byte',u8inttype);
  515. addtype('ShortInt',s8inttype);
  516. addtype('Word',u16inttype);
  517. addtype('SmallInt',s16inttype);
  518. addtype('LongWord',u32inttype);
  519. addtype('LongInt',s32inttype);
  520. addtype('QWord',u64inttype);
  521. addtype('Int64',s64inttype);
  522. addtype('AnsiChar',cansichartype);
  523. addtype('WideChar',cwidechartype);
  524. addtype('Text',cfiledef.createtext);
  525. addtype('TypedFile',cfiledef.createtyped(voidtype));
  526. if f_variants in features then
  527. begin
  528. addtype('Variant',cvarianttype);
  529. addtype('OleVariant',colevarianttype);
  530. end;
  531. { Internal types }
  532. addtype('$undefined',cundefinedtype);
  533. addtype('$formal',cformaltype);
  534. addtype('$typedformal',ctypedformaltype);
  535. addtype('$void',voidtype);
  536. addtype('$void_pointer',voidpointertype);
  537. addtype('$byte',u8inttype);
  538. addtype('$shortint',s8inttype);
  539. addtype('$word',u16inttype);
  540. addtype('$smallint',s16inttype);
  541. addtype('$sint24',s24inttype);
  542. addtype('$uint24',u24inttype);
  543. addtype('$ulong',u32inttype);
  544. addtype('$longint',s32inttype);
  545. addtype('$sint40',s40inttype);
  546. addtype('$uint40',u40inttype);
  547. addtype('$sint48',s48inttype);
  548. addtype('$uint48',u48inttype);
  549. addtype('$sint56',s56inttype);
  550. addtype('$uint56',u56inttype);
  551. addtype('$qword',u64inttype);
  552. addtype('$int64',s64inttype);
  553. addtype('$uint128',u128inttype);
  554. addtype('$int128',s128inttype);
  555. addtype('$ansichar',cansichartype);
  556. addtype('$widechar',cwidechartype);
  557. addtype('$shortstring',cshortstringtype);
  558. addtype('$longstring',clongstringtype);
  559. addtype('$ansistring',cansistringtype);
  560. addtype('$widestring',cwidestringtype);
  561. addtype('$unicodestring',cunicodestringtype);
  562. addtype('$openshortstring',openshortstringtype);
  563. addtype('$boolean',pasbool1type);
  564. addtype('$boolean8',pasbool8type);
  565. addtype('$boolean16',pasbool16type);
  566. addtype('$boolean32',pasbool32type);
  567. addtype('$boolean64',pasbool64type);
  568. addtype('$bytebool',bool8type);
  569. addtype('$wordbool',bool16type);
  570. addtype('$longbool',bool32type);
  571. addtype('$qwordbool',bool64type);
  572. {$ifdef llvm}
  573. addtype('$llvmbool1',llvmbool1type);
  574. llvm_metadatatype:=cformaldef.create(false);
  575. { if this gets renamed, also adjust agllvm so it still writes the identifier of this type as "metadata" }
  576. addtype('$metadata',llvm_metadatatype);
  577. addtype('LLVMMetadata',llvm_metadatatype);
  578. {$endif llvm}
  579. addtype('$char_pointer',charpointertype);
  580. addtype('$widechar_pointer',widecharpointertype);
  581. addtype('$parentfp_void_pointer',parentfpvoidpointertype);
  582. {$ifdef x86}
  583. addtype('$void_nearpointer',voidnearpointertype);
  584. addtype('$void_nearcspointer',voidnearcspointertype);
  585. addtype('$void_neardspointer',voidneardspointertype);
  586. addtype('$void_nearsspointer',voidnearsspointertype);
  587. addtype('$void_nearespointer',voidnearespointertype);
  588. addtype('$void_nearfspointer',voidnearfspointertype);
  589. addtype('$void_neargspointer',voidneargspointertype);
  590. {$ifdef i8086}
  591. addtype('$void_farpointer',voidfarpointertype);
  592. addtype('$void_hugepointer',voidhugepointertype);
  593. addtype('$char_nearpointer',charnearpointertype);
  594. addtype('$char_farpointer',charfarpointertype);
  595. addtype('$char_hugepointer',charhugepointertype);
  596. addtype('$byte_farpointer',bytefarpointertype);
  597. addtype('$word_farpointer',wordfarpointertype);
  598. addtype('$longint_farpointer',longintfarpointertype);
  599. {$endif i8086}
  600. addtype('$__m64', x86_m64type);
  601. addtype('$__m128', x86_m128type);
  602. addtype('$__m128d',x86_m128dtype);
  603. addtype('$__m128i',x86_m128itype);
  604. addtype('$__m256', x86_m256type);
  605. addtype('$__m256d',x86_m256dtype);
  606. addtype('$__m256i',x86_m256itype);
  607. {$endif x86}
  608. {$ifdef wasm}
  609. addtype('$wasm_void_externref',wasmvoidexternreftype);
  610. addtype('WasmExternRef',wasmvoidexternreftype);
  611. {$endif wasm}
  612. addtype('$openchararray',openchararraytype);
  613. addtype('$file',cfiletype);
  614. if f_variants in features then
  615. begin
  616. addtype('$variant',cvarianttype);
  617. addtype('$olevariant',colevarianttype);
  618. end;
  619. if init_settings.fputype<>fpu_none then
  620. begin
  621. addtype('$s32real',s32floattype);
  622. addtype('$s64real',s64floattype);
  623. addtype('$s80real',s80floattype);
  624. addtype('$sc80real',sc80floattype);
  625. end;
  626. addtype('$s64currency',s64currencytype);
  627. if not(target_info.system in systems_managed_vm) then
  628. begin
  629. { Add a type for virtual method tables }
  630. hrecst:=trecordsymtable.create('',current_settings.packrecords,current_settings.alignment.recordalignmin);
  631. vmttype:=crecorddef.create('',hrecst);
  632. pvmttype:=cpointerdef.create(vmttype);
  633. { can't use addtype for pvmt because the rtti of the pointed
  634. type is not available. The rtti for pvmt will be written implicitly
  635. by thev tblarray below }
  636. systemunit.insertsym(ctypesym.create('$'+pvmt_name,pvmttype));
  637. addfield(hrecst,cfieldvarsym.create('$length',vs_value,sizesinttype,[]));
  638. addfield(hrecst,cfieldvarsym.create('$mlength',vs_value,sizesinttype,[]));
  639. addfield(hrecst,cfieldvarsym.create('$parent',vs_value,pvmttype,[]));
  640. { it seems vmttype is used both for TP objects and Delphi classes,
  641. so the next entry could either be the first virtual method (vm1)
  642. (object) or the class name (class). We can't easily create separate
  643. vtable formats for both, as gdb is hard coded to search for
  644. __vtbl_ptr_type in all cases (JM) }
  645. addfield(hrecst,cfieldvarsym.create('$vm1_or_classname',vs_value,cpointerdef.create(cshortstringtype),[]));
  646. vmtarraytype:=carraydef.create(0,0,s32inttype);
  647. tarraydef(vmtarraytype).elementdef:=voidpointertype;
  648. addfield(hrecst,cfieldvarsym.create('$__pfn',vs_value,vmtarraytype,[]));
  649. addtype('$__vtbl_ptr_type',vmttype);
  650. vmtarraytype:=carraydef.create(0,1,s32inttype);
  651. tarraydef(vmtarraytype).elementdef:=pvmttype;
  652. addtype('$vtblarray',vmtarraytype);
  653. end;
  654. { Add a type for methodpointers }
  655. hrecst:=trecordsymtable.create('',1,current_settings.alignment.recordalignmin);
  656. addfield(hrecst,cfieldvarsym.create('$proc',vs_value,voidcodepointertype,[]));
  657. addfield(hrecst,cfieldvarsym.create('$self',vs_value,voidpointertype,[]));
  658. methodpointertype:=crecorddef.create('',hrecst);
  659. addtype('$methodpointer',methodpointertype);
  660. { Add a type for nested proc pointers }
  661. hrecst:=trecordsymtable.create('',1,current_settings.alignment.recordalignmin);
  662. addfield(hrecst,cfieldvarsym.create('$proc',vs_value,voidcodepointertype,[]));
  663. addfield(hrecst,cfieldvarsym.create('$parentfp',vs_value,parentfpvoidpointertype,[]));
  664. nestedprocpointertype:=crecorddef.create('',hrecst);
  665. addtype('$nestedprocpointer',nestedprocpointertype);
  666. symtablestack.pop(systemunit);
  667. end;
  668. procedure load_intern_types;
  669. {
  670. Load all default definitions for consts from the system unit
  671. }
  672. procedure loadtype(const s:string;var def:tdef);
  673. var
  674. srsym : ttypesym;
  675. begin
  676. srsym:=search_system_type(s);
  677. def:=srsym.typedef;
  678. end;
  679. var
  680. oldcurrentmodule : tmodule;
  681. pvmt_name : shortstring;
  682. begin
  683. {$ifndef FPC_SUPPORT_X87_TYPES_ON_WIN64}
  684. if target_info.system=system_x86_64_win64 then
  685. pbestrealtype:=@s64floattype;
  686. {$endif FPC_SUPPORT_X87_TYPES_ON_WIN64}
  687. oldcurrentmodule:=current_module;
  688. set_current_module(nil);
  689. loadtype('byte',u8inttype);
  690. loadtype('shortint',s8inttype);
  691. loadtype('word',u16inttype);
  692. loadtype('smallint',s16inttype);
  693. loadtype('uint24',u24inttype);
  694. loadtype('sint24',s24inttype);
  695. loadtype('ulong',u32inttype);
  696. loadtype('longint',s32inttype);
  697. loadtype('uint40',u40inttype);
  698. loadtype('sint40',s40inttype);
  699. loadtype('uint48',u48inttype);
  700. loadtype('sint48',s48inttype);
  701. loadtype('uint56',u56inttype);
  702. loadtype('sint56',s56inttype);
  703. loadtype('qword',u64inttype);
  704. loadtype('int64',s64inttype);
  705. loadtype('uint128',u128inttype);
  706. loadtype('int128',s128inttype);
  707. loadtype('undefined',cundefinedtype);
  708. loadtype('formal',cformaltype);
  709. loadtype('typedformal',ctypedformaltype);
  710. loadtype('void',voidtype);
  711. loadtype('void_pointer',voidpointertype);
  712. loadtype('ansichar',cansichartype);
  713. loadtype('widechar',cwidechartype);
  714. loadtype('shortstring',cshortstringtype);
  715. loadtype('longstring',clongstringtype);
  716. loadtype('ansistring',cansistringtype);
  717. loadtype('widestring',cwidestringtype);
  718. loadtype('unicodestring',cunicodestringtype);
  719. loadtype('openshortstring',openshortstringtype);
  720. loadtype('openchararray',openchararraytype);
  721. if init_settings.fputype <> fpu_none then
  722. begin
  723. loadtype('s32real',s32floattype);
  724. loadtype('s64real',s64floattype);
  725. loadtype('s80real',s80floattype);
  726. loadtype('sc80real',sc80floattype);
  727. end;
  728. loadtype('s64currency',s64currencytype);
  729. loadtype('boolean',pasbool1type);
  730. loadtype('boolean8',pasbool8type);
  731. loadtype('boolean16',pasbool16type);
  732. loadtype('boolean32',pasbool32type);
  733. loadtype('boolean64',pasbool64type);
  734. loadtype('bytebool',bool8type);
  735. loadtype('wordbool',bool16type);
  736. loadtype('longbool',bool32type);
  737. loadtype('qwordbool',bool64type);
  738. loadtype('char_pointer',charpointertype);
  739. loadtype('widechar_pointer',widecharpointertype);
  740. loadtype('parentfp_void_pointer',parentfpvoidpointertype);
  741. {$ifdef x86}
  742. loadtype('void_nearpointer',voidnearpointertype);
  743. loadtype('void_nearcspointer',voidnearcspointertype);
  744. loadtype('void_neardspointer',voidneardspointertype);
  745. loadtype('void_nearsspointer',voidnearsspointertype);
  746. loadtype('void_nearespointer',voidnearespointertype);
  747. loadtype('void_nearfspointer',voidnearfspointertype);
  748. loadtype('void_neargspointer',voidneargspointertype);
  749. {$ifdef i8086}
  750. loadtype('void_farpointer',voidfarpointertype);
  751. loadtype('void_hugepointer',voidhugepointertype);
  752. loadtype('char_nearpointer',charnearpointertype);
  753. loadtype('char_farpointer',charfarpointertype);
  754. loadtype('char_hugepointer',charhugepointertype);
  755. loadtype('byte_farpointer',bytefarpointertype);
  756. loadtype('word_farpointer',wordfarpointertype);
  757. loadtype('longint_farpointer',longintfarpointertype);
  758. {$endif i8086}
  759. loadtype('__m64', x86_m64type);
  760. loadtype('__m128', x86_m128type);
  761. loadtype('__m128d',x86_m128dtype);
  762. loadtype('__m128i',x86_m128itype);
  763. loadtype('__m256', x86_m256type);
  764. loadtype('__m256d',x86_m256dtype);
  765. loadtype('__m256i',x86_m256itype);
  766. {$endif x86}
  767. {$ifdef llvm}
  768. loadtype('llvmbool1',llvmbool1type);
  769. loadtype('metadata',llvm_metadatatype);
  770. {$endif llvm}
  771. {$ifdef wasm}
  772. loadtype('wasm_void_externref',wasmvoidexternreftype);
  773. {$endif wasm}
  774. loadtype('file',cfiletype);
  775. if target_info.system=system_i386_watcom then
  776. pvmt_name:='lower__pvmt'
  777. else
  778. pvmt_name:='pvmt';
  779. if not(target_info.system in systems_managed_vm) then
  780. begin
  781. loadtype(pvmt_name,pvmttype);
  782. loadtype('vtblarray',vmtarraytype);
  783. loadtype('__vtbl_ptr_type',vmttype);
  784. end;
  785. if f_variants in features then
  786. begin
  787. loadtype('variant',cvarianttype);
  788. loadtype('olevariant',colevarianttype);
  789. end;
  790. loadtype('methodpointer',methodpointertype);
  791. loadtype('nestedprocpointer',nestedprocpointertype);
  792. loadtype('HRESULT',hresultdef);
  793. loadtype('TTYPEKIND',typekindtype);
  794. set_default_int_types;
  795. set_default_ptr_types;
  796. set_current_module(oldcurrentmodule);
  797. end;
  798. procedure registernodes;
  799. {
  800. Register all possible nodes in the nodeclass array that
  801. will be used for loading the nodes from a ppu
  802. }
  803. begin
  804. nodeclass[addn]:=caddnode;
  805. nodeclass[muln]:=caddnode;
  806. nodeclass[subn]:=caddnode;
  807. nodeclass[divn]:=cmoddivnode;
  808. nodeclass[symdifn]:=caddnode;
  809. nodeclass[modn]:=cmoddivnode;
  810. nodeclass[assignn]:=cassignmentnode;
  811. nodeclass[loadn]:=cloadnode;
  812. nodeclass[rangen]:=crangenode;
  813. nodeclass[ltn]:=caddnode;
  814. nodeclass[lten]:=caddnode;
  815. nodeclass[gtn]:=caddnode;
  816. nodeclass[gten]:=caddnode;
  817. nodeclass[equaln]:=caddnode;
  818. nodeclass[unequaln]:=caddnode;
  819. nodeclass[inn]:=cinnode;
  820. nodeclass[orn]:=caddnode;
  821. nodeclass[xorn]:=caddnode;
  822. nodeclass[shrn]:=cshlshrnode;
  823. nodeclass[shln]:=cshlshrnode;
  824. nodeclass[slashn]:=caddnode;
  825. nodeclass[andn]:=caddnode;
  826. nodeclass[subscriptn]:=csubscriptnode;
  827. nodeclass[derefn]:=cderefnode;
  828. nodeclass[addrn]:=caddrnode;
  829. nodeclass[ordconstn]:=cordconstnode;
  830. nodeclass[typeconvn]:=ctypeconvnode;
  831. nodeclass[calln]:=ccallnode;
  832. nodeclass[callparan]:=ccallparanode;
  833. nodeclass[realconstn]:=crealconstnode;
  834. nodeclass[unaryminusn]:=cunaryminusnode;
  835. nodeclass[unaryplusn]:=cunaryplusnode;
  836. nodeclass[asmn]:=casmnode;
  837. nodeclass[vecn]:=cvecnode;
  838. nodeclass[pointerconstn]:=cpointerconstnode;
  839. nodeclass[stringconstn]:=cstringconstnode;
  840. nodeclass[notn]:=cnotnode;
  841. nodeclass[inlinen]:=cinlinenode;
  842. nodeclass[niln]:=cnilnode;
  843. nodeclass[errorn]:=cerrornode;
  844. nodeclass[typen]:=ctypenode;
  845. nodeclass[setelementn]:=csetelementnode;
  846. nodeclass[setconstn]:=csetconstnode;
  847. nodeclass[blockn]:=cblocknode;
  848. nodeclass[statementn]:=cstatementnode;
  849. nodeclass[ifn]:=cifnode;
  850. nodeclass[breakn]:=cbreaknode;
  851. nodeclass[continuen]:=ccontinuenode;
  852. nodeclass[whilerepeatn]:=cwhilerepeatnode;
  853. nodeclass[forn]:=cfornode;
  854. nodeclass[exitn]:=cexitnode;
  855. nodeclass[casen]:=ccasenode;
  856. nodeclass[labeln]:=clabelnode;
  857. nodeclass[goton]:=cgotonode;
  858. nodeclass[tryexceptn]:=ctryexceptnode;
  859. nodeclass[raisen]:=craisenode;
  860. nodeclass[tryfinallyn]:=ctryfinallynode;
  861. nodeclass[onn]:=connode;
  862. nodeclass[isn]:=cisnode;
  863. nodeclass[asn]:=casnode;
  864. nodeclass[starstarn]:=caddnode;
  865. nodeclass[arrayconstructorn]:=carrayconstructornode;
  866. nodeclass[arrayconstructorrangen]:=carrayconstructorrangenode;
  867. nodeclass[tempcreaten]:=ctempcreatenode;
  868. nodeclass[temprefn]:=ctemprefnode;
  869. nodeclass[tempdeleten]:=ctempdeletenode;
  870. nodeclass[addoptn]:=caddnode;
  871. nodeclass[nothingn]:=cnothingnode;
  872. nodeclass[loadvmtaddrn]:=cloadvmtaddrnode;
  873. nodeclass[guidconstn]:=cguidconstnode;
  874. nodeclass[rttin]:=crttinode;
  875. nodeclass[loadparentfpn]:=cloadparentfpnode;
  876. end;
  877. procedure registertais;
  878. {
  879. Register all possible tais in the taiclass array that
  880. will be used for loading the tais from a ppu
  881. }
  882. begin
  883. aiclass[ait_none]:=nil;
  884. aiclass[ait_align]:=tai_align;
  885. aiclass[ait_section]:=tai_section;
  886. aiclass[ait_comment]:=tai_comment;
  887. aiclass[ait_string]:=tai_string;
  888. aiclass[ait_instruction]:=taicpu;
  889. aiclass[ait_datablock]:=tai_datablock;
  890. aiclass[ait_symbol]:=tai_symbol;
  891. aiclass[ait_symbol_end]:=tai_symbol_end;
  892. aiclass[ait_directive]:=tai_directive;
  893. aiclass[ait_label]:=tai_label;
  894. aiclass[ait_const]:=tai_const;
  895. aiclass[ait_realconst]:=tai_realconst;
  896. aiclass[ait_stab]:=tai_stab;
  897. aiclass[ait_force_line]:=tai_force_line;
  898. aiclass[ait_function_name]:=tai_function_name;
  899. aiclass[ait_symbolpair]:=tai_symbolpair;
  900. aiclass[ait_cutobject]:=tai_cutobject;
  901. aiclass[ait_regalloc]:=tai_regalloc;
  902. aiclass[ait_tempalloc]:=tai_tempalloc;
  903. aiclass[ait_marker]:=tai_marker;
  904. aiclass[ait_seh_directive]:=tai_seh_directive;
  905. {$ifdef JVM}
  906. aiclass[ait_jvar]:=tai_jvar;
  907. aiclass[ait_jcatch]:=tai_jcatch;
  908. {$endif JVM}
  909. end;
  910. end.