< prev index next >

test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java

Print this page
rev 58672 : Shenandoah: New incremental-update mode


  21  * questions.
  22  */
  23 
  24 /*
  25  * common code to run and validate tests of code generation for
  26  * volatile ops on AArch64
  27  *
  28  * incoming args are <testclass> <testtype>
  29  *
  30  * where <testclass> in {TestVolatileLoad,
  31  *                       TestVolatileStore,
  32  *                       TestUnsafeVolatileLoad,
  33  *                       TestUnsafeVolatileStore,
  34  *                       TestUnsafeVolatileCAS,
  35  *                       TestUnsafeVolatileWeakCAS,
  36  *                       TestUnsafeVolatileCAE,
  37  *                       TestUnsafeVolatileGAS}
  38  * and <testtype> in {G1,
  39  *                    Serial,
  40  *                    Parallel,
  41  *                    Shenandoah}

  42  */
  43 
  44 
  45 package compiler.c2.aarch64;
  46 
  47 import java.util.List;
  48 import java.util.ListIterator;
  49 import java.util.Iterator;
  50 import java.util.regex.Pattern;
  51 import java.io.*;
  52 
  53 import jdk.test.lib.Asserts;
  54 import jdk.test.lib.compiler.InMemoryJavaCompiler;
  55 import jdk.test.lib.process.OutputAnalyzer;
  56 import jdk.test.lib.process.ProcessTools;
  57 import sun.hotspot.WhiteBox;
  58 
  59 // runner class that spawns a new JVM to exercises a combination of
  60 // volatile MemOp and GC. The ops are compiled with the dmb -->
  61 // ldar/stlr transforms either enabled or disabled. this runner parses


  76             argcount = 9;
  77             procArgs = new String[argcount];
  78             procArgs[argcount - 2] = "-XX:+UseG1GC";
  79             break;
  80         case "Parallel":
  81             argcount = 9;
  82             procArgs = new String[argcount];
  83             procArgs[argcount - 2] = "-XX:+UseParallelGC";
  84             break;
  85         case "Serial":
  86             argcount = 9;
  87             procArgs = new String[argcount];
  88             procArgs[argcount - 2] = "-XX:+UseSerialGC";
  89             break;
  90         case "Shenandoah":
  91             argcount = 10;
  92             procArgs = new String[argcount];
  93             procArgs[argcount - 3] = "-XX:+UnlockExperimentalVMOptions";
  94             procArgs[argcount - 2] = "-XX:+UseShenandoahGC";
  95             break;







  96         default:
  97             throw new RuntimeException("unexpected test type " + testType);
  98         }
  99 
 100         // fill in arguments common to all cases
 101 
 102         // the first round of test enables transform of barriers to
 103         // use acquiring loads and releasing stores by setting arg
 104         // zero appropriately. this arg is reset in the second run to
 105         // disable the transform.
 106 
 107         procArgs[0] = "-XX:-UseBarriersForVolatile";
 108         procArgs[1] = "-XX:+UseCompressedOops";
 109 
 110         procArgs[2] = "-XX:-TieredCompilation";
 111         procArgs[3] = "-XX:+PrintOptoAssembly";
 112         procArgs[4] = "-XX:CompileCommand=compileonly," + fullclassname + "::" + "test*";
 113         procArgs[5] = "--add-exports";
 114         procArgs[6] = "java.base/jdk.internal.misc=ALL-UNNAMED";
 115         procArgs[argcount - 1] = fullclassname;


 306                 };
 307                 break;
 308             case "G1":
 309                 // a card mark volatile barrier should be generated
 310                 // before the card mark strb
 311                 //
 312                 // following the fix for 8225776 the G1 barrier is now
 313                 // scheduled out of line after the membar volatile and
 314                 // and subsequent return
 315                 matches = new String[] {
 316                     "membar_release \\(elided\\)",
 317                     useCompressedOops ? "stlrw?" : "stlr",
 318                     "membar_volatile \\(elided\\)",
 319                     "ret",
 320                     "membar_volatile",
 321                     "dmb ish",
 322                     "strb"
 323                 };
 324                 break;
 325             case "Shenandoah":

 326                  // Shenandoah generates normal object graphs for
 327                  // volatile stores
 328                 matches = new String[] {
 329                     "membar_release \\(elided\\)",
 330                     useCompressedOops ? "stlrw?" : "stlr",
 331                     "membar_volatile \\(elided\\)",
 332                     "ret"
 333                 };
 334                 break;
 335             }
 336         } else {
 337             switch (testType) {
 338             default:
 339                 // this is the basic sequence of instructions
 340                 matches = new String[] {
 341                     "membar_release",
 342                     "dmb ish",
 343                     useCompressedOops ? "strw?" : "str",
 344                     "membar_volatile",
 345                     "dmb ish",


 384                 break;
 385             case "CMS":
 386                 // a volatile card mark membar should not be generated
 387                 // before the card mark strb from the StoreCM and the
 388                 // storestore barrier from the StoreCM should be generated
 389                 // as "dmb ishst"
 390                 matches = new String[] {
 391                     "membar_release",
 392                     "dmb ish",
 393                     useCompressedOops ? "strw?" : "str",
 394                     "storestore",
 395                     "dmb ishst",
 396                     "strb",
 397                     "membar_volatile",
 398                     "dmb ish",
 399                     "ret"
 400                 };
 401                 break;
 402 
 403             case "Shenandoah":

 404                  // Shenandoah generates normal object graphs for
 405                  // volatile stores
 406                 matches = new String[] {
 407                     "membar_release",
 408                     "dmb ish",
 409                     useCompressedOops ? "strw?" : "str",
 410                     "membar_volatile",
 411                     "dmb ish",
 412                     "ret"
 413                 };
 414                 break;
 415             }
 416         }
 417 
 418         checkCompile(iter, "testObj", matches, output, true);
 419     }
 420 
 421     // check for expected asm output from a volatile cas
 422 
 423     private void checkcas(OutputAnalyzer output, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable


 473                 };
 474                 break;
 475             case "G1":
 476                 // a card mark volatile barrier should be generated
 477                 // before the card mark strb
 478                 //
 479                 // following the fix for 8225776 the G1 barrier is now
 480                 // scheduled out of line after the membar acquire and
 481                 // and subsequent return
 482                 matches = new String[] {
 483                     "membar_release \\(elided\\)",
 484                     useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq",
 485                     "membar_acquire \\(elided\\)",
 486                     "ret",
 487                     "membar_volatile",
 488                     "dmb ish",
 489                     "strb"
 490                 };
 491                 break;
 492             case "Shenandoah":

 493                 // For volatile CAS, Shenanodoah generates normal
 494                 // graphs with a shenandoah-specific cmpxchg
 495                 matches = new String[] {
 496                     "membar_release \\(elided\\)",
 497                     useCompressedOops ? "cmpxchgw?_acq_shenandoah" : "cmpxchg_acq_shenandoah",
 498                     "membar_acquire \\(elided\\)",
 499                     "ret"
 500                 };
 501                 break;
 502             }
 503         } else {
 504             switch (testType) {
 505             default:
 506                 // this is the basic sequence of instructions
 507                 matches = new String[] {
 508                     "membar_release",
 509                     "dmb ish",
 510                     useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
 511                     "membar_acquire",
 512                     "dmb ish",


 550                 };
 551                 break;
 552             case "CMS":
 553                 // a volatile card mark membar should not be generated
 554                 // before the card mark strb from the StoreCM and the
 555                 // storestore barrier from the StoreCM should be generated
 556                 // as "dmb ishst"
 557                 matches = new String[] {
 558                     "membar_release",
 559                     "dmb ish",
 560                     useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
 561                     "storestore",
 562                     "dmb ishst",
 563                     "strb",
 564                     "membar_acquire",
 565                     "dmb ish",
 566                     "ret"
 567                 };
 568                 break;
 569             case "Shenandoah":

 570                 // For volatile CAS, Shenanodoah generates normal
 571                 // graphs with a shenandoah-specific cmpxchg
 572                 matches = new String[] {
 573                     "membar_release",
 574                     "dmb ish",
 575                     useCompressedOops ? "cmpxchgw?_shenandoah" : "cmpxchg_shenandoah",
 576                     "membar_acquire",
 577                     "dmb ish",
 578                     "ret"
 579                 };
 580                 break;
 581             }
 582         }
 583 
 584         checkCompile(iter, "testObj", matches, output, true);
 585     }
 586 
 587     private void checkcae(OutputAnalyzer output, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable
 588     {
 589         ListIterator<String> iter = output.asLines().listIterator();


 655                 return;
 656 
 657             case "G1":
 658                 // a card mark volatile barrier should be generated
 659                 // before the card mark strb
 660                 //
 661                 // following the fix for 8225776 the G1 barrier is now
 662                 // scheduled out of line after the membar acquire and
 663                 // and subsequent return
 664                 matches = new String[] {
 665                     "membar_release \\(elided\\)",
 666                     useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq",
 667                     "membar_acquire \\(elided\\)",
 668                     "ret",
 669                     "membar_volatile",
 670                     "dmb ish",
 671                     "strb"
 672                 };
 673                 break;
 674             case "Shenandoah":

 675                 // For volatile CAS, Shenanodoah generates normal
 676                 // graphs with a shenandoah-specific cmpxchg
 677                 matches = new String[] {
 678                     "membar_release \\(elided\\)",
 679                     useCompressedOops ? "cmpxchgw?_acq_shenandoah" : "cmpxchg_acq_shenandoah",
 680                     "membar_acquire \\(elided\\)",
 681                     "ret"
 682                 };
 683                 break;
 684             }
 685         } else {
 686             switch (testType) {
 687             default:
 688                 // this is the basic sequence of instructions
 689                 matches = new String[] {
 690                     "membar_release",
 691                     "dmb ish",
 692                     useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
 693                     "membar_acquire",
 694                     "dmb ish",


 732                 };
 733                 break;
 734             case "CMS":
 735                 // a volatile card mark membar should not be generated
 736                 // before the card mark strb from the StoreCM and the
 737                 // storestore barrier from the StoreCM should be generated
 738                 // as "dmb ishst"
 739                 matches = new String[] {
 740                     "membar_release",
 741                     "dmb ish",
 742                     useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
 743                     "storestore",
 744                     "dmb ishst",
 745                     "strb",
 746                     "membar_acquire",
 747                     "dmb ish",
 748                     "ret"
 749                 };
 750                 break;
 751             case "Shenandoah":

 752                 // For volatile CAS, Shenanodoah generates normal
 753                 // graphs with a shenandoah-specific cmpxchg
 754                 matches = new String[] {
 755                     "membar_release",
 756                     "dmb ish",
 757                     useCompressedOops ? "cmpxchgw?_shenandoah" : "cmpxchg_shenandoah",
 758                     "membar_acquire",
 759                     "dmb ish",
 760                     "ret"
 761                 };
 762                 break;
 763             }
 764         }
 765 
 766         checkCompile(iter, "testObj", matches, output, true);
 767     }
 768 
 769     private void checkgas(OutputAnalyzer output, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable
 770     {
 771         Iterator<String> iter = output.asLines().listIterator();


 817                 };
 818                 break;
 819             case "G1":
 820                 // a card mark volatile barrier should be generated
 821                 // before the card mark strb
 822                 //
 823                 // following the fix for 8225776 the G1 barrier is now
 824                 // scheduled out of line after the membar acquire and
 825                 // and subsequent return
 826                 matches = new String[] {
 827                     "membar_release \\(elided\\)",
 828                     useCompressedOops ? "atomic_xchgw?_acq" : "atomic_xchg_acq",
 829                     "membar_acquire \\(elided\\)",
 830                     "ret",
 831                     "membar_volatile",
 832                     "dmb ish",
 833                     "strb"
 834                 };
 835                 break;
 836             case "Shenandoah":

 837                 matches = new String[] {
 838                     "membar_release \\(elided\\)",
 839                     useCompressedOops ? "atomic_xchgw?_acq" : "atomic_xchg_acq",
 840                     "membar_acquire \\(elided\\)",
 841                     "ret"
 842                 };
 843                 break;
 844             }
 845         } else {
 846             switch (testType) {
 847             default:
 848                 // this is the basic sequence of instructions
 849                 matches = new String[] {
 850                     "membar_release",
 851                     "dmb ish",
 852                     useCompressedOops ? "atomic_xchgw? " : "atomic_xchg ",
 853                     "membar_acquire",
 854                     "dmb ish",
 855                     "ret"
 856                 };


 892                 };
 893                 break;
 894             case "CMS":
 895                 // a volatile card mark membar should not be generated
 896                 // before the card mark strb from the StoreCM and the
 897                 // storestore barrier from the StoreCM should be generated
 898                 // as "dmb ishst"
 899                 matches = new String[] {
 900                     "membar_release",
 901                     "dmb ish",
 902                     useCompressedOops ? "atomic_xchgw? " : "atomic_xchg ",
 903                     "storestore",
 904                     "dmb ishst",
 905                     "strb",
 906                     "membar_acquire",
 907                     "dmb ish",
 908                     "ret"
 909                 };
 910                 break;
 911             case "Shenandoah":

 912                 matches = new String[] {
 913                     "membar_release",
 914                     "dmb ish",
 915                     useCompressedOops ? "atomic_xchgw? " : "atomic_xchg ",
 916                     "membar_acquire",
 917                     "dmb ish",
 918                     "ret"
 919                 };
 920                 break;
 921             }
 922         }
 923 
 924         checkCompile(iter, "testObj", matches, output, true);
 925     }
 926 
 927     private void checkgaa(OutputAnalyzer output, String testType, boolean useBarriersForVolatile) throws Throwable
 928     {
 929         Iterator<String> iter = output.asLines().listIterator();
 930 
 931         String[] matches;




  21  * questions.
  22  */
  23 
  24 /*
  25  * common code to run and validate tests of code generation for
  26  * volatile ops on AArch64
  27  *
  28  * incoming args are <testclass> <testtype>
  29  *
  30  * where <testclass> in {TestVolatileLoad,
  31  *                       TestVolatileStore,
  32  *                       TestUnsafeVolatileLoad,
  33  *                       TestUnsafeVolatileStore,
  34  *                       TestUnsafeVolatileCAS,
  35  *                       TestUnsafeVolatileWeakCAS,
  36  *                       TestUnsafeVolatileCAE,
  37  *                       TestUnsafeVolatileGAS}
  38  * and <testtype> in {G1,
  39  *                    Serial,
  40  *                    Parallel,
  41  *                    Shenandoah,
  42  *                    ShenandoahIU}
  43  */
  44 
  45 
  46 package compiler.c2.aarch64;
  47 
  48 import java.util.List;
  49 import java.util.ListIterator;
  50 import java.util.Iterator;
  51 import java.util.regex.Pattern;
  52 import java.io.*;
  53 
  54 import jdk.test.lib.Asserts;
  55 import jdk.test.lib.compiler.InMemoryJavaCompiler;
  56 import jdk.test.lib.process.OutputAnalyzer;
  57 import jdk.test.lib.process.ProcessTools;
  58 import sun.hotspot.WhiteBox;
  59 
  60 // runner class that spawns a new JVM to exercises a combination of
  61 // volatile MemOp and GC. The ops are compiled with the dmb -->
  62 // ldar/stlr transforms either enabled or disabled. this runner parses


  77             argcount = 9;
  78             procArgs = new String[argcount];
  79             procArgs[argcount - 2] = "-XX:+UseG1GC";
  80             break;
  81         case "Parallel":
  82             argcount = 9;
  83             procArgs = new String[argcount];
  84             procArgs[argcount - 2] = "-XX:+UseParallelGC";
  85             break;
  86         case "Serial":
  87             argcount = 9;
  88             procArgs = new String[argcount];
  89             procArgs[argcount - 2] = "-XX:+UseSerialGC";
  90             break;
  91         case "Shenandoah":
  92             argcount = 10;
  93             procArgs = new String[argcount];
  94             procArgs[argcount - 3] = "-XX:+UnlockExperimentalVMOptions";
  95             procArgs[argcount - 2] = "-XX:+UseShenandoahGC";
  96             break;
  97         case "ShenandoahIU":
  98             argcount = 11;
  99             procArgs = new String[argcount];
 100             procArgs[argcount - 4] = "-XX:+UnlockExperimentalVMOptions";
 101             procArgs[argcount - 3] = "-XX:+UseShenandoahGC";
 102             procArgs[argcount - 2] = "-XX:ShenandoahGCMode=iu";
 103             break;
 104         default:
 105             throw new RuntimeException("unexpected test type " + testType);
 106         }
 107 
 108         // fill in arguments common to all cases
 109 
 110         // the first round of test enables transform of barriers to
 111         // use acquiring loads and releasing stores by setting arg
 112         // zero appropriately. this arg is reset in the second run to
 113         // disable the transform.
 114 
 115         procArgs[0] = "-XX:-UseBarriersForVolatile";
 116         procArgs[1] = "-XX:+UseCompressedOops";
 117 
 118         procArgs[2] = "-XX:-TieredCompilation";
 119         procArgs[3] = "-XX:+PrintOptoAssembly";
 120         procArgs[4] = "-XX:CompileCommand=compileonly," + fullclassname + "::" + "test*";
 121         procArgs[5] = "--add-exports";
 122         procArgs[6] = "java.base/jdk.internal.misc=ALL-UNNAMED";
 123         procArgs[argcount - 1] = fullclassname;


 314                 };
 315                 break;
 316             case "G1":
 317                 // a card mark volatile barrier should be generated
 318                 // before the card mark strb
 319                 //
 320                 // following the fix for 8225776 the G1 barrier is now
 321                 // scheduled out of line after the membar volatile and
 322                 // and subsequent return
 323                 matches = new String[] {
 324                     "membar_release \\(elided\\)",
 325                     useCompressedOops ? "stlrw?" : "stlr",
 326                     "membar_volatile \\(elided\\)",
 327                     "ret",
 328                     "membar_volatile",
 329                     "dmb ish",
 330                     "strb"
 331                 };
 332                 break;
 333             case "Shenandoah":
 334             case "ShenandoahIU":
 335                  // Shenandoah generates normal object graphs for
 336                  // volatile stores
 337                 matches = new String[] {
 338                     "membar_release \\(elided\\)",
 339                     useCompressedOops ? "stlrw?" : "stlr",
 340                     "membar_volatile \\(elided\\)",
 341                     "ret"
 342                 };
 343                 break;
 344             }
 345         } else {
 346             switch (testType) {
 347             default:
 348                 // this is the basic sequence of instructions
 349                 matches = new String[] {
 350                     "membar_release",
 351                     "dmb ish",
 352                     useCompressedOops ? "strw?" : "str",
 353                     "membar_volatile",
 354                     "dmb ish",


 393                 break;
 394             case "CMS":
 395                 // a volatile card mark membar should not be generated
 396                 // before the card mark strb from the StoreCM and the
 397                 // storestore barrier from the StoreCM should be generated
 398                 // as "dmb ishst"
 399                 matches = new String[] {
 400                     "membar_release",
 401                     "dmb ish",
 402                     useCompressedOops ? "strw?" : "str",
 403                     "storestore",
 404                     "dmb ishst",
 405                     "strb",
 406                     "membar_volatile",
 407                     "dmb ish",
 408                     "ret"
 409                 };
 410                 break;
 411 
 412             case "Shenandoah":
 413             case "ShenandoahIU":
 414                  // Shenandoah generates normal object graphs for
 415                  // volatile stores
 416                 matches = new String[] {
 417                     "membar_release",
 418                     "dmb ish",
 419                     useCompressedOops ? "strw?" : "str",
 420                     "membar_volatile",
 421                     "dmb ish",
 422                     "ret"
 423                 };
 424                 break;
 425             }
 426         }
 427 
 428         checkCompile(iter, "testObj", matches, output, true);
 429     }
 430 
 431     // check for expected asm output from a volatile cas
 432 
 433     private void checkcas(OutputAnalyzer output, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable


 483                 };
 484                 break;
 485             case "G1":
 486                 // a card mark volatile barrier should be generated
 487                 // before the card mark strb
 488                 //
 489                 // following the fix for 8225776 the G1 barrier is now
 490                 // scheduled out of line after the membar acquire and
 491                 // and subsequent return
 492                 matches = new String[] {
 493                     "membar_release \\(elided\\)",
 494                     useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq",
 495                     "membar_acquire \\(elided\\)",
 496                     "ret",
 497                     "membar_volatile",
 498                     "dmb ish",
 499                     "strb"
 500                 };
 501                 break;
 502             case "Shenandoah":
 503             case "ShenandoahIU":
 504                 // For volatile CAS, Shenanodoah generates normal
 505                 // graphs with a shenandoah-specific cmpxchg
 506                 matches = new String[] {
 507                     "membar_release \\(elided\\)",
 508                     useCompressedOops ? "cmpxchgw?_acq_shenandoah" : "cmpxchg_acq_shenandoah",
 509                     "membar_acquire \\(elided\\)",
 510                     "ret"
 511                 };
 512                 break;
 513             }
 514         } else {
 515             switch (testType) {
 516             default:
 517                 // this is the basic sequence of instructions
 518                 matches = new String[] {
 519                     "membar_release",
 520                     "dmb ish",
 521                     useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
 522                     "membar_acquire",
 523                     "dmb ish",


 561                 };
 562                 break;
 563             case "CMS":
 564                 // a volatile card mark membar should not be generated
 565                 // before the card mark strb from the StoreCM and the
 566                 // storestore barrier from the StoreCM should be generated
 567                 // as "dmb ishst"
 568                 matches = new String[] {
 569                     "membar_release",
 570                     "dmb ish",
 571                     useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
 572                     "storestore",
 573                     "dmb ishst",
 574                     "strb",
 575                     "membar_acquire",
 576                     "dmb ish",
 577                     "ret"
 578                 };
 579                 break;
 580             case "Shenandoah":
 581             case "ShenandoahIU":
 582                 // For volatile CAS, Shenanodoah generates normal
 583                 // graphs with a shenandoah-specific cmpxchg
 584                 matches = new String[] {
 585                     "membar_release",
 586                     "dmb ish",
 587                     useCompressedOops ? "cmpxchgw?_shenandoah" : "cmpxchg_shenandoah",
 588                     "membar_acquire",
 589                     "dmb ish",
 590                     "ret"
 591                 };
 592                 break;
 593             }
 594         }
 595 
 596         checkCompile(iter, "testObj", matches, output, true);
 597     }
 598 
 599     private void checkcae(OutputAnalyzer output, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable
 600     {
 601         ListIterator<String> iter = output.asLines().listIterator();


 667                 return;
 668 
 669             case "G1":
 670                 // a card mark volatile barrier should be generated
 671                 // before the card mark strb
 672                 //
 673                 // following the fix for 8225776 the G1 barrier is now
 674                 // scheduled out of line after the membar acquire and
 675                 // and subsequent return
 676                 matches = new String[] {
 677                     "membar_release \\(elided\\)",
 678                     useCompressedOops ? "cmpxchgw?_acq" : "cmpxchg_acq",
 679                     "membar_acquire \\(elided\\)",
 680                     "ret",
 681                     "membar_volatile",
 682                     "dmb ish",
 683                     "strb"
 684                 };
 685                 break;
 686             case "Shenandoah":
 687             case "ShenandoahIU":
 688                 // For volatile CAS, Shenanodoah generates normal
 689                 // graphs with a shenandoah-specific cmpxchg
 690                 matches = new String[] {
 691                     "membar_release \\(elided\\)",
 692                     useCompressedOops ? "cmpxchgw?_acq_shenandoah" : "cmpxchg_acq_shenandoah",
 693                     "membar_acquire \\(elided\\)",
 694                     "ret"
 695                 };
 696                 break;
 697             }
 698         } else {
 699             switch (testType) {
 700             default:
 701                 // this is the basic sequence of instructions
 702                 matches = new String[] {
 703                     "membar_release",
 704                     "dmb ish",
 705                     useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
 706                     "membar_acquire",
 707                     "dmb ish",


 745                 };
 746                 break;
 747             case "CMS":
 748                 // a volatile card mark membar should not be generated
 749                 // before the card mark strb from the StoreCM and the
 750                 // storestore barrier from the StoreCM should be generated
 751                 // as "dmb ishst"
 752                 matches = new String[] {
 753                     "membar_release",
 754                     "dmb ish",
 755                     useCompressedOops ? "cmpxchgw? " : "cmpxchg ",
 756                     "storestore",
 757                     "dmb ishst",
 758                     "strb",
 759                     "membar_acquire",
 760                     "dmb ish",
 761                     "ret"
 762                 };
 763                 break;
 764             case "Shenandoah":
 765             case "ShenandoahIU":
 766                 // For volatile CAS, Shenanodoah generates normal
 767                 // graphs with a shenandoah-specific cmpxchg
 768                 matches = new String[] {
 769                     "membar_release",
 770                     "dmb ish",
 771                     useCompressedOops ? "cmpxchgw?_shenandoah" : "cmpxchg_shenandoah",
 772                     "membar_acquire",
 773                     "dmb ish",
 774                     "ret"
 775                 };
 776                 break;
 777             }
 778         }
 779 
 780         checkCompile(iter, "testObj", matches, output, true);
 781     }
 782 
 783     private void checkgas(OutputAnalyzer output, String testType, boolean useBarriersForVolatile, boolean useCompressedOops) throws Throwable
 784     {
 785         Iterator<String> iter = output.asLines().listIterator();


 831                 };
 832                 break;
 833             case "G1":
 834                 // a card mark volatile barrier should be generated
 835                 // before the card mark strb
 836                 //
 837                 // following the fix for 8225776 the G1 barrier is now
 838                 // scheduled out of line after the membar acquire and
 839                 // and subsequent return
 840                 matches = new String[] {
 841                     "membar_release \\(elided\\)",
 842                     useCompressedOops ? "atomic_xchgw?_acq" : "atomic_xchg_acq",
 843                     "membar_acquire \\(elided\\)",
 844                     "ret",
 845                     "membar_volatile",
 846                     "dmb ish",
 847                     "strb"
 848                 };
 849                 break;
 850             case "Shenandoah":
 851             case "ShenandoahIU":
 852                 matches = new String[] {
 853                     "membar_release \\(elided\\)",
 854                     useCompressedOops ? "atomic_xchgw?_acq" : "atomic_xchg_acq",
 855                     "membar_acquire \\(elided\\)",
 856                     "ret"
 857                 };
 858                 break;
 859             }
 860         } else {
 861             switch (testType) {
 862             default:
 863                 // this is the basic sequence of instructions
 864                 matches = new String[] {
 865                     "membar_release",
 866                     "dmb ish",
 867                     useCompressedOops ? "atomic_xchgw? " : "atomic_xchg ",
 868                     "membar_acquire",
 869                     "dmb ish",
 870                     "ret"
 871                 };


 907                 };
 908                 break;
 909             case "CMS":
 910                 // a volatile card mark membar should not be generated
 911                 // before the card mark strb from the StoreCM and the
 912                 // storestore barrier from the StoreCM should be generated
 913                 // as "dmb ishst"
 914                 matches = new String[] {
 915                     "membar_release",
 916                     "dmb ish",
 917                     useCompressedOops ? "atomic_xchgw? " : "atomic_xchg ",
 918                     "storestore",
 919                     "dmb ishst",
 920                     "strb",
 921                     "membar_acquire",
 922                     "dmb ish",
 923                     "ret"
 924                 };
 925                 break;
 926             case "Shenandoah":
 927             case "ShenandoahIU":
 928                 matches = new String[] {
 929                     "membar_release",
 930                     "dmb ish",
 931                     useCompressedOops ? "atomic_xchgw? " : "atomic_xchg ",
 932                     "membar_acquire",
 933                     "dmb ish",
 934                     "ret"
 935                 };
 936                 break;
 937             }
 938         }
 939 
 940         checkCompile(iter, "testObj", matches, output, true);
 941     }
 942 
 943     private void checkgaa(OutputAnalyzer output, String testType, boolean useBarriersForVolatile) throws Throwable
 944     {
 945         Iterator<String> iter = output.asLines().listIterator();
 946 
 947         String[] matches;


< prev index next >