MCPcopy Index your code
hub / github.com/compiler-explorer/compiler-explorer / handleInterpreting

Method handleInterpreting

lib/compilers/java.ts:178–216  ·  view source on GitHub ↗
(
        key: CacheKey,
        executeParameters: ExecutableExecutionOptions,
    )

Source from the content-addressed store, hash-verified

176 }
177
178 override async handleInterpreting(
179 key: CacheKey,
180 executeParameters: ExecutableExecutionOptions,
181 ): Promise<CompilationResult> {
182 const executionPackageHash = this.env.getExecutableHash(key);
183 const compileResult = await this.getOrBuildExecutable(key, BypassCache.None, executionPackageHash);
184 if (compileResult.code === 0) {
185 const extraXXFlags: string[] = [];
186 if (Semver.gte(utils.asSafeVer(this.compiler.semver), '11.0.0', true)) {
187 extraXXFlags.push('-XX:-UseDynamicNumberOfCompilerThreads');
188 }
189 assert(compileResult.dirPath !== undefined);
190 executeParameters.args = [
191 '-Xss136K', // Reduce thread stack size
192 '-XX:CICompilerCount=2', // Reduce JIT compilation threads. 2 is minimum
193 '-XX:-UseDynamicNumberOfGCThreads',
194 '-XX:+UseSerialGC', // Disable parallell/concurrent garbage collector
195 ...extraXXFlags,
196 await this.getMainClassName(compileResult.dirPath),
197 '-cp',
198 compileResult.dirPath,
199 ...executeParameters.args,
200 ];
201 const result = await this.runExecutable(this.javaRuntime, executeParameters, compileResult.dirPath);
202 return {
203 ...result,
204 didExecute: true,
205 buildResult: compileResult,
206 };
207 }
208 return {
209 stdout: compileResult.stdout,
210 stderr: compileResult.stderr,
211 code: compileResult.code,
212 didExecute: false,
213 buildResult: compileResult,
214 timedOut: false,
215 };
216 }
217
218 async getMainClassName(dirPath: string) {
219 const maxSize = this.env.ceProps('max-asm-size', 64 * 1024 * 1024);

Callers

nothing calls this directly

Calls 7

getMainClassNameMethod · 0.95
getExecutableHashMethod · 0.80
getOrBuildExecutableMethod · 0.80
gteMethod · 0.80
pushMethod · 0.80
assertFunction · 0.50
runExecutableMethod · 0.45

Tested by

no test coverage detected