# HG changeset patch # User Doug Simon # Date 1354051578 -3600 # Node ID 06d5f450f32bf662e64eaa374336275440f70195 # Parent e4d9f153934f53375f738256f95a49ca07928f78 rename: ResolvedJavaType.isArrayClass() -> ResolvedJavaType.isArray() diff -r e4d9f153934f -r 06d5f450f32b graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/TypeCheckHints.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/TypeCheckHints.java Tue Nov 27 22:24:39 2012 +0100 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/TypeCheckHints.java Tue Nov 27 22:26:18 2012 +0100 @@ -111,7 +111,7 @@ * @return true if {@code type} has no subtype(s) */ public static boolean isFinalClass(ResolvedJavaType type) { - if (type.isArrayClass()) { + if (type.isArray()) { return isFinalClass(type.getComponentType()); } return Modifier.isFinal(type.getModifiers()); diff -r e4d9f153934f -r 06d5f450f32b graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/VirtualObject.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/VirtualObject.java Tue Nov 27 22:24:39 2012 +0100 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/VirtualObject.java Tue Nov 27 22:26:18 2012 +0100 @@ -68,7 +68,7 @@ if (values == null) { buf.append(""); } else { - if (type.isArrayClass()) { + if (type.isArray()) { for (int i = 0; i < values.length; i++) { if (i != 0) { buf.append(','); @@ -112,7 +112,7 @@ private static boolean checkValues(ResolvedJavaType type, Value[] values) { if (values != null) { - if (!type.isArrayClass()) { + if (!type.isArray()) { ResolvedJavaField[] fields = type.getInstanceFields(true); assert fields.length == values.length : type + ": fields=" + Arrays.toString(fields) + ", field values=" + Arrays.toString(values); for (int i = 0; i < values.length; i++) { diff -r e4d9f153934f -r 06d5f450f32b graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestMetaAccessProvider.java --- a/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestMetaAccessProvider.java Tue Nov 27 22:24:39 2012 +0100 +++ b/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestMetaAccessProvider.java Tue Nov 27 22:26:18 2012 +0100 @@ -186,7 +186,7 @@ assertNotNull(type); assertTrue(type.isClass(c)); assertEquals(c.getModifiers(), type.getModifiers()); - if (!type.isArrayClass()) { + if (!type.isArray()) { assertEquals(type.getName(), toInternalName(c.getName())); assertEquals(toJavaName(type), c.getName()); } diff -r e4d9f153934f -r 06d5f450f32b graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestResolvedJavaType.java --- a/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestResolvedJavaType.java Tue Nov 27 22:24:39 2012 +0100 +++ b/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestResolvedJavaType.java Tue Nov 27 22:26:18 2012 +0100 @@ -86,7 +86,7 @@ for (Class c : classes) { ResolvedJavaType type = runtime.lookupJavaType(c); boolean expected = c.isArray(); - boolean actual = type.isArrayClass(); + boolean actual = type.isArray(); assertEquals(expected, actual); } } @@ -268,7 +268,7 @@ } } - if (!type.isArrayClass()) { + if (!type.isArray()) { ResolvedJavaType arrayType = type.getArrayClass(); ResolvedJavaType arraySubtype = arrayType.findUniqueConcreteSubtype(); if (arraySubtype != null) { diff -r e4d9f153934f -r 06d5f450f32b graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaUtil.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaUtil.java Tue Nov 27 22:24:39 2012 +0100 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaUtil.java Tue Nov 27 22:26:18 2012 +0100 @@ -65,7 +65,7 @@ throw (NoClassDefFoundError) new NoClassDefFoundError().initCause(e); } } - if (type.isArrayClass()) { + if (type.isArray()) { ResolvedJavaType t = type; while (t.getComponentType() != null) { elementalClass = Array.newInstance(elementalClass, 0).getClass(); diff -r e4d9f153934f -r 06d5f450f32b graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java Tue Nov 27 22:24:39 2012 +0100 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java Tue Nov 27 22:26:18 2012 +0100 @@ -101,7 +101,7 @@ * * @return {@code true} if this type is an array class */ - boolean isArrayClass(); + boolean isArray(); /** * Checks whether this type is primitive. @@ -180,7 +180,7 @@ /** * Attempts to get a unique concrete subclass of this type. *

- * For an {@linkplain #isArrayClass() array} type A, the unique concrete subclass is A if + * For an {@linkplain #isArray() array} type A, the unique concrete subclass is A if * the element type of A is primitive or has no subtype. Otherwise there is no unique concrete subclass. *

* For a non-array type T, the result is the unique concrete type in the complete hierarchy of T. diff -r e4d9f153934f -r 06d5f450f32b graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotRuntimeInterpreterInterface.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotRuntimeInterpreterInterface.java Tue Nov 27 22:24:39 2012 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotRuntimeInterpreterInterface.java Tue Nov 27 22:26:18 2012 +0100 @@ -298,7 +298,7 @@ private void checkArray(Object array, long index) { nullCheck(array); ResolvedJavaType type = metaProvider.lookupJavaType(array.getClass()); - if (!type.isArrayClass()) { + if (!type.isArray()) { throw new ArrayStoreException(array.getClass().getName()); } if (index < 0 || index >= arrayLength(array)) { diff -r e4d9f153934f -r 06d5f450f32b graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaType.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaType.java Tue Nov 27 22:24:39 2012 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaType.java Tue Nov 27 22:26:18 2012 +0100 @@ -131,7 +131,7 @@ this.hasFinalizableSubclass = hasFinalizableSubclass; this.sizeOrSpecies = sizeOrSpecies; assert name.charAt(0) != '[' || sizeOrSpecies == ARRAY_SPECIES_VALUE : name + " " + Long.toHexString(sizeOrSpecies); - assert javaMirror.isArray() == isArrayClass(); + assert javaMirror.isArray() == isArray(); assert javaMirror.isInterface() == isInterface(); //System.out.println("0x" + Long.toHexString(metaspaceKlass) + ": " + name); } @@ -161,7 +161,7 @@ } private static boolean hasSubtype(ResolvedJavaType type) { - assert !type.isArrayClass() : type; + assert !type.isArray() : type; if (type.isPrimitive()) { return false; } @@ -175,7 +175,7 @@ @Override public ResolvedJavaType findUniqueConcreteSubtype() { HotSpotVMConfig config = HotSpotGraalRuntime.getInstance().getConfig(); - if (isArrayClass()) { + if (isArray()) { if (hasSubtype(getElementalType(this))) { return null; } @@ -216,7 +216,7 @@ } public HotSpotResolvedJavaType getSupertype() { - if (isArrayClass()) { + if (isArray()) { ResolvedJavaType componentType = getComponentType(); if (javaMirror == Object[].class || componentType.isPrimitive()) { return (HotSpotResolvedJavaType) fromClass(Object.class); @@ -251,7 +251,7 @@ @Override public ResolvedJavaType asExactType() { - if (isArrayClass()) { + if (isArray()) { return getComponentType().asExactType() != null ? this : null; } return Modifier.isFinal(getModifiers()) ? this : null; @@ -290,7 +290,7 @@ } @Override - public boolean isArrayClass() { + public boolean isArray() { return sizeOrSpecies == ARRAY_SPECIES_VALUE; } @@ -320,7 +320,7 @@ @Override public boolean isInstanceClass() { - return !isArrayClass() && !isInterface(); + return !isArray() && !isInterface(); } @Override @@ -366,7 +366,7 @@ * value gives the size). Must not be called if this is an array or interface type. */ public int instanceSize() { - assert !isArrayClass(); + assert !isArray(); assert !isInterface(); return sizeOrSpecies; } @@ -416,7 +416,7 @@ @Override public ResolvedJavaField[] getInstanceFields(boolean includeSuperclasses) { if (instanceFields == null) { - if (isArrayClass() || isInterface()) { + if (isArray() || isInterface()) { instanceFields = new HotSpotResolvedJavaField[0]; } else { HotSpotResolvedJavaField[] myFields = HotSpotGraalRuntime.getInstance().getCompilerToVM().getInstanceFields(this); diff -r e4d9f153934f -r 06d5f450f32b graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Tue Nov 27 22:24:39 2012 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Tue Nov 27 22:26:18 2012 +0100 @@ -460,7 +460,7 @@ ValueNode expected = cas.expected(); if (expected.kind() == Kind.Object && !cas.newValue().objectStamp().alwaysNull()) { ResolvedJavaType type = cas.object().objectStamp().type(); - if (type != null && !type.isArrayClass() && !type.isClass(Object.class)) { + if (type != null && !type.isArray() && !type.isClass(Object.class)) { // Use a field write barrier since it's not an array store FieldWriteBarrier writeBarrier = graph.add(new FieldWriteBarrier(cas.object())); graph.addAfterFixed(cas, writeBarrier); @@ -533,7 +533,7 @@ if (write.value().kind() == Kind.Object && !write.value().objectStamp().alwaysNull()) { ResolvedJavaType type = object.objectStamp().type(); WriteBarrier writeBarrier; - if (type != null && !type.isArrayClass() && !type.isClass(Object.class)) { + if (type != null && !type.isArray() && !type.isClass(Object.class)) { // Use a field write barrier since it's not an array store writeBarrier = graph.add(new FieldWriteBarrier(object)); } else { diff -r e4d9f153934f -r 06d5f450f32b graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotTypePrimitive.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotTypePrimitive.java Tue Nov 27 22:24:39 2012 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotTypePrimitive.java Tue Nov 27 22:26:18 2012 +0100 @@ -97,7 +97,7 @@ } @Override - public boolean isArrayClass() { + public boolean isArray() { return false; } diff -r e4d9f153934f -r 06d5f450f32b graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/IntrinsifyArrayCopyPhase.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/IntrinsifyArrayCopyPhase.java Tue Nov 27 22:24:39 2012 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/IntrinsifyArrayCopyPhase.java Tue Nov 27 22:26:18 2012 +0100 @@ -83,9 +83,9 @@ ResolvedJavaType srcType = src.objectStamp().type(); ResolvedJavaType destType = dest.objectStamp().type(); if (srcType != null - && srcType.isArrayClass() + && srcType.isArray() && destType != null - && destType.isArrayClass()) { + && destType.isArray()) { Kind componentKind = srcType.getComponentType().getKind(); if (srcType.getComponentType() == destType.getComponentType()) { if (componentKind == Kind.Int) { diff -r e4d9f153934f -r 06d5f450f32b 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 Tue Nov 27 22:24:39 2012 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewObjectSnippets.java Tue Nov 27 22:26:18 2012 +0100 @@ -342,7 +342,7 @@ public void lower(InitializeObjectNode initializeNode, LoweringTool tool) { StructuredGraph graph = (StructuredGraph) initializeNode.graph(); HotSpotResolvedJavaType type = (HotSpotResolvedJavaType) initializeNode.type(); - assert !type.isArrayClass(); + assert !type.isArray(); ConstantNode hub = ConstantNode.forConstant(type.klass(), runtime, graph); int size = type.instanceSize(); assert (size % wordSize()) == 0; diff -r e4d9f153934f -r 06d5f450f32b graal/com.oracle.graal.interpreter/src/com/oracle/graal/interpreter/BytecodeInterpreter.java --- a/graal/com.oracle.graal.interpreter/src/com/oracle/graal/interpreter/BytecodeInterpreter.java Tue Nov 27 22:24:39 2012 +0100 +++ b/graal/com.oracle.graal.interpreter/src/com/oracle/graal/interpreter/BytecodeInterpreter.java Tue Nov 27 22:26:18 2012 +0100 @@ -1396,7 +1396,7 @@ private ResolvedJavaType getLastDimensionType(ResolvedJavaType type) { ResolvedJavaType result = type; - while (result.isArrayClass()) { + while (result.isArray()) { result = result.getComponentType(); } return result; diff -r e4d9f153934f -r 06d5f450f32b graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewInstanceNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewInstanceNode.java Tue Nov 27 22:24:39 2012 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewInstanceNode.java Tue Nov 27 22:26:18 2012 +0100 @@ -84,7 +84,7 @@ @Override public ObjectDesc[] getAllocations(long nextVirtualId, MetaAccessProvider metaAccess) { if (instanceClass != null) { - assert !instanceClass().isArrayClass(); + assert !instanceClass().isArray(); ResolvedJavaField[] fields = instanceClass().getInstanceFields(true); ValueNode[] state = new ValueNode[fields.length]; for (int i = 0; i < state.length; i++) { diff -r e4d9f153934f -r 06d5f450f32b graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewMultiArrayNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewMultiArrayNode.java Tue Nov 27 22:24:39 2012 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewMultiArrayNode.java Tue Nov 27 22:26:18 2012 +0100 @@ -54,7 +54,7 @@ super(StampFactory.exactNonNull(type)); this.type = type; this.dimensions = new NodeInputList<>(this, dimensions); - assert dimensions.length > 0 && type.isArrayClass(); + assert dimensions.length > 0 && type.isArray(); } @Override diff -r e4d9f153934f -r 06d5f450f32b 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 Tue Nov 27 22:24:39 2012 +0100 +++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetTemplate.java Tue Nov 27 22:26:18 2012 +0100 @@ -401,7 +401,7 @@ private static boolean checkVarargs(final ResolvedJavaMethod method, Signature signature, int i, String name, Varargs varargs) { Object arg = varargs.getArray(); ResolvedJavaType type = (ResolvedJavaType) signature.getParameterType(i, method.getDeclaringClass()); - assert type.isArrayClass() : "varargs parameter must be an array type"; + assert type.isArray() : "varargs parameter must be an array type"; assert type.isInstance(Constant.forObject(arg)) : "value for " + name + " is not a " + MetaUtil.toJavaName(type) + " instance: " + arg; return true; } diff -r e4d9f153934f -r 06d5f450f32b graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/BlockState.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/BlockState.java Tue Nov 27 22:24:39 2012 +0100 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/BlockState.java Tue Nov 27 22:26:18 2012 +0100 @@ -85,7 +85,7 @@ private void materializeChangedBefore(FixedNode fixed, VirtualObjectNode virtual, HashSet deferred, GraphEffectList deferredStores, GraphEffectList materializeEffects) { trace("materializing %s at %s", virtual, fixed); ObjectState obj = getObjectState(virtual); - if (obj.getLockCount() > 0 && obj.virtual.type().isArrayClass()) { + if (obj.getLockCount() > 0 && obj.virtual.type().isArray()) { throw new BailoutException("array materialized with lock"); }