src/hotspot/share/compiler/directivesParser.cpp
changeset 52290 db83eceba962
parent 49480 d7df2dd501ce
child 53266 57d8566a2732
--- a/src/hotspot/share/compiler/directivesParser.cpp	Thu Oct 25 10:58:59 2018 -0700
+++ b/src/hotspot/share/compiler/directivesParser.cpp	Thu Oct 25 11:18:24 2018 -0700
@@ -566,159 +566,3 @@
   }
 }
 
-#ifndef PRODUCT
-void DirectivesParser::test(const char* text, bool should_pass) {
-  DirectivesParser cd(text, tty, !VerboseInternalVMTests);
-  if (should_pass) {
-    assert(cd.valid() == true, "failed on a valid DirectivesParser string");
-    if (VerboseInternalVMTests) {
-      tty->print("-- DirectivesParser test passed as expected --\n");
-    }
-  } else {
-    assert(cd.valid() == false, "succeeded on an invalid DirectivesParser string");
-    if (VerboseInternalVMTests) {
-      tty->print("-- DirectivesParser test failed as expected --\n");
-    }
-  }
-  cd.clean_tmp();
-}
-
-void DirectivesParser::test() {
-  DirectivesParser::test("{}", false);
-  DirectivesParser::test("[]", true);
-  DirectivesParser::test("[{}]", false);
-  DirectivesParser::test("[{},{}]", false);
-  DirectivesParser::test("{},{}", false);
-
-  DirectivesParser::test(
-    "[" "\n"
-    "  {" "\n"
-    "    match: \"foo/bar.*\"," "\n"
-    "    inline : \"+java/util.*\"," "\n"
-    "    PrintAssembly: true," "\n"
-    "    BreakAtExecute: true," "\n"
-    "  }" "\n"
-    "]" "\n", true);
-
-  DirectivesParser::test(
-    "[" "\n"
-    "  [" "\n"
-    "    {" "\n"
-    "      match: \"foo/bar.*\"," "\n"
-    "      inline : \"+java/util.*\"," "\n"
-    "      PrintAssembly: true," "\n"
-    "      BreakAtExecute: true," "\n"
-    "    }" "\n"
-    "  ]" "\n"
-    "]" "\n", false);
-
-  /*DirectivesParser::test(
-    "[" "\n"
-    "  {" "\n"
-    "    match: \"foo/bar.*\"," "\n"
-    "    c1: {"
-    "      PrintIntrinsics: false," "\n"
-    "    }" "\n"
-    "  }" "\n"
-    "]" "\n", false);*/
-
-  DirectivesParser::test(
-    "[" "\n"
-    "  {" "\n"
-    "    match: \"foo/bar.*\"," "\n"
-    "    c2: {" "\n"
-    "      PrintInlining: false," "\n"
-    "    }" "\n"
-    "  }" "\n"
-    "]" "\n", true);
-
-  DirectivesParser::test(
-    "[" "\n"
-    "  {" "\n"
-    "    match: \"foo/bar.*\"," "\n"
-    "    c2: {" "\n"
-    "      VectorizeDebug: 1," "\n"
-    "      VectorizeDebug: -1," "\n"
-    "    }" "\n"
-    "  }" "\n"
-    "]" "\n", COMPILER2_PRESENT(true) NOT_COMPILER2(false));
-
-  DirectivesParser::test(
-    "[" "\n"
-    "  {" "\n"
-    "    match: \"foo/bar.*\"," "\n"
-    "    PrintInlining: [" "\n"
-    "      true," "\n"
-    "      false" "\n"
-    "    ]," "\n"
-    "  }" "\n"
-    "]" "\n", false);
-
-  DirectivesParser::test(
-    "[" "\n"
-    "  {"
-    "    // pattern to match against class+method+signature" "\n"
-    "    // leading and trailing wildcard (*) allowed" "\n"
-    "    match: \"foo/bar.*\"," "\n"
-    "" "\n"
-    "    // override defaults for specified compiler" "\n"
-    "    // we may differentiate between levels too. TBD." "\n"
-    "    c1:  {" "\n"
-    "      //override c1 presets " "\n"
-    "      DumpReplay: false," "\n"
-    "      BreakAtCompile: true," "\n"
-    "    }," "\n"
-    "" "\n"
-    "    c2: {" "\n"
-    "        // control inlining of method" "\n"
-    "        // + force inline, - dont inline" "\n"
-    "        inline : \"+java/util.*\"," "\n"
-    "        PrintInlining: true," "\n"
-    "    }," "\n"
-    "" "\n"
-    "    // directives outside a specific preset applies to all compilers" "\n"
-    "    inline : [ \"+java/util.*\", \"-com/sun.*\"]," "\n"
-    "    BreakAtExecute: true," "\n"
-    "    Log: true," "\n"
-    "  }," "\n"
-    "  {" "\n"
-    "    // matching several patterns require an array" "\n"
-    "    match: [\"baz.*\",\"frob.*\"]," "\n"
-    "" "\n"
-    "    // applies to all compilers" "\n"
-    "    // + force inline, - dont inline" "\n"
-    "    inline : [ \"+java/util.*\", \"-com/sun.*\" ]," "\n"
-    "    PrintInlining: true," "\n"
-    "" "\n"
-    "    // force matching compiles to be blocking/syncronous" "\n"
-    "    PrintNMethods: true" "\n"
-    "  }," "\n"
-    "]" "\n", true);
-
-  // Test max stack depth
-    DirectivesParser::test(
-      "[" "\n"             // depth 1: type_dir_array
-      "  {" "\n"           // depth 2: type_directives
-      "    match: \"*.*\"," // match required
-      "    c1:" "\n"       // depth 3: type_c1
-      "    {" "\n"
-      "      inline:" "\n" // depth 4: type_inline
-      "      [" "\n"       // depth 5: type_value_array
-      "        \"foo\"," "\n"
-      "        \"bar\"," "\n"
-      "      ]" "\n"       // depth 3: pop type_value_array and type_inline keys
-      "    }" "\n"         // depth 2: pop type_c1 key
-      "  }" "\n"           // depth 1: pop type_directives key
-      "]" "\n", true);     // depth 0: pop type_dir_array key
-
-    // Test max stack depth
-    DirectivesParser::test(
-      "[{c1:{c1:{c1:{c1:{c1:{c1:{c1:{}}}}}}}}]", false);
-
-}
-
-void DirectivesParser_test() {
-  DirectivesParser::test();
-}
-
-#endif