changeset 18267:fa6c97ede679

added Remote interface and applied it to API types that will be proxied for the purpose of replay/remote compilation
author Doug Simon <doug.simon@oracle.com>
date Wed, 05 Nov 2014 22:18:55 +0100
parents ae181ec869c5
children 2a604849b3e6
files graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ConstantPool.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ConstantReflectionProvider.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaField.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaMethod.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaType.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaAccessProvider.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MethodHandleAccessProvider.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ProfilingInfo.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Remote.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Signature.java graal/com.oracle.graal.api.replacements/src/com/oracle/graal/api/replacements/SnippetReflectionProvider.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMetaspaceConstant.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotObjectConstant.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/Replacements.java
diffstat 14 files changed, 52 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- 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}
--- 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
--- 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.
--- 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.
--- 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
--- 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.
--- 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
--- 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.
--- /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 {
+}
--- 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 <a href="http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3.3">Method
  *      Descriptors</a>
  */
-public interface Signature {
+public interface Signature extends Remote {
 
     /**
      * Returns the number of parameters in this signature, adding 1 for a receiver if requested.
--- 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 @@
  * <p>
  * 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.
--- 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();
 
--- 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();
 
--- 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.