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