aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers/java.js
diff options
context:
space:
mode:
authorMats Larsen <me@supergrecko.com>2021-07-06 16:42:21 +0200
committerGitHub <noreply@github.com>2021-07-06 09:42:21 -0500
commitf3be74183de288f4ae360f059ebc3a56a3bd1d29 (patch)
tree40bee0269f302984ed6f5fd60834113a1833f79b /lib/compilers/java.js
parent70cb841dafcd1ea04b02bc1ebbe80fa6bd32a3da (diff)
downloadcompiler-explorer-f3be74183de288f4ae360f059ebc3a56a3bd1d29.tar.gz
compiler-explorer-f3be74183de288f4ae360f059ebc3a56a3bd1d29.zip
Fix execution for JVM compilers (#2767)
Diffstat (limited to 'lib/compilers/java.js')
-rw-r--r--lib/compilers/java.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/compilers/java.js b/lib/compilers/java.js
index 3f6b9d184..32e17c1a3 100644
--- a/lib/compilers/java.js
+++ b/lib/compilers/java.js
@@ -103,7 +103,13 @@ export class JavaCompiler extends BaseCompiler {
];
}
- async handleInterpreting(key, executeParameters) {
+ async handleInterpreting(source, executeParameters) {
+ const dirPath = await this.newTempDir();
+ const inputFile = path.join(dirPath, this.compileFilename);
+ await fs.writeFile(inputFile, source);
+ const execOpts = this.getDefaultExecOptions();
+ const compileResult = await this.runCompiler(this.compiler.exe, [inputFile], inputFile, execOpts);
+
executeParameters.args = [
'-Xss136K', // Reduce thread stack size
'-XX:CICompilerCount=2', // Reduce JIT compilation threads. 2 is minimum
@@ -113,11 +119,9 @@ export class JavaCompiler extends BaseCompiler {
this.getMainClassName(),
...executeParameters.args,
];
- const buildResult = await this.getOrBuildExecutable(key);
- const dirPath = path.dirname(buildResult.executableFilename);
const result = await this.runExecutable(this.javaRuntime, executeParameters, dirPath);
result.didExecute = true;
- result.buildResult = buildResult;
+ result.buildResult = compileResult;
return result;
}