ILGenerator.cs 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. //
  2. // System.Reflection.Emit/ILGenerator.cs
  3. //
  4. // Author:
  5. // Paolo Molaro ([email protected])
  6. //
  7. // (C) 2001 Ximian, Inc. http://www.ximian.com
  8. //
  9. using System;
  10. using System.Collections;
  11. using System.Diagnostics.SymbolStore;
  12. namespace System.Reflection.Emit {
  13. internal struct ILExceptionBlock {
  14. public const int CATCH = 0;
  15. public const int FILTER = 1;
  16. public const int FINALLY = 2;
  17. public const int FAULT = 4;
  18. internal Type extype;
  19. internal int type;
  20. internal int start;
  21. internal int len;
  22. internal int filter_offset;
  23. internal void Debug () {
  24. #if NO
  25. System.Console.Write ("\ttype="+type.ToString()+" start="+start.ToString()+" len="+len.ToString());
  26. if (extype != null)
  27. System.Console.WriteLine (" extype="+extype.ToString());
  28. else
  29. System.Console.WriteLine ("");
  30. #endif
  31. }
  32. }
  33. internal struct ILExceptionInfo {
  34. ILExceptionBlock[] handlers;
  35. internal int start;
  36. int len;
  37. internal Label end;
  38. internal int NumHandlers () {
  39. return handlers.Length;
  40. }
  41. internal void AddCatch (Type extype, int offset) {
  42. int i;
  43. End (offset);
  44. add_block (offset);
  45. i = handlers.Length - 1;
  46. handlers [i].type = ILExceptionBlock.CATCH;
  47. handlers [i].start = offset;
  48. handlers [i].extype = extype;
  49. }
  50. internal void AddFinally (int offset) {
  51. int i;
  52. End (offset);
  53. add_block (offset);
  54. i = handlers.Length - 1;
  55. handlers [i].type = ILExceptionBlock.FINALLY;
  56. handlers [i].start = offset;
  57. handlers [i].extype = null;
  58. }
  59. internal void End (int offset) {
  60. if (handlers == null)
  61. return;
  62. int i = handlers.Length - 1;
  63. if (i >= 0)
  64. handlers [i].len = offset - handlers [i].start;
  65. }
  66. internal int LastClauseType () {
  67. if (handlers != null)
  68. return handlers [handlers.Length-1].type;
  69. else
  70. return ILExceptionBlock.CATCH;
  71. }
  72. internal void Debug (int b) {
  73. #if NO
  74. System.Console.WriteLine ("Handler {0} at {1}, len: {2}", b, start, len);
  75. for (int i = 0; i < handlers.Length; ++i)
  76. handlers [i].Debug ();
  77. #endif
  78. }
  79. void add_block (int offset) {
  80. if (handlers != null) {
  81. int i = handlers.Length;
  82. ILExceptionBlock[] new_b = new ILExceptionBlock [i + 1];
  83. System.Array.Copy (handlers, new_b, i);
  84. handlers = new_b;
  85. handlers [i].len = offset - handlers [i].start;
  86. } else {
  87. handlers = new ILExceptionBlock [1];
  88. len = offset - start;
  89. }
  90. }
  91. }
  92. internal struct ILTokenInfo {
  93. public MemberInfo member;
  94. public int code_pos;
  95. }
  96. public class ILGenerator: Object {
  97. private struct LabelFixup {
  98. public int size;
  99. public int pos; // the location of the fixup
  100. public int label_base; // the base address for this fixup
  101. public int label_idx;
  102. };
  103. static Type void_type = typeof (void);
  104. private byte[] code;
  105. private MethodBase mbuilder; /* a MethodBuilder or ConstructorBuilder */
  106. private int code_len;
  107. private int max_stack;
  108. private int cur_stack;
  109. private LocalBuilder[] locals;
  110. private ILExceptionInfo[] ex_handlers;
  111. private int num_token_fixups;
  112. private ILTokenInfo[] token_fixups;
  113. private int[] label_to_addr;
  114. private int num_labels;
  115. private LabelFixup[] fixups;
  116. private int num_fixups;
  117. private ModuleBuilder module;
  118. private AssemblyBuilder abuilder;
  119. private ISymbolWriter sym_writer;
  120. private Stack scopes;
  121. private int cur_block;
  122. private Stack open_blocks;
  123. internal ILGenerator (MethodBase mb, int size) {
  124. if (size < 0)
  125. size = 256;
  126. code_len = 0;
  127. code = new byte [size];
  128. mbuilder = mb;
  129. cur_stack = max_stack = 0;
  130. num_fixups = num_labels = 0;
  131. label_to_addr = new int [16];
  132. fixups = new LabelFixup [16];
  133. token_fixups = new ILTokenInfo [16];
  134. scopes = new Stack ();
  135. num_token_fixups = 0;
  136. if (mb is MethodBuilder) {
  137. module = (ModuleBuilder)((MethodBuilder)mb).TypeBuilder.Module;
  138. } else if (mb is ConstructorBuilder) {
  139. module = (ModuleBuilder)((ConstructorBuilder)mb).TypeBuilder.Module;
  140. }
  141. abuilder = (AssemblyBuilder)module.Assembly;
  142. sym_writer = module.GetSymWriter ();
  143. open_blocks = new Stack ();
  144. }
  145. private void add_token_fixup (MemberInfo mi) {
  146. if (num_token_fixups == token_fixups.Length) {
  147. ILTokenInfo[] ntf = new ILTokenInfo [num_token_fixups * 2];
  148. token_fixups.CopyTo (ntf, 0);
  149. token_fixups = ntf;
  150. }
  151. token_fixups [num_token_fixups].member = mi;
  152. token_fixups [num_token_fixups++].code_pos = code_len;
  153. }
  154. private void make_room (int nbytes) {
  155. if (code_len + nbytes < code.Length)
  156. return;
  157. byte[] new_code = new byte [(code_len + nbytes) * 2 + 128];
  158. System.Array.Copy (code, 0, new_code, 0, code.Length);
  159. code = new_code;
  160. }
  161. private void emit_int (int val) {
  162. code [code_len++] = (byte) (val & 0xFF);
  163. code [code_len++] = (byte) ((val >> 8) & 0xFF);
  164. code [code_len++] = (byte) ((val >> 16) & 0xFF);
  165. code [code_len++] = (byte) ((val >> 24) & 0xFF);
  166. }
  167. /* change to pass by ref to avoid copy */
  168. private void ll_emit (OpCode opcode) {
  169. /*
  170. * there is already enough room allocated in code.
  171. */
  172. // access op1 and op2 directly since the Value property is useless
  173. if (opcode.Size == 2)
  174. code [code_len++] = opcode.op1;
  175. code [code_len++] = opcode.op2;
  176. /*
  177. * We should probably keep track of stack needs here.
  178. * Or we may want to run the verifier on the code before saving it
  179. * (this may be needed anyway when the ILGenerator is not used...).
  180. */
  181. switch (opcode.StackBehaviourPush) {
  182. case StackBehaviour.Push1:
  183. case StackBehaviour.Pushi:
  184. case StackBehaviour.Pushi8:
  185. case StackBehaviour.Pushr4:
  186. case StackBehaviour.Pushr8:
  187. case StackBehaviour.Pushref:
  188. case StackBehaviour.Varpush: /* again we are conservative and assume it pushes 1 */
  189. cur_stack ++;
  190. break;
  191. case StackBehaviour.Push1_push1:
  192. cur_stack += 2;
  193. break;
  194. }
  195. if (max_stack < cur_stack)
  196. max_stack = cur_stack;
  197. /*
  198. * Note that we adjust for the pop behaviour _after_ setting max_stack.
  199. */
  200. switch (opcode.StackBehaviourPop) {
  201. case StackBehaviour.Varpop:
  202. break; /* we are conservative and assume it doesn't decrease the stack needs */
  203. case StackBehaviour.Pop1:
  204. case StackBehaviour.Popi:
  205. case StackBehaviour.Popref:
  206. cur_stack --;
  207. break;
  208. case StackBehaviour.Pop1_pop1:
  209. case StackBehaviour.Popi_pop1:
  210. case StackBehaviour.Popi_popi:
  211. case StackBehaviour.Popi_popi8:
  212. case StackBehaviour.Popi_popr4:
  213. case StackBehaviour.Popi_popr8:
  214. case StackBehaviour.Popref_pop1:
  215. case StackBehaviour.Popref_popi:
  216. cur_stack -= 2;
  217. break;
  218. case StackBehaviour.Popi_popi_popi:
  219. case StackBehaviour.Popref_popi_popi:
  220. case StackBehaviour.Popref_popi_popi8:
  221. case StackBehaviour.Popref_popi_popr4:
  222. case StackBehaviour.Popref_popi_popr8:
  223. case StackBehaviour.Popref_popi_popref:
  224. cur_stack -= 3;
  225. break;
  226. }
  227. }
  228. private static int target_len (OpCode opcode) {
  229. if (opcode.operandType == OperandType.InlineBrTarget)
  230. return 4;
  231. return 1;
  232. }
  233. private void InternalEndClause () {
  234. switch (ex_handlers [cur_block].LastClauseType ()) {
  235. case ILExceptionBlock.CATCH:
  236. // how could we optimize code size here?
  237. Emit (OpCodes.Leave, ex_handlers [cur_block].end);
  238. break;
  239. case ILExceptionBlock.FAULT:
  240. case ILExceptionBlock.FINALLY:
  241. Emit (OpCodes.Endfinally);
  242. break;
  243. case ILExceptionBlock.FILTER:
  244. Emit (OpCodes.Endfilter);
  245. break;
  246. }
  247. }
  248. public virtual void BeginCatchBlock (Type exceptionType) {
  249. if (open_blocks.Count <= 0)
  250. throw new NotSupportedException ("Not in an exception block");
  251. InternalEndClause ();
  252. ex_handlers [cur_block].AddCatch (exceptionType, code_len);
  253. //System.Console.WriteLine ("Begin catch Block: "+exceptionType.ToString());
  254. //throw new NotImplementedException ();
  255. }
  256. public virtual void BeginExceptFilterBlock () {
  257. throw new NotImplementedException ();
  258. }
  259. public virtual Label BeginExceptionBlock () {
  260. //System.Console.WriteLine ("Begin Block");
  261. if (ex_handlers != null) {
  262. cur_block = ex_handlers.Length;
  263. ILExceptionInfo[] new_ex = new ILExceptionInfo [cur_block + 1];
  264. System.Array.Copy (ex_handlers, new_ex, cur_block);
  265. ex_handlers = new_ex;
  266. } else {
  267. ex_handlers = new ILExceptionInfo [1];
  268. cur_block = 0;
  269. }
  270. open_blocks.Push (cur_block);
  271. ex_handlers [cur_block].start = code_len;
  272. return ex_handlers [cur_block].end = DefineLabel ();
  273. }
  274. public virtual void BeginFaultBlock() {
  275. if (open_blocks.Count <= 0)
  276. throw new NotSupportedException ("Not in an exception block");
  277. //System.Console.WriteLine ("Begin fault Block");
  278. //throw new NotImplementedException ();
  279. }
  280. public virtual void BeginFinallyBlock() {
  281. if (open_blocks.Count <= 0)
  282. throw new NotSupportedException ("Not in an exception block");
  283. InternalEndClause ();
  284. //System.Console.WriteLine ("Begin finally Block");
  285. ex_handlers [cur_block].AddFinally (code_len);
  286. }
  287. public virtual void BeginScope () {
  288. if (sym_writer != null)
  289. scopes.Push (sym_writer.OpenScope (code_len));
  290. }
  291. public LocalBuilder DeclareLocal (Type localType) {
  292. LocalBuilder res = new LocalBuilder (module, localType);
  293. if (locals != null) {
  294. LocalBuilder[] new_l = new LocalBuilder [locals.Length + 1];
  295. System.Array.Copy (locals, new_l, locals.Length);
  296. new_l [locals.Length] = res;
  297. locals = new_l;
  298. } else {
  299. locals = new LocalBuilder [1];
  300. locals [0] = res;
  301. }
  302. res.position = (uint)(locals.Length - 1);
  303. return res;
  304. }
  305. public virtual Label DefineLabel () {
  306. if (num_labels >= label_to_addr.Length) {
  307. int[] new_l = new int [label_to_addr.Length * 2];
  308. System.Array.Copy (label_to_addr, new_l, label_to_addr.Length);
  309. label_to_addr = new_l;
  310. }
  311. label_to_addr [num_labels] = -1;
  312. return new Label (num_labels++);
  313. }
  314. public virtual void Emit (OpCode opcode) {
  315. make_room (2);
  316. ll_emit (opcode);
  317. }
  318. public virtual void Emit (OpCode opcode, Byte val) {
  319. make_room (3);
  320. ll_emit (opcode);
  321. code [code_len++] = val;
  322. }
  323. public virtual void Emit (OpCode opcode, ConstructorInfo constructor) {
  324. int token = abuilder.GetToken (constructor);
  325. make_room (6);
  326. ll_emit (opcode);
  327. if (constructor is ConstructorBuilder)
  328. add_token_fixup (constructor);
  329. emit_int (token);
  330. ParameterInfo[] mparams = constructor.GetParameters();
  331. if (mparams != null)
  332. cur_stack -= mparams.Length;
  333. }
  334. public virtual void Emit (OpCode opcode, Double val) {
  335. byte[] s = System.BitConverter.GetBytes (val);
  336. make_room (10);
  337. ll_emit (opcode);
  338. System.Array.Copy (s, 0, code, code_len, 8);
  339. code_len += 8;
  340. }
  341. public virtual void Emit (OpCode opcode, FieldInfo field) {
  342. int token = abuilder.GetToken (field);
  343. make_room (6);
  344. ll_emit (opcode);
  345. if (field is FieldBuilder)
  346. add_token_fixup (field);
  347. emit_int (token);
  348. }
  349. public virtual void Emit (OpCode opcode, Int16 val) {
  350. make_room (4);
  351. ll_emit (opcode);
  352. code [code_len++] = (byte) (val & 0xFF);
  353. code [code_len++] = (byte) ((val >> 8) & 0xFF);
  354. }
  355. public virtual void Emit (OpCode opcode, Int32 val) {
  356. make_room (6);
  357. ll_emit (opcode);
  358. emit_int (val);
  359. }
  360. public virtual void Emit (OpCode opcode, Int64 val) {
  361. make_room (10);
  362. ll_emit (opcode);
  363. code [code_len++] = (byte) (val & 0xFF);
  364. code [code_len++] = (byte) ((val >> 8) & 0xFF);
  365. code [code_len++] = (byte) ((val >> 16) & 0xFF);
  366. code [code_len++] = (byte) ((val >> 24) & 0xFF);
  367. code [code_len++] = (byte) ((val >> 32) & 0xFF);
  368. code [code_len++] = (byte) ((val >> 40) & 0xFF);
  369. code [code_len++] = (byte) ((val >> 48) & 0xFF);
  370. code [code_len++] = (byte) ((val >> 56) & 0xFF);
  371. }
  372. public virtual void Emit (OpCode opcode, Label label) {
  373. int tlen = target_len (opcode);
  374. make_room (6);
  375. ll_emit (opcode);
  376. if (num_fixups >= fixups.Length) {
  377. LabelFixup[] newf = new LabelFixup [fixups.Length + 16];
  378. System.Array.Copy (fixups, newf, fixups.Length);
  379. fixups = newf;
  380. }
  381. fixups [num_fixups].size = tlen;
  382. fixups [num_fixups].pos = code_len;
  383. fixups [num_fixups].label_base = code_len;
  384. fixups [num_fixups].label_idx = label.label;
  385. num_fixups++;
  386. code_len += tlen;
  387. }
  388. public virtual void Emit (OpCode opcode, Label[] labels) {
  389. /* opcode needs to be switch. */
  390. int count = labels.Length;
  391. make_room (6 + count * 4);
  392. ll_emit (opcode);
  393. int switch_base = code_len + count*4;
  394. emit_int (count);
  395. if (num_fixups + count >= fixups.Length) {
  396. LabelFixup[] newf = new LabelFixup [fixups.Length + count + 16];
  397. System.Array.Copy (fixups, newf, fixups.Length);
  398. fixups = newf;
  399. }
  400. for (int i = 0; i < count; ++i) {
  401. fixups [num_fixups].size = 4;
  402. fixups [num_fixups].pos = code_len;
  403. fixups [num_fixups].label_base = switch_base;
  404. fixups [num_fixups].label_idx = labels [i].label;
  405. num_fixups++;
  406. code_len += 4;
  407. }
  408. }
  409. public virtual void Emit (OpCode opcode, LocalBuilder lbuilder) {
  410. uint pos = lbuilder.position;
  411. bool load_addr = false;
  412. bool is_store = false;
  413. make_room (6);
  414. /* inline the code from ll_emit () to optimize il code size */
  415. if (opcode.StackBehaviourPop == StackBehaviour.Pop1) {
  416. cur_stack --;
  417. is_store = true;
  418. } else {
  419. cur_stack++;
  420. if (cur_stack > max_stack)
  421. max_stack = cur_stack;
  422. load_addr = opcode.StackBehaviourPush == StackBehaviour.Pushi;
  423. }
  424. if (load_addr) {
  425. if (pos < 256) {
  426. code [code_len++] = (byte)0x12;
  427. code [code_len++] = (byte)pos;
  428. } else {
  429. code [code_len++] = (byte)0xfe;
  430. code [code_len++] = (byte)0x0d;
  431. code [code_len++] = (byte)(pos & 0xff);
  432. code [code_len++] = (byte)((pos >> 8) & 0xff);
  433. }
  434. } else {
  435. if (is_store) {
  436. if (pos < 4) {
  437. code [code_len++] = (byte)(0x0a + pos);
  438. } else if (pos < 256) {
  439. code [code_len++] = (byte)0x13;
  440. code [code_len++] = (byte)pos;
  441. } else {
  442. code [code_len++] = (byte)0xfe;
  443. code [code_len++] = (byte)0x0e;
  444. code [code_len++] = (byte)(pos & 0xff);
  445. code [code_len++] = (byte)((pos >> 8) & 0xff);
  446. }
  447. } else {
  448. if (pos < 4) {
  449. code [code_len++] = (byte)(0x06 + pos);
  450. } else if (pos < 256) {
  451. code [code_len++] = (byte)0x11;
  452. code [code_len++] = (byte)pos;
  453. } else {
  454. code [code_len++] = (byte)0xfe;
  455. code [code_len++] = (byte)0x0c;
  456. code [code_len++] = (byte)(pos & 0xff);
  457. code [code_len++] = (byte)((pos >> 8) & 0xff);
  458. }
  459. }
  460. }
  461. }
  462. public virtual void Emit (OpCode opcode, MethodInfo method) {
  463. int token = abuilder.GetToken (method);
  464. make_room (6);
  465. ll_emit (opcode);
  466. if (method is MethodBuilder)
  467. add_token_fixup (method);
  468. emit_int (token);
  469. if (method.ReturnType == void_type)
  470. cur_stack --;
  471. ParameterInfo[] mparams = method.GetParameters();
  472. if (mparams != null)
  473. cur_stack -= mparams.Length;
  474. }
  475. [CLSCompliant(false)]
  476. public void Emit (OpCode opcode, sbyte val) {
  477. make_room (3);
  478. ll_emit (opcode);
  479. code [code_len++] = (byte)val;
  480. }
  481. [MonoTODO]
  482. public virtual void Emit (OpCode opcode, SignatureHelper shelper) {
  483. int token = 0; // FIXME: request a token from the modulebuilder
  484. make_room (6);
  485. ll_emit (opcode);
  486. emit_int (token);
  487. }
  488. public virtual void Emit (OpCode opcode, float val) {
  489. byte[] s = System.BitConverter.GetBytes (val);
  490. make_room (6);
  491. ll_emit (opcode);
  492. System.Array.Copy (s, 0, code, code_len, 4);
  493. code_len += 4;
  494. }
  495. public virtual void Emit (OpCode opcode, string val) {
  496. int token = abuilder.GetToken (val);
  497. make_room (6);
  498. ll_emit (opcode);
  499. emit_int (token);
  500. }
  501. public virtual void Emit (OpCode opcode, Type type) {
  502. make_room (6);
  503. ll_emit (opcode);
  504. emit_int (abuilder.GetToken (type));
  505. }
  506. public void EmitCall (OpCode opcode, MethodInfo methodinfo, Type[] optionalParamTypes) {
  507. throw new NotImplementedException ();
  508. }
  509. public void EmitCalli (OpCode opcode, CallingConventions call_conv, Type returnType, Type[] paramTypes, Type[] optionalParamTypes) {
  510. throw new NotImplementedException ();
  511. }
  512. public virtual void EmitWriteLine (FieldInfo field) {
  513. throw new NotImplementedException ();
  514. }
  515. public virtual void EmitWriteLine (LocalBuilder lbuilder) {
  516. throw new NotImplementedException ();
  517. }
  518. public virtual void EmitWriteLine (string val) {
  519. throw new NotImplementedException ();
  520. }
  521. public virtual void EndExceptionBlock () {
  522. if (open_blocks.Count <= 0)
  523. throw new NotSupportedException ("Not in an exception block");
  524. InternalEndClause ();
  525. MarkLabel (ex_handlers [cur_block].end);
  526. ex_handlers [cur_block].End (code_len);
  527. ex_handlers [cur_block].Debug (cur_block);
  528. //System.Console.WriteLine ("End Block {0} (handlers: {1})", cur_block, ex_handlers [cur_block].NumHandlers ());
  529. open_blocks.Pop ();
  530. if (open_blocks.Count > 0)
  531. cur_block = (int)open_blocks.Peek ();
  532. //Console.WriteLine ("curblock restored to {0}", cur_block);
  533. //throw new NotImplementedException ();
  534. }
  535. public virtual void EndScope () {
  536. if (sym_writer != null) {
  537. sym_writer.CloseScope (code_len);
  538. scopes.Pop ();
  539. }
  540. }
  541. public virtual void MarkLabel (Label loc) {
  542. if (loc.label < 0 || loc.label >= num_labels)
  543. throw new System.ArgumentException ("The label is not valid");
  544. if (label_to_addr [loc.label] >= 0)
  545. throw new System.ArgumentException ("The label was already defined");
  546. label_to_addr [loc.label] = code_len;
  547. }
  548. public virtual void MarkSequencePoint (ISymbolDocumentWriter document, int startLine,
  549. int startColumn, int endLine, int endColumn) {
  550. if (sym_writer == null)
  551. return;
  552. int[] offsets = { code_len };
  553. int[] startLines = { startLine };
  554. int[] startColumns = { startColumn };
  555. int[] endLines = { endLine };
  556. int[] endColumns = { endColumn };
  557. sym_writer.DefineSequencePoints (document, offsets, startLines, startColumns,
  558. endLines, endColumns);
  559. }
  560. public virtual void ThrowException (Type exceptionType) {
  561. throw new NotImplementedException ();
  562. }
  563. public void UsingNamespace (String usingNamespace) {
  564. throw new NotImplementedException ();
  565. }
  566. internal void label_fixup () {
  567. int i;
  568. for (i = 0; i < num_fixups; ++i) {
  569. int diff = label_to_addr [fixups [i].label_idx] - fixups [i].label_base;
  570. if (fixups [i].size == 1) {
  571. code [fixups [i].pos] = (byte)((sbyte) diff - 1);
  572. } else {
  573. int old_cl = code_len;
  574. code_len = fixups [i].pos;
  575. emit_int (diff - 4);
  576. code_len = old_cl;
  577. }
  578. }
  579. }
  580. }
  581. }