summaryrefslogtreecommitdiff
path: root/stubs
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@opera.com>2026-11-23 23:01:12 +0100
committerJoel Klinghed <the_jk@opera.com>2026-11-23 23:01:12 +0100
commit4a104f1147eb88c217f6ab57b296e3a543ffbce8 (patch)
tree097439ef7fcc2ad6674a3c26c4ba06957bbd99aa /stubs
parentf6d1b9d25ede46567a8da89f01b3db915a25798d (diff)
Add kotlin.proxy.pgoProfileDir property
Used to collect profile directories.
Diffstat (limited to 'stubs')
-rw-r--r--stubs/src/kotlin/proxy/KotlinProxyOverrides.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/stubs/src/kotlin/proxy/KotlinProxyOverrides.java b/stubs/src/kotlin/proxy/KotlinProxyOverrides.java
index e03c04d..996e06c 100644
--- a/stubs/src/kotlin/proxy/KotlinProxyOverrides.java
+++ b/stubs/src/kotlin/proxy/KotlinProxyOverrides.java
@@ -30,6 +30,7 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.IdentityHashMap;
import java.util.Map;
+import java.util.UUID;
import java.util.stream.Stream;
/**
@@ -118,6 +119,13 @@ public final class KotlinProxyOverrides {
}
ArrayList<String> cmd = new ArrayList<String>();
cmd.add(nativeImage.toString());
+ // For an image built with --pgo-instrument. Each compile writes its own profile, because parallel
+ // compiles share the working directory and overwrite each other's default.iprof.
+ String pgoProfileDir = System.getProperty("kotlin.proxy.pgoProfileDir");
+ if (pgoProfileDir != null && !pgoProfileDir.isEmpty()) {
+ new File(pgoProfileDir).mkdirs();
+ cmd.add("-XX:ProfilesDumpFile=" + new File(pgoProfileDir, UUID.randomUUID() + ".iprof"));
+ }
cmd.addAll(GeneratedJvmArguments.buildCommandArgs(arguments));
cmd.addAll(arguments.getFreeArgs());
ProcessBuilder builder = new ProcessBuilder(cmd);