comparison graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java @ 15162:dbb1fe8348e6

Allow to supply predefined installed code object when adding a method to the code cache.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Tue, 15 Apr 2014 15:22:37 +0200
parents 0286888f792b
children d90e5c22ba55
comparison
equal deleted inserted replaced
15161:2c940b1a48d8 15162:dbb1fe8348e6
310 } 310 }
311 } 311 }
312 } 312 }
313 313
314 try (TimerCloseable b = CodeInstallationTime.start()) { 314 try (TimerCloseable b = CodeInstallationTime.start()) {
315 installedCode = installMethod(result); 315 installedCode = (HotSpotInstalledCode) installMethod(result);
316 if (!isOSR) { 316 if (!isOSR) {
317 ProfilingInfo profile = method.getProfilingInfo(); 317 ProfilingInfo profile = method.getProfilingInfo();
318 profile.setCompilerIRSize(StructuredGraph.class, graph.getNodeCount()); 318 profile.setCompilerIRSize(StructuredGraph.class, graph.getNodeCount());
319 } 319 }
320 } 320 }
383 TTY.println(String.format("%s%7d %4d %c%c%c%c%c %s %s %s(%d bytes)", compilerName, backend.getRuntime().compilerToVm.getTimeStamp(), id, isOSR ? '%' : ' ', 383 TTY.println(String.format("%s%7d %4d %c%c%c%c%c %s %s %s(%d bytes)", compilerName, backend.getRuntime().compilerToVm.getTimeStamp(), id, isOSR ? '%' : ' ',
384 Modifier.isSynchronized(mod) ? 's' : ' ', hasExceptionHandlers ? '!' : ' ', blocking ? 'b' : ' ', Modifier.isNative(mod) ? 'n' : ' ', compLevelString, 384 Modifier.isSynchronized(mod) ? 's' : ' ', hasExceptionHandlers ? '!' : ' ', blocking ? 'b' : ' ', Modifier.isNative(mod) ? 'n' : ' ', compLevelString,
385 MetaUtil.format("%H::%n(%p)", method), isOSR ? "@ " + entryBCI + " " : "", method.getCodeSize())); 385 MetaUtil.format("%H::%n(%p)", method), isOSR ? "@ " + entryBCI + " " : "", method.getCodeSize()));
386 } 386 }
387 387
388 private HotSpotInstalledCode installMethod(final CompilationResult compResult) { 388 private InstalledCode installMethod(final CompilationResult compResult) {
389 final HotSpotCodeCacheProvider codeCache = backend.getProviders().getCodeCache(); 389 final HotSpotCodeCacheProvider codeCache = backend.getProviders().getCodeCache();
390 HotSpotInstalledCode installedCode = null; 390 InstalledCode installedCode = null;
391 try (Scope s = Debug.scope("CodeInstall", new DebugDumpScope(String.valueOf(id), true), codeCache, method)) { 391 try (Scope s = Debug.scope("CodeInstall", new DebugDumpScope(String.valueOf(id), true), codeCache, method)) {
392 installedCode = codeCache.installMethod(method, compResult); 392 installedCode = codeCache.installMethod(method, compResult);
393 } catch (Throwable e) { 393 } catch (Throwable e) {
394 throw Debug.handle(e); 394 throw Debug.handle(e);
395 } 395 }