# HG changeset patch # User Doug Simon # Date 1363810739 -3600 # Node ID d9347ee39fbe69453683e165b5e368a9610d1b1e # Parent 488a5f6947861f91005732395d6c6120bfdafbb0 rename: SnippetsInterface -> Snippets diff -r 488a5f694786 -r d9347ee39fbe graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/ArrayCopySnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/ArrayCopySnippets.java Wed Mar 20 20:34:26 2013 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/ArrayCopySnippets.java Wed Mar 20 21:18:59 2013 +0100 @@ -42,7 +42,7 @@ import com.oracle.graal.word.*; @SuppressWarnings("unused") -public class ArrayCopySnippets implements SnippetsInterface { +public class ArrayCopySnippets implements Snippets { private static final EnumMap arraycopyMethods = new EnumMap<>(Kind.class); public static final Method genericArraycopySnippet; diff -r 488a5f694786 -r d9347ee39fbe graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/CheckCastSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/CheckCastSnippets.java Wed Mar 20 20:34:26 2013 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/CheckCastSnippets.java Wed Mar 20 21:18:59 2013 +0100 @@ -59,7 +59,7 @@ * href="http://dl.acm.org/citation.cfm?id=583821"> Fast subtype checking in the HotSpot JVM by * Cliff Click and John Rose. */ -public class CheckCastSnippets implements SnippetsInterface { +public class CheckCastSnippets implements Snippets { @NodeIntrinsic(BreakpointNode.class) static native void bkpt(Object object, Word hub, Word objectHub); diff -r 488a5f694786 -r d9347ee39fbe graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/InstanceOfSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/InstanceOfSnippets.java Wed Mar 20 20:34:26 2013 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/InstanceOfSnippets.java Wed Mar 20 21:18:59 2013 +0100 @@ -53,7 +53,7 @@ * href="http://dl.acm.org/citation.cfm?id=583821"> Fast subtype checking in the HotSpot JVM by * Cliff Click and John Rose. */ -public class InstanceOfSnippets implements SnippetsInterface { +public class InstanceOfSnippets implements Snippets { // @formatter:off diff -r 488a5f694786 -r d9347ee39fbe graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/MonitorSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/MonitorSnippets.java Wed Mar 20 20:34:26 2013 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/MonitorSnippets.java Wed Mar 20 21:18:59 2013 +0100 @@ -61,7 +61,7 @@ * atomic operations with biased locking and bulk rebiasing by Kenneth Russell and David * Detlefs. */ -public class MonitorSnippets implements SnippetsInterface { +public class MonitorSnippets implements Snippets { /** * Monitor operations on objects whose type contains this substring will be traced. diff -r 488a5f694786 -r d9347ee39fbe graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewObjectSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewObjectSnippets.java Wed Mar 20 20:34:26 2013 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewObjectSnippets.java Wed Mar 20 21:18:59 2013 +0100 @@ -55,7 +55,7 @@ /** * Snippets used for implementing NEW, ANEWARRAY and NEWARRAY. */ -public class NewObjectSnippets implements SnippetsInterface { +public class NewObjectSnippets implements Snippets { // @formatter:off diff -r 488a5f694786 -r d9347ee39fbe graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/ObjectCloneSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/ObjectCloneSnippets.java Wed Mar 20 20:34:26 2013 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/ObjectCloneSnippets.java Wed Mar 20 21:18:59 2013 +0100 @@ -36,7 +36,7 @@ import com.oracle.graal.snippets.*; import com.oracle.graal.word.*; -public class ObjectCloneSnippets implements SnippetsInterface { +public class ObjectCloneSnippets implements Snippets { public static final Method instanceCloneMethod = getCloneMethod("instanceClone"); public static final Method arrayCloneMethod = getCloneMethod("arrayClone"); diff -r 488a5f694786 -r d9347ee39fbe 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 Mar 20 20:34:26 2013 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java Wed Mar 20 21:18:59 2013 +0100 @@ -52,7 +52,7 @@ * Implementation detail: The stub classes re-use some of the functionality for {@link Snippet}s * purely for convenience (e.g., can re-use the {@link ReplacementsInstaller}). */ -public abstract class Stub extends AbstractTemplates implements SnippetsInterface { +public abstract class Stub extends AbstractTemplates implements Snippets { /** * The method implementing the stub. diff -r 488a5f694786 -r d9347ee39fbe graal/com.oracle.graal.snippets.amd64/src/com/oracle/graal/snippets/amd64/AMD64ConvertSnippets.java --- a/graal/com.oracle.graal.snippets.amd64/src/com/oracle/graal/snippets/amd64/AMD64ConvertSnippets.java Wed Mar 20 20:34:26 2013 +0100 +++ b/graal/com.oracle.graal.snippets.amd64/src/com/oracle/graal/snippets/amd64/AMD64ConvertSnippets.java Wed Mar 20 21:18:59 2013 +0100 @@ -43,7 +43,7 @@ * Snippets used for conversion operations on AMD64 where the AMD64 instruction used does not match * the semantics of the JVM specification. */ -public class AMD64ConvertSnippets implements SnippetsInterface { +public class AMD64ConvertSnippets implements Snippets { /** * Converts a float to an int. diff -r 488a5f694786 -r d9347ee39fbe graal/com.oracle.graal.snippets.test/src/com/oracle/graal/snippets/PointerTest.java --- a/graal/com.oracle.graal.snippets.test/src/com/oracle/graal/snippets/PointerTest.java Wed Mar 20 20:34:26 2013 +0100 +++ b/graal/com.oracle.graal.snippets.test/src/com/oracle/graal/snippets/PointerTest.java Wed Mar 20 21:18:59 2013 +0100 @@ -39,7 +39,7 @@ /** * Tests for the {@link Pointer} read and write operations. */ -public class PointerTest extends GraalCompilerTest implements SnippetsInterface { +public class PointerTest extends GraalCompilerTest implements Snippets { private static final Object ID = new Object(); private static final Kind[] KINDS = new Kind[]{Kind.Byte, Kind.Char, Kind.Short, Kind.Int, Kind.Long, Kind.Float, Kind.Double, Kind.Object}; diff -r 488a5f694786 -r d9347ee39fbe graal/com.oracle.graal.snippets.test/src/com/oracle/graal/snippets/WordTest.java --- a/graal/com.oracle.graal.snippets.test/src/com/oracle/graal/snippets/WordTest.java Wed Mar 20 20:34:26 2013 +0100 +++ b/graal/com.oracle.graal.snippets.test/src/com/oracle/graal/snippets/WordTest.java Wed Mar 20 21:18:59 2013 +0100 @@ -36,7 +36,7 @@ /** * Tests for the {@link Word} type. */ -public class WordTest extends GraalCompilerTest implements SnippetsInterface { +public class WordTest extends GraalCompilerTest implements Snippets { private final ReplacementsInstaller installer; diff -r 488a5f694786 -r d9347ee39fbe graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/InstanceOfSnippetsTemplates.java --- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/InstanceOfSnippetsTemplates.java Wed Mar 20 20:34:26 2013 +0100 +++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/InstanceOfSnippetsTemplates.java Wed Mar 20 21:18:59 2013 +0100 @@ -46,13 +46,13 @@ * replacing a floating node with control flow is not trivial. *

* The mechanism implemented in this class ensures that the graph for an instanceof snippet is - * instantiated once per {@link InstanceOfNode} being lowered. The result produced the graph is then - * re-used by all usages of the node. Additionally, if there is a single usage that is an - * {@link IfNode}, the control flow in the snippet is connected directly to the true and false - * successors of the {@link IfNode}. This avoids materializating the instanceof test as a boolean - * which is then retested by the {@link IfNode}. + * instantiated once per {@link InstanceOfNode} being lowered. The result produced is then re-used + * by all usages of the node. Additionally, if there is a single usage that is an {@link IfNode}, + * the control flow in the snippet is connected directly to the true and false successors of the + * {@link IfNode}. This avoids materializing the instanceof test as a boolean which is then retested + * by the {@link IfNode}. */ -public abstract class InstanceOfSnippetsTemplates extends AbstractTemplates { +public abstract class InstanceOfSnippetsTemplates extends AbstractTemplates { public InstanceOfSnippetsTemplates(MetaAccessProvider runtime, Assumptions assumptions, TargetDescription target, Class snippetsClass) { super(runtime, assumptions, target, snippetsClass); diff -r 488a5f694786 -r d9347ee39fbe graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/ReplacementsInstaller.java --- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/ReplacementsInstaller.java Wed Mar 20 20:34:26 2013 +0100 +++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/ReplacementsInstaller.java Wed Mar 20 21:18:59 2013 +0100 @@ -49,8 +49,8 @@ /** * Utility for managing the pre-processing and installation of node replacements. Node replacements - * are either {@linkplain SnippetsInterface snippets}, {@linkplain MethodSubstitution method - * substitutions} or {@link MacroSubstitution macro substitutions}. + * are either {@linkplain Snippets snippets}, {@linkplain MethodSubstitution method substitutions} + * or {@link MacroSubstitution macro substitutions}. */ public class ReplacementsInstaller { @@ -81,8 +81,8 @@ * graph with the key value of {@code Graph.class} in the * {@linkplain ResolvedJavaMethod#getCompilerStorage() compiler storage} of each method. */ - public void installSnippets(Class clazz) { - for (Method method : clazz.getDeclaredMethods()) { + public void installSnippets(Class snippets) { + for (Method method : snippets.getDeclaredMethods()) { if (method.getAnnotation(Snippet.class) != null) { int modifiers = method.getModifiers(); if (Modifier.isAbstract(modifiers) || Modifier.isNative(modifiers)) { @@ -109,7 +109,7 @@ assert owner == Thread.currentThread() : "substitution installation must be single threaded"; ClassSubstitution classSubstitution = substitutions.getAnnotation(ClassSubstitution.class); assert classSubstitution != null; - assert !SnippetsInterface.class.isAssignableFrom(substitutions); + assert !Snippets.class.isAssignableFrom(substitutions); for (Method substituteMethod : substitutions.getDeclaredMethods()) { MethodSubstitution methodSubstitution = substituteMethod.getAnnotation(MethodSubstitution.class); MacroSubstitution macroSubstitution = substituteMethod.getAnnotation(MacroSubstitution.class); diff -r 488a5f694786 -r d9347ee39fbe graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetTemplate.java --- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetTemplate.java Wed Mar 20 20:34:26 2013 +0100 +++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetTemplate.java Wed Mar 20 21:18:59 2013 +0100 @@ -186,7 +186,7 @@ } } - public abstract static class AbstractTemplates { + public abstract static class AbstractTemplates { protected final Cache cache; protected final MetaAccessProvider runtime; @@ -197,7 +197,7 @@ this.runtime = runtime; this.assumptions = assumptions; if (snippetsClass == null) { - assert this instanceof SnippetsInterface; + assert this instanceof Snippets; this.snippetsClass = getClass(); } else { this.snippetsClass = snippetsClass; diff -r 488a5f694786 -r d9347ee39fbe graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/Snippets.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/Snippets.java Wed Mar 20 21:18:59 2013 +0100 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2011, 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.snippets; + +/** + * Marker interface for a class that defines one or more {@link Snippet}s. + */ +public interface Snippets { +} diff -r 488a5f694786 -r d9347ee39fbe graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetsInterface.java --- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetsInterface.java Wed Mar 20 20:34:26 2013 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2011, 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.snippets; - -/** - * Tagging interface for interfaces or classes providing snippets. - */ -public interface SnippetsInterface { - -}