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.ia32; 009 010import org.jikesrvm.Configuration; 011import org.jikesrvm.compilers.opt.ir.operand.ia32.IA32ConditionOperand; 012import org.jikesrvm.compilers.opt.ir.operand.*; 013import org.jikesrvm.compilers.opt.ir.Instruction; 014import org.jikesrvm.compilers.opt.ir.Operator; 015 016/** 017 * The MIR_Call InstructionFormat class. 018 * 019 * The header comment for {@link Instruction} contains 020 * an explanation of the role of InstructionFormats in the 021 * opt compiler's IR. 022 */ 023@SuppressWarnings("unused") // Machine generated code is never 100% clean 024public final class MIR_Call extends ArchInstructionFormat { 025 /** 026 * InstructionFormat identification method for MIR_Call. 027 * @param i an instruction 028 * @return <code>true</code> if the InstructionFormat of the argument 029 * instruction is MIR_Call or <code>false</code> 030 * if it is not. 031 */ 032 public static boolean conforms(Instruction i) { 033 return conforms(i.operator()); 034 } 035 /** 036 * InstructionFormat identification method for MIR_Call. 037 * @param o an instruction 038 * @return <code>true</code> if the InstructionFormat of the argument 039 * operator is MIR_Call or <code>false</code> 040 * if it is not. 041 */ 042 public static boolean conforms(Operator o) { 043 return o.format == MIR_Call_format; 044 } 045 046 /** 047 * Get the operand called Result from the 048 * argument instruction. Note that the returned operand 049 * will still point to its containing instruction. 050 * @param i the instruction to fetch the operand from 051 * @return the operand called Result 052 */ 053 public static RegisterOperand getResult(Instruction i) { 054 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 055 return (RegisterOperand) i.getOperand(0); 056 } 057 /** 058 * Get the operand called Result from the argument 059 * instruction clearing its instruction pointer. The returned 060 * operand will not point to any containing instruction. 061 * @param i the instruction to fetch the operand from 062 * @return the operand called Result 063 */ 064 public static RegisterOperand getClearResult(Instruction i) { 065 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 066 return (RegisterOperand) i.getClearOperand(0); 067 } 068 /** 069 * Set the operand called Result in the argument 070 * instruction to the argument operand. The operand will 071 * now point to the argument instruction as its containing 072 * instruction. 073 * @param i the instruction in which to store the operand 074 * @param Result the operand to store 075 */ 076 public static void setResult(Instruction i, RegisterOperand Result) { 077 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 078 i.putOperand(0, Result); 079 } 080 /** 081 * Return the index of the operand called Result 082 * in the argument instruction. 083 * @param i the instruction to access. 084 * @return the index of the operand called Result 085 * in the argument instruction 086 */ 087 public static int indexOfResult(Instruction i) { 088 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 089 return 0; 090 } 091 /** 092 * Does the argument instruction have a non-null 093 * operand named Result? 094 * @param i the instruction to access. 095 * @return <code>true</code> if the instruction has an non-null 096 * operand named Result or <code>false</code> 097 * if it does not. 098 */ 099 public static boolean hasResult(Instruction i) { 100 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 101 return i.getOperand(0) != null; 102 } 103 104 /** 105 * Get the operand called Result2 from the 106 * argument instruction. Note that the returned operand 107 * will still point to its containing instruction. 108 * @param i the instruction to fetch the operand from 109 * @return the operand called Result2 110 */ 111 public static RegisterOperand getResult2(Instruction i) { 112 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 113 return (RegisterOperand) i.getOperand(1); 114 } 115 /** 116 * Get the operand called Result2 from the argument 117 * instruction clearing its instruction pointer. The returned 118 * operand will not point to any containing instruction. 119 * @param i the instruction to fetch the operand from 120 * @return the operand called Result2 121 */ 122 public static RegisterOperand getClearResult2(Instruction i) { 123 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 124 return (RegisterOperand) i.getClearOperand(1); 125 } 126 /** 127 * Set the operand called Result2 in the argument 128 * instruction to the argument operand. The operand will 129 * now point to the argument instruction as its containing 130 * instruction. 131 * @param i the instruction in which to store the operand 132 * @param Result2 the operand to store 133 */ 134 public static void setResult2(Instruction i, RegisterOperand Result2) { 135 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 136 i.putOperand(1, Result2); 137 } 138 /** 139 * Return the index of the operand called Result2 140 * in the argument instruction. 141 * @param i the instruction to access. 142 * @return the index of the operand called Result2 143 * in the argument instruction 144 */ 145 public static int indexOfResult2(Instruction i) { 146 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 147 return 1; 148 } 149 /** 150 * Does the argument instruction have a non-null 151 * operand named Result2? 152 * @param i the instruction to access. 153 * @return <code>true</code> if the instruction has an non-null 154 * operand named Result2 or <code>false</code> 155 * if it does not. 156 */ 157 public static boolean hasResult2(Instruction i) { 158 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 159 return i.getOperand(1) != null; 160 } 161 162 /** 163 * Get the operand called Target from the 164 * argument instruction. Note that the returned operand 165 * will still point to its containing instruction. 166 * @param i the instruction to fetch the operand from 167 * @return the operand called Target 168 */ 169 public static Operand getTarget(Instruction i) { 170 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 171 return (Operand) i.getOperand(2); 172 } 173 /** 174 * Get the operand called Target from the argument 175 * instruction clearing its instruction pointer. The returned 176 * operand will not point to any containing instruction. 177 * @param i the instruction to fetch the operand from 178 * @return the operand called Target 179 */ 180 public static Operand getClearTarget(Instruction i) { 181 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 182 return (Operand) i.getClearOperand(2); 183 } 184 /** 185 * Set the operand called Target in the argument 186 * instruction to the argument operand. The operand will 187 * now point to the argument instruction as its containing 188 * instruction. 189 * @param i the instruction in which to store the operand 190 * @param Target the operand to store 191 */ 192 public static void setTarget(Instruction i, Operand Target) { 193 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 194 i.putOperand(2, Target); 195 } 196 /** 197 * Return the index of the operand called Target 198 * in the argument instruction. 199 * @param i the instruction to access. 200 * @return the index of the operand called Target 201 * in the argument instruction 202 */ 203 public static int indexOfTarget(Instruction i) { 204 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 205 return 2; 206 } 207 /** 208 * Does the argument instruction have a non-null 209 * operand named Target? 210 * @param i the instruction to access. 211 * @return <code>true</code> if the instruction has an non-null 212 * operand named Target or <code>false</code> 213 * if it does not. 214 */ 215 public static boolean hasTarget(Instruction i) { 216 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 217 return i.getOperand(2) != null; 218 } 219 220 /** 221 * Get the operand called Method from the 222 * argument instruction. Note that the returned operand 223 * will still point to its containing instruction. 224 * @param i the instruction to fetch the operand from 225 * @return the operand called Method 226 */ 227 public static MethodOperand getMethod(Instruction i) { 228 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 229 return (MethodOperand) i.getOperand(3); 230 } 231 /** 232 * Get the operand called Method from the argument 233 * instruction clearing its instruction pointer. The returned 234 * operand will not point to any containing instruction. 235 * @param i the instruction to fetch the operand from 236 * @return the operand called Method 237 */ 238 public static MethodOperand getClearMethod(Instruction i) { 239 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 240 return (MethodOperand) i.getClearOperand(3); 241 } 242 /** 243 * Set the operand called Method in the argument 244 * instruction to the argument operand. The operand will 245 * now point to the argument instruction as its containing 246 * instruction. 247 * @param i the instruction in which to store the operand 248 * @param Method the operand to store 249 */ 250 public static void setMethod(Instruction i, MethodOperand Method) { 251 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 252 i.putOperand(3, Method); 253 } 254 /** 255 * Return the index of the operand called Method 256 * in the argument instruction. 257 * @param i the instruction to access. 258 * @return the index of the operand called Method 259 * in the argument instruction 260 */ 261 public static int indexOfMethod(Instruction i) { 262 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 263 return 3; 264 } 265 /** 266 * Does the argument instruction have a non-null 267 * operand named Method? 268 * @param i the instruction to access. 269 * @return <code>true</code> if the instruction has an non-null 270 * operand named Method or <code>false</code> 271 * if it does not. 272 */ 273 public static boolean hasMethod(Instruction i) { 274 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 275 return i.getOperand(3) != null; 276 } 277 278 /** 279 * Get the k'th operand called Param from the 280 * argument instruction. Note that the returned operand 281 * will still point to its containing instruction. 282 * @param i the instruction to fetch the operand from 283 * @param k the index of the operand 284 * @return the k'th operand called Param 285 */ 286 public static Operand getParam(Instruction i, int k) { 287 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 288 return (Operand) i.getOperand(4+k); 289 } 290 /** 291 * Get the k'th operand called Param from the argument 292 * instruction clearing its instruction pointer. The returned 293 * operand will not point to any containing instruction. 294 * @param i the instruction to fetch the operand from 295 * @param k the index of the operand 296 * @return the k'th operand called Param 297 */ 298 public static Operand getClearParam(Instruction i, int k) { 299 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 300 return (Operand) i.getClearOperand(4+k); 301 } 302 /** 303 * Set the k'th operand called Param in the argument 304 * instruction to the argument operand. The operand will 305 * now point to the argument instruction as its containing 306 * instruction. 307 * @param i the instruction in which to store the operand 308 * @param k the index of the operand 309 * @param o the operand to store 310 */ 311 public static void setParam(Instruction i, int k, Operand o) { 312 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 313 i.putOperand(4+k, o); 314 } 315 /** 316 * Return the index of the k'th operand called Param 317 * in the argument instruction. 318 * @param i the instruction to access. 319 * @param k the index of the operand. 320 * @return the index of the k'th operand called Param 321 * in the argument instruction 322 */ 323 public static int indexOfParam(Instruction i, int k) { 324 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 325 return 4+k; 326 } 327 /** 328 * Does the argument instruction have a non-null 329 * k'th operand named Param? 330 * @param i the instruction to access. 331 * @param k the index of the operand. 332 * @return <code>true</code> if the instruction has an non-null 333 * k'th operand named Param or <code>false</code> 334 * if it does not. 335 */ 336 public static boolean hasParam(Instruction i, int k) { 337 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 338 return i.getOperand(4+k) != null; 339 } 340 341 /** 342 * Return the index of the first operand called Param 343 * in the argument instruction. 344 * @param i the instruction to access. 345 * @return the index of the first operand called Param 346 * in the argument instruction 347 */ 348 public static int indexOfParams(Instruction i) 349 { 350 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 351 return 4; 352 } 353 /** 354 * Does the argument instruction have any operands 355 * named Param? 356 * @param i the instruction to access. 357 * @return <code>true</code> if the instruction has operands 358 * named Param or <code>false</code> if it does not. 359 */ 360 public static boolean hasParams(Instruction i) 361 { 362 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 363 return i.getNumberOfOperands()-4 > 0 && i.getOperand(4) != null; 364 } 365 366 /** 367 * How many variable-length operands called Params 368 * does the argument instruction have? 369 * @param i the instruction to access 370 * @return the number of operands called Params the instruction has 371 */ 372 public static int getNumberOfParams(Instruction i) 373 { 374 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 375 return i.getNumberOfOperands()-4; 376 } 377 378 /** 379 * Change the number of Params that may be stored in 380 * the argument instruction to numVarOps. 381 * @param i the instruction to access 382 * @param numVarOps the new number of variable operands called Params 383 * that may be stored in the instruction 384 */ 385 public static void resizeNumberOfParams(Instruction i, int numVarOps) 386 { 387 if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_Call"); 388 if (4+numVarOps>MIN_OPERAND_ARRAY_LENGTH) 389 i.resizeNumberOfOperands(4+numVarOps); 390 else 391 for (int j = 4+numVarOps; j < MIN_OPERAND_ARRAY_LENGTH; j++) 392 i.putOperand(j, null); 393 } 394 395 /** 396 * Create an instruction of the MIR_Call instruction format. 397 * @param o the instruction's operator 398 * @param Result the instruction's Result operand 399 * @param Result2 the instruction's Result2 operand 400 * @param Target the instruction's Target operand 401 * @param Method the instruction's Method operand 402 * @param numVarOps the number of variable length operands that 403 * will be stored in the insruction. 404 * @return the newly created MIR_Call instruction 405 */ 406 public static Instruction create(Operator o 407 , RegisterOperand Result 408 , RegisterOperand Result2 409 , Operand Target 410 , MethodOperand Method 411 , int numVarOps 412 ) 413 { 414 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 415 Instruction i = Instruction.create(o, Math.max(4+numVarOps, MIN_OPERAND_ARRAY_LENGTH)); 416 i.putOperand(0, Result); 417 i.putOperand(1, Result2); 418 i.putOperand(2, Target); 419 i.putOperand(3, Method); 420 return i; 421 } 422 /** 423 * Create an instruction of the MIR_Call instruction format 424 * with 0 variable arguments. 425 * @param o the instruction's operator 426 * @param Result the instruction's Result operand 427 * @param Result2 the instruction's Result2 operand 428 * @param Target the instruction's Target operand 429 * @param Method the instruction's Method operand 430 * @return the newly created MIR_Call instruction 431 */ 432 public static Instruction create0(Operator o 433 , RegisterOperand Result 434 , RegisterOperand Result2 435 , Operand Target 436 , MethodOperand Method 437 ) 438 { 439 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 440 Instruction i = Instruction.create(o, 5); 441 i.putOperand(0, Result); 442 i.putOperand(1, Result2); 443 i.putOperand(2, Target); 444 i.putOperand(3, Method); 445 return i; 446 } 447 /** 448 * Create an instruction of the MIR_Call instruction format 449 * with 1 variable arguments. 450 * @param o the instruction's operator 451 * @param Result the instruction's Result operand 452 * @param Result2 the instruction's Result2 operand 453 * @param Target the instruction's Target operand 454 * @param Method the instruction's Method operand 455 * @param Param_1 the k'th variable argument called Param 456 * @return the newly created MIR_Call instruction 457 */ 458 public static Instruction create1(Operator o 459 , RegisterOperand Result 460 , RegisterOperand Result2 461 , Operand Target 462 , MethodOperand Method 463 , Operand Param_1 464 ) 465 { 466 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 467 Instruction i = Instruction.create(o, 5); 468 i.putOperand(0, Result); 469 i.putOperand(1, Result2); 470 i.putOperand(2, Target); 471 i.putOperand(3, Method); 472 i.putOperand(4, Param_1); 473 return i; 474 } 475 476 /** 477 * Mutate the argument instruction into an instruction of the 478 * MIR_Call instruction format having the specified 479 * operator and operands. 480 * @param i the instruction to mutate 481 * @param o the instruction's operator 482 * @param Result the instruction's Result operand 483 * @param Result2 the instruction's Result2 operand 484 * @param Target the instruction's Target operand 485 * @param Method the instruction's Method operand 486 * @param numVarOps the number of variable length operands that 487 * will be stored in the insruction. 488 * @return the mutated instruction 489 */ 490 public static Instruction mutate(Instruction i, Operator o 491 , RegisterOperand Result 492 , RegisterOperand Result2 493 , Operand Target 494 , MethodOperand Method 495 , int numVarOps 496 ) 497 { 498 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 499 if (4+numVarOps>MIN_OPERAND_ARRAY_LENGTH) 500 i.resizeNumberOfOperands(4+numVarOps); 501 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 * Mutate the argument instruction into an instruction of the 511 * MIR_Call instruction format having the specified 512 * operator, operands, and number of variable-length operands. 513 * @param i the instruction to mutate 514 * @param o the instruction's operator 515 * @param Result the instruction's Result operand 516 * @param Result2 the instruction's Result2 operand 517 * @param Target the instruction's Target operand 518 * @param Method the instruction's Method operand 519 * @return the mutated instruction 520 */ 521 public static Instruction mutate0(Instruction i, Operator o 522 , RegisterOperand Result 523 , RegisterOperand Result2 524 , Operand Target 525 , MethodOperand Method 526 ) 527 { 528 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 529 i.changeOperatorTo(o); 530 i.putOperand(0, Result); 531 i.putOperand(1, Result2); 532 i.putOperand(2, Target); 533 i.putOperand(3, Method); 534 return i; 535 } 536 /** 537 * Mutate the argument instruction into an instruction of the 538 * MIR_Call instruction format having the specified 539 * operator, operands, and number of variable-length operands. 540 * @param i the instruction to mutate 541 * @param o the instruction's operator 542 * @param Result the instruction's Result operand 543 * @param Result2 the instruction's Result2 operand 544 * @param Target the instruction's Target operand 545 * @param Method the instruction's Method operand 546 * @param Param_1 the k'th variable argument called Param 547 * @return the mutated instruction 548 */ 549 public static Instruction mutate1(Instruction i, Operator o 550 , RegisterOperand Result 551 , RegisterOperand Result2 552 , Operand Target 553 , MethodOperand Method 554 , Operand Param_1 555 ) 556 { 557 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 558 i.changeOperatorTo(o); 559 i.putOperand(0, Result); 560 i.putOperand(1, Result2); 561 i.putOperand(2, Target); 562 i.putOperand(3, Method); 563 i.putOperand(4, Param_1); 564 return i; 565 } 566 /** 567 * Create an instruction of the MIR_Call instruction format. 568 * @param o the instruction's operator 569 * @param Result the instruction's Result operand 570 * @param Result2 the instruction's Result2 operand 571 * @param Target the instruction's Target operand 572 * @param numVarOps the number of variable length operands that 573 * will be stored in the insruction. 574 * @return the newly created MIR_Call instruction 575 */ 576 public static Instruction create(Operator o 577 , RegisterOperand Result 578 , RegisterOperand Result2 579 , Operand Target 580 , int numVarOps 581 ) 582 { 583 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 584 Instruction i = Instruction.create(o, Math.max(4+numVarOps, MIN_OPERAND_ARRAY_LENGTH)); 585 i.putOperand(0, Result); 586 i.putOperand(1, Result2); 587 i.putOperand(2, Target); 588 return i; 589 } 590 /** 591 * Create an instruction of the MIR_Call instruction format 592 * with 0 variable arguments. 593 * @param o the instruction's operator 594 * @param Result the instruction's Result operand 595 * @param Result2 the instruction's Result2 operand 596 * @param Target the instruction's Target operand 597 * @return the newly created MIR_Call instruction 598 */ 599 public static Instruction create0(Operator o 600 , RegisterOperand Result 601 , RegisterOperand Result2 602 , Operand Target 603 ) 604 { 605 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 606 Instruction i = Instruction.create(o, 5); 607 i.putOperand(0, Result); 608 i.putOperand(1, Result2); 609 i.putOperand(2, Target); 610 return i; 611 } 612 /** 613 * Create an instruction of the MIR_Call instruction format 614 * with 1 variable arguments. 615 * @param o the instruction's operator 616 * @param Result the instruction's Result operand 617 * @param Result2 the instruction's Result2 operand 618 * @param Target the instruction's Target operand 619 * @param Param_1 the k'th variable argument called Param 620 * @return the newly created MIR_Call instruction 621 */ 622 public static Instruction create1(Operator o 623 , RegisterOperand Result 624 , RegisterOperand Result2 625 , Operand Target 626 , Operand Param_1 627 ) 628 { 629 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 630 Instruction i = Instruction.create(o, 5); 631 i.putOperand(0, Result); 632 i.putOperand(1, Result2); 633 i.putOperand(2, Target); 634 i.putOperand(4, Param_1); 635 return i; 636 } 637 638 /** 639 * Mutate the argument instruction into an instruction of the 640 * MIR_Call instruction format having the specified 641 * operator and operands. 642 * @param i the instruction to mutate 643 * @param o the instruction's operator 644 * @param Result the instruction's Result operand 645 * @param Result2 the instruction's Result2 operand 646 * @param Target the instruction's Target operand 647 * @param numVarOps the number of variable length operands that 648 * will be stored in the insruction. 649 * @return the mutated instruction 650 */ 651 public static Instruction mutate(Instruction i, Operator o 652 , RegisterOperand Result 653 , RegisterOperand Result2 654 , Operand Target 655 , int numVarOps 656 ) 657 { 658 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 659 if (4+numVarOps>MIN_OPERAND_ARRAY_LENGTH) 660 i.resizeNumberOfOperands(4+numVarOps); 661 662 i.changeOperatorTo(o); 663 i.putOperand(0, Result); 664 i.putOperand(1, Result2); 665 i.putOperand(2, Target); 666 i.putOperand(3, null); 667 return i; 668 } 669 /** 670 * Mutate the argument instruction into an instruction of the 671 * MIR_Call instruction format having the specified 672 * operator, operands, and number of variable-length operands. 673 * @param i the instruction to mutate 674 * @param o the instruction's operator 675 * @param Result the instruction's Result operand 676 * @param Result2 the instruction's Result2 operand 677 * @param Target the instruction's Target operand 678 * @return the mutated instruction 679 */ 680 public static Instruction mutate0(Instruction i, Operator o 681 , RegisterOperand Result 682 , RegisterOperand Result2 683 , Operand Target 684 ) 685 { 686 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 687 i.changeOperatorTo(o); 688 i.putOperand(0, Result); 689 i.putOperand(1, Result2); 690 i.putOperand(2, Target); 691 i.putOperand(3, null); 692 return i; 693 } 694 /** 695 * Mutate the argument instruction into an instruction of the 696 * MIR_Call instruction format having the specified 697 * operator, operands, and number of variable-length operands. 698 * @param i the instruction to mutate 699 * @param o the instruction's operator 700 * @param Result the instruction's Result operand 701 * @param Result2 the instruction's Result2 operand 702 * @param Target the instruction's Target operand 703 * @param Param_1 the k'th variable argument called Param 704 * @return the mutated instruction 705 */ 706 public static Instruction mutate1(Instruction i, Operator o 707 , RegisterOperand Result 708 , RegisterOperand Result2 709 , Operand Target 710 , Operand Param_1 711 ) 712 { 713 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 714 i.changeOperatorTo(o); 715 i.putOperand(0, Result); 716 i.putOperand(1, Result2); 717 i.putOperand(2, Target); 718 i.putOperand(3, null); 719 i.putOperand(4, Param_1); 720 return i; 721 } 722 /** 723 * Create an instruction of the MIR_Call instruction format. 724 * @param o the instruction's operator 725 * @param Result the instruction's Result operand 726 * @param Result2 the instruction's Result2 operand 727 * @param Method the instruction's Method operand 728 * @param numVarOps the number of variable length operands that 729 * will be stored in the insruction. 730 * @return the newly created MIR_Call instruction 731 */ 732 public static Instruction create(Operator o 733 , RegisterOperand Result 734 , RegisterOperand Result2 735 , MethodOperand Method 736 , int numVarOps 737 ) 738 { 739 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 740 Instruction i = Instruction.create(o, Math.max(4+numVarOps, MIN_OPERAND_ARRAY_LENGTH)); 741 i.putOperand(0, Result); 742 i.putOperand(1, Result2); 743 i.putOperand(3, Method); 744 return i; 745 } 746 /** 747 * Create an instruction of the MIR_Call instruction format 748 * with 0 variable arguments. 749 * @param o the instruction's operator 750 * @param Result the instruction's Result operand 751 * @param Result2 the instruction's Result2 operand 752 * @param Method the instruction's Method operand 753 * @return the newly created MIR_Call instruction 754 */ 755 public static Instruction create0(Operator o 756 , RegisterOperand Result 757 , RegisterOperand Result2 758 , MethodOperand Method 759 ) 760 { 761 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 762 Instruction i = Instruction.create(o, 5); 763 i.putOperand(0, Result); 764 i.putOperand(1, Result2); 765 i.putOperand(3, Method); 766 return i; 767 } 768 /** 769 * Create an instruction of the MIR_Call instruction format 770 * with 1 variable arguments. 771 * @param o the instruction's operator 772 * @param Result the instruction's Result operand 773 * @param Result2 the instruction's Result2 operand 774 * @param Method the instruction's Method operand 775 * @param Param_1 the k'th variable argument called Param 776 * @return the newly created MIR_Call instruction 777 */ 778 public static Instruction create1(Operator o 779 , RegisterOperand Result 780 , RegisterOperand Result2 781 , MethodOperand Method 782 , Operand Param_1 783 ) 784 { 785 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 786 Instruction i = Instruction.create(o, 5); 787 i.putOperand(0, Result); 788 i.putOperand(1, Result2); 789 i.putOperand(3, Method); 790 i.putOperand(4, Param_1); 791 return i; 792 } 793 794 /** 795 * Mutate the argument instruction into an instruction of the 796 * MIR_Call instruction format having the specified 797 * operator and operands. 798 * @param i the instruction to mutate 799 * @param o the instruction's operator 800 * @param Result the instruction's Result operand 801 * @param Result2 the instruction's Result2 operand 802 * @param Method the instruction's Method operand 803 * @param numVarOps the number of variable length operands that 804 * will be stored in the insruction. 805 * @return the mutated instruction 806 */ 807 public static Instruction mutate(Instruction i, Operator o 808 , RegisterOperand Result 809 , RegisterOperand Result2 810 , MethodOperand Method 811 , int numVarOps 812 ) 813 { 814 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 815 if (4+numVarOps>MIN_OPERAND_ARRAY_LENGTH) 816 i.resizeNumberOfOperands(4+numVarOps); 817 818 i.changeOperatorTo(o); 819 i.putOperand(0, Result); 820 i.putOperand(1, Result2); 821 i.putOperand(2, null); 822 i.putOperand(3, Method); 823 return i; 824 } 825 /** 826 * Mutate the argument instruction into an instruction of the 827 * MIR_Call instruction format having the specified 828 * operator, operands, and number of variable-length operands. 829 * @param i the instruction to mutate 830 * @param o the instruction's operator 831 * @param Result the instruction's Result operand 832 * @param Result2 the instruction's Result2 operand 833 * @param Method the instruction's Method operand 834 * @return the mutated instruction 835 */ 836 public static Instruction mutate0(Instruction i, Operator o 837 , RegisterOperand Result 838 , RegisterOperand Result2 839 , MethodOperand Method 840 ) 841 { 842 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 843 i.changeOperatorTo(o); 844 i.putOperand(0, Result); 845 i.putOperand(1, Result2); 846 i.putOperand(2, null); 847 i.putOperand(3, Method); 848 return i; 849 } 850 /** 851 * Mutate the argument instruction into an instruction of the 852 * MIR_Call instruction format having the specified 853 * operator, operands, and number of variable-length operands. 854 * @param i the instruction to mutate 855 * @param o the instruction's operator 856 * @param Result the instruction's Result operand 857 * @param Result2 the instruction's Result2 operand 858 * @param Method the instruction's Method operand 859 * @param Param_1 the k'th variable argument called Param 860 * @return the mutated instruction 861 */ 862 public static Instruction mutate1(Instruction i, Operator o 863 , RegisterOperand Result 864 , RegisterOperand Result2 865 , MethodOperand Method 866 , Operand Param_1 867 ) 868 { 869 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 870 i.changeOperatorTo(o); 871 i.putOperand(0, Result); 872 i.putOperand(1, Result2); 873 i.putOperand(2, null); 874 i.putOperand(3, Method); 875 i.putOperand(4, Param_1); 876 return i; 877 } 878 /** 879 * Create an instruction of the MIR_Call instruction format. 880 * @param o the instruction's operator 881 * @param Result the instruction's Result operand 882 * @param Result2 the instruction's Result2 operand 883 * @param numVarOps the number of variable length operands that 884 * will be stored in the insruction. 885 * @return the newly created MIR_Call instruction 886 */ 887 public static Instruction create(Operator o 888 , RegisterOperand Result 889 , RegisterOperand Result2 890 , int numVarOps 891 ) 892 { 893 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 894 Instruction i = Instruction.create(o, Math.max(4+numVarOps, MIN_OPERAND_ARRAY_LENGTH)); 895 i.putOperand(0, Result); 896 i.putOperand(1, Result2); 897 return i; 898 } 899 /** 900 * Create an instruction of the MIR_Call instruction format 901 * with 0 variable arguments. 902 * @param o the instruction's operator 903 * @param Result the instruction's Result operand 904 * @param Result2 the instruction's Result2 operand 905 * @return the newly created MIR_Call instruction 906 */ 907 public static Instruction create0(Operator o 908 , RegisterOperand Result 909 , RegisterOperand Result2 910 ) 911 { 912 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 913 Instruction i = Instruction.create(o, 5); 914 i.putOperand(0, Result); 915 i.putOperand(1, Result2); 916 return i; 917 } 918 /** 919 * Create an instruction of the MIR_Call instruction format 920 * with 1 variable arguments. 921 * @param o the instruction's operator 922 * @param Result the instruction's Result operand 923 * @param Result2 the instruction's Result2 operand 924 * @param Param_1 the k'th variable argument called Param 925 * @return the newly created MIR_Call instruction 926 */ 927 public static Instruction create1(Operator o 928 , RegisterOperand Result 929 , RegisterOperand Result2 930 , Operand Param_1 931 ) 932 { 933 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 934 Instruction i = Instruction.create(o, 5); 935 i.putOperand(0, Result); 936 i.putOperand(1, Result2); 937 i.putOperand(4, Param_1); 938 return i; 939 } 940 941 /** 942 * Mutate the argument instruction into an instruction of the 943 * MIR_Call instruction format having the specified 944 * operator and operands. 945 * @param i the instruction to mutate 946 * @param o the instruction's operator 947 * @param Result the instruction's Result operand 948 * @param Result2 the instruction's Result2 operand 949 * @param numVarOps the number of variable length operands that 950 * will be stored in the insruction. 951 * @return the mutated instruction 952 */ 953 public static Instruction mutate(Instruction i, Operator o 954 , RegisterOperand Result 955 , RegisterOperand Result2 956 , int numVarOps 957 ) 958 { 959 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 960 if (4+numVarOps>MIN_OPERAND_ARRAY_LENGTH) 961 i.resizeNumberOfOperands(4+numVarOps); 962 963 i.changeOperatorTo(o); 964 i.putOperand(0, Result); 965 i.putOperand(1, Result2); 966 i.putOperand(2, null); 967 i.putOperand(3, null); 968 return i; 969 } 970 /** 971 * Mutate the argument instruction into an instruction of the 972 * MIR_Call instruction format having the specified 973 * operator, operands, and number of variable-length operands. 974 * @param i the instruction to mutate 975 * @param o the instruction's operator 976 * @param Result the instruction's Result operand 977 * @param Result2 the instruction's Result2 operand 978 * @return the mutated instruction 979 */ 980 public static Instruction mutate0(Instruction i, Operator o 981 , RegisterOperand Result 982 , RegisterOperand Result2 983 ) 984 { 985 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 986 i.changeOperatorTo(o); 987 i.putOperand(0, Result); 988 i.putOperand(1, Result2); 989 i.putOperand(2, null); 990 i.putOperand(3, null); 991 return i; 992 } 993 /** 994 * Mutate the argument instruction into an instruction of the 995 * MIR_Call instruction format having the specified 996 * operator, operands, and number of variable-length operands. 997 * @param i the instruction to mutate 998 * @param o the instruction's operator 999 * @param Result the instruction's Result operand 1000 * @param Result2 the instruction's Result2 operand 1001 * @param Param_1 the k'th variable argument called Param 1002 * @return the mutated instruction 1003 */ 1004 public static Instruction mutate1(Instruction i, Operator o 1005 , RegisterOperand Result 1006 , RegisterOperand Result2 1007 , Operand Param_1 1008 ) 1009 { 1010 if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_Call"); 1011 i.changeOperatorTo(o); 1012 i.putOperand(0, Result); 1013 i.putOperand(1, Result2); 1014 i.putOperand(2, null); 1015 i.putOperand(3, null); 1016 i.putOperand(4, Param_1); 1017 return i; 1018 } 1019} 1020