8155719: remove TrustedInterface from JVMCI

Reviewed-by: twisti
This commit is contained in:
Roland Schatz 2016-05-10 12:18:22 +02:00
parent 1e4b00b1dc
commit aab69bdeb5
9 changed files with 12 additions and 73 deletions

View File

@ -52,7 +52,6 @@ import jdk.vm.ci.meta.ModifiersProvider;
import jdk.vm.ci.meta.ResolvedJavaField;
import jdk.vm.ci.meta.ResolvedJavaMethod;
import jdk.vm.ci.meta.ResolvedJavaType;
import jdk.vm.ci.meta.TrustedInterface;
/**
* Implementation of {@link JavaType} for resolved non-primitive HotSpot classes.
@ -878,11 +877,6 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem
return "HotSpotType<" + getName() + ", resolved>";
}
@Override
public boolean isTrustedInterfaceType() {
return TrustedInterface.class.isAssignableFrom(mirror());
}
@Override
public boolean isCloneableWithAllocation() {
return (getAccessFlags() & config().jvmAccIsCloneableFast) != 0;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2016, 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
@ -263,11 +263,6 @@ public final class HotSpotResolvedPrimitiveType extends HotSpotResolvedJavaType
return null;
}
@Override
public boolean isTrustedInterfaceType() {
return false;
}
@Override
public boolean isCloneableWithAllocation() {
return false;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2016, 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
@ -29,7 +29,7 @@ import java.util.UnknownFormatConversionException;
* 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 extends TrustedInterface {
public interface JavaField {
/**
* Returns the name of this field.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2016, 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
@ -29,7 +29,7 @@ import java.util.UnknownFormatConversionException;
* 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 extends TrustedInterface {
public interface JavaMethod {
/**
* Returns the name of this method.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2016, 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
@ -28,7 +28,7 @@ import static jdk.vm.ci.meta.MetaUtil.internalNameToJava;
* Represents a resolved or unresolved type. Types include primitives, objects, {@code void}, and
* arrays thereof.
*/
public interface JavaType extends TrustedInterface {
public interface JavaType {
/**
* Returns the name of this type in internal form. The following are examples of strings

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2016, 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
@ -345,12 +345,6 @@ public interface ResolvedJavaType extends JavaType, ModifiersProvider {
*/
ResolvedJavaMethod getClassInitializer();
/**
* Returns true if this type represents an interface and it should be trusted even in places
* where the JVM verifier would not give any guarantees other than {@link Object}.
*/
boolean isTrustedInterfaceType();
default ResolvedJavaMethod findMethod(String name, Signature signature) {
for (ResolvedJavaMethod method : getDeclaredMethods()) {
if (method.getName().equals(name) && method.getSignature().equals(signature)) {

View File

@ -1,32 +0,0 @@
/*
* Copyright (c) 2014, 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 jdk.vm.ci.meta;
/**
* Interfaces extending this interface should be trusted by the compiler. See
* {@link ResolvedJavaType#isTrustedInterfaceType()}.
*
*/
public interface TrustedInterface {
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2016, 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
@ -68,7 +68,6 @@ import jdk.vm.ci.meta.ModifiersProvider;
import jdk.vm.ci.meta.ResolvedJavaField;
import jdk.vm.ci.meta.ResolvedJavaMethod;
import jdk.vm.ci.meta.ResolvedJavaType;
import jdk.vm.ci.meta.TrustedInterface;
import org.junit.Test;
@ -841,16 +840,6 @@ public class TestResolvedJavaType extends TypeUniverse {
}
}
@Test
public void isTrustedInterfaceTypeTest() {
for (Class<?> c : classes) {
ResolvedJavaType type = metaAccess.lookupJavaType(c);
if (TrustedInterface.class.isAssignableFrom(c)) {
assertTrue(type.isTrustedInterfaceType());
}
}
}
@Test
public void isLeafTest() {
for (Class<?> c : classes) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2016, 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
@ -52,7 +52,6 @@ import jdk.vm.ci.meta.JavaConstant;
import jdk.vm.ci.meta.MetaAccessProvider;
import jdk.vm.ci.meta.ResolvedJavaField;
import jdk.vm.ci.meta.ResolvedJavaType;
import jdk.vm.ci.meta.TrustedInterface;
import jdk.vm.ci.runtime.JVMCI;
import org.junit.Test;
@ -116,8 +115,8 @@ public class TypeUniverse {
byte[].class, short[].class, char[].class, int[].class, float[].class, long[].class, double[].class, Object[].class, Class[].class, List[].class, boolean[][].class,
byte[][].class, short[][].class, char[][].class, int[][].class, float[][].class, long[][].class, double[][].class, Object[][].class, Class[][].class, List[][].class,
ClassLoader.class, String.class, Serializable.class, Cloneable.class, Test.class, TestMetaAccessProvider.class, List.class, Collection.class, Map.class, Queue.class,
HashMap.class, LinkedHashMap.class, IdentityHashMap.class, AbstractCollection.class, AbstractList.class, ArrayList.class, TrustedInterface.class, InnerClass.class,
InnerStaticClass.class, InnerStaticFinalClass.class, PrivateInnerClass.class, ProtectedInnerClass.class};
HashMap.class, LinkedHashMap.class, IdentityHashMap.class, AbstractCollection.class, AbstractList.class, ArrayList.class, InnerClass.class, InnerStaticClass.class,
InnerStaticFinalClass.class, PrivateInnerClass.class, ProtectedInnerClass.class};
for (Class<?> c : initialClasses) {
addClass(c);
}