001
002/*
003 * THIS FILE IS MACHINE_GENERATED. DO NOT EDIT.
004 * See InstructionFormats.template, InstructionFormatList.dat,
005 * OperatorList.dat, etc.
006 */
007
008package org.jikesrvm.compilers.opt.ir.ppc;
009
010import org.jikesrvm.Configuration;
011import org.jikesrvm.compilers.opt.ir.operand.ppc.PowerPCConditionOperand;
012import org.jikesrvm.compilers.opt.ir.operand.ppc.PowerPCTrapOperand;
013import org.jikesrvm.compilers.opt.ir.operand.*;
014import org.jikesrvm.compilers.opt.ir.Instruction;
015import org.jikesrvm.compilers.opt.ir.Operator;
016
017/**
018 * The MIR_Call InstructionFormat class.
019 *
020 * The header comment for {@link Instruction} contains
021 * an explanation of the role of InstructionFormats in the
022 * opt compiler's IR.
023 */
024@SuppressWarnings("unused")  // Machine generated code is never 100% clean
025public final class MIR_Call extends ArchInstructionFormat {
026  /**
027   * InstructionFormat identification method for MIR_Call.
028   * @param i an instruction
029   * @return <code>true</code> if the InstructionFormat of the argument
030   *         instruction is MIR_Call or <code>false</code>
031   *         if it is not.
032   */
033  public static boolean conforms(Instruction i) {
034    return conforms(i.operator());
035  }
036  /**
037   * InstructionFormat identification method for MIR_Call.
038   * @param o an instruction
039   * @return <code>true</code> if the InstructionFormat of the argument
040   *         operator is MIR_Call or <code>false</code>
041   *         if it is not.
042   */
043  public static boolean conforms(Operator o) {
044    return o.format == MIR_Call_format;
045  }
046
047  /**
048   * Get the operand called Result from the
049   * argument instruction. Note that the returned operand
050   * will still point to its containing instruction.
051   * @param i the instruction to fetch the operand from
052   * @return the operand called Result
053   */
054  public static RegisterOperand getResult(Instruction i) {
055    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
056    return (RegisterOperand) i.getOperand(0);
057  }
058  /**
059   * Get the operand called Result from the argument
060   * instruction clearing its instruction pointer. The returned
061   * operand will not point to any containing instruction.
062   * @param i the instruction to fetch the operand from
063   * @return the operand called Result
064   */
065  public static RegisterOperand getClearResult(Instruction i) {
066    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
067    return (RegisterOperand) i.getClearOperand(0);
068  }
069  /**
070   * Set the operand called Result in the argument
071   * instruction to the argument operand. The operand will
072   * now point to the argument instruction as its containing
073   * instruction.
074   * @param i the instruction in which to store the operand
075   * @param Result the operand to store
076   */
077  public static void setResult(Instruction i, RegisterOperand Result) {
078    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
079    i.putOperand(0, Result);
080  }
081  /**
082   * Return the index of the operand called Result
083   * in the argument instruction.
084   * @param i the instruction to access.
085   * @return the index of the operand called Result
086   *         in the argument instruction
087   */
088  public static int indexOfResult(Instruction i) {
089    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
090    return 0;
091  }
092  /**
093   * Does the argument instruction have a non-null
094   * operand named Result?
095   * @param i the instruction to access.
096   * @return <code>true</code> if the instruction has an non-null
097   *         operand named Result or <code>false</code>
098   *         if it does not.
099   */
100  public static boolean hasResult(Instruction i) {
101    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
102    return i.getOperand(0) != null;
103  }
104
105  /**
106   * Get the operand called Result2 from the
107   * argument instruction. Note that the returned operand
108   * will still point to its containing instruction.
109   * @param i the instruction to fetch the operand from
110   * @return the operand called Result2
111   */
112  public static RegisterOperand getResult2(Instruction i) {
113    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
114    return (RegisterOperand) i.getOperand(1);
115  }
116  /**
117   * Get the operand called Result2 from the argument
118   * instruction clearing its instruction pointer. The returned
119   * operand will not point to any containing instruction.
120   * @param i the instruction to fetch the operand from
121   * @return the operand called Result2
122   */
123  public static RegisterOperand getClearResult2(Instruction i) {
124    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
125    return (RegisterOperand) i.getClearOperand(1);
126  }
127  /**
128   * Set the operand called Result2 in the argument
129   * instruction to the argument operand. The operand will
130   * now point to the argument instruction as its containing
131   * instruction.
132   * @param i the instruction in which to store the operand
133   * @param Result2 the operand to store
134   */
135  public static void setResult2(Instruction i, RegisterOperand Result2) {
136    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
137    i.putOperand(1, Result2);
138  }
139  /**
140   * Return the index of the operand called Result2
141   * in the argument instruction.
142   * @param i the instruction to access.
143   * @return the index of the operand called Result2
144   *         in the argument instruction
145   */
146  public static int indexOfResult2(Instruction i) {
147    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
148    return 1;
149  }
150  /**
151   * Does the argument instruction have a non-null
152   * operand named Result2?
153   * @param i the instruction to access.
154   * @return <code>true</code> if the instruction has an non-null
155   *         operand named Result2 or <code>false</code>
156   *         if it does not.
157   */
158  public static boolean hasResult2(Instruction i) {
159    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
160    return i.getOperand(1) != null;
161  }
162
163  /**
164   * Get the operand called Target from the
165   * argument instruction. Note that the returned operand
166   * will still point to its containing instruction.
167   * @param i the instruction to fetch the operand from
168   * @return the operand called Target
169   */
170  public static BranchOperand getTarget(Instruction i) {
171    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
172    return (BranchOperand) i.getOperand(2);
173  }
174  /**
175   * Get the operand called Target from the argument
176   * instruction clearing its instruction pointer. The returned
177   * operand will not point to any containing instruction.
178   * @param i the instruction to fetch the operand from
179   * @return the operand called Target
180   */
181  public static BranchOperand getClearTarget(Instruction i) {
182    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
183    return (BranchOperand) i.getClearOperand(2);
184  }
185  /**
186   * Set the operand called Target in the argument
187   * instruction to the argument operand. The operand will
188   * now point to the argument instruction as its containing
189   * instruction.
190   * @param i the instruction in which to store the operand
191   * @param Target the operand to store
192   */
193  public static void setTarget(Instruction i, BranchOperand Target) {
194    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
195    i.putOperand(2, Target);
196  }
197  /**
198   * Return the index of the operand called Target
199   * in the argument instruction.
200   * @param i the instruction to access.
201   * @return the index of the operand called Target
202   *         in the argument instruction
203   */
204  public static int indexOfTarget(Instruction i) {
205    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
206    return 2;
207  }
208  /**
209   * Does the argument instruction have a non-null
210   * operand named Target?
211   * @param i the instruction to access.
212   * @return <code>true</code> if the instruction has an non-null
213   *         operand named Target or <code>false</code>
214   *         if it does not.
215   */
216  public static boolean hasTarget(Instruction i) {
217    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
218    return i.getOperand(2) != null;
219  }
220
221  /**
222   * Get the operand called Method from the
223   * argument instruction. Note that the returned operand
224   * will still point to its containing instruction.
225   * @param i the instruction to fetch the operand from
226   * @return the operand called Method
227   */
228  public static MethodOperand getMethod(Instruction i) {
229    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
230    return (MethodOperand) i.getOperand(3);
231  }
232  /**
233   * Get the operand called Method from the argument
234   * instruction clearing its instruction pointer. The returned
235   * operand will not point to any containing instruction.
236   * @param i the instruction to fetch the operand from
237   * @return the operand called Method
238   */
239  public static MethodOperand getClearMethod(Instruction i) {
240    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
241    return (MethodOperand) i.getClearOperand(3);
242  }
243  /**
244   * Set the operand called Method in the argument
245   * instruction to the argument operand. The operand will
246   * now point to the argument instruction as its containing
247   * instruction.
248   * @param i the instruction in which to store the operand
249   * @param Method the operand to store
250   */
251  public static void setMethod(Instruction i, MethodOperand Method) {
252    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
253    i.putOperand(3, Method);
254  }
255  /**
256   * Return the index of the operand called Method
257   * in the argument instruction.
258   * @param i the instruction to access.
259   * @return the index of the operand called Method
260   *         in the argument instruction
261   */
262  public static int indexOfMethod(Instruction i) {
263    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
264    return 3;
265  }
266  /**
267   * Does the argument instruction have a non-null
268   * operand named Method?
269   * @param i the instruction to access.
270   * @return <code>true</code> if the instruction has an non-null
271   *         operand named Method or <code>false</code>
272   *         if it does not.
273   */
274  public static boolean hasMethod(Instruction i) {
275    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
276    return i.getOperand(3) != null;
277  }
278
279  /**
280   * Get the k'th operand called Param from the
281   * argument instruction. Note that the returned operand
282   * will still point to its containing instruction.
283   * @param i the instruction to fetch the operand from
284   * @param k the index of the operand
285   * @return the k'th operand called Param
286   */
287  public static Operand getParam(Instruction i, int k) {
288    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
289    return (Operand) i.getOperand(4+k);
290  }
291  /**
292   * Get the k'th operand called Param from the argument
293   * instruction clearing its instruction pointer. The returned
294   * operand will not point to any containing instruction.
295   * @param i the instruction to fetch the operand from
296   * @param k the index of the operand
297   * @return the k'th operand called Param
298   */
299  public static Operand getClearParam(Instruction i, int k) {
300    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
301    return (Operand) i.getClearOperand(4+k);
302  }
303  /**
304   * Set the k'th operand called Param in the argument
305   * instruction to the argument operand. The operand will
306   * now point to the argument instruction as its containing
307   * instruction.
308   * @param i the instruction in which to store the operand
309   * @param k the index of the operand
310   * @param o the operand to store
311   */
312  public static void setParam(Instruction i, int k, Operand o) {
313    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
314    i.putOperand(4+k, o);
315  }
316  /**
317   * Return the index of the k'th operand called Param
318   * in the argument instruction.
319   * @param i the instruction to access.
320   * @param k the index of the operand.
321   * @return the index of the k'th operand called Param
322   *         in the argument instruction
323   */
324  public static int indexOfParam(Instruction i, int k) {
325    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
326    return 4+k;
327  }
328  /**
329   * Does the argument instruction have a non-null
330   * k'th operand named Param?
331   * @param i the instruction to access.
332   * @param k the index of the operand.
333   * @return <code>true</code> if the instruction has an non-null
334   *         k'th operand named Param or <code>false</code>
335   *         if it does not.
336   */
337  public static boolean hasParam(Instruction i, int k) {
338    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
339    return i.getOperand(4+k) != null;
340  }
341
342  /**
343   * Return the index of the first operand called Param
344   * in the argument instruction.
345   * @param i the instruction to access.
346   * @return the index of the first operand called Param
347   *         in the argument instruction
348   */
349  public static int indexOfParams(Instruction i)
350  {
351    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
352    return 4;
353  }
354  /**
355   * Does the argument instruction have any operands
356   * named Param?
357   * @param i the instruction to access.
358   * @return <code>true</code> if the instruction has operands
359   *         named Param or <code>false</code> if it does not.
360   */
361  public static boolean hasParams(Instruction i)
362  {
363    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
364    return i.getNumberOfOperands()-4 > 0 && i.getOperand(4) != null;
365  }
366
367  /**
368   * How many variable-length operands called Params
369   * does the argument instruction have?
370   * @param i the instruction to access
371   * @return the number of operands called Params the instruction has
372   */
373  public static int getNumberOfParams(Instruction i)
374  {
375    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
376    return i.getNumberOfOperands()-4;
377  }
378
379  /**
380   * Change the number of Params that may be stored in
381   * the argument instruction to numVarOps.
382   * @param i the instruction to access
383   * @param numVarOps the new number of variable operands called Params
384   *        that may be stored in the instruction
385   */
386  public static void resizeNumberOfParams(Instruction i, int numVarOps)
387  {
388    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call");
389  if (4+numVarOps>MIN_OPERAND_ARRAY_LENGTH)
390    i.resizeNumberOfOperands(4+numVarOps);
391  else
392    for (int j = 4+numVarOps; j < MIN_OPERAND_ARRAY_LENGTH; j++)
393      i.putOperand(j, null);
394  }
395
396  /**
397   * Create an instruction of the MIR_Call instruction format.
398   * @param o the instruction's operator
399   * @param Result the instruction's Result operand
400   * @param Result2 the instruction's Result2 operand
401   * @param Target the instruction's Target operand
402   * @param Method the instruction's Method operand
403   * @param numVarOps the number of variable length operands that
404   *                 will be stored in the insruction.
405   * @return the newly created MIR_Call instruction
406   */
407  public static Instruction create(Operator o
408                   , RegisterOperand Result
409                   , RegisterOperand Result2
410                   , BranchOperand Target
411                   , MethodOperand Method
412                   , int numVarOps
413                )
414  {
415    if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call");
416    Instruction i = Instruction.create(o, Math.max(4+numVarOps, MIN_OPERAND_ARRAY_LENGTH));
417    i.putOperand(0, Result);
418    i.putOperand(1, Result2);
419    i.putOperand(2, Target);
420    i.putOperand(3, Method);
421    return i;
422  }
423  /**
424   * Create an instruction of the MIR_Call instruction format
425   * with 0 variable arguments.
426   * @param o the instruction's operator
427   * @param Result the instruction's Result operand
428   * @param Result2 the instruction's Result2 operand
429   * @param Target the instruction's Target operand
430   * @param Method the instruction's Method operand
431   * @return the newly created MIR_Call instruction
432   */
433  public static Instruction create0(Operator o
434                   , RegisterOperand Result
435                   , RegisterOperand Result2
436                   , BranchOperand Target
437                   , MethodOperand Method
438                )
439  {
440    if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call");
441    Instruction i = Instruction.create(o, 5);
442    i.putOperand(0, Result);
443    i.putOperand(1, Result2);
444    i.putOperand(2, Target);
445    i.putOperand(3, Method);
446    return i;
447  }
448
449  /**
450   * Mutate the argument instruction into an instruction of the
451   * MIR_Call instruction format having the specified
452   * operator and operands.
453   * @param i the instruction to mutate
454   * @param o the instruction's operator
455   * @param Result the instruction's Result operand
456   * @param Result2 the instruction's Result2 operand
457   * @param Target the instruction's Target operand
458   * @param Method the instruction's Method operand
459   * @param numVarOps the number of variable length operands that
460   *                  will be stored in the insruction.
461   * @return the mutated instruction
462   */
463  public static Instruction mutate(Instruction i, Operator o
464                   , RegisterOperand Result
465                   , RegisterOperand Result2
466                   , BranchOperand Target
467                   , MethodOperand Method
468                   , int numVarOps
469                )
470  {
471    if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call");
472    if (4+numVarOps>MIN_OPERAND_ARRAY_LENGTH)
473      i.resizeNumberOfOperands(4+numVarOps);
474
475    i.changeOperatorTo(o);
476    i.putOperand(0, Result);
477    i.putOperand(1, Result2);
478    i.putOperand(2, Target);
479    i.putOperand(3, Method);
480    return i;
481  }
482  /**
483   * Mutate the argument instruction into an instruction of the
484   * MIR_Call instruction format having the specified
485   * operator, operands, and number of variable-length operands.
486   * @param i the instruction to mutate
487   * @param o the instruction's operator
488   * @param Result the instruction's Result operand
489   * @param Result2 the instruction's Result2 operand
490   * @param Target the instruction's Target operand
491   * @param Method the instruction's Method operand
492   * @return the mutated instruction
493   */
494  public static Instruction mutate0(Instruction i, Operator o
495                   , RegisterOperand Result
496                   , RegisterOperand Result2
497                   , BranchOperand Target
498                   , MethodOperand Method
499                )
500  {
501    if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call");
502    i.changeOperatorTo(o);
503    i.putOperand(0, Result);
504    i.putOperand(1, Result2);
505    i.putOperand(2, Target);
506    i.putOperand(3, Method);
507    return i;
508  }
509  /**
510   * Create an instruction of the MIR_Call instruction format.
511   * @param o the instruction's operator
512   * @param Result the instruction's Result operand
513   * @param Result2 the instruction's Result2 operand
514   * @param Target the instruction's Target operand
515   * @param numVarOps the number of variable length operands that
516   *                 will be stored in the insruction.
517   * @return the newly created MIR_Call instruction
518   */
519  public static Instruction create(Operator o
520                   , RegisterOperand Result
521                   , RegisterOperand Result2
522                   , BranchOperand Target
523                   , int numVarOps
524                )
525  {
526    if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call");
527    Instruction i = Instruction.create(o, Math.max(4+numVarOps, MIN_OPERAND_ARRAY_LENGTH));
528    i.putOperand(0, Result);
529    i.putOperand(1, Result2);
530    i.putOperand(2, Target);
531    return i;
532  }
533  /**
534   * Create an instruction of the MIR_Call instruction format
535   * with 0 variable arguments.
536   * @param o the instruction's operator
537   * @param Result the instruction's Result operand
538   * @param Result2 the instruction's Result2 operand
539   * @param Target the instruction's Target operand
540   * @return the newly created MIR_Call instruction
541   */
542  public static Instruction create0(Operator o
543                   , RegisterOperand Result
544                   , RegisterOperand Result2
545                   , BranchOperand Target
546                )
547  {
548    if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call");
549    Instruction i = Instruction.create(o, 5);
550    i.putOperand(0, Result);
551    i.putOperand(1, Result2);
552    i.putOperand(2, Target);
553    return i;
554  }
555
556  /**
557   * Mutate the argument instruction into an instruction of the
558   * MIR_Call instruction format having the specified
559   * operator and operands.
560   * @param i the instruction to mutate
561   * @param o the instruction's operator
562   * @param Result the instruction's Result operand
563   * @param Result2 the instruction's Result2 operand
564   * @param Target the instruction's Target operand
565   * @param numVarOps the number of variable length operands that
566   *                  will be stored in the insruction.
567   * @return the mutated instruction
568   */
569  public static Instruction mutate(Instruction i, Operator o
570                   , RegisterOperand Result
571                   , RegisterOperand Result2
572                   , BranchOperand Target
573                   , int numVarOps
574                )
575  {
576    if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call");
577    if (4+numVarOps>MIN_OPERAND_ARRAY_LENGTH)
578      i.resizeNumberOfOperands(4+numVarOps);
579
580    i.changeOperatorTo(o);
581    i.putOperand(0, Result);
582    i.putOperand(1, Result2);
583    i.putOperand(2, Target);
584    i.putOperand(3, null);
585    return i;
586  }
587  /**
588   * Mutate the argument instruction into an instruction of the
589   * MIR_Call instruction format having the specified
590   * operator, operands, and number of variable-length operands.
591   * @param i the instruction to mutate
592   * @param o the instruction's operator
593   * @param Result the instruction's Result operand
594   * @param Result2 the instruction's Result2 operand
595   * @param Target the instruction's Target operand
596   * @return the mutated instruction
597   */
598  public static Instruction mutate0(Instruction i, Operator o
599                   , RegisterOperand Result
600                   , RegisterOperand Result2
601                   , BranchOperand Target
602                )
603  {
604    if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call");
605    i.changeOperatorTo(o);
606    i.putOperand(0, Result);
607    i.putOperand(1, Result2);
608    i.putOperand(2, Target);
609    i.putOperand(3, null);
610    return i;
611  }
612  /**
613   * Create an instruction of the MIR_Call instruction format.
614   * @param o the instruction's operator
615   * @param Result the instruction's Result operand
616   * @param Result2 the instruction's Result2 operand
617   * @param Method the instruction's Method operand
618   * @param numVarOps the number of variable length operands that
619   *                 will be stored in the insruction.
620   * @return the newly created MIR_Call instruction
621   */
622  public static Instruction create(Operator o
623                   , RegisterOperand Result
624                   , RegisterOperand Result2
625                   , MethodOperand Method
626                   , int numVarOps
627                )
628  {
629    if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call");
630    Instruction i = Instruction.create(o, Math.max(4+numVarOps, MIN_OPERAND_ARRAY_LENGTH));
631    i.putOperand(0, Result);
632    i.putOperand(1, Result2);
633    i.putOperand(3, Method);
634    return i;
635  }
636  /**
637   * Create an instruction of the MIR_Call instruction format
638   * with 0 variable arguments.
639   * @param o the instruction's operator
640   * @param Result the instruction's Result operand
641   * @param Result2 the instruction's Result2 operand
642   * @param Method the instruction's Method operand
643   * @return the newly created MIR_Call instruction
644   */
645  public static Instruction create0(Operator o
646                   , RegisterOperand Result
647                   , RegisterOperand Result2
648                   , MethodOperand Method
649                )
650  {
651    if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call");
652    Instruction i = Instruction.create(o, 5);
653    i.putOperand(0, Result);
654    i.putOperand(1, Result2);
655    i.putOperand(3, Method);
656    return i;
657  }
658
659  /**
660   * Mutate the argument instruction into an instruction of the
661   * MIR_Call instruction format having the specified
662   * operator and operands.
663   * @param i the instruction to mutate
664   * @param o the instruction's operator
665   * @param Result the instruction's Result operand
666   * @param Result2 the instruction's Result2 operand
667   * @param Method the instruction's Method operand
668   * @param numVarOps the number of variable length operands that
669   *                  will be stored in the insruction.
670   * @return the mutated instruction
671   */
672  public static Instruction mutate(Instruction i, Operator o
673                   , RegisterOperand Result
674                   , RegisterOperand Result2
675                   , MethodOperand Method
676                   , int numVarOps
677                )
678  {
679    if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call");
680    if (4+numVarOps>MIN_OPERAND_ARRAY_LENGTH)
681      i.resizeNumberOfOperands(4+numVarOps);
682
683    i.changeOperatorTo(o);
684    i.putOperand(0, Result);
685    i.putOperand(1, Result2);
686    i.putOperand(2, null);
687    i.putOperand(3, Method);
688    return i;
689  }
690  /**
691   * Mutate the argument instruction into an instruction of the
692   * MIR_Call instruction format having the specified
693   * operator, operands, and number of variable-length operands.
694   * @param i the instruction to mutate
695   * @param o the instruction's operator
696   * @param Result the instruction's Result operand
697   * @param Result2 the instruction's Result2 operand
698   * @param Method the instruction's Method operand
699   * @return the mutated instruction
700   */
701  public static Instruction mutate0(Instruction i, Operator o
702                   , RegisterOperand Result
703                   , RegisterOperand Result2
704                   , MethodOperand Method
705                )
706  {
707    if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call");
708    i.changeOperatorTo(o);
709    i.putOperand(0, Result);
710    i.putOperand(1, Result2);
711    i.putOperand(2, null);
712    i.putOperand(3, Method);
713    return i;
714  }
715  /**
716   * Create an instruction of the MIR_Call instruction format.
717   * @param o the instruction's operator
718   * @param Result the instruction's Result operand
719   * @param Result2 the instruction's Result2 operand
720   * @param numVarOps the number of variable length operands that
721   *                 will be stored in the insruction.
722   * @return the newly created MIR_Call instruction
723   */
724  public static Instruction create(Operator o
725                   , RegisterOperand Result
726                   , RegisterOperand Result2
727                   , int numVarOps
728                )
729  {
730    if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call");
731    Instruction i = Instruction.create(o, Math.max(4+numVarOps, MIN_OPERAND_ARRAY_LENGTH));
732    i.putOperand(0, Result);
733    i.putOperand(1, Result2);
734    return i;
735  }
736  /**
737   * Create an instruction of the MIR_Call instruction format
738   * with 0 variable arguments.
739   * @param o the instruction's operator
740   * @param Result the instruction's Result operand
741   * @param Result2 the instruction's Result2 operand
742   * @return the newly created MIR_Call instruction
743   */
744  public static Instruction create0(Operator o
745                   , RegisterOperand Result
746                   , RegisterOperand Result2
747                )
748  {
749    if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call");
750    Instruction i = Instruction.create(o, 5);
751    i.putOperand(0, Result);
752    i.putOperand(1, Result2);
753    return i;
754  }
755
756  /**
757   * Mutate the argument instruction into an instruction of the
758   * MIR_Call instruction format having the specified
759   * operator and operands.
760   * @param i the instruction to mutate
761   * @param o the instruction's operator
762   * @param Result the instruction's Result operand
763   * @param Result2 the instruction's Result2 operand
764   * @param numVarOps the number of variable length operands that
765   *                  will be stored in the insruction.
766   * @return the mutated instruction
767   */
768  public static Instruction mutate(Instruction i, Operator o
769                   , RegisterOperand Result
770                   , RegisterOperand Result2
771                   , int numVarOps
772                )
773  {
774    if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call");
775    if (4+numVarOps>MIN_OPERAND_ARRAY_LENGTH)
776      i.resizeNumberOfOperands(4+numVarOps);
777
778    i.changeOperatorTo(o);
779    i.putOperand(0, Result);
780    i.putOperand(1, Result2);
781    i.putOperand(2, null);
782    i.putOperand(3, null);
783    return i;
784  }
785  /**
786   * Mutate the argument instruction into an instruction of the
787   * MIR_Call instruction format having the specified
788   * operator, operands, and number of variable-length operands.
789   * @param i the instruction to mutate
790   * @param o the instruction's operator
791   * @param Result the instruction's Result operand
792   * @param Result2 the instruction's Result2 operand
793   * @return the mutated instruction
794   */
795  public static Instruction mutate0(Instruction i, Operator o
796                   , RegisterOperand Result
797                   , RegisterOperand Result2
798                )
799  {
800    if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call");
801    i.changeOperatorTo(o);
802    i.putOperand(0, Result);
803    i.putOperand(1, Result2);
804    i.putOperand(2, null);
805    i.putOperand(3, null);
806    return i;
807  }
808}
809