8153782: [JVMCI] update JVMCI sources to Eclipse 4.5.2 format style

Reviewed-by: twisti, never
This commit is contained in:
Doug Simon 2016-05-11 16:40:04 +00:00
parent 1917be9572
commit 1d60ce77a0
29 changed files with 592 additions and 616 deletions

View file

@ -25,8 +25,8 @@ package jdk.vm.ci.code;
/**
* Constants and intrinsic definition for memory barriers.
*
* The documentation for each constant is taken from Doug Lea's <a
* href="http://gee.cs.oswego.edu/dl/jmm/cookbook.html">The JSR-133 Cookbook for Compiler
* The documentation for each constant is taken from Doug Lea's
* <a href="http://gee.cs.oswego.edu/dl/jmm/cookbook.html">The JSR-133 Cookbook for Compiler
* Writers</a>.
* <p>
* The {@code JMM_*} constants capture the memory barriers necessary to implement the Java Memory

View file

@ -56,8 +56,8 @@ public class TargetDescription {
public final JavaKind wordJavaKind;
/**
* The stack alignment requirement of the platform. For example, from Appendix D of <a
* href="http://www.intel.com/Assets/PDF/manual/248966.pdf">Intel 64 and IA-32 Architectures
* The stack alignment requirement of the platform. For example, from Appendix D of
* <a href="http://www.intel.com/Assets/PDF/manual/248966.pdf">Intel 64 and IA-32 Architectures
* Optimization Reference Manual</a>:
*
* <pre>

View file

@ -21,10 +21,10 @@
* questions.
*/
/**
* Package that defines the interface between a Java application that wants to install code and the runtime.
* The runtime provides in implementation of the {@link jdk.vm.ci.code.CodeCacheProvider} interface.
* The method {@link jdk.vm.ci.code.CodeCacheProvider#addCode(jdk.vm.ci.meta.ResolvedJavaMethod, CompiledCode, jdk.vm.ci.meta.SpeculationLog, InstalledCode)}
* Package that defines the interface between a Java application that wants to install code and the
* runtime. The runtime provides in implementation of the {@link jdk.vm.ci.code.CodeCacheProvider}
* interface. The method
* {@link jdk.vm.ci.code.CodeCacheProvider#addCode(jdk.vm.ci.meta.ResolvedJavaMethod, CompiledCode, jdk.vm.ci.meta.SpeculationLog, InstalledCode)}
* can be used to install code.
*/
package jdk.vm.ci.code;

View file

@ -122,7 +122,8 @@ public class AArch64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFac
}
}
protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, ConstantReflectionProvider constantReflection, StackIntrospection stackIntrospection) {
protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, ConstantReflectionProvider constantReflection,
StackIntrospection stackIntrospection) {
return new JVMCIBackend(metaAccess, codeCache, constantReflection, stackIntrospection);
}
}

View file

@ -206,7 +206,8 @@ public class AMD64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFacto
}
}
protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, ConstantReflectionProvider constantReflection, StackIntrospection stackIntrospection) {
protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, ConstantReflectionProvider constantReflection,
StackIntrospection stackIntrospection) {
return new JVMCIBackend(metaAccess, codeCache, constantReflection, stackIntrospection);
}
}

View file

@ -246,8 +246,8 @@ final class CompilerToVM {
native void resolveInvokeDynamicInPool(HotSpotConstantPool constantPool, int cpi);
/**
* Ensures that the type referenced by the entry for a <a
* href="https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-2.html#jvms-2.9">signature
* Ensures that the type referenced by the entry for a
* <a href="https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-2.html#jvms-2.9">signature
* polymorphic</a> method at index {@code cpi} in {@code constantPool} is loaded and
* initialized.
*

View file

@ -152,7 +152,8 @@ public class HotSpotMetaAccessProvider implements MetaAccessProvider, HotSpotPro
int actionValue = convertDeoptAction(action);
int reasonValue = convertDeoptReason(reason);
int debugValue = debugId & intMaskRight(config.deoptimizationDebugIdBits);
JavaConstant c = JavaConstant.forInt(~((debugValue << config.deoptimizationDebugIdShift) | (reasonValue << config.deoptimizationReasonShift) | (actionValue << config.deoptimizationActionShift)));
JavaConstant c = JavaConstant.forInt(
~((debugValue << config.deoptimizationDebugIdShift) | (reasonValue << config.deoptimizationReasonShift) | (actionValue << config.deoptimizationActionShift)));
assert c.asInt() < 0;
return c;
}

View file

@ -27,8 +27,8 @@ package jdk.vm.ci.inittimer;
*/
public @interface SuppressFBWarnings {
/**
* The set of FindBugs <a
* href="http://findbugs.sourceforge.net/bugDescriptions.html">warnings</a> that are to be
* The set of FindBugs
* <a href="http://findbugs.sourceforge.net/bugDescriptions.html">warnings</a> that are to be
* suppressed in annotated element. The value can be a bug category, kind or pattern.
*/
String[] value();

View file

@ -123,10 +123,10 @@ public interface ConstantReflectionProvider {
JavaConstant boxPrimitive(JavaConstant source);
/**
* Converts the given {@link JavaKind#Object object} constant to a
* {@link JavaKind#isPrimitive() primitive} constant, according to the Java unboxing rules.
* Returns {@code null} if the source is is not an object constant that can be unboxed, or the
* unboxed value is not available at this point.
* Converts the given {@link JavaKind#Object object} constant to a {@link JavaKind#isPrimitive()
* primitive} constant, according to the Java unboxing rules. Returns {@code null} if the source
* is is not an object constant that can be unboxed, or the unboxed value is not available at
* this point.
*/
JavaConstant unboxPrimitive(JavaConstant source);

View file

@ -81,8 +81,8 @@ public interface MetaAccessProvider {
long getMemorySize(JavaConstant constant);
/**
* Parses a <a
* href="http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3.3">method
* Parses a
* <a href="http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3.3">method
* descriptor</a> into a {@link Signature}. The behavior of this method is undefined if the
* method descriptor is not well formed.
*/

View file

@ -94,8 +94,8 @@ public interface ResolvedJavaMethod extends JavaMethod, InvokeTarget, ModifiersP
}
/**
* Checks that the method is a <a
* href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6">varargs</a>
* Checks that the method is a
* <a href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6">varargs</a>
* method.
*
* @return whether the method is a varargs method
@ -105,8 +105,8 @@ public interface ResolvedJavaMethod extends JavaMethod, InvokeTarget, ModifiersP
}
/**
* Checks that the method is a <a
* href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6">bridge</a>
* Checks that the method is a
* <a href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6">bridge</a>
* method.
*
* @return whether the method is a bridge method
@ -332,8 +332,8 @@ public interface ResolvedJavaMethod extends JavaMethod, InvokeTarget, ModifiersP
SpeculationLog getSpeculationLog();
/**
* Determines if the method identified by its holder and name is a <a
* href="https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-2.html#jvms-2.9">signature
* Determines if the method identified by its holder and name is a
* <a href="https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-2.html#jvms-2.9">signature
* polymorphic</a> method.
*/
static boolean isSignaturePolymorphic(JavaType holder, String name, MetaAccessProvider metaAccess) {

View file

@ -276,10 +276,10 @@ public interface ResolvedJavaType extends JavaType, ModifiersProvider, Annotated
ResolvedJavaField[] getInstanceFields(boolean includeSuperclasses);
/**
* Returns the static fields of this class, including
* {@linkplain ResolvedJavaField#isInternal() internal} fields. A zero-length array is returned
* for array and primitive types. The order of fields returned by this method is stable. That
* is, for a single JVM execution the same order is returned each time this method is called.
* Returns the static fields of this class, including {@linkplain ResolvedJavaField#isInternal()
* internal} fields. A zero-length array is returned for array and primitive types. The order of
* fields returned by this method is stable. That is, for a single JVM execution the same order
* is returned each time this method is called.
*/
ResolvedJavaField[] getStaticFields();

View file

@ -84,8 +84,8 @@ public interface Signature {
}
/**
* Gets the <a
* href="http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3.3">method
* Gets the
* <a href="http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3.3">method
* descriptor</a> corresponding to this signature. For example:
*
* <pre>

View file

@ -22,8 +22,8 @@
*/
/**
* Package that defines the interface between a runtime and a Java application that wants to access meta information. The runtime
* provides an implementation of the {@link jdk.vm.ci.meta.MetaAccessProvider} interface.
* Package that defines the interface between a runtime and a Java application that wants to access
* meta information. The runtime provides an implementation of the
* {@link jdk.vm.ci.meta.MetaAccessProvider} interface.
*/
package jdk.vm.ci.meta;

View file

@ -95,15 +95,12 @@ public class HotSpotConstantReflectionProviderTest {
expected == null ? "null" : expected.toString(), "Unexpected result:");
}
@Test(dataProvider = "readFieldValueNegativeDataProvider",
dataProviderClass = ReadFieldValueDataProvider.class,
expectedExceptions = {NullPointerException.class})
@Test(dataProvider = "readFieldValueNegativeDataProvider", dataProviderClass = ReadFieldValueDataProvider.class, expectedExceptions = {NullPointerException.class})
public void testNegativeReadFieldValue(ResolvedJavaField field, JavaConstant receiver) {
CONSTANT_REFLECTION_PROVIDER.readFieldValue(field, receiver);
}
@Test(dataProvider = "readStableFieldValueDataProvider",
dataProviderClass = ReadStableFieldValueDataProvider.class)
@Test(dataProvider = "readStableFieldValueDataProvider", dataProviderClass = ReadStableFieldValueDataProvider.class)
public void testReadStableFieldValue(ResolvedJavaField field, JavaConstant receiver, boolean isDefStab,
JavaConstant expected) {
Assert.assertEquals(
@ -112,8 +109,7 @@ public class HotSpotConstantReflectionProviderTest {
"Unexpected result:");
}
@Test(dataProvider = "readStableFieldValueArrayDataProvider",
dataProviderClass = ReadStableFieldValueDataProvider.class)
@Test(dataProvider = "readStableFieldValueArrayDataProvider", dataProviderClass = ReadStableFieldValueDataProvider.class)
public void testReadStableFieldValueForArray(ResolvedJavaField field, JavaConstant receiver, boolean isDefStab,
int arrayDim, JavaConstant expected) {
JavaConstant result = CONSTANT_REFLECTION_PROVIDER.readStableFieldValue(field, receiver,
@ -141,15 +137,12 @@ public class HotSpotConstantReflectionProviderTest {
Assert.assertEquals(result.toString(), expected.toString(), "Unexpected result:");
}
@Test(dataProvider = "readStableFieldValueNegativeDataProvider",
dataProviderClass = ReadStableFieldValueDataProvider.class,
expectedExceptions = {NullPointerException.class})
@Test(dataProvider = "readStableFieldValueNegativeDataProvider", dataProviderClass = ReadStableFieldValueDataProvider.class, expectedExceptions = {NullPointerException.class})
public void testNegativeReadStableFieldValue(ResolvedJavaField field, JavaConstant receiver, boolean isDefStab) {
CONSTANT_REFLECTION_PROVIDER.readStableFieldValue(field, receiver, isDefStab);
}
@Test(dataProvider = "readConstantFieldValueDataProvider",
dataProviderClass = ReadConstantFieldValueDataProvider.class)
@Test(dataProvider = "readConstantFieldValueDataProvider", dataProviderClass = ReadConstantFieldValueDataProvider.class)
public void testReadConstantFieldValue(ResolvedJavaField field, JavaConstant receiver, JavaConstant expected,
String testInfo) {
String msg = String.format("Unexpected result for %s. Field is stable = %s.", testInfo,
@ -158,15 +151,12 @@ public class HotSpotConstantReflectionProviderTest {
expected, msg);
}
@Test(dataProvider = "readConstantFieldValueNegativeDataProvider",
dataProviderClass = ReadConstantFieldValueDataProvider.class,
expectedExceptions = {NullPointerException.class})
@Test(dataProvider = "readConstantFieldValueNegativeDataProvider", dataProviderClass = ReadConstantFieldValueDataProvider.class, expectedExceptions = {NullPointerException.class})
public void testNegativeReadConstantFieldValue(ResolvedJavaField field, JavaConstant receiver) {
CONSTANT_REFLECTION_PROVIDER.readConstantFieldValue(field, receiver);
}
@Test(dataProvider = "readConstantArrayElementDataProvider",
dataProviderClass = ReadConstantArrayElementDataProvider.class)
@Test(dataProvider = "readConstantArrayElementDataProvider", dataProviderClass = ReadConstantArrayElementDataProvider.class)
public void testReadConstantArrayElement(JavaConstant array, int index, JavaConstant expected, String testInfo) {
JavaConstant actual = CONSTANT_REFLECTION_PROVIDER.readConstantArrayElement(array, index);
Assert.assertEquals(actual == null ? "null" : actual.toString(),
@ -174,8 +164,7 @@ public class HotSpotConstantReflectionProviderTest {
String.format("Unexpected result while testing %s:", testInfo));
}
@Test(dataProvider = "readConstantArrayElementForOffsetDataProvider",
dataProviderClass = ReadConstantArrayElementDataProvider.class)
@Test(dataProvider = "readConstantArrayElementForOffsetDataProvider", dataProviderClass = ReadConstantArrayElementDataProvider.class)
public void testReadConstantArrayElementForOffset(JavaConstant array, long offset, JavaConstant expected,
String testInfo) {
JavaConstant actual = CONSTANT_REFLECTION_PROVIDER.readConstantArrayElementForOffset(array,

View file

@ -48,8 +48,7 @@ import jdk.vm.ci.meta.ResolvedJavaField;
public class ReadConstantArrayElementDataProvider {
// Non-stable array fields names mapped to their base offsets and index scale
private static final List<ArrayFieldParams> NON_STABLE_ARRAY_NAMES
= new LinkedList<>();
private static final List<ArrayFieldParams> NON_STABLE_ARRAY_NAMES = new LinkedList<>();
static {
NON_STABLE_ARRAY_NAMES.add(
@ -109,8 +108,7 @@ public class ReadConstantArrayElementDataProvider {
}
// Stable array fields names mapped to their base offsets and index scale
private static final List<ArrayFieldParams> STABLE_ARRAY_NAMES
= new LinkedList<>();
private static final List<ArrayFieldParams> STABLE_ARRAY_NAMES = new LinkedList<>();
static {
NON_STABLE_ARRAY_NAMES.stream().forEach((entry) -> {
@ -145,11 +143,9 @@ public class ReadConstantArrayElementDataProvider {
"array field \"" + fieldName + "\" for index " + i});
});
}
Stream<Map.Entry<ResolvedJavaField, JavaConstant>> arraysStream1
= Stream.concat(ARRAYS_MAP.entrySet().stream(),
Stream<Map.Entry<ResolvedJavaField, JavaConstant>> arraysStream1 = Stream.concat(ARRAYS_MAP.entrySet().stream(),
ARRAY_ARRAYS_MAP.entrySet().stream());
Stream<Map.Entry<ResolvedJavaField, JavaConstant>> arraysStream2
= Stream.concat(STABLE_ARRAYS_MAP.entrySet().stream(),
Stream<Map.Entry<ResolvedJavaField, JavaConstant>> arraysStream2 = Stream.concat(STABLE_ARRAYS_MAP.entrySet().stream(),
STABLE_ARRAY_ARRAYS_MAP.entrySet().stream());
Stream.concat(arraysStream1, arraysStream2).forEach((array) -> {
for (int i : new int[]{-1, 2}) {

View file

@ -39,7 +39,6 @@ import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
import jdk.vm.ci.meta.JavaConstant;
import org.testng.annotations.DataProvider;
public class ReadConstantFieldValueDataProvider {
@DataProvider(name = "readConstantFieldValueDataProvider")

View file

@ -39,7 +39,6 @@ import java.util.LinkedList;
import jdk.vm.ci.meta.JavaConstant;
import org.testng.annotations.DataProvider;
public class ReadFieldValueDataProvider {
@DataProvider(name = "readFieldValueDataProvider")

View file

@ -35,13 +35,10 @@ import jdk.vm.ci.runtime.JVMCI;
public class TestHelper {
public static final DummyClass DUMMY_CLASS_INSTANCE = new DummyClass();
public static final HotSpotConstantReflectionProvider CONSTANT_REFLECTION_PROVIDER
= (HotSpotConstantReflectionProvider) JVMCI.getRuntime().getHostJVMCIBackend().getConstantReflection();
public static final JavaConstant DUMMY_CLASS_CONSTANT
= CONSTANT_REFLECTION_PROVIDER.forObject(DUMMY_CLASS_INSTANCE);
public static final HotSpotConstantReflectionProvider CONSTANT_REFLECTION_PROVIDER = (HotSpotConstantReflectionProvider) JVMCI.getRuntime().getHostJVMCIBackend().getConstantReflection();
public static final JavaConstant DUMMY_CLASS_CONSTANT = CONSTANT_REFLECTION_PROVIDER.forObject(DUMMY_CLASS_INSTANCE);
public static final Map<ResolvedJavaField, JavaConstant> INSTANCE_FIELDS_MAP
= new HashMap<>();
public static final Map<ResolvedJavaField, JavaConstant> INSTANCE_FIELDS_MAP = new HashMap<>();
static {
INSTANCE_FIELDS_MAP.put(getResolvedJavaField(DummyClass.class, "booleanField"),
@ -65,8 +62,7 @@ public class TestHelper {
DUMMY_CLASS_INSTANCE.objectField));
}
public static final Map<ResolvedJavaField, JavaConstant> INSTANCE_FINAL_FIELDS_MAP
= new HashMap<>();
public static final Map<ResolvedJavaField, JavaConstant> INSTANCE_FINAL_FIELDS_MAP = new HashMap<>();
static {
INSTANCE_FINAL_FIELDS_MAP.put(getResolvedJavaField(DummyClass.class, "finalBooleanField"),
@ -92,8 +88,7 @@ public class TestHelper {
DUMMY_CLASS_INSTANCE.finalObjectField));
}
public static final Map<ResolvedJavaField, JavaConstant> INSTANCE_FINAL_DEFAULT_FIELDS_MAP
= new HashMap<>();
public static final Map<ResolvedJavaField, JavaConstant> INSTANCE_FINAL_DEFAULT_FIELDS_MAP = new HashMap<>();
static {
INSTANCE_FINAL_DEFAULT_FIELDS_MAP.put(getResolvedJavaField(DummyClass.class,
@ -134,8 +129,7 @@ public class TestHelper {
DUMMY_CLASS_INSTANCE.finalDefaultObjectField));
}
public static final Map<ResolvedJavaField, JavaConstant> INSTANCE_STABLE_FIELDS_MAP
= new HashMap<>();
public static final Map<ResolvedJavaField, JavaConstant> INSTANCE_STABLE_FIELDS_MAP = new HashMap<>();
static {
INSTANCE_STABLE_FIELDS_MAP.put(getResolvedJavaField(DummyClass.class, "stableBooleanField"),
@ -163,8 +157,7 @@ public class TestHelper {
DUMMY_CLASS_INSTANCE.stableObjectField));
}
public static final Map<ResolvedJavaField, JavaConstant> INSTANCE_STABLE_DEFAULT_FIELDS_MAP
= new HashMap<>();
public static final Map<ResolvedJavaField, JavaConstant> INSTANCE_STABLE_DEFAULT_FIELDS_MAP = new HashMap<>();
static {
INSTANCE_STABLE_DEFAULT_FIELDS_MAP.put(getResolvedJavaField(DummyClass.class,
@ -228,8 +221,7 @@ public class TestHelper {
CONSTANT_REFLECTION_PROVIDER.forObject(DummyClass.staticObjectField));
}
public static final Map<ResolvedJavaField, JavaConstant> STATIC_FINAL_FIELDS_MAP
= new HashMap<>();
public static final Map<ResolvedJavaField, JavaConstant> STATIC_FINAL_FIELDS_MAP = new HashMap<>();
static {
STATIC_FINAL_FIELDS_MAP.put(
@ -255,8 +247,7 @@ public class TestHelper {
CONSTANT_REFLECTION_PROVIDER.forObject(DummyClass.staticFinalObjectField));
}
public static final Map<ResolvedJavaField, JavaConstant> STATIC_STABLE_FIELDS_MAP
= new HashMap<>();
public static final Map<ResolvedJavaField, JavaConstant> STATIC_STABLE_FIELDS_MAP = new HashMap<>();
static {
STATIC_STABLE_FIELDS_MAP.put(
@ -287,8 +278,7 @@ public class TestHelper {
CONSTANT_REFLECTION_PROVIDER.forObject(DummyClass.staticStableObjectField));
}
public static final Map<ResolvedJavaField, JavaConstant> STATIC_STABLE_DEFAULT_FIELDS_MAP
= new HashMap<>();
public static final Map<ResolvedJavaField, JavaConstant> STATIC_STABLE_DEFAULT_FIELDS_MAP = new HashMap<>();
static {
STATIC_STABLE_DEFAULT_FIELDS_MAP.put(getResolvedJavaField(DummyClass.class,