# HG changeset patch # User Christian Humer # Date 1395167629 -3600 # Node ID 918b0360bdb2289bb25541feeffa26bd5a6ab75e # Parent 2e35f6eb8684395b9a0c02b63b329045bc89ab5b# Parent 90b43a808eb0dd0f82284a1ff6bfbb46f6cc6990 Merge. diff -r 2e35f6eb8684 -r 918b0360bdb2 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/util/MethodDebugValueName.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/util/MethodDebugValueName.java Tue Mar 18 19:33:49 2014 +0100 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.phases.util; + +import com.oracle.graal.api.meta.*; +import com.oracle.graal.phases.*; + +/** + * Lazily computed debug value name composed of a prefix and a {@linkplain JavaMethod#getName() + * method name}. + */ +public class MethodDebugValueName extends LazyName { + final String prefix; + final JavaMethod method; + + public MethodDebugValueName(String prefix, JavaMethod method) { + this.prefix = prefix; + this.method = method; + } + + @Override + public String createString() { + return prefix + "[" + method.getName() + "]"; + } +} diff -r 2e35f6eb8684 -r 918b0360bdb2 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 Tue Mar 18 18:13:43 2014 +0100 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java Tue Mar 18 19:33:49 2014 +0100 @@ -99,7 +99,7 @@ FrameStateProcessing frameStateProcessing = method.getAnnotation(Snippet.class).removeAllFrameStates() ? FrameStateProcessing.Removal : FrameStateProcessing.CollapseFrameForSingleSideEffect; StructuredGraph newGraph = makeGraph(method, recursiveEntry, recursiveEntry, inliningPolicy(method), frameStateProcessing); - Debug.metric("SnippetNodeCount[" + method.getName() + "]").add(newGraph.getNodeCount()); + Debug.metric(new MethodDebugValueName("SnippetNodeCount", method)).add(newGraph.getNodeCount()); if (!UseSnippetGraphCache) { return newGraph; } @@ -201,8 +201,8 @@ } } } - // We don't have per method guards for macro substitutions but at least respect the - // defaultGuard if there is one. + // We don't have per method guards for macro substitutions but at + // least respect the defaultGuard if there is one. if (macroSubstitution != null && (defaultGuard == null || defaultGuard.execute())) { String originalName = originalName(substituteMethod, macroSubstitution.value()); JavaSignature originalSignature = originalSignature(substituteMethod, macroSubstitution.signature(), macroSubstitution.isStatic()); diff -r 2e35f6eb8684 -r 918b0360bdb2 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 Tue Mar 18 18:13:43 2014 +0100 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Tue Mar 18 19:33:49 2014 +0100 @@ -97,8 +97,8 @@ protected SnippetInfo(ResolvedJavaMethod method) { this.method = method; - instantiationCounter = Debug.metric("SnippetInstantiationCount[" + method.getName() + "]"); - instantiationTimer = Debug.timer("SnippetInstantiationTime[" + method.getName() + "]"); + instantiationCounter = Debug.metric(new MethodDebugValueName("SnippetInstantiationCount", method)); + instantiationTimer = Debug.timer(new MethodDebugValueName("SnippetInstantiationTime", method)); assert Modifier.isStatic(method.getModifiers()) : "snippet method must be static: " + MetaUtil.format("%H.%n", method); int count = method.getSignature().getParameterCount(false); constantParameters = new boolean[count];