# HG changeset patch # User Gilles Duboscq # Date 1389963762 -3600 # Node ID 034706a93f277c8666c092bbc242f4f8f1bedac7 # Parent a5206a3b92f2857d8010017a8474c5168a562003 CodeCacheProvider.addMethod: add speculationLog argument diff -r a5206a3b92f2 -r 034706a93f27 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java --- 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. diff -r a5206a3b92f2 -r 034706a93f27 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/package-info.java --- 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; diff -r a5206a3b92f2 -r 034706a93f27 graal/com.oracle.graal.asm.test/src/com/oracle/graal/asm/test/AssemblerTest.java --- 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) { diff -r a5206a3b92f2 -r 034706a93f27 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java --- 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); } /** diff -r a5206a3b92f2 -r 034706a93f27 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java --- 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. diff -r a5206a3b92f2 -r 034706a93f27 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotCodeCacheProvider.java --- 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); diff -r a5206a3b92f2 -r 034706a93f27 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerImpl.java --- 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); }