# HG changeset patch # User Doug Simon # Date 1423750814 -3600 # Node ID 49605c649beb474e6855c98ed45eb763cab7f88e # Parent 5664cadb3cee9bf396fde953a1696aca5c11b0df# Parent de5ef2d5498f28d05cab68aff93ebef542672413 Merge. diff -r de5ef2d5498f -r 49605c649beb graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCompiledNmethod.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCompiledNmethod.java Thu Feb 12 13:42:11 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCompiledNmethod.java Thu Feb 12 15:20:14 2015 +0100 @@ -47,4 +47,9 @@ this.id = compResult.getId(); this.ctask = ctask; } + + @Override + public String toString() { + return getClass().getSimpleName() + "[" + id + ":" + method.format("%H.%n(%p)%r@") + entryBCI + "]"; + } } diff -r de5ef2d5498f -r 49605c649beb graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCompiledRuntimeStub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCompiledRuntimeStub.java Thu Feb 12 13:42:11 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCompiledRuntimeStub.java Thu Feb 12 15:20:14 2015 +0100 @@ -51,7 +51,13 @@ * Checks the conditions a compilation must satisfy to be installed as a RuntimeStub. */ private boolean checkStubInvariants(CompilationResult compResult) { - assert compResult.getExceptionHandlers().isEmpty(); + assert compResult.getExceptionHandlers().isEmpty() : this; + + // Stubs cannot be recompiled so they cannot be compiled with + // assumptions and there is no point in recording evol_method dependencies + assert compResult.getAssumptions().isEmpty() : "stubs should not use assumptions: " + this; + assert compResult.getMethods().isEmpty() : "stubs should not record evol_method dependencies: " + this; + for (DataPatch data : compResult.getDataPatches()) { if (data.reference instanceof ConstantReference) { ConstantReference ref = (ConstantReference) data.reference; diff -r de5ef2d5498f -r 49605c649beb graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/ForeignCallStub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/ForeignCallStub.java Thu Feb 12 13:42:11 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/ForeignCallStub.java Thu Feb 12 15:20:14 2015 +0100 @@ -192,6 +192,7 @@ boolean isObjectResult = linkage.getOutgoingCallingConvention().getReturn().getKind() == Kind.Object; StructuredGraph graph = new StructuredGraph(toString(), null, AllowAssumptions.NO); + graph.disableMethodRecording(); GraphKit kit = new HotSpotGraphKit(graph, providers); ParameterNode[] params = createParameters(kit, args); diff -r de5ef2d5498f -r 49605c649beb graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java Thu Feb 12 13:42:11 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java Thu Feb 12 15:20:14 2015 +0100 @@ -157,7 +157,12 @@ if (code == null) { try (Scope d = Debug.sandbox("CompilingStub", DebugScope.getConfig(), providers.getCodeCache(), debugScopeContext())) { final StructuredGraph graph = getGraph(); + + // Stubs cannot be recompiled so they cannot be compiled with + // assumptions and there is no point in recording evol_method dependencies assert graph.getAssumptions() == null; + assert !graph.isMethodRecordingEnabled() : graph; + if (!(graph.start() instanceof StubStartNode)) { StubStartNode newStart = graph.add(new StubStartNode(Stub.this)); newStart.setStateAfter(graph.start().stateAfter()); diff -r de5ef2d5498f -r 49605c649beb graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningUtil.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningUtil.java Thu Feb 12 13:42:11 2015 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningUtil.java Thu Feb 12 15:20:14 2015 +0100 @@ -373,6 +373,11 @@ assert inlineGraph.getAssumptions() == null : "cannot inline graph which makes assumptions into a graph that doesn't: " + inlineGraph + " -> " + graph; } + // Copy method dependencies from inlinee to caller + if (inlineGraph.isMethodRecordingEnabled() && graph.isMethodRecordingEnabled()) { + graph.getMethods().addAll(inlineGraph.getMethods()); + } + return duplicates; } diff -r de5ef2d5498f -r 49605c649beb graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java Thu Feb 12 13:42:11 2015 +0100 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java Thu Feb 12 15:20:14 2015 +0100 @@ -610,6 +610,10 @@ // Replacements cannot have optimistic assumptions since they have // to be valid for the entire run of the VM. final StructuredGraph graph = new StructuredGraph(methodToParse, AllowAssumptions.NO); + + // They will also never be never be evolved or have breakpoints set in them + graph.disableMethodRecording(); + try (Scope s = Debug.scope("buildInitialGraph", graph)) { MetaAccessProvider metaAccess = replacements.providers.getMetaAccess(); diff -r de5ef2d5498f -r 49605c649beb graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Thu Feb 12 13:42:11 2015 +0100 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Thu Feb 12 15:20:14 2015 +0100 @@ -566,6 +566,10 @@ // Copy snippet graph, replacing constant parameters with given arguments final StructuredGraph snippetCopy = new StructuredGraph(snippetGraph.name, snippetGraph.method(), AllowAssumptions.NO); + if (!snippetGraph.isMethodRecordingEnabled()) { + snippetCopy.disableMethodRecording(); + } + Map nodeReplacements = Node.newIdentityMap(); nodeReplacements.put(snippetGraph.start(), snippetCopy.start());