Mercurial > hg > graal-compiler
changeset 22713:ddbd40b1a30e
SnippetTemplate: Allow remove locations in snippet
author | Stefan Anzinger <stefan.anzinger@oracle.com> |
---|---|
date | Mon, 28 Sep 2015 17:18:58 +0200 |
parents | c2484dfe93e3 |
children | 265e4cfa1f9f |
files | graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java |
diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Mon Sep 28 17:17:42 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Mon Sep 28 17:18:58 2015 +0200 @@ -134,6 +134,7 @@ public class SnippetTemplate { private static final boolean EAGER_SNIPPETS = Boolean.getBoolean("graal.snippets.eager"); + private boolean mayRemoveLocation = false; /** * Holds the {@link ResolvedJavaMethod} of the snippet, together with some information about the @@ -1236,8 +1237,9 @@ if (pos.getInputType() == InputType.Memory && pos.get(usage) == node) { MemoryNode replacement = map.getLastLocationAccess(location); if (replacement == null) { - assert LocationIdentity.any().equals(location) || Arrays.stream(info.privateLocations).anyMatch(Predicate.isEqual(location)) : "Snippet " + info.method.format("%h.%n") + - " contains access to the non-private location " + location + ", but replacee doesn't access this location." + map.getLocations(); + assert mayRemoveLocation || LocationIdentity.any().equals(location) || Arrays.stream(info.privateLocations).anyMatch(Predicate.isEqual(location)) : "Snippet " + + info.method.format("%h.%n") + " contains access to the non-private location " + location + ", but replacee doesn't access this location." + + map.getLocations(); } else { pos.set(usage, replacement.asNode()); } @@ -1496,4 +1498,8 @@ } return true; } + + public void setMayRemoveLocation(boolean mayRemoveLocation) { + this.mayRemoveLocation = mayRemoveLocation; + } }