njvminl.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. {
  2. Copyright (c) 1998-2011 by Florian Klaempfl and Jonas Maebe
  3. Generate JVM inline nodes
  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 njvminl;
  18. {$i fpcdefs.inc}
  19. interface
  20. uses
  21. cpubase,
  22. node,ninl,ncginl;
  23. type
  24. tjvminlinenode = class(tcginlinenode)
  25. protected
  26. function typecheck_length(var handled: boolean): tnode;
  27. function typecheck_high(var handled: boolean): tnode;
  28. function typecheck_new(var handled: boolean): tnode;
  29. function first_setlength_array: tnode;
  30. function first_setlength_string: tnode;
  31. public
  32. { typecheck override to intercept handling }
  33. function pass_typecheck: tnode; override;
  34. { first pass override
  35. so that the code generator will actually generate
  36. these nodes.
  37. }
  38. (*
  39. function first_sqrt_real: tnode; override;
  40. *)
  41. function first_sqr_real: tnode; override;
  42. function first_trunc_real: tnode; override;
  43. (*
  44. function first_round_real: tnode; override;
  45. *)
  46. function first_new: tnode; override;
  47. function first_setlength: tnode; override;
  48. function first_length: tnode; override;
  49. procedure second_length; override;
  50. (*
  51. procedure second_sqrt_real; override;
  52. procedure second_abs_real; override;
  53. *)
  54. procedure second_sqr_real; override;
  55. procedure second_trunc_real; override;
  56. (*
  57. procedure second_round_real; override;
  58. *)
  59. procedure second_new; override;
  60. procedure second_setlength; override;
  61. protected
  62. procedure load_fpu_location;
  63. end;
  64. implementation
  65. uses
  66. cutils,globals,verbose,globtype,constexp,
  67. aasmbase,aasmtai,aasmdata,aasmcpu,
  68. symtype,symconst,symdef,symsym,symtable,jvmdef,
  69. defutil,
  70. nbas,ncon,ncnv,ncal,nld,nflw,nutils,
  71. cgbase,pass_1,pass_2,
  72. cpuinfo,ncgutil,
  73. cgutils,hlcgobj,hlcgcpu;
  74. {*****************************************************************************
  75. tjvminlinenode
  76. *****************************************************************************}
  77. function tjvminlinenode.typecheck_length(var handled: boolean): tnode;
  78. begin
  79. typecheckpass(left);
  80. if is_dynamic_array(left.resultdef) or
  81. is_open_array(left.resultdef) or
  82. is_wide_or_unicode_string(left.resultdef) then
  83. begin
  84. resultdef:=s32inttype;
  85. result:=nil;
  86. handled:=true;
  87. end;
  88. end;
  89. function tjvminlinenode.typecheck_high(var handled: boolean): tnode;
  90. begin
  91. typecheckpass(left);
  92. if is_dynamic_array(left.resultdef) or
  93. is_open_array(left.resultdef) then
  94. begin
  95. { replace with pred(length(arr)) }
  96. result:=cinlinenode.create(in_pred_x,false,
  97. cinlinenode.create(in_length_x,false,left));
  98. left:=nil;
  99. handled:=true;
  100. end;
  101. end;
  102. function tjvminlinenode.typecheck_new(var handled: boolean): tnode;
  103. var
  104. para: tcallparanode;
  105. elemdef: tdef;
  106. begin
  107. { normally never exists; used by the JVM backend to create new
  108. arrays because it requires special opcodes }
  109. tcallparanode(left).get_paratype;
  110. if is_dynamic_array(left.resultdef) then
  111. begin
  112. para:=tcallparanode(left);
  113. { need at least one extra parameter in addition to the
  114. array }
  115. if not assigned(para.right) then
  116. internalerror(2011012206);
  117. elemdef:=tarraydef(left.resultdef).elementdef;
  118. while elemdef.typ=arraydef do
  119. begin
  120. { if we have less length specifiers than dimensions, make
  121. the last array an array of length 0 }
  122. if not assigned(para.right) then
  123. begin
  124. para.right:=ccallparanode.create(
  125. cordconstnode.create(0,s32inttype,false),nil);
  126. tcallparanode(para.right).get_paratype;
  127. break;
  128. end
  129. else
  130. begin
  131. inserttypeconv(tcallparanode(para.right).left,s32inttype);
  132. tcallparanode(para.right).get_paratype;
  133. end;
  134. para:=tcallparanode(para.right);
  135. elemdef:=tarraydef(elemdef).elementdef;
  136. end;
  137. result:=nil;
  138. resultdef:=left.resultdef;
  139. handled:=true;
  140. end;
  141. end;
  142. function tjvminlinenode.pass_typecheck: tnode;
  143. var
  144. handled: boolean;
  145. begin
  146. handled:=false;
  147. case inlinenumber of
  148. in_length_x:
  149. begin
  150. result:=typecheck_length(handled);
  151. end;
  152. in_high_x:
  153. begin
  154. result:=typecheck_high(handled);
  155. end;
  156. in_new_x:
  157. begin
  158. result:=typecheck_new(handled);
  159. end;
  160. end;
  161. if not handled then
  162. result:=inherited pass_typecheck;
  163. end;
  164. (*
  165. function tjvminlinenode.first_sqrt_real : tnode;
  166. begin
  167. if (current_settings.cputype >= cpu_PPC970) then
  168. begin
  169. expectloc:=LOC_FPUREGISTER;
  170. first_sqrt_real := nil;
  171. end
  172. else
  173. result:=inherited first_sqrt_real;
  174. end;
  175. *)
  176. function tjvminlinenode.first_sqr_real : tnode;
  177. begin
  178. expectloc:=LOC_FPUREGISTER;
  179. first_sqr_real:=nil;
  180. end;
  181. function tjvminlinenode.first_trunc_real : tnode;
  182. begin
  183. expectloc:=LOC_REGISTER;
  184. first_trunc_real:=nil;
  185. end;
  186. function tjvminlinenode.first_new: tnode;
  187. begin
  188. { skip the array; it's a type node }
  189. tcallparanode(tcallparanode(left).right).firstcallparan;
  190. expectloc:=LOC_REGISTER;
  191. result:=nil;
  192. end;
  193. function tjvminlinenode.first_setlength_array: tnode;
  194. var
  195. assignmenttarget,
  196. ppn,
  197. newparas: tnode;
  198. newnode: tnode;
  199. eledef,
  200. objarraydef: tdef;
  201. ndims: longint;
  202. finaltype: char;
  203. setlenroutine: string;
  204. lefttemp: ttempcreatenode;
  205. newblock: tblocknode;
  206. newstatement: tstatementnode;
  207. primitive: boolean;
  208. begin
  209. { first parameter is the array, the rest are the dimensions }
  210. newparas:=tcallparanode(left).right;
  211. tcallparanode(left).right:=nil;
  212. { count the number of specified dimensions, and determine the type of
  213. the final one }
  214. ppn:=newparas;
  215. eledef:=tarraydef(left.resultdef).elementdef;
  216. { ppn already points to the first dimension }
  217. ndims:=1;
  218. while assigned(tcallparanode(ppn).right) do
  219. begin
  220. inc(ndims);
  221. eledef:=tarraydef(eledef).elementdef;
  222. ppn:=tcallparanode(ppn).right;
  223. end;
  224. { in case it's a dynamic array of static arrays, we must also allocate
  225. the static arrays! }
  226. while (eledef.typ=arraydef) and
  227. not is_dynamic_array(eledef) do
  228. begin
  229. inc(ndims);
  230. tcallparanode(ppn).right:=
  231. ccallparanode.create(
  232. genintconstnode(tarraydef(eledef).elecount),nil);
  233. ppn:=tcallparanode(ppn).right;
  234. eledef:=tarraydef(eledef).elementdef;
  235. end;
  236. { prepend type parameter for the array }
  237. newparas:=ccallparanode.create(ctypenode.create(left.resultdef),newparas);
  238. ttypenode(tcallparanode(newparas).left).allowed:=true;
  239. { node to create the new array }
  240. newnode:=cinlinenode.create(in_new_x,false,newparas);
  241. { Common parameters for setlength helper }
  242. { start with org (save assignmenttarget itself to assign the result back to) }
  243. { store left into a temp in case it may contain a function call
  244. (which must not be evaluated twice) }
  245. lefttemp:=maybereplacewithtempref(tcallparanode(left).left,tcallparanode(left).left.resultdef.size,false);
  246. if assigned(lefttemp) then
  247. begin
  248. newblock:=internalstatements(newstatement);
  249. addstatement(newstatement,lefttemp);
  250. assignmenttarget:=ctemprefnode.create(lefttemp);
  251. typecheckpass(tnode(assignmenttarget));
  252. end
  253. else
  254. assignmenttarget:=tcallparanode(left).left.getcopy;
  255. newparas:=left;
  256. left:=nil;
  257. { if more than 1 dimension, or if 1 dimention of a non-primitive type,
  258. typecast to generic array of tobject }
  259. setlenroutine:=jvmarrtype(eledef,primitive);
  260. finaltype:=jvmarrtype_setlength(eledef);
  261. { since the setlength prototypes require certain types, insert
  262. explicit type conversions where necessary }
  263. objarraydef:=nil;
  264. { all arrays, records and object types need to be handled as JLObject }
  265. if (ndims>1) or
  266. not primitive then
  267. objarraydef:=search_system_type('TJOBJECTARRAY').typedef
  268. { insert type conversion, because this is used both for signed and
  269. unsigned types }
  270. else case finaltype of
  271. 'Z': { boolean is always the same };
  272. 'C': { char is always the same };
  273. 'B':
  274. { jbyte: used for both shortint and byte }
  275. objarraydef:=search_system_type('TJBYTEARRAY').typedef;
  276. 'S':
  277. { jshort: used for both smallint and word }
  278. objarraydef:=search_system_type('TJSHORTARRAY').typedef;
  279. 'I':
  280. { jshort: used for both smallint and word }
  281. objarraydef:=search_system_type('TJINTARRAY').typedef;
  282. 'J':
  283. { jshort: used for both smallint and word }
  284. objarraydef:=search_system_type('TJLONGARRAY').typedef;
  285. 'F': { float is always the same };
  286. 'D': { double is always the same };
  287. else
  288. internalerror(2011040705);
  289. end;
  290. if assigned(objarraydef) then
  291. begin
  292. tcallparanode(newparas).left:=ctypeconvnode.create_explicit(tcallparanode(newparas).left,objarraydef);
  293. newnode:=ctypeconvnode.create_explicit(newnode,objarraydef);
  294. end;
  295. { prepend new }
  296. newparas:=ccallparanode.create(newnode,newparas);
  297. { prepend deepcopy }
  298. newparas:=ccallparanode.create(cordconstnode.create(0,pasbool8type,false),newparas);
  299. { call the right setlenght helper }
  300. if ndims>1 then
  301. begin
  302. setlenroutine:='FPC_SETLENGTH_DYNARR_MULTIDIM';
  303. { create proper parameters, from right to left:
  304. eletype=finaltype, ndim=ndims, deepcopy=false, new=newnode,
  305. assignmenttarget=tcallparanode(left).left }
  306. { prepend ndim }
  307. newparas:=ccallparanode.create(cordconstnode.create(ndims,s32inttype,false),newparas);
  308. { prepend eletype }
  309. newparas:=ccallparanode.create(cordconstnode.create(ord(finaltype),cwidechartype,false),newparas);
  310. end
  311. else
  312. begin
  313. if not primitive then
  314. setlenroutine:='OBJECT'
  315. else
  316. uppervar(setlenroutine);
  317. setlenroutine:='FPC_SETLENGTH_DYNARR_J'+setlenroutine;
  318. { create proper parameters, from right to left:
  319. deepcopy=false, new=newnode, assignmenttarget=tcallparnode(left).left
  320. -> already done in common part above }
  321. end;
  322. result:=ccallnode.createintern(setlenroutine,newparas);
  323. { assign result back to org (no call-by-reference for Java) }
  324. result:=cassignmentnode.create(assignmenttarget,
  325. ctypeconvnode.create_explicit(result,assignmenttarget.resultdef));
  326. if assigned(lefttemp) then
  327. begin
  328. addstatement(newstatement,result);
  329. addstatement(newstatement,ctempdeletenode.create(lefttemp));
  330. result:=newblock;
  331. end;
  332. end;
  333. function tjvminlinenode.first_setlength_string: tnode;
  334. var
  335. newblock: tblocknode;
  336. newstatement: tstatementnode;
  337. lefttemp: ttempcreatenode;
  338. assignmenttarget: tnode;
  339. begin
  340. if is_wide_or_unicode_string(left.resultdef) then
  341. begin
  342. { store left into a temp in case it may contain a function call
  343. (which must not be evaluated twice) }
  344. lefttemp:=maybereplacewithtempref(tcallparanode(left).left,tcallparanode(left).left.resultdef.size,false);
  345. if assigned(lefttemp) then
  346. begin
  347. newblock:=internalstatements(newstatement);
  348. addstatement(newstatement,lefttemp);
  349. assignmenttarget:=ctemprefnode.create(lefttemp);
  350. typecheckpass(tnode(assignmenttarget));
  351. end
  352. else
  353. assignmenttarget:=tcallparanode(left).left.getcopy;
  354. { back to original order for the call }
  355. left:=reverseparameters(tcallparanode(left));
  356. result:=cassignmentnode.create(assignmenttarget,
  357. ccallnode.createintern('fpc_unicodestr_setlength',left));
  358. if assigned(lefttemp) then
  359. begin
  360. addstatement(newstatement,result);
  361. addstatement(newstatement,ctempdeletenode.create(lefttemp));
  362. result:=newblock;
  363. end;
  364. left:=nil;
  365. end
  366. else
  367. internalerror(2011031405);
  368. end;
  369. function tjvminlinenode.first_setlength: tnode;
  370. begin
  371. { reverse the parameter order so we can process them more easily }
  372. left:=reverseparameters(tcallparanode(left));
  373. { treat setlength(x,0) specially: used to init uninitialised locations }
  374. if not assigned(tcallparanode(tcallparanode(left).right).right) and
  375. is_constintnode(tcallparanode(tcallparanode(left).right).left) and
  376. (tordconstnode(tcallparanode(tcallparanode(left).right).left).value=0) then
  377. begin
  378. result:=nil;
  379. expectloc:=LOC_VOID;
  380. exit;
  381. end;
  382. case left.resultdef.typ of
  383. arraydef:
  384. result:=first_setlength_array;
  385. stringdef:
  386. result:=first_setlength_string;
  387. else
  388. internalerror(2011031204);
  389. end;
  390. end;
  391. function tjvminlinenode.first_length: tnode;
  392. var
  393. newblock: tblocknode;
  394. newstatement: tstatementnode;
  395. lentemp: ttempcreatenode;
  396. ifcond,
  397. stringnonnull,
  398. stringnull: tnode;
  399. psym: tsym;
  400. begin
  401. if is_wide_or_unicode_string(left.resultdef) then
  402. begin
  403. { if assigned(JLString(left)) then
  404. lentemp:=JLString(left).length()
  405. else
  406. lentemp:=0;
  407. --> return lentemp
  408. }
  409. newblock:=internalstatements(newstatement);
  410. lentemp:=ctempcreatenode.create(s32inttype,s32inttype.size,tt_persistent,true);
  411. addstatement(newstatement,lentemp);
  412. { if-condition }
  413. ifcond:=cinlinenode.create(in_assigned_x,false,
  414. ccallparanode.create(ctypeconvnode.create_explicit(left.getcopy,java_jlstring),nil));
  415. { then-path (reuse left, since last use) }
  416. psym:=search_struct_member(java_jlstring,'LENGTH');
  417. if not assigned(psym) or
  418. (psym.typ<>procsym) then
  419. internalerror(2011031403);
  420. stringnonnull:=cassignmentnode.create(
  421. ctemprefnode.create(lentemp),
  422. ccallnode.create(nil,tprocsym(psym),psym.owner,
  423. ctypeconvnode.create_explicit(left,java_jlstring),[]));
  424. left:=nil;
  425. { else-path}
  426. stringnull:=cassignmentnode.create(
  427. ctemprefnode.create(lentemp),
  428. genintconstnode(0));
  429. { complete if-statement }
  430. addstatement(newstatement,cifnode.create(ifcond,stringnonnull,stringnull));
  431. { return temp }
  432. addstatement(newstatement,ctempdeletenode.create_normal_temp(lentemp));
  433. addstatement(newstatement,ctemprefnode.create(lentemp));
  434. result:=newblock;
  435. end
  436. else
  437. result:=inherited first_length;
  438. end;
  439. procedure tjvminlinenode.second_length;
  440. begin
  441. if is_dynamic_array(left.resultdef) or
  442. is_open_array(left.resultdef) then
  443. begin
  444. location_reset(location,LOC_REGISTER,OS_S32);
  445. location.register:=hlcg.getintregister(current_asmdata.CurrAsmList,s32inttype);
  446. secondpass(left);
  447. thlcgjvm(hlcg).g_getarraylen(current_asmdata.CurrAsmList,left.location);
  448. thlcgjvm(hlcg).a_load_stack_reg(current_asmdata.CurrAsmList,resultdef,location.register);
  449. end
  450. else
  451. internalerror(2011012004);
  452. end;
  453. (*
  454. function tjvminlinenode.first_round_real : tnode;
  455. begin
  456. if (current_settings.cputype >= cpu_PPC970) then
  457. begin
  458. expectloc:=LOC_REFERENCE;
  459. first_round_real := nil;
  460. end
  461. else
  462. result:=inherited first_round_real;
  463. end;
  464. *)
  465. { load the FPU value on the evaluation stack }
  466. procedure tjvminlinenode.load_fpu_location;
  467. begin
  468. secondpass(left);
  469. thlcgjvm(hlcg).a_load_loc_stack(current_asmdata.CurrAsmList,left.resultdef,left.location);
  470. end;
  471. (*
  472. procedure tjvminlinenode.second_sqrt_real;
  473. begin
  474. if (current_settings.cputype < cpu_PPC970) then
  475. internalerror(2007020910);
  476. location.loc:=LOC_FPUREGISTER;
  477. load_fpu_location;
  478. case left.location.size of
  479. OS_F32:
  480. current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_FSQRTS,location.register,
  481. left.location.register));
  482. OS_F64:
  483. current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_FSQRT,location.register,
  484. left.location.register));
  485. else
  486. inherited;
  487. end;
  488. end;
  489. *)
  490. procedure tjvminlinenode.second_sqr_real;
  491. begin
  492. load_fpu_location;
  493. location_reset(location,LOC_FPUREGISTER,location.size);
  494. location.register:=hlcg.getfpuregister(current_asmdata.CurrAsmList,resultdef);
  495. case left.location.size of
  496. OS_F32:
  497. begin
  498. current_asmdata.CurrAsmList.concat(taicpu.op_none(a_dup));
  499. thlcgjvm(hlcg).incstack(current_asmdata.CurrAsmList,1);
  500. current_asmdata.CurrAsmList.concat(taicpu.op_none(a_fmul));
  501. thlcgjvm(hlcg).decstack(current_asmdata.CurrAsmList,1);
  502. end;
  503. OS_F64:
  504. begin
  505. current_asmdata.CurrAsmList.concat(taicpu.op_none(a_dup2));
  506. thlcgjvm(hlcg).incstack(current_asmdata.CurrAsmList,2);
  507. current_asmdata.CurrAsmList.concat(taicpu.op_none(a_dmul));
  508. thlcgjvm(hlcg).decstack(current_asmdata.CurrAsmList,2);
  509. end;
  510. else
  511. internalerror(2011010804);
  512. end;
  513. thlcgjvm(hlcg).a_load_stack_reg(current_asmdata.CurrAsmList,resultdef,location.register);
  514. end;
  515. procedure tjvminlinenode.second_trunc_real;
  516. begin
  517. load_fpu_location;
  518. location_reset(location,LOC_REGISTER,left.location.size);
  519. location.register:=hlcg.getintregister(current_asmdata.CurrAsmList,resultdef);
  520. case left.location.size of
  521. OS_F32:
  522. begin
  523. current_asmdata.CurrAsmList.concat(taicpu.op_none(a_f2l));
  524. { 32 bit float -> 64 bit int: +1 stack slot }
  525. thlcgjvm(hlcg).incstack(current_asmdata.CurrAsmList,1);
  526. end;
  527. OS_F64:
  528. begin
  529. { 64 bit float -> 64 bit int: same number of stack slots }
  530. current_asmdata.CurrAsmList.concat(taicpu.op_none(a_d2l));
  531. end;
  532. else
  533. internalerror(2011010805);
  534. end;
  535. thlcgjvm(hlcg).a_load_stack_reg(current_asmdata.CurrAsmList,resultdef,location.register);
  536. end;
  537. procedure tjvminlinenode.second_new;
  538. var
  539. arr: tnode;
  540. hp: tcallparanode;
  541. paracount: longint;
  542. begin
  543. hp:=tcallparanode(left);
  544. { we don't second pass this one, it's only a type node }
  545. arr:=hp.left;
  546. if not is_dynamic_array(arr.resultdef) then
  547. internalerror(2011012204);
  548. hp:=tcallparanode(hp.right);
  549. if not assigned(hp) then
  550. internalerror(2011012205);
  551. paracount:=0;
  552. { put all the dimensions on the stack }
  553. repeat
  554. inc(paracount);
  555. secondpass(hp.left);
  556. thlcgjvm(hlcg).a_load_loc_stack(current_asmdata.CurrAsmList,hp.left.resultdef,hp.left.location);
  557. hp:=tcallparanode(hp.right);
  558. until not assigned(hp);
  559. { create the array }
  560. thlcgjvm(hlcg).g_newarray(current_asmdata.CurrAsmList,arr.resultdef,paracount);
  561. location_reset(location,LOC_REGISTER,OS_ADDR);
  562. location.register:=hlcg.getaddressregister(current_asmdata.CurrAsmList,resultdef);
  563. thlcgjvm(hlcg).a_load_stack_reg(current_asmdata.CurrAsmList,arr.resultdef,location.register);
  564. end;
  565. procedure tjvminlinenode.second_setlength;
  566. var
  567. target: tnode;
  568. lenpara: tnode;
  569. emptystr: ansichar;
  570. begin
  571. target:=tcallparanode(left).left;
  572. lenpara:=tcallparanode(tcallparanode(left).right).left;
  573. if assigned(tcallparanode(tcallparanode(left).right).right) or
  574. not is_constintnode(lenpara) or
  575. (tordconstnode(lenpara).value<>0) then
  576. internalerror(2011031801);
  577. secondpass(target);
  578. if is_wide_or_unicode_string(target.resultdef) then
  579. begin
  580. emptystr:=#0;
  581. current_asmdata.CurrAsmList.concat(taicpu.op_string(a_ldc,0,@emptystr));
  582. thlcgjvm(hlcg).incstack(current_asmdata.CurrAsmList,1);
  583. end
  584. else if is_dynamic_array(target.resultdef) then
  585. begin
  586. thlcgjvm(hlcg).a_load_const_stack(current_asmdata.CurrAsmList,s32inttype,0,R_INTREGISTER);
  587. thlcgjvm(hlcg).g_newarray(current_asmdata.CurrAsmList,target.resultdef,1);
  588. end
  589. else
  590. internalerror(2011031401);
  591. thlcgjvm(hlcg).a_load_stack_loc(current_asmdata.CurrAsmList,target.resultdef,target.location);
  592. end;
  593. begin
  594. cinlinenode:=tjvminlinenode;
  595. end.