# HG changeset patch # User Gilles Duboscq # Date 1404318236 -7200 # Node ID 347915b8cea80126cfa938d1e040e5f6593cd294 # Parent fca7699bacd8c16716f548ea0781585eb8d7014e Move name from HotSpotNmethod to InstalledCode to have a name again for truffle nmethods. diff -r fca7699bacd8 -r 347915b8cea8 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/InstalledCode.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/InstalledCode.java Wed Jul 02 16:54:45 2014 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/InstalledCode.java Wed Jul 02 18:23:56 2014 +0200 @@ -38,6 +38,12 @@ */ private long version; + protected final String name; + + public InstalledCode(String name) { + this.name = name; + } + /** * @return the address of this code blob */ diff -r fca7699bacd8 -r 347915b8cea8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotInstalledCode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotInstalledCode.java Wed Jul 02 16:54:45 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotInstalledCode.java Wed Jul 02 18:23:56 2014 +0200 @@ -49,6 +49,10 @@ */ @SuppressFBWarnings(value = "UWF_UNWRITTEN_FIELD", justification = "field is set by the native part") private int codeSize; + public HotSpotInstalledCode(String name) { + super(name); + } + /** * @return the total size of this code blob */ diff -r fca7699bacd8 -r 347915b8cea8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotNmethod.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotNmethod.java Wed Jul 02 16:54:45 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotNmethod.java Wed Jul 02 18:23:56 2014 +0200 @@ -46,17 +46,16 @@ private final boolean isDefault; private final boolean isExternal; - private final String name; public HotSpotNmethod(HotSpotResolvedJavaMethod method, String name, boolean isDefault) { this(method, name, isDefault, false); } public HotSpotNmethod(HotSpotResolvedJavaMethod method, String name, boolean isDefault, boolean isExternal) { + super(name); this.method = method; this.isDefault = isDefault; this.isExternal = isExternal; - this.name = name; } public boolean isDefault() { diff -r fca7699bacd8 -r 347915b8cea8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntimeStub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntimeStub.java Wed Jul 02 16:54:45 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntimeStub.java Wed Jul 02 18:23:56 2014 +0200 @@ -35,6 +35,7 @@ private final Stub stub; public HotSpotRuntimeStub(Stub stub) { + super(stub.toString()); this.stub = stub; } diff -r fca7699bacd8 -r 347915b8cea8 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 Wed Jul 02 16:54:45 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java Wed Jul 02 18:23:56 2014 +0200 @@ -157,7 +157,7 @@ CallingConvention incomingCc = linkage.getIncomingCallingConvention(); TargetDescription target = codeCache.getTarget(); - compResult = new CompilationResult(); + compResult = new CompilationResult(toString()); try (Scope s0 = Debug.scope("StubCompilation", graph, providers.getCodeCache())) { Assumptions assumptions = new Assumptions(OptAssumptions.getValue()); SchedulePhase schedule = emitFrontEnd(providers, target, graph, assumptions, null, providers.getSuites().getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL, diff -r fca7699bacd8 -r 347915b8cea8 graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/PartialEvaluationTest.java --- a/graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/PartialEvaluationTest.java Wed Jul 02 16:54:45 2014 +0200 +++ b/graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/PartialEvaluationTest.java Wed Jul 02 18:23:56 2014 +0200 @@ -65,7 +65,7 @@ protected InstalledCode assertPartialEvalEquals(String methodName, RootNode root, Object[] arguments) { Assumptions assumptions = new Assumptions(true); StructuredGraph actual = partialEval(root, arguments, assumptions, true); - InstalledCode result = new InstalledCode(); + InstalledCode result = new InstalledCode("Test:" + methodName); truffleCompiler.compileMethodHelper(actual, assumptions, root.toString(), getSpeculationLog(), result); StructuredGraph expected = parseForComparison(methodName); removeFrameStates(actual); diff -r fca7699bacd8 -r 347915b8cea8 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java Wed Jul 02 16:54:45 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java Wed Jul 02 18:23:56 2014 +0200 @@ -63,6 +63,7 @@ } public OptimizedCallTarget(RootNode rootNode, GraalTruffleRuntime runtime, int invokeCounter, int compilationThreshold, CompilationPolicy compilationPolicy, SpeculationLog speculationLog) { + super(rootNode.toString()); this.runtime = runtime; this.speculationLog = speculationLog; this.rootNode = rootNode; diff -r fca7699bacd8 -r 347915b8cea8 src/share/vm/graal/graalJavaAccess.hpp --- a/src/share/vm/graal/graalJavaAccess.hpp Wed Jul 02 16:54:45 2014 +0200 +++ b/src/share/vm/graal/graalJavaAccess.hpp Wed Jul 02 18:23:56 2014 +0200 @@ -57,6 +57,7 @@ start_class(InstalledCode) \ long_field(InstalledCode, address) \ long_field(InstalledCode, version) \ + oop_field(InstalledCode, name, "Ljava/lang/String;") \ end_class \ start_class(HotSpotInstalledCode) \ int_field(HotSpotInstalledCode, size) \ @@ -66,7 +67,6 @@ start_class(HotSpotNmethod) \ boolean_field(HotSpotNmethod, isDefault) \ boolean_field(HotSpotNmethod, isExternal) \ - oop_field(HotSpotNmethod, name, "Ljava/lang/String;") \ end_class \ start_class(HotSpotCompiledCode) \ oop_field(HotSpotCompiledCode, comp, "Lcom/oracle/graal/api/code/CompilationResult;") \ diff -r fca7699bacd8 -r 347915b8cea8 src/share/vm/runtime/deoptimization.cpp --- a/src/share/vm/runtime/deoptimization.cpp Wed Jul 02 16:54:45 2014 +0200 +++ b/src/share/vm/runtime/deoptimization.cpp Wed Jul 02 18:23:56 2014 +0200 @@ -1487,8 +1487,8 @@ oop installedCode = nm->graal_installed_code(); if (installedCode != NULL) { oop installedCodeName = NULL; - if (installedCode->is_a(HotSpotNmethod::klass())) { - installedCodeName = HotSpotNmethod::name(installedCode); + if (installedCode->is_a(InstalledCode::klass())) { + installedCodeName = InstalledCode::name(installedCode); } if (installedCodeName != NULL) { tty->print(" (Graal: installedCodeName=%s) ", java_lang_String::as_utf8_string(installedCodeName));