8211740: [AOT] -XX:AOTLibrary doesn't accept windows path
authorbobv
Tue, 16 Oct 2018 09:54:28 -0400
changeset 52145 89f3b013ab8f
parent 52120 84fe81feae26
child 52146 032c1c1379ab
8211740: [AOT] -XX:AOTLibrary doesn't accept windows path Reviewed-by: kvn, iignatyev
src/hotspot/share/aot/aotLoader.cpp
test/hotspot/jtreg/compiler/aot/cli/MultipleAOTLibraryTest.java
--- a/src/hotspot/share/aot/aotLoader.cpp	Mon Oct 15 14:42:31 2018 +0100
+++ b/src/hotspot/share/aot/aotLoader.cpp	Tue Oct 16 09:54:28 2018 -0400
@@ -137,6 +137,12 @@
       return;
     }
 
+#ifdef _WINDOWS
+    const char pathSep = ';';
+#else
+    const char pathSep = ':';
+#endif
+
     // Scan the AOTLibrary option.
     if (AOTLibrary != NULL) {
       const int len = (int)strlen(AOTLibrary);
@@ -147,7 +153,7 @@
         char* end = cp + len;
         while (cp < end) {
           const char* name = cp;
-          while ((*cp) != '\0' && (*cp) != '\n' && (*cp) != ',' && (*cp) != ':' && (*cp) != ';')  cp++;
+          while ((*cp) != '\0' && (*cp) != '\n' && (*cp) != ',' && (*cp) != pathSep) cp++;
           cp[0] = '\0';  // Terminate name
           cp++;
           load_library(name, true);
--- a/test/hotspot/jtreg/compiler/aot/cli/MultipleAOTLibraryTest.java	Mon Oct 15 14:42:31 2018 +0100
+++ b/test/hotspot/jtreg/compiler/aot/cli/MultipleAOTLibraryTest.java	Tue Oct 16 09:54:28 2018 -0400
@@ -54,6 +54,7 @@
 package compiler.aot.cli;
 
 import compiler.aot.HelloWorldPrinter;
+import java.io.File;
 import java.util.Arrays;
 import jdk.test.lib.process.ExitCode;
 import jdk.test.lib.cli.CommandLineOptionTest;
@@ -75,8 +76,11 @@
             boolean addTestVMOptions = true;
             String[] allArgs = Arrays.copyOf(args, args.length + 4);
             allArgs[args.length] = "-XX:AOTLibrary="
-                    + "./libMultipleAOTLibraryTest1.so:"
-                    + "./libMultipleAOTLibraryTest2.so";
+                    + "." + File.separator
+                    + "libMultipleAOTLibraryTest1.so"
+                    + File.pathSeparator
+                    + "." + File.separator
+                    + "libMultipleAOTLibraryTest2.so";
             allArgs[args.length + 1] = "-XX:+PrintAOT";
             allArgs[args.length + 2] = "-XX:+UseAOT";
             allArgs[args.length + 3] = HelloWorldPrinter.class.getName();