Mercurial > hg > graal-compiler
comparison graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/HotSpotNmethodExecuteNode.java @ 10052:5b21ddb3deaa
readd optional graph to HotSpotNmethod
author | Andreas Woess <andreas.woess@jku.at> |
---|---|
date | Fri, 14 Jun 2013 17:28:00 +0200 |
parents | 6e4b72bcc97f |
children | ae6f0c381087 |
comparison
equal
deleted
inserted
replaced
10051:215a4291e387 | 10052:5b21ddb3deaa |
---|---|
31 import com.oracle.graal.nodes.*; | 31 import com.oracle.graal.nodes.*; |
32 import com.oracle.graal.nodes.extended.*; | 32 import com.oracle.graal.nodes.extended.*; |
33 import com.oracle.graal.nodes.java.*; | 33 import com.oracle.graal.nodes.java.*; |
34 import com.oracle.graal.nodes.spi.*; | 34 import com.oracle.graal.nodes.spi.*; |
35 import com.oracle.graal.nodes.type.*; | 35 import com.oracle.graal.nodes.type.*; |
36 import com.oracle.graal.phases.common.*; | |
36 | 37 |
37 public class HotSpotNmethodExecuteNode extends AbstractCallNode implements Lowerable { | 38 public class HotSpotNmethodExecuteNode extends AbstractCallNode implements Lowerable { |
38 | 39 |
39 @Input private ValueNode code; | 40 @Input private ValueNode code; |
40 private final Class[] signature; | 41 private final Class[] signature; |
50 return new LocationIdentity[]{LocationIdentity.ANY_LOCATION}; | 51 return new LocationIdentity[]{LocationIdentity.ANY_LOCATION}; |
51 } | 52 } |
52 | 53 |
53 @Override | 54 @Override |
54 public void lower(LoweringTool tool, LoweringType loweringType) { | 55 public void lower(LoweringTool tool, LoweringType loweringType) { |
55 replaceWithInvoke(tool.getRuntime()); | 56 if (code.isConstant() && code.asConstant().asObject() instanceof HotSpotNmethod) { |
57 HotSpotNmethod nmethod = (HotSpotNmethod) code.asConstant().asObject(); | |
58 InvokeNode invoke = replaceWithInvoke(tool.getRuntime()); | |
59 StructuredGraph graph = (StructuredGraph) nmethod.getGraph(); | |
60 if (graph != null) { | |
61 InliningUtil.inline(invoke, graph, false); | |
62 } | |
63 } else { | |
64 replaceWithInvoke(tool.getRuntime()); | |
65 } | |
56 } | 66 } |
57 | 67 |
58 protected InvokeNode replaceWithInvoke(MetaAccessProvider tool) { | 68 protected InvokeNode replaceWithInvoke(MetaAccessProvider tool) { |
59 ResolvedJavaMethod method = null; | 69 ResolvedJavaMethod method = null; |
60 ResolvedJavaField methodField = null; | 70 ResolvedJavaField methodField = null; |