Mercurial > hg > truffle
diff graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewObjectSnippets.java @ 7064:8d16b9b2c51e
first part of refactoring the InliningPhase
added control-flow sensitive inlining
inlining requires an Assumption object so that HotSpot can keep track of the inlined methods
author | Christian Haeubl <haeubl@ssw.jku.at> |
---|---|
date | Thu, 22 Nov 2012 13:30:14 +0100 |
parents | d8408e5563e5 |
children | 7d815d842ee0 |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewObjectSnippets.java Thu Nov 15 15:10:41 2012 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewObjectSnippets.java Thu Nov 22 13:30:14 2012 +0100 @@ -243,8 +243,8 @@ private final TargetDescription target; private final boolean useTLAB; - public Templates(CodeCacheProvider runtime, TargetDescription target, boolean useTLAB) { - super(runtime, NewObjectSnippets.class); + public Templates(CodeCacheProvider runtime, Assumptions assumptions, TargetDescription target, boolean useTLAB) { + super(runtime, assumptions, NewObjectSnippets.class); this.target = target; this.useTLAB = useTLAB; allocate = snippet("allocate", int.class); @@ -318,7 +318,7 @@ add("wordKind", target.wordKind). add("type", arrayType); Arguments arguments = new Arguments().add("length", lengthNode); - SnippetTemplate template = cache.get(key); + SnippetTemplate template = cache.get(key, assumptions); Debug.log("Lowering allocateArrayAndInitialize in %s: node=%s, template=%s, arguments=%s", graph, newArrayNode, template, arguments); template.instantiate(runtime, newArrayNode, DEFAULT_REPLACER, arguments); } @@ -330,7 +330,7 @@ ValueNode size = tlabAllocateNode.size(); Key key = new Key(allocate); Arguments arguments = arguments("size", size); - SnippetTemplate template = cache.get(key); + SnippetTemplate template = cache.get(key, assumptions); Debug.log("Lowering fastAllocate in %s: node=%s, template=%s, arguments=%s", graph, tlabAllocateNode, template, arguments); template.instantiate(runtime, tlabAllocateNode, DEFAULT_REPLACER, arguments); } @@ -347,7 +347,7 @@ Key key = new Key(initializeObject).add("size", size).add("fillContents", initializeNode.fillContents()).add("locked", initializeNode.locked()); ValueNode memory = initializeNode.memory(); Arguments arguments = arguments("memory", memory).add("hub", hub).add("prototypeMarkWord", type.prototypeMarkWord()); - SnippetTemplate template = cache.get(key); + SnippetTemplate template = cache.get(key, assumptions); Debug.log("Lowering initializeObject in %s: node=%s, template=%s, arguments=%s", graph, initializeNode, template, arguments); template.instantiate(runtime, initializeNode, DEFAULT_REPLACER, arguments); } @@ -364,7 +364,7 @@ Key key = new Key(elementKind.isObject() ? initializeObjectArray : initializePrimitiveArray).add("headerSize", headerSize).add("fillContents", initializeNode.fillContents()).add("locked", initializeNode.locked()); ValueNode memory = initializeNode.memory(); Arguments arguments = arguments("memory", memory).add("hub", hub).add("prototypeMarkWord", type.prototypeMarkWord()).add("size", initializeNode.size()).add("length", initializeNode.length()); - SnippetTemplate template = cache.get(key); + SnippetTemplate template = cache.get(key, assumptions); Debug.log("Lowering initializeObjectArray in %s: node=%s, template=%s, arguments=%s", graph, initializeNode, template, arguments); template.instantiate(runtime, initializeNode, DEFAULT_REPLACER, arguments); } @@ -381,7 +381,7 @@ HotSpotKlassOop hub = type.klassOop(); Key key = new Key(newmultiarray).add("dimensions", Varargs.vargargs(int.class, rank)).add("rank", rank); Arguments arguments = arguments("dimensions", dims).add("hub", hub); - SnippetTemplate template = cache.get(key); + SnippetTemplate template = cache.get(key, assumptions); template.instantiate(runtime, newmultiarrayNode, DEFAULT_REPLACER, arguments); } }