checkSnippetKills
Deneau, Tom
tom.deneau at amd.com
Wed Mar 26 22:35:16 UTC 2014
Bernhard --
OK, so if in my own snippets I only plan to use snippet counters outside of stubs, I only need the change to SnippetCounter.java itself, is that correct?
Were the NewObjectSnippets the only ones where snippets could be used inside of stubs?
-- Tom
From: lewurm at gmail.com [mailto:lewurm at gmail.com] On Behalf Of Bernhard Urban
Sent: Wednesday, March 26, 2014 4:30 PM
To: Deneau, Tom
Cc: graal-dev at openjdk.java.net
Subject: Re: checkSnippetKills
Hi Tom,
thanks, there's indeed a problem around SnippetCounters. First, as a comment in the snippet counter implementation already suggest, it should not use ANY_LOCATION but a separate location designated to snippet counters. After doing that, it exposes another problem around HotSpot stubs. Stubs are not allowed to embed oops in their code. Thus my fix excludes snippet counters in snippets designed for stubs.
Apparently we don't use snippet counters that much lately ;-) I'm pushing it through the gate now, in the meanwhile you can fetch the patch from here: http://lafo.ssw.uni-linz.ac.at/lewurm/snippetcounters.patch
-Bernhard
On Wed, Mar 26, 2014 at 8:36 PM, Deneau, Tom <tom.deneau at amd.com<mailto:tom.deneau at amd.com>> wrote:
I just tried this with the amd64 backend and got similar results
I compiled:
MyObj[] escapingObject;
public void newObjTest(int gid) {
escapingObject[gid] = new MyObj();
}
and using -G:+SnippetCounters
The log showed
Lowering allocateInstance in StructuredGraph:18{HotSpotMethod<BasicTest2.newObjTest(int)>}: node=159|NewInstance, template=StructuredGraph:39{HotSpotMethod<NewObjectSnippets.allocateInstance(int, Word, Word, boolean, Register, boolean, String)>}(<constant> [0], long [1], <unused> [2], <constant> [3], <constant> [4], <constant> [5], <constant> [6]), arguments=Parameters<NewObjectSnippets.allocateInstance [const size = 16, hub = 124|Const(4296021216), prototypeMarkWord = 5, const fillContents = true, const threadRegister = r15, const constantSize = true, const typeContext = >
WARNING: 159|NewInstance is not a MemoryCheckpoint, but the snippet graph contains kills ([ANY_LOCATION]). You might want 159|NewInstance to be a MemoryCheckpoint
[thread:1] scope: BasicTest2.Compiling.GraalCompiler.FrontEnd.LowTier.Lowering.IncrementalCanonicalizer.LoweringIteration0.InterceptException
Exception occurred in scope: BasicTest2.Compiling.GraalCompiler.FrontEnd.LowTier.Lowering.IncrementalCanonicalizer.LoweringIteration0.InterceptException
Context obj java.lang.AssertionError: snippet graph contains a kill to ANY_LOCATION, but replacee (159|NewInstance) doesn't kill ANY_LOCATION. kills: [ANY_LOCATION]
> -----Original Message-----
> From: Deneau, Tom
> Sent: Wednesday, March 26, 2014 2:27 PM
> To: graal-dev at openjdk.java.net<mailto:graal-dev at openjdk.java.net>
> Subject: checkSnippetKills
>
> I have a snippet for NewInstance that works but I wanted to increment a
> snippet counter on one of the paths thru the snippet. After doing that
> and using -G:+SnippetCounters, I get the following error:
>
> java.lang.AssertionError: snippet graph contains a kill to ANY_LOCATION,
> but replacee (333|NewInstance) doesn't kill ANY_LOCATION. kills:
> [ANY_LOCATION, Initialization]
> at
> com.oracle.graal.replacements.SnippetTemplate.checkSnippetKills(SnippetT
> emplate.java:946)
>
> How should this be corrected?
>
> -- Tom
More information about the graal-dev
mailing list