Mercurial > hg > graal-compiler
changeset 13669:034706a93f27
CodeCacheProvider.addMethod: add speculationLog argument
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Fri, 17 Jan 2014 14:02:42 +0100 |
parents | a5206a3b92f2 |
children | f82eb515d58d |
files | graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/package-info.java graal/com.oracle.graal.asm.test/src/com/oracle/graal/asm/test/AssemblerTest.java graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotCodeCacheProvider.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerImpl.java |
diffstat | 7 files changed, 10 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java Fri Jan 17 14:01:02 2014 +0100 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java Fri Jan 17 14:02:42 2014 +0100 @@ -36,10 +36,11 @@ * * @param method a method to which the executable code is begin added * @param compResult the compilation result to be added + * @param speculationLog the speculation log to be used * @return a reference to the compiled and ready-to-run code or null if the code installation * failed */ - InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult); + InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult, SpeculationLog speculationLog); /** * Sets the given compilation result as the default implementation of the given method.
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/package-info.java Fri Jan 17 14:01:02 2014 +0100 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/package-info.java Fri Jan 17 14:02:42 2014 +0100 @@ -23,7 +23,7 @@ /** * Package that defines the interface between a Java application that wants to install code and the runtime. * The runtime provides in implementation of the {@link com.oracle.graal.api.code.CodeCacheProvider} interface. - * The method {@link com.oracle.graal.api.code.CodeCacheProvider#addMethod(com.oracle.graal.api.meta.ResolvedJavaMethod, CompilationResult)} + * The method {@link com.oracle.graal.api.code.CodeCacheProvider#addMethod(com.oracle.graal.api.meta.ResolvedJavaMethod, CompilationResult, SpeculationLog)} * can be used to install code for a given method. */ package com.oracle.graal.api.code;
--- a/graal/com.oracle.graal.asm.test/src/com/oracle/graal/asm/test/AssemblerTest.java Fri Jan 17 14:01:02 2014 +0100 +++ b/graal/com.oracle.graal.asm.test/src/com/oracle/graal/asm/test/AssemblerTest.java Fri Jan 17 14:02:42 2014 +0100 @@ -63,7 +63,7 @@ Buffer codeBuffer = test.generateCode(compResult, codeCache.getTarget(), registerConfig, cc); compResult.setTargetCode(codeBuffer.close(true), codeBuffer.position()); - InstalledCode code = codeCache.addMethod(method, compResult); + InstalledCode code = codeCache.addMethod(method, compResult, null); DisassemblerProvider dis = Graal.getRequiredCapability(RuntimeProvider.class).getHostBackend().getDisassembler(); if (dis != null) {
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Fri Jan 17 14:01:02 2014 +0100 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Fri Jan 17 14:02:42 2014 +0100 @@ -582,7 +582,7 @@ } protected InstalledCode addMethod(final ResolvedJavaMethod method, final CompilationResult compResult) { - return getCodeCache().addMethod(method, compResult); + return getCodeCache().addMethod(method, compResult, null); } /**
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java Fri Jan 17 14:01:02 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java Fri Jan 17 14:02:42 2014 +0100 @@ -170,7 +170,7 @@ * @param code the details of the installed CodeBlob are written to this object * @return the outcome of the installation as a {@link CodeInstallResult}. */ - CodeInstallResult installCode(HotSpotCompiledCode compiledCode, HotSpotInstalledCode code, SpeculationLog cache); + CodeInstallResult installCode(HotSpotCompiledCode compiledCode, HotSpotInstalledCode code, SpeculationLog speculationLog); /** * Notifies the VM of statistics for a completed compilation.
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotCodeCacheProvider.java Fri Jan 17 14:01:02 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotCodeCacheProvider.java Fri Jan 17 14:02:42 2014 +0100 @@ -174,16 +174,17 @@ } @Override - public InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult) { + public InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult, SpeculationLog log) { HotSpotResolvedJavaMethod hotspotMethod = (HotSpotResolvedJavaMethod) method; HotSpotInstalledCode code = new HotSpotNmethod(hotspotMethod, compResult.getName(), false); - CodeInstallResult result = runtime.getCompilerToVM().installCode(new HotSpotCompiledNmethod(hotspotMethod, compResult), code, null); + CodeInstallResult result = runtime.getCompilerToVM().installCode(new HotSpotCompiledNmethod(hotspotMethod, compResult), code, log); if (result != CodeInstallResult.OK) { return null; } return logOrDump(code, compResult); } + @Override public InstalledCode setDefaultMethod(ResolvedJavaMethod method, CompilationResult compResult) { HotSpotResolvedJavaMethod hotspotMethod = (HotSpotResolvedJavaMethod) method; return installMethod(hotspotMethod, compResult);
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerImpl.java Fri Jan 17 14:01:02 2014 +0100 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerImpl.java Fri Jan 17 14:02:42 2014 +0100 @@ -244,7 +244,7 @@ InstalledCode installedCode = null; try (Scope s = Debug.scope("CodeInstall", providers.getCodeCache()); TimerCloseable a = CodeInstallationTime.start()) { - installedCode = providers.getCodeCache().addMethod(graph.method(), result); + installedCode = providers.getCodeCache().addMethod(graph.method(), result, null); } catch (Throwable e) { throw Debug.handle(e); }