# HG changeset patch # User Doug Simon # Date 1415222335 -3600 # Node ID fa6c97ede679c14ad93149bbdb4d4ec747bbdd13 # Parent ae181ec869c51dca11c6bb65ac4ec2488ffdb389 added Remote interface and applied it to API types that will be proxied for the purpose of replay/remote compilation diff -r ae181ec869c5 -r fa6c97ede679 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ConstantPool.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ConstantPool.java Wed Nov 05 21:55:55 2014 +0100 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ConstantPool.java Wed Nov 05 22:18:55 2014 +0100 @@ -27,11 +27,11 @@ * parsing bytecode. Provides methods to look up a constant pool entry without performing * resolution. They are used during compilation. */ -public interface ConstantPool { +public interface ConstantPool extends Remote { /** * Returns the number of entries the constant pool. - * + * * @return number of entries in the constant pool */ int length(); @@ -40,7 +40,7 @@ * Ensures that the type referenced by the specified constant pool entry is loaded and * initialized. This can be used to compile time resolve a type. It works for field, method, or * type constant pool entries. - * + * * @param cpi the index of the constant pool entry that references the type * @param opcode the opcode of the instruction that references the type */ @@ -50,7 +50,7 @@ * Looks up a reference to a field. If {@code opcode} is non-negative, then resolution checks * specific to the bytecode it denotes are performed if the field is already resolved. Should * any of these checks fail, an unresolved field reference is returned. - * + * * @param cpi the constant pool index * @param opcode the opcode of the instruction for which the lookup is being performed or * {@code -1} @@ -63,7 +63,7 @@ * Looks up a reference to a method. If {@code opcode} is non-negative, then resolution checks * specific to the bytecode it denotes are performed if the method is already resolved. Should * any of these checks fail, an unresolved method reference is returned. - * + * * @param cpi the constant pool index * @param opcode the opcode of the instruction for which the lookup is being performed or * {@code -1} @@ -76,7 +76,7 @@ * Looks up a reference to a type. If {@code opcode} is non-negative, then resolution checks * specific to the bytecode it denotes are performed if the type is already resolved. Should any * of these checks fail, an unresolved type reference is returned. - * + * * @param cpi the constant pool index * @param opcode the opcode of the instruction for which the lookup is being performed or * {@code -1} @@ -86,7 +86,7 @@ /** * Looks up an Utf8 string. - * + * * @param cpi the constant pool index * @return the Utf8 string at index {@code cpi} in this constant pool */ @@ -94,7 +94,7 @@ /** * Looks up a method signature. - * + * * @param cpi the constant pool index * @return the method signature at index {@code cpi} in this constant pool */ @@ -102,7 +102,7 @@ /** * Looks up a constant at the specified index. - * + * * @param cpi the constant pool index * @return the {@code Constant} or {@code JavaType} instance representing the constant pool * entry @@ -111,7 +111,7 @@ /** * Looks up the appendix at the specified index. - * + * * @param cpi the constant pool index * @param opcode the opcode of the instruction for which the lookup is being performed or * {@code -1} diff -r ae181ec869c5 -r fa6c97ede679 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ConstantReflectionProvider.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ConstantReflectionProvider.java Wed Nov 05 21:55:55 2014 +0100 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ConstantReflectionProvider.java Wed Nov 05 22:18:55 2014 +0100 @@ -30,7 +30,7 @@ * result is not available at this point. The caller is responsible to check for {@code null} * results and handle them properly, e.g., not perform an optimization. */ -public interface ConstantReflectionProvider { +public interface ConstantReflectionProvider extends Remote { /** * Compares two constants for equality. The equality relationship is symmetric. Returns diff -r ae181ec869c5 -r fa6c97ede679 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaField.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaField.java Wed Nov 05 21:55:55 2014 +0100 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaField.java Wed Nov 05 22:18:55 2014 +0100 @@ -28,7 +28,7 @@ * Represents a reference to a Java field, either resolved or unresolved fields. Fields, like * methods and types, are resolved through {@link ConstantPool constant pools}. */ -public interface JavaField { +public interface JavaField extends Remote { /** * Returns the name of this field. diff -r ae181ec869c5 -r fa6c97ede679 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaMethod.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaMethod.java Wed Nov 05 21:55:55 2014 +0100 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaMethod.java Wed Nov 05 22:18:55 2014 +0100 @@ -28,7 +28,7 @@ * Represents a reference to a Java method, either resolved or unresolved. Methods, like fields and * types, are resolved through {@link ConstantPool constant pools}. */ -public interface JavaMethod { +public interface JavaMethod extends Remote { /** * Returns the name of this method. diff -r ae181ec869c5 -r fa6c97ede679 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaType.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaType.java Wed Nov 05 21:55:55 2014 +0100 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaType.java Wed Nov 05 22:18:55 2014 +0100 @@ -28,7 +28,7 @@ * Represents a resolved or unresolved type. Types include primitives, objects, {@code void}, and * arrays thereof. */ -public interface JavaType { +public interface JavaType extends Remote { /** * Returns the name of this type in internal form. The following are examples of strings diff -r ae181ec869c5 -r fa6c97ede679 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaAccessProvider.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaAccessProvider.java Wed Nov 05 21:55:55 2014 +0100 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaAccessProvider.java Wed Nov 05 22:18:55 2014 +0100 @@ -28,7 +28,7 @@ /** * Provides access to the metadata of a class typically provided in a class file. */ -public interface MetaAccessProvider { +public interface MetaAccessProvider extends Remote { /** * Returns the resolved Java type representing a given Java class. diff -r ae181ec869c5 -r fa6c97ede679 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MethodHandleAccessProvider.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MethodHandleAccessProvider.java Wed Nov 05 21:55:55 2014 +0100 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MethodHandleAccessProvider.java Wed Nov 05 22:18:55 2014 +0100 @@ -29,7 +29,7 @@ * implementation of this interface is usually required to access non-public classes, methods, and * fields of {@link MethodHandle}, i.e., data that is not standardized by the Java specification. */ -public interface MethodHandleAccessProvider { +public interface MethodHandleAccessProvider extends Remote { /** * Identification for methods defined on the class {@link MethodHandle} that are processed by diff -r ae181ec869c5 -r fa6c97ede679 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ProfilingInfo.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ProfilingInfo.java Wed Nov 05 21:55:55 2014 +0100 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ProfilingInfo.java Wed Nov 05 22:18:55 2014 +0100 @@ -28,7 +28,7 @@ * multiple times, it may return significantly different results for every invocation as the * profiling information may be changed by other Java threads at any time. */ -public interface ProfilingInfo { +public interface ProfilingInfo extends Remote { /** * Represents the three possibilities that an exception was seen at a specific BCI. diff -r ae181ec869c5 -r fa6c97ede679 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Remote.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Remote.java Wed Nov 05 22:18:55 2014 +0100 @@ -0,0 +1,30 @@ +/* + * 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.api.meta; + +/** + * Marker interface for classes whose values are proxied during replay compilation capture or remote + * compilation. + */ +public interface Remote { +} diff -r ae181ec869c5 -r fa6c97ede679 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Signature.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Signature.java Wed Nov 05 21:55:55 2014 +0100 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Signature.java Wed Nov 05 22:18:55 2014 +0100 @@ -28,7 +28,7 @@ * @see Method * Descriptors */ -public interface Signature { +public interface Signature extends Remote { /** * Returns the number of parameters in this signature, adding 1 for a receiver if requested. diff -r ae181ec869c5 -r fa6c97ede679 graal/com.oracle.graal.api.replacements/src/com/oracle/graal/api/replacements/SnippetReflectionProvider.java --- a/graal/com.oracle.graal.api.replacements/src/com/oracle/graal/api/replacements/SnippetReflectionProvider.java Wed Nov 05 21:55:55 2014 +0100 +++ b/graal/com.oracle.graal.api.replacements/src/com/oracle/graal/api/replacements/SnippetReflectionProvider.java Wed Nov 05 22:18:55 2014 +0100 @@ -31,7 +31,7 @@ *

* This interface must not be used in Graal code that is not related to snippet processing. */ -public interface SnippetReflectionProvider { +public interface SnippetReflectionProvider extends Remote { /** * Creates a boxed {@link Kind#Object object} constant. diff -r ae181ec869c5 -r fa6c97ede679 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMetaspaceConstant.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMetaspaceConstant.java Wed Nov 05 21:55:55 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMetaspaceConstant.java Wed Nov 05 22:18:55 2014 +0100 @@ -25,7 +25,7 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.hotspot.HotSpotVMConfig.CompressEncoding; -public interface HotSpotMetaspaceConstant extends HotSpotConstant, VMConstant { +public interface HotSpotMetaspaceConstant extends HotSpotConstant, VMConstant, Remote { boolean isCompressed(); diff -r ae181ec869c5 -r fa6c97ede679 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotObjectConstant.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotObjectConstant.java Wed Nov 05 21:55:55 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotObjectConstant.java Wed Nov 05 22:18:55 2014 +0100 @@ -28,7 +28,7 @@ * Represents a constant non-{@code null} object reference, within the compiler and across the * compiler/runtime interface. */ -public interface HotSpotObjectConstant extends JavaValue, HotSpotConstant, VMConstant { +public interface HotSpotObjectConstant extends JavaValue, HotSpotConstant, VMConstant, Remote { JavaConstant compress(); diff -r ae181ec869c5 -r fa6c97ede679 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/Replacements.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/Replacements.java Wed Nov 05 21:55:55 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/Replacements.java Wed Nov 05 22:18:55 2014 +0100 @@ -33,7 +33,7 @@ /** * Interface for managing replacements. */ -public interface Replacements { +public interface Replacements extends Remote { /** * Gets the snippet graph derived from a given method.