Automated rollback of commit 872c11ae8d1fe9b74aaaf8874201ab7e0f2906df.

*** Reason for rollback ***

This change introduced a performance regression in bazel.

More details in https://github.com/bazelbuild/bazel/issues/9270.

*** Original change description ***

Allow G1 in tools/jdk/BUILD.java_tools.

This is a followup to 01e6e05a35633df92cafc20b28eac15cd1aefa09. (I think BUILD.java_tools was introduced in between the creation of the PR for 01e6e05a35633df92cafc20b28eac15cd1aefa09 and its landing.)

Closes #8964.

PiperOrigin-RevId: 272156477
diff --git a/tools/jdk/BUILD.java_tools b/tools/jdk/BUILD.java_tools
index 8ccde87..3f1e916 100644
--- a/tools/jdk/BUILD.java_tools
+++ b/tools/jdk/BUILD.java_tools
@@ -36,6 +36,10 @@
     javac = [":javac_jar"],
     javac_supports_workers = 1,
     jvm_opts = [
+        # In JDK9 we have seen a ~30% slow down in JavaBuilder performance when using
+        # G1 collector and having compact strings enabled.
+        "-XX:+UseParallelOldGC",
+        "-XX:-CompactStrings",
         # Allow JavaBuilder to access internal javac APIs.
         "--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
         "--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
@@ -93,6 +97,10 @@
     javac = [":javac_jar"],
     javac_supports_workers = 1,
     jvm_opts = [
+        # In JDK9 we have seen a ~30% slow down in JavaBuilder performance
+        # when using G1 collector and having compact strings enabled.
+        "-XX:+UseParallelOldGC",
+        "-XX:-CompactStrings",
         # Allow JavaBuilder to access internal javac APIs.
         "--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
         "--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
@@ -154,6 +162,10 @@
     javac = [":javac_jar"],
     javac_supports_workers = 1,
     jvm_opts = [
+        # In JDK9 we have seen a ~30% slow down in JavaBuilder performance when using
+        # G1 collector and having compact strings enabled.
+        "-XX:+UseParallelOldGC",
+        "-XX:-CompactStrings",
         # Allow JavaBuilder to access internal javac APIs.
         "--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
         "--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",