Mercurial > hg > truffle
changeset 15311:820c6d353358
added ModifiersProvider as superinterface for ResolvedJava[Method|Field|Type] and implemented all checks against modifiers as default methods
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeUtil.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeUtil.java Wed Apr 23 12:38:05 2014 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.api.code; -import java.lang.reflect.*; import java.util.*; import com.oracle.graal.api.meta.*; @@ -342,7 +341,7 @@ int sigCount = sig.getParameterCount(false); JavaType[] argTypes; int argIndex = 0; - if (!Modifier.isStatic(method.getModifiers())) { + if (!method.isStatic()) { argTypes = new JavaType[sigCount + 1]; argTypes[argIndex++] = method.getDeclaringClass(); } else {
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/TypeCheckHints.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/TypeCheckHints.java Wed Apr 23 12:38:05 2014 +0200 @@ -23,8 +23,6 @@ package com.oracle.graal.api.code; import static com.oracle.graal.api.meta.MetaUtil.*; -import static java.lang.reflect.Modifier.*; - import java.util.*; import com.oracle.graal.api.meta.*; @@ -83,7 +81,7 @@ /** * Derives hint information for use when generating the code for a type check instruction. - * + * * @param targetType the target type of the type check * @param profile the profiling information available for the instruction (if any) * @param assumptions the object in which speculations are recorded. This is null if @@ -151,10 +149,10 @@ /** * Determines if a given type can have subtypes other than itself. This analysis is purely * static; no assumptions are made. - * + * * @return true if {@code type} can have subtypes */ public static boolean canHaveSubtype(ResolvedJavaType type) { - return !isFinal(getElementalType(type).getModifiers()); + return !getElementalType(type).isFinal(); } }
--- a/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestResolvedJavaMethod.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.api.meta.test/src/com/oracle/graal/api/meta/test/TestResolvedJavaMethod.java Wed Apr 23 12:38:05 2014 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.api.meta.test; -import static java.lang.reflect.Modifier.*; import static org.junit.Assert.*; import java.lang.annotation.*; @@ -52,9 +51,9 @@ if (code == null) { assertTrue(m.getCodeSize() == 0); } else { - if (isAbstract(m.getModifiers())) { + if (m.isAbstract()) { assertTrue(code.length == 0); - } else if (!isNative(m.getModifiers())) { + } else if (!m.isNative()) { assertTrue(code.length > 0); } } @@ -69,9 +68,9 @@ for (Map.Entry<Method, ResolvedJavaMethod> e : methods.entrySet()) { ResolvedJavaMethod m = e.getValue(); int codeSize = m.getCodeSize(); - if (isAbstract(m.getModifiers())) { + if (m.isAbstract()) { assertTrue(codeSize == 0); - } else if (!isNative(m.getModifiers())) { + } else if (!m.isNative()) { assertTrue(codeSize > 0); } }
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaTypeProfile.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaTypeProfile.java Wed Apr 23 12:38:05 2014 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.api.meta; -import static java.lang.reflect.Modifier.*; - import java.util.*; import com.oracle.graal.api.meta.JavaTypeProfile.ProfiledType; @@ -146,7 +144,7 @@ public ProfiledType(ResolvedJavaType type, double probability) { super(type, probability); - assert type.isArray() || !isAbstract(type.getModifiers()) : type; + assert type.isArray() || !type.isAbstract() : type; } /**
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaUtil.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaUtil.java Wed Apr 23 12:38:05 2014 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.api.meta; -import static java.lang.reflect.Modifier.*; - import java.io.*; import java.lang.annotation.*; import java.lang.reflect.*; @@ -378,7 +376,7 @@ break; } case 'f': { - sb.append(!(method instanceof ResolvedJavaMethod) ? "unresolved" : isStatic(((ResolvedJavaMethod) method).getModifiers()) ? "static" : "virtual"); + sb.append(!(method instanceof ResolvedJavaMethod) ? "unresolved" : ((ResolvedJavaMethod) method).isStatic() ? "static" : "virtual"); break; } case '%': { @@ -452,7 +450,7 @@ break; } case 'f': { - sb.append(!(field instanceof ResolvedJavaField) ? "unresolved" : isStatic(((ResolvedJavaField) field).getModifiers()) ? "static" : "instance"); + sb.append(!(field instanceof ResolvedJavaField) ? "unresolved" : ((ResolvedJavaField) field).isStatic() ? "static" : "instance"); break; } case '%': { @@ -561,7 +559,7 @@ } public static JavaType[] signatureToTypes(ResolvedJavaMethod method) { - JavaType receiver = isStatic(method.getModifiers()) ? null : method.getDeclaringClass(); + JavaType receiver = method.isStatic() ? null : method.getDeclaringClass(); return signatureToTypes(method.getSignature(), receiver); }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ModifiersProvider.java Wed Apr 23 12:38:05 2014 +0200 @@ -0,0 +1,131 @@ +/* + * 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; + +import static java.lang.reflect.Modifier.*; + +import java.lang.reflect.*; + +/** + * A Java element (i.e., a class, interface, field or method) that is described by a set of Java + * language {@linkplain #getModifiers() modifiers}. + */ +public interface ModifiersProvider { + + /** + * Returns the Java language modifiers for this element. + */ + int getModifiers(); + + /** + * see {@link Modifier#isInterface(int)} + */ + default boolean isInterface() { + return Modifier.isInterface(getModifiers()); + } + + /** + * see {@link Modifier#isSynchronized(int)} + */ + default boolean isSynchronized() { + return Modifier.isSynchronized(getModifiers()); + } + + /** + * see {@link Modifier#isStatic(int)} + */ + default boolean isStatic() { + return Modifier.isStatic(getModifiers()); + } + + /** + * see {@link Modifier#isFinal(int)} + */ + default boolean isFinal() { + return Modifier.isFinal(getModifiers()); + } + + /** + * see {@link Modifier#isPublic(int)} + */ + default boolean isPublic() { + return Modifier.isPublic(getModifiers()); + } + + /** + * Determines if this element is neither {@linkplain #isPublic() public}, + * {@linkplain #isProtected() protected} nor {@linkplain #isPrivate() private}. + */ + default boolean isPackagePrivate() { + return ((PUBLIC | PROTECTED | PRIVATE) & getModifiers()) == 0; + } + + /** + * see {@link Modifier#isPrivate(int)} + */ + default boolean isPrivate() { + return Modifier.isPrivate(getModifiers()); + } + + /** + * see {@link Modifier#isProtected(int)} + */ + default boolean isProtected() { + return Modifier.isProtected(getModifiers()); + } + + /** + * see {@link Modifier#isTransient(int)} + */ + default boolean isTransient() { + return Modifier.isTransient(getModifiers()); + } + + /** + * see {@link Modifier#isStrict(int)} + */ + default boolean isStrict() { + return Modifier.isStrict(getModifiers()); + } + + /** + * see {@link Modifier#isVolatile(int)} + */ + default boolean isVolatile() { + return Modifier.isVolatile(getModifiers()); + } + + /** + * see {@link Modifier#isNative(int)} + */ + default boolean isNative() { + return Modifier.isNative(getModifiers()); + } + + /** + * see {@link Modifier#isAbstract(int)} + */ + default boolean isAbstract() { + return Modifier.isAbstract(getModifiers()); + } +}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaField.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaField.java Wed Apr 23 12:38:05 2014 +0200 @@ -29,12 +29,13 @@ * Represents a reference to a resolved Java field. Fields, like methods and types, are resolved * through {@link ConstantPool constant pools}. */ -public interface ResolvedJavaField extends JavaField, LocationIdentity { +public interface ResolvedJavaField extends JavaField, LocationIdentity, ModifiersProvider { /** - * Returns the Java language modifiers for this field, as an integer. The {@link Modifier} class - * should be used to decode the modifiers. Only the {@linkplain Modifier#fieldModifiers() field - * flags} specified in the JVM specification will be included in the returned mask. + * {@inheritDoc} + * <p> + * Only the {@linkplain Modifier#fieldModifiers() field flags} specified in the JVM + * specification will be included in the returned mask. */ int getModifiers(); @@ -53,7 +54,7 @@ * Gets the constant value of this field. Note that a {@code static final} field may not be * considered constant if its declaring class is not yet initialized or if it is a well known * field that can be updated via other means (e.g., {@link System#setOut(java.io.PrintStream)}). - * + * * @param receiver object from which this field's value is to be read. This value is ignored if * this field is static. * @return the constant value of this field or {@code null} if this field is not considered @@ -65,7 +66,7 @@ * Gets the current value of this field for a given object, if available. There is no guarantee * that the same value will be returned by this method for a field unless the field is * considered to be {@linkplain #readConstantValue(Constant) constant} by the runtime. - * + * * @param receiver object from which this field's value is to be read. This value is ignored if * this field is static. * @return the value of this field or {@code null} if the value is not available (e.g., because @@ -82,7 +83,7 @@ /** * Returns the annotation for the specified type of this field, if such an annotation is * present. - * + * * @param annotationClass the Class object corresponding to the annotation type * @return this element's annotation for the specified annotation type if present on this field, * else {@code null}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaMethod.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaMethod.java Wed Apr 23 12:38:05 2014 +0200 @@ -29,7 +29,7 @@ * Represents a resolved Java method. Methods, like fields and types, are resolved through * {@link ConstantPool constant pools}. */ -public interface ResolvedJavaMethod extends JavaMethod, InvokeTarget { +public interface ResolvedJavaMethod extends JavaMethod, InvokeTarget, ModifiersProvider { /** * Returns the bytecode of this method, if the method has code. The returned byte array does not @@ -69,10 +69,10 @@ int getMaxStackSize(); /** - * Returns the Java language modifiers for this method, as an integer. The {@link Modifier} - * class should be used to decode the modifiers. Only the - * {@linkplain Modifier#methodModifiers() method flags} specified in the JVM specification will - * be included in the returned mask. + * {@inheritDoc} + * <p> + * Only the {@linkplain Modifier#methodModifiers() method flags} specified in the JVM + * specification will be included in the returned mask. */ int getModifiers(); @@ -115,8 +115,6 @@ */ boolean canBeStaticallyBound(); - boolean isSynchronized(); - /** * Returns the list of exception handlers for this method. */
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java Wed Apr 23 12:38:05 2014 +0200 @@ -31,7 +31,7 @@ * thereof. Types, like fields and methods, are resolved through {@link ConstantPool constant pools} * . */ -public interface ResolvedJavaType extends JavaType { +public interface ResolvedJavaType extends JavaType, ModifiersProvider { /** * Represents each of the several different parts of the runtime representation of a type which @@ -54,7 +54,7 @@ /** * Gets the encoding of (that is, a constant representing the value of) the specified part of * this type. - * + * * @param r the part of this type * @return a constant representing a reference to the specified part of this type */ @@ -62,7 +62,7 @@ /** * Checks whether this type has a finalizer method. - * + * * @return {@code true} if this class has a finalizer */ boolean hasFinalizer(); @@ -70,51 +70,52 @@ /** * Checks whether this type has any finalizable subclasses so far. Any decisions based on this * information require the registration of a dependency, since this information may change. - * + * * @return {@code true} if this class has any subclasses with finalizers */ boolean hasFinalizableSubclass(); /** * Checks whether this type is an interface. - * + * * @return {@code true} if this type is an interface */ boolean isInterface(); /** * Checks whether this type is an instance class. - * + * * @return {@code true} if this type is an instance class */ boolean isInstanceClass(); /** * Checks whether this type is an array class. - * + * * @return {@code true} if this type is an array class */ boolean isArray(); /** * Checks whether this type is primitive. - * + * * @return {@code true} if this type is primitive */ boolean isPrimitive(); /** - * Returns the Java language modifiers for this type, as an integer. The {@link Modifier} class - * should be used to decode the modifiers. Only the flags specified in the JVM specification - * will be included in the returned mask. This method is identical to - * {@link Class#getModifiers()} in terms of the value return for this type. + * {@inheritDoc} + * <p> + * Only the flags specified in the JVM specification will be included in the returned mask. This + * method is identical to {@link Class#getModifiers()} in terms of the value return for this + * type. */ int getModifiers(); /** * Checks whether this type is initialized. If a type is initialized it implies that it was * {@link #isLinked() linked} and that the static initializer has run. - * + * * @return {@code true} if this type is initialized */ boolean isInitialized(); @@ -127,7 +128,7 @@ /** * Checks whether this type is linked and verified. When a type is linked the static initializer * has not necessarily run. An {@link #isInitialized() initialized} type is always linked. - * + * * @return {@code true} if this type is linked */ boolean isLinked(); @@ -141,7 +142,7 @@ /** * Checks whether the specified object is an instance of this type. - * + * * @param obj the object to test * @return {@code true} if the object is an instance of this type */ @@ -150,7 +151,7 @@ /** * Returns this type if it is an exact type otherwise returns null. This type is exact if it is * void, primitive, final, or an array of a final or primitive type. - * + * * @return this type if it is exact; {@code null} otherwise */ ResolvedJavaType asExactType(); @@ -172,7 +173,7 @@ /** * Walks the class hierarchy upwards and returns the least common class that is a superclass of * both the current and the given type. - * + * * @return the least common type that is a super type of both the current and the given type, or * {@code null} if primitive types are involved. */ @@ -194,7 +195,7 @@ * <p> * If the compiler uses the result of this method for its compilation, it must register an * assumption because dynamic class loading can invalidate the result of this method. - * + * * @return the unique concrete subclass for this type as described above */ ResolvedJavaType findUniqueConcreteSubtype(); @@ -208,7 +209,7 @@ * This resolution process only searches "up" the class hierarchy of this type. A broader search * that also walks "down" the hierarchy is implemented by * {@link #findUniqueConcreteMethod(ResolvedJavaMethod)}. - * + * * @param method the method to select the implementation of * @return the concrete method that would be selected at runtime, or {@code null} if there is no * concrete implementation of {@code method} in this type or any of its superclasses @@ -223,7 +224,7 @@ * <p> * If the compiler uses the result of this method for its compilation, it must register an * assumption because dynamic class loading can invalidate the result of this method. - * + * * @param method the method A for which a unique concrete target is searched * @return the unique concrete target or {@code null} if no such target exists or assumptions * are not supported by this runtime @@ -237,7 +238,7 @@ * is, for a single JVM execution the same order is returned each time this method is called. It * is also the "natural" order, which means that the JVM would expect the fields in this order * if no specific order is given. - * + * * @param includeSuperclasses if true, then instance fields for the complete hierarchy of this * type are included in the result * @return an array of instance fields @@ -247,7 +248,7 @@ /** * Returns the annotation for the specified type of this class, if such an annotation is * present. - * + * * @param annotationClass the Class object corresponding to the annotation type * @return this element's annotation for the specified annotation type if present on this class, * else {@code null} @@ -257,7 +258,7 @@ /** * Returns the instance field of this class (or one of its super classes) at the given offset, * or {@code null} if there is no such field. - * + * * @param offset the offset of the field to look for * @return the field with the given offset, or {@code null} if there is no such field. */
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ObjectStamp.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ObjectStamp.java Wed Apr 23 12:38:05 2014 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.compiler.common.type; -import java.lang.reflect.*; import java.util.*; import com.oracle.graal.api.meta.*; @@ -249,7 +248,7 @@ } public static boolean isConcreteType(ResolvedJavaType type) { - return !(Modifier.isAbstract(type.getModifiers()) && !type.isArray()); + return !(type.isAbstract() && !type.isArray()); } private static ResolvedJavaType meetTypes(ResolvedJavaType a, ResolvedJavaType b) {
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/BytecodeLIRBuilder.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/BytecodeLIRBuilder.java Wed Apr 23 12:38:05 2014 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.compiler.gen; -import java.lang.reflect.*; - import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.lir.gen.*; @@ -54,7 +52,7 @@ gen.emitIncomingValues(params); Signature sig = method.getSignature(); - boolean isStatic = Modifier.isStatic(method.getModifiers()); + boolean isStatic = method.isStatic(); for (int i = 0; i < sig.getParameterCount(!isStatic); i++) { Value paramValue = params[i]; assert paramValue.getKind() == sig.getParameterKind(i).getStackKind();
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java Wed Apr 23 12:38:05 2014 +0200 @@ -26,8 +26,6 @@ import static com.oracle.graal.api.code.CallingConvention.Type.*; import static com.oracle.graal.api.code.ValueUtil.*; import static com.oracle.graal.compiler.common.GraalOptions.*; -import static java.lang.reflect.Modifier.*; - import java.util.*; import sun.misc.*; @@ -265,7 +263,7 @@ */ public void emitCodePrefix(ResolvedJavaMethod installedCodeOwner, CompilationResultBuilder crb, AMD64MacroAssembler asm, RegisterConfig regConfig, HotSpotVMConfig config, Label verifiedEntry) { HotSpotProviders providers = getProviders(); - if (installedCodeOwner != null && !isStatic(installedCodeOwner.getModifiers())) { + if (installedCodeOwner != null && !installedCodeOwner.isStatic()) { MarkId.recordMark(crb, MarkId.UNVERIFIED_ENTRY); CallingConvention cc = regConfig.getCallingConvention(JavaCallee, null, new JavaType[]{providers.getMetaAccess().lookupJavaType(Object.class)}, getTarget(), false); Register inlineCacheKlass = rax; // see definition of IC_Klass in
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBytecodeLIRBuilder.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBytecodeLIRBuilder.java Wed Apr 23 12:38:05 2014 +0200 @@ -24,8 +24,6 @@ import static com.oracle.graal.amd64.AMD64.*; -import java.lang.reflect.*; - import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.gen.*; @@ -73,7 +71,7 @@ gen.append(getSaveRbp().placeholder); Signature sig = method.getSignature(); - boolean isStatic = Modifier.isStatic(method.getModifiers()); + boolean isStatic = method.isStatic(); for (int i = 0; i < sig.getParameterCount(!isStatic); i++) { Value paramValue = params[i]; assert paramValue.getKind() == sig.getParameterKind(i).getStackKind();
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java Wed Apr 23 12:38:05 2014 +0200 @@ -26,8 +26,6 @@ import static com.oracle.graal.api.code.ValueUtil.*; import static com.oracle.graal.hotspot.HotSpotBackend.*; -import java.lang.reflect.*; - import com.oracle.graal.amd64.*; import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; @@ -123,7 +121,7 @@ } else { assert invokeKind == InvokeKind.Static || invokeKind == InvokeKind.Special; HotSpotResolvedJavaMethod resolvedMethod = (HotSpotResolvedJavaMethod) callTarget.target(); - assert !Modifier.isAbstract(resolvedMethod.getModifiers()) : "Cannot make direct call to abstract method."; + assert !resolvedMethod.isAbstract() : "Cannot make direct call to abstract method."; append(new AMD64HotspotDirectStaticCallOp(callTarget.target(), result, parameters, temps, callState, invokeKind)); } }
--- a/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotBackend.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotBackend.java Wed Apr 23 12:38:05 2014 +0200 @@ -469,7 +469,7 @@ // We're subtracting 1 because we're not making the final gid as a parameter. int nonConstantParamCount = sigParamCount - 1; - boolean isStatic = (Modifier.isStatic(method.getModifiers())); + boolean isStatic = (method.isStatic()); // Determine if this is an object lambda. boolean isObjectLambda = true;
--- a/graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXWrapperBuilder.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXWrapperBuilder.java Wed Apr 23 12:38:05 2014 +0200 @@ -31,8 +31,6 @@ import static com.oracle.graal.hotspot.ptx.PTXWrapperBuilder.LaunchArg.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import static com.oracle.graal.nodes.ConstantNode.*; -import static java.lang.reflect.Modifier.*; - import java.util.*; import com.oracle.graal.api.meta.*; @@ -61,8 +59,8 @@ * <li>PINNED: a buffer into which the address of pinned objects is saved.</li> * <li>OBJECT_OFFSETS: the offsets of the object values in PARAMS.</li> * </ul> - * - * + * + * * The PARAMS buffer is the {@code CU_LAUNCH_PARAM_BUFFER_POINTER} buffer passed in the * {@code extra} argument to the {@code cuLaunchKernel} function. This buffer contains the * parameters to the call. The buffer is word aligned and each parameter is aligned in the buffer @@ -74,13 +72,13 @@ * The object pointers in PARAMS are specified by OBJECT_OFFSETS. * <p> * As a concrete example, for a kernel whose Java method signature is: - * + * * <pre> * static int kernel(int p1, short p2, Object p3, long p4) * </pre> - * + * * the graph created is shown below as psuedo-code: - * + * * <pre> * int kernel_wrapper(int p1, short p2, oop p3, long p4) { * address kernelAddr = kernel.start; @@ -121,7 +119,7 @@ /** * The size of the buffer holding the kernel parameters and the extra word for storing the * pointer to device memory for the return value. - * + * * @see LaunchArg#ParametersAndReturnValueBufferSize */ int bufSize; @@ -152,7 +150,7 @@ /** * Creates the graph implementing the CPU to GPU transition. - * + * * @param method a method that has been compiled to GPU binary code * @param kernel the installed GPU binary for {@code method} * @see PTXWrapperBuilder @@ -163,7 +161,7 @@ int intSize = Integer.SIZE / Byte.SIZE; Kind wordKind = providers.getCodeCache().getTarget().wordKind; Signature sig = method.getSignature(); - boolean isStatic = isStatic(method.getModifiers()); + boolean isStatic = method.isStatic(); int sigCount = sig.getParameterCount(false); javaParameters = new ParameterNode[(!isStatic ? 1 : 0) + sigCount]; javaParameterOffsetsInKernelParametersBuffer = new int[javaParameters.length]; @@ -300,7 +298,7 @@ /** * Computes offset and size of space in PARAMS for a Java parameter. - * + * * @param kind the kind of the parameter * @param javaParametersIndex the index of the Java parameter */
--- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java Wed Apr 23 12:38:05 2014 +0200 @@ -26,8 +26,6 @@ import static com.oracle.graal.api.code.ValueUtil.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.sparc.SPARC.*; -import static java.lang.reflect.Modifier.*; - import java.util.*; import sun.misc.*; @@ -202,7 +200,7 @@ FrameMap frameMap = crb.frameMap; RegisterConfig regConfig = frameMap.registerConfig; HotSpotVMConfig config = getRuntime().getConfig(); - Label unverifiedStub = installedCodeOwner == null || isStatic(installedCodeOwner.getModifiers()) ? null : new Label(); + Label unverifiedStub = installedCodeOwner == null || installedCodeOwner.isStatic() ? null : new Label(); // Emit the prefix
--- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java Wed Apr 23 12:38:05 2014 +0200 @@ -26,8 +26,6 @@ import static com.oracle.graal.hotspot.HotSpotBackend.*; import static com.oracle.graal.sparc.SPARC.*; -import java.lang.reflect.*; - import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.gen.*; @@ -104,7 +102,7 @@ } else { assert invokeKind == InvokeKind.Static || invokeKind == InvokeKind.Special; HotSpotResolvedJavaMethod resolvedMethod = (HotSpotResolvedJavaMethod) callTarget.target(); - assert !Modifier.isAbstract(resolvedMethod.getModifiers()) : "Cannot make direct call to abstract method."; + assert !resolvedMethod.isAbstract() : "Cannot make direct call to abstract method."; append(new SPARCHotspotDirectStaticCallOp(callTarget.target(), result, parameters, temps, callState, invokeKind)); } }
--- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotResolvedJavaFieldTest.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotResolvedJavaFieldTest.java Wed Apr 23 12:38:05 2014 +0200 @@ -24,7 +24,6 @@ import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; import static com.oracle.graal.hotspot.meta.HotSpotResolvedObjectType.*; -import static java.lang.reflect.Modifier.*; import java.lang.reflect.*; @@ -79,7 +78,7 @@ public void testIsInObject() { for (Field f : String.class.getDeclaredFields()) { HotSpotResolvedJavaField rf = (HotSpotResolvedJavaField) runtime().getHostProviders().getMetaAccess().lookupJavaField(f); - Assert.assertEquals(rf.toString(), rf.isInObject("a string"), !isStatic(rf.getModifiers())); + Assert.assertEquals(rf.toString(), rf.isInObject("a string"), !rf.isStatic()); } } }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Wed Apr 23 12:38:05 2014 +0200 @@ -32,7 +32,6 @@ import java.io.*; import java.lang.management.*; -import java.lang.reflect.*; import java.util.*; import java.util.concurrent.*; import java.util.concurrent.atomic.*; @@ -364,7 +363,6 @@ */ private void printCompilation() { final boolean isOSR = entryBCI != StructuredGraph.INVOCATION_ENTRY_BCI; - final int mod = method.getModifiers(); String compilerName = ""; if (HotSpotCIPrintCompilerName.getValue()) { compilerName = "Graal:"; @@ -381,9 +379,9 @@ compLevelString = ""; } boolean hasExceptionHandlers = method.getExceptionHandlers().length > 0; - TTY.println(String.format("%s%7d %4d %c%c%c%c%c %s %s %s(%d bytes)", compilerName, backend.getRuntime().compilerToVm.getTimeStamp(), id, isOSR ? '%' : ' ', - Modifier.isSynchronized(mod) ? 's' : ' ', hasExceptionHandlers ? '!' : ' ', blocking ? 'b' : ' ', Modifier.isNative(mod) ? 'n' : ' ', compLevelString, - MetaUtil.format("%H::%n(%p)", method), isOSR ? "@ " + entryBCI + " " : "", method.getCodeSize())); + TTY.println(String.format("%s%7d %4d %c%c%c%c%c %s %s %s(%d bytes)", compilerName, backend.getRuntime().compilerToVm.getTimeStamp(), id, isOSR ? '%' : ' ', method.isSynchronized() ? 's' + : ' ', hasExceptionHandlers ? '!' : ' ', blocking ? 'b' : ' ', method.isNative() ? 'n' : ' ', compLevelString, MetaUtil.format("%H::%n(%p)", method), isOSR ? "@ " + entryBCI + + " " : "", method.getCodeSize())); } private InstalledCode installMethod(final CompilationResult compResult) {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java Wed Apr 23 12:38:05 2014 +0200 @@ -345,7 +345,7 @@ private void enqueue(Method m) throws Throwable { JavaMethod javaMethod = runtime.getHostProviders().getMetaAccess().lookupJavaMethod(m); - assert !Modifier.isAbstract(((HotSpotResolvedJavaMethod) javaMethod).getModifiers()) && !Modifier.isNative(((HotSpotResolvedJavaMethod) javaMethod).getModifiers()) : javaMethod; + assert !((HotSpotResolvedJavaMethod) javaMethod).isAbstract() && !((HotSpotResolvedJavaMethod) javaMethod).isNative() : javaMethod; compileMethod((HotSpotResolvedJavaMethod) javaMethod, StructuredGraph.INVOCATION_ENTRY_BCI, false); }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotNmethod.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotNmethod.java Wed Apr 23 12:38:05 2014 +0200 @@ -24,8 +24,6 @@ import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; -import java.lang.reflect.*; - import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; @@ -84,10 +82,10 @@ } protected boolean checkThreeObjectArgs() { - assert method.getSignature().getParameterCount(!Modifier.isStatic(method.getModifiers())) == 3; + assert method.getSignature().getParameterCount(!method.isStatic()) == 3; assert method.getSignature().getParameterKind(0) == Kind.Object; assert method.getSignature().getParameterKind(1) == Kind.Object; - assert !Modifier.isStatic(method.getModifiers()) || method.getSignature().getParameterKind(2) == Kind.Object; + assert !method.isStatic() || method.getSignature().getParameterKind(2) == Kind.Object; return true; }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaField.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaField.java Wed Apr 23 12:38:05 2014 +0200 @@ -26,7 +26,6 @@ import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; import static com.oracle.graal.hotspot.meta.HotSpotResolvedObjectType.*; -import static java.lang.reflect.Modifier.*; import java.lang.annotation.*; import java.lang.reflect.*; @@ -200,8 +199,8 @@ assert !ImmutableCode.getValue() || isCalledForSnippets() : receiver; if (receiver == null) { - assert isStatic(modifiers); - if (Modifier.isFinal(getModifiers())) { + assert isStatic(); + if (isFinal()) { if (holder.isInitialized() && !holder.getName().equals(SystemClassName) && isEmbeddable()) { return readValue(receiver); } @@ -211,14 +210,14 @@ * for non-static final fields, we must assume that they are only initialized if they * have a non-default value. */ - assert !isStatic(modifiers); + assert !isStatic(); Object object = HotSpotObjectConstant.asObject(receiver); // Canonicalization may attempt to process an unsafe read before // processing a guard (e.g. a null check or a type check) for this read // so we need to check the object being read if (object != null && isInObject(object)) { - if (Modifier.isFinal(getModifiers())) { + if (isFinal()) { Constant value = readValue(receiver); if (assumeNonStaticFinalFieldsAsFinal(object.getClass()) || !value.isDefaultForKind()) { return value; @@ -248,7 +247,7 @@ * {@code object}'s class */ public boolean isInObject(Object object) { - if (isStatic(modifiers)) { + if (isStatic()) { return false; } return getDeclaringClass().isAssignableFrom(HotSpotResolvedObjectType.fromClass(object.getClass())); @@ -257,13 +256,13 @@ @Override public Constant readValue(Constant receiver) { if (receiver == null) { - assert isStatic(modifiers); + assert isStatic(); if (holder.isInitialized()) { return runtime().getHostProviders().getConstantReflection().readUnsafeConstant(getKind(), HotSpotObjectConstant.forObject(holder.mirror()), offset); } return null; } else { - assert !isStatic(modifiers); + assert !isStatic(); assert receiver.isNonNull() && isInObject(HotSpotObjectConstant.asObject(receiver)); return runtime().getHostProviders().getConstantReflection().readUnsafeConstant(getKind(), receiver, offset); }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java Wed Apr 23 12:38:05 2014 +0200 @@ -186,8 +186,7 @@ @Override public boolean canBeStaticallyBound() { - int modifiers = getModifiers(); - return (Modifier.isFinal(modifiers) || Modifier.isPrivate(modifiers) || Modifier.isStatic(modifiers) || Modifier.isFinal(holder.getModifiers())) && !Modifier.isAbstract(modifiers); + return (isFinal() || isPrivate() || isStatic() || holder.isFinal()) && !isAbstract(); } @Override @@ -314,18 +313,17 @@ @Override public boolean isClassInitializer() { - return "<clinit>".equals(name) && Modifier.isStatic(getModifiers()); + return "<clinit>".equals(name) && isStatic(); } @Override public boolean isConstructor() { - return "<init>".equals(name) && !Modifier.isStatic(getModifiers()); + return "<init>".equals(name) && !isStatic(); } @Override public int getMaxLocals() { - int modifiers = getModifiers(); - if (Modifier.isAbstract(modifiers) || Modifier.isNative(modifiers)) { + if (isAbstract() || isNative()) { return 0; } HotSpotVMConfig config = runtime().getConfig(); @@ -334,8 +332,7 @@ @Override public int getMaxStackSize() { - int modifiers = getModifiers(); - if (Modifier.isAbstract(modifiers) || Modifier.isNative(modifiers)) { + if (isAbstract() || isNative()) { return 0; } HotSpotVMConfig config = runtime().getConfig(); @@ -487,10 +484,6 @@ return ((getModifiers() & mask) == Modifier.PUBLIC) && getDeclaringClass().isInterface(); } - public boolean isSynchronized() { - return Modifier.isSynchronized(getModifiers()); - } - @Override public Type[] getGenericParameterTypes() { if (isConstructor()) { @@ -620,7 +613,7 @@ * @return virtual table index */ private int getVtableIndex() { - assert !Modifier.isInterface(holder.getModifiers()); + assert !holder.isInterface(); HotSpotVMConfig config = runtime().getConfig(); int result = unsafe.getInt(metaspaceMethod + config.methodVtableIndexOffset); assert result >= config.nonvirtualVtableIndex : "must be linked";
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java Wed Apr 23 12:38:05 2014 +0200 @@ -25,8 +25,6 @@ import static com.oracle.graal.api.meta.MetaUtil.*; import static com.oracle.graal.compiler.common.UnsafeAccess.*; import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; -import static java.lang.reflect.Modifier.*; - import java.lang.annotation.*; import java.lang.reflect.*; import java.net.*; @@ -141,7 +139,7 @@ public ResolvedJavaType findUniqueConcreteSubtype() { HotSpotVMConfig config = runtime().getConfig(); if (isArray()) { - return isFinal(getElementalType(this).getModifiers()) ? this : null; + return getElementalType(this).isFinal() ? this : null; } else if (isInterface()) { final long implementorMetaspaceKlass = runtime().getCompilerToVM().getKlassImplementor(metaspaceKlass()); @@ -157,20 +155,20 @@ * than one implementors (see: InstanceKlass::add_implementor). The isInterface check * takes care of this fact since this class is an interface. */ - if (isAbstract(type.getModifiers()) || type.isInterface() || !type.isLeafClass()) { + if (type.isAbstract() || type.isInterface() || !type.isLeafClass()) { return null; } return type; } else { HotSpotResolvedObjectType type = this; - while (isAbstract(type.getModifiers())) { + while (type.isAbstract()) { long subklass = type.getSubklass(); if (subklass == 0 || unsafeReadWord(subklass + config.nextSiblingOffset) != 0) { return null; } type = (HotSpotResolvedObjectType) fromMetaspaceKlass(subklass); } - if (isAbstract(type.getModifiers()) || type.isInterface() || !type.isLeafClass()) { + if (type.isAbstract() || type.isInterface() || !type.isLeafClass()) { return null; } return type; @@ -255,7 +253,7 @@ if (isArray()) { return getComponentType().asExactType() != null ? this : null; } - return isFinal(getModifiers()) ? this : null; + return isFinal() ? this : null; } @Override @@ -358,7 +356,7 @@ @Override public ResolvedJavaMethod resolveMethod(ResolvedJavaMethod method) { assert method instanceof HotSpotMethod; - if (!isAbstract(method.getModifiers()) && method.getDeclaringClass().equals(this)) { + if (!method.isAbstract() && method.getDeclaringClass().equals(this)) { return method; } @@ -367,7 +365,7 @@ return null; } HotSpotResolvedJavaMethod resolvedMethod = HotSpotResolvedJavaMethod.fromMetaspace(resolvedMetaspaceMethod); - if (isAbstract(resolvedMethod.getModifiers())) { + if (resolvedMethod.isAbstract()) { return null; } return resolvedMethod;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/TailcallNode.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/TailcallNode.java Wed Apr 23 12:38:05 2014 +0200 @@ -24,7 +24,6 @@ import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; -import java.lang.reflect.*; import java.util.*; import com.oracle.graal.api.code.*; @@ -62,7 +61,7 @@ public void generate(NodeLIRBuilderTool gen, LIRGenerationResult res) { HotSpotVMConfig config = runtime().getConfig(); ResolvedJavaMethod method = frameState.method(); - boolean isStatic = Modifier.isStatic(method.getModifiers()); + boolean isStatic = method.isStatic(); JavaType[] signature = MetaUtil.signatureToTypes(method.getSignature(), isStatic ? null : method.getDeclaringClass()); CallingConvention cc = res.getFrameMap().registerConfig.getCallingConvention(CallingConvention.Type.JavaCall, null, signature, gen.getLIRGeneratorTool().target(), false);
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AbstractMethodHandleNode.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AbstractMethodHandleNode.java Wed Apr 23 12:38:05 2014 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.hotspot.replacements; -import java.lang.reflect.*; import java.util.*; import com.oracle.graal.api.meta.*; @@ -173,7 +172,7 @@ // to a direct call we must cast the receiver and arguments to its // actual types. HotSpotSignature signature = targetMethod.getSignature(); - final boolean isStatic = Modifier.isStatic(targetMethod.getModifiers()); + final boolean isStatic = targetMethod.isStatic(); final int receiverSkip = isStatic ? 0 : 1; // Cast receiver to its type. @@ -240,7 +239,7 @@ * @return invoke node for the member name target */ private InvokeNode createTargetInvokeNode(ResolvedJavaMethod targetMethod) { - InvokeKind invokeKind = Modifier.isStatic(targetMethod.getModifiers()) ? InvokeKind.Static : InvokeKind.Special; + InvokeKind invokeKind = targetMethod.isStatic() ? InvokeKind.Static : InvokeKind.Special; JavaType returnType = targetMethod.getSignature().getReturnType(null); // MethodHandleLinkTo* nodes have a trailing MemberName argument which
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/AbstractBytecodeParser.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/AbstractBytecodeParser.java Wed Apr 23 12:38:05 2014 +0200 @@ -25,8 +25,6 @@ import static com.oracle.graal.api.code.TypeCheckHints.*; import static com.oracle.graal.bytecode.Bytecodes.*; -import static java.lang.reflect.Modifier.*; - import java.util.*; import com.oracle.graal.api.code.*; @@ -326,7 +324,7 @@ private void genArithmeticOp(Kind result, int opcode) { T y = frameState.pop(result); T x = frameState.pop(result); - boolean isStrictFP = isStrict(method.getModifiers()); + boolean isStrictFP = method.isStrict(); T v; switch (opcode) { case IADD:
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Wed Apr 23 12:38:05 2014 +0200 @@ -26,8 +26,6 @@ import static com.oracle.graal.api.meta.DeoptimizationReason.*; import static com.oracle.graal.bytecode.Bytecodes.*; import static com.oracle.graal.compiler.common.GraalOptions.*; -import static java.lang.reflect.Modifier.*; - import java.util.*; import com.oracle.graal.api.code.*; @@ -722,7 +720,7 @@ * https://wikis.oracle.com/display/HotSpotInternals/Method+handles * +and+invokedynamic */ - boolean hasReceiver = !isStatic(((ResolvedJavaMethod) target).getModifiers()); + boolean hasReceiver = !((ResolvedJavaMethod) target).isStatic(); Constant appendix = constantPool.lookupAppendix(stream.readCPI(), Bytecodes.INVOKEVIRTUAL); if (appendix != null) { frameState.apush(ConstantNode.forConstant(appendix, metaAccess, currentGraph)); @@ -1088,7 +1086,7 @@ } private ValueNode synchronizedObject(HIRFrameStateBuilder state, ResolvedJavaMethod target) { - if (isStatic(target.getModifiers())) { + if (target.isStatic()) { return appendConstant(target.getDeclaringClass().getEncoding(Representation.JavaClass)); } else { return state.loadLocal(0);
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/HIRFrameStateBuilder.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/HIRFrameStateBuilder.java Wed Apr 23 12:38:05 2014 +0200 @@ -23,8 +23,6 @@ package com.oracle.graal.java; import static com.oracle.graal.graph.iterators.NodePredicates.*; -import static java.lang.reflect.Modifier.*; - import java.util.*; import com.oracle.graal.api.code.*; @@ -55,7 +53,7 @@ int javaIndex = 0; int index = 0; - if (!isStatic(method.getModifiers())) { + if (!method.isStatic()) { // add the receiver ParameterNode receiver = graph.unique(new ParameterNode(javaIndex, StampFactory.declaredNonNull(method.getDeclaringClass()))); storeLocal(javaIndex, receiver);
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/VerifyOptionsPhase.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/VerifyOptionsPhase.java Wed Apr 23 12:38:05 2014 +0200 @@ -24,8 +24,6 @@ package com.oracle.graal.java; import static com.oracle.graal.api.meta.MetaUtil.*; -import static java.lang.reflect.Modifier.*; - import java.util.*; import com.oracle.graal.api.meta.*; @@ -115,9 +113,9 @@ if (node instanceof StoreFieldNode) { ResolvedJavaField field = ((StoreFieldNode) node).field(); verify(field.getDeclaringClass().equals(declaringClass), node, "store to field " + format("%H.%n", field)); - verify(isStatic(field.getModifiers()), node, "store to field " + format("%H.%n", field)); + verify(field.isStatic(), node, "store to field " + format("%H.%n", field)); if (optionValueType.isAssignableFrom((ResolvedJavaType) field.getType())) { - verify(isFinal(field.getModifiers()), node, "option field " + format("%H.%n", field) + " not final"); + verify(field.isFinal(), node, "option field " + format("%H.%n", field) + " not final"); } else { verify((field.isSynthetic()), node, "store to non-synthetic field " + format("%H.%n", field)); }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadMethodNode.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadMethodNode.java Wed Apr 23 12:38:05 2014 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.nodes.extended; -import java.lang.reflect.*; - import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; @@ -45,8 +43,8 @@ super(kind == Kind.Object ? StampFactory.objectNonNull() : StampFactory.forKind(kind)); this.hub = hub; this.method = method; - assert !Modifier.isAbstract(method.getModifiers()) : "Cannot load abstract method from a hub"; - assert !Modifier.isStatic(method.getModifiers()) : "Cannot load a static method from a hub"; + assert !method.isAbstract() : "Cannot load abstract method from a hub"; + assert !method.isStatic() : "Cannot load a static method from a hub"; assert method.isInVirtualMethodTable(); }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessFieldNode.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessFieldNode.java Wed Apr 23 12:38:05 2014 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.nodes.java; -import java.lang.reflect.*; - import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; @@ -70,7 +68,7 @@ * @return {@code true} if this field access is to a static field */ public boolean isStatic() { - return Modifier.isStatic(field.getModifiers()); + return field.isStatic(); } /** @@ -79,7 +77,7 @@ * @return {@code true} if the field is resolved and declared volatile */ public boolean isVolatile() { - return Modifier.isVolatile(field.getModifiers()); + return field.isVolatile(); } @Override
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java Wed Apr 23 12:38:05 2014 +0200 @@ -24,8 +24,6 @@ import static com.oracle.graal.graph.iterators.NodePredicates.*; -import java.lang.reflect.*; - import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; @@ -99,7 +97,7 @@ } private PhiNode asPhi(MetaAccessProvider metaAccess) { - if (!isStatic() && Modifier.isFinal(field.getModifiers()) && object() instanceof ValuePhiNode && ((ValuePhiNode) object()).values().filter(isNotA(ConstantNode.class)).isEmpty()) { + if (!isStatic() && field.isFinal() && object() instanceof ValuePhiNode && ((ValuePhiNode) object()).values().filter(isNotA(ConstantNode.class)).isEmpty()) { PhiNode phi = (PhiNode) object(); Constant[] constants = new Constant[phi.valueCount()]; for (int i = 0; i < phi.valueCount(); i++) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java Wed Apr 23 12:38:05 2014 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.nodes.java; -import java.lang.reflect.*; - import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; @@ -109,12 +107,12 @@ assertTrue(n instanceof Invoke, "call target can only be used from an invoke (%s)", n); } if (invokeKind == InvokeKind.Special || invokeKind == InvokeKind.Static) { - assertFalse(Modifier.isAbstract(targetMethod.getModifiers()), "special calls or static calls are only allowed for concrete methods (%s)", targetMethod); + assertFalse(targetMethod.isAbstract(), "special calls or static calls are only allowed for concrete methods (%s)", targetMethod); } if (invokeKind == InvokeKind.Static) { - assertTrue(Modifier.isStatic(targetMethod.getModifiers()), "static calls are only allowed for static methods (%s)", targetMethod); + assertTrue(targetMethod.isStatic(), "static calls are only allowed for static methods (%s)", targetMethod); } else { - assertFalse(Modifier.isStatic(targetMethod.getModifiers()), "static calls are only allowed for non-static methods (%s)", targetMethod); + assertFalse(targetMethod.isStatic(), "static calls are only allowed for non-static methods (%s)", targetMethod); } return super.verify(); }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/SelfReplacingMethodCallTargetNode.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/SelfReplacingMethodCallTargetNode.java Wed Apr 23 12:38:05 2014 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.nodes.java; -import java.lang.reflect.*; - import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.graph.*; @@ -66,7 +64,7 @@ @Override public void lower(LoweringTool tool) { - InvokeKind invokeKind = Modifier.isStatic(replacementTargetMethod.getModifiers()) ? InvokeKind.Static : InvokeKind.Special; + InvokeKind invokeKind = replacementTargetMethod.isStatic() ? InvokeKind.Static : InvokeKind.Special; MethodCallTargetNode replacement = graph().add( new MethodCallTargetNode(invokeKind, replacementTargetMethod, replacementArguments.toArray(new ValueNode[replacementArguments.size()]), replacementReturnType));
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java Wed Apr 23 12:38:05 2014 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.phases.common; -import java.lang.reflect.*; import java.util.*; import com.oracle.graal.api.meta.*; @@ -815,7 +814,7 @@ if (!Objects.equals(type, StampTool.typeOrNull(receiver))) { ResolvedJavaMethod method = type.resolveMethod(callTarget.targetMethod()); if (method != null) { - if (method.canBeStaticallyBound() || Modifier.isFinal(type.getModifiers())) { + if (method.canBeStaticallyBound() || type.isFinal()) { callTarget.setInvokeKind(InvokeKind.Special); callTarget.setTargetMethod(method); }
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java Wed Apr 23 12:38:05 2014 +0200 @@ -26,9 +26,6 @@ import static com.oracle.graal.api.meta.DeoptimizationReason.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.compiler.common.type.StampFactory.*; -import static java.lang.reflect.Modifier.*; - -import java.lang.reflect.*; import java.util.*; import com.oracle.graal.api.code.*; @@ -140,13 +137,12 @@ */ private static void printInlining(final ResolvedJavaMethod method, final Invoke invoke, final int inliningDepth, final boolean success, final String msg, final Object... args) { if (HotSpotPrintInlining.getValue()) { - final int mod = method.getModifiers(); // 1234567 TTY.print(" "); // print timestamp // 1234 TTY.print(" "); // print compilation number // % s ! b n - TTY.print("%c%c%c%c%c ", ' ', Modifier.isSynchronized(mod) ? 's' : ' ', ' ', ' ', Modifier.isNative(mod) ? 'n' : ' '); + TTY.print("%c%c%c%c%c ", ' ', method.isSynchronized() ? 's' : ' ', ' ', ' ', method.isNative() ? 'n' : ' '); TTY.print(" "); // more indent TTY.print(" "); // initial inlining indent for (int i = 0; i < inliningDepth; i++) { @@ -435,7 +431,7 @@ super(invoke); this.concrete = concrete; this.type = type; - assert type.isArray() || !isAbstract(type.getModifiers()) : type; + assert type.isArray() || !type.isAbstract() : type; } @Override @@ -1114,7 +1110,7 @@ private static InlineInfo getAssumptionInlineInfo(InliningData data, Invoke invoke, Replacements replacements, OptimisticOptimizations optimisticOpts, ResolvedJavaMethod concrete, Assumption takenAssumption) { - assert !Modifier.isAbstract(concrete.getModifiers()); + assert !concrete.isAbstract(); if (!checkTargetConditions(data, replacements, invoke, concrete, optimisticOpts)) { return null; } @@ -1122,7 +1118,7 @@ } private static InlineInfo getExactInlineInfo(InliningData data, Invoke invoke, Replacements replacements, OptimisticOptimizations optimisticOpts, ResolvedJavaMethod targetMethod) { - assert !Modifier.isAbstract(targetMethod.getModifiers()); + assert !targetMethod.isAbstract(); if (!checkTargetConditions(data, replacements, invoke, targetMethod, optimisticOpts)) { return null; } @@ -1152,7 +1148,7 @@ } ResolvedJavaType type = ptypes[0].getType(); - assert type.isArray() || !isAbstract(type.getModifiers()); + assert type.isArray() || !type.isAbstract(); ResolvedJavaMethod concrete = type.resolveMethod(targetMethod); if (!checkTargetConditions(data, replacements, invoke, concrete, optimisticOpts)) { return null; @@ -1224,7 +1220,7 @@ if (index == -1) { notRecordedTypeProbability += type.getProbability(); } else { - assert type.getType().isArray() || !isAbstract(type.getType().getModifiers()) : type + " " + concrete; + assert type.getType().isArray() || !type.getType().isAbstract() : type + " " + concrete; usedTypes.add(type); typesToConcretes.add(index); } @@ -1277,9 +1273,9 @@ private static boolean checkTargetConditions(InliningData data, Replacements replacements, Invoke invoke, ResolvedJavaMethod method, OptimisticOptimizations optimisticOpts) { if (method == null) { return logNotInlinedMethodAndReturnFalse(invoke, data.inliningDepth(), method, "the method is not resolved"); - } else if (Modifier.isNative(method.getModifiers()) && (!Intrinsify.getValue() || !InliningUtil.canIntrinsify(replacements, method))) { + } else if (method.isNative() && (!Intrinsify.getValue() || !InliningUtil.canIntrinsify(replacements, method))) { return logNotInlinedMethodAndReturnFalse(invoke, data.inliningDepth(), method, "it is a non-intrinsic native method"); - } else if (Modifier.isAbstract(method.getModifiers())) { + } else if (method.isAbstract()) { return logNotInlinedMethodAndReturnFalse(invoke, data.inliningDepth(), method, "it is an abstract method"); } else if (!method.getDeclaringClass().isInitialized()) { return logNotInlinedMethodAndReturnFalse(invoke, data.inliningDepth(), method, "the method's class is not initialized");
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/BoxingSnippets.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/BoxingSnippets.java Wed Apr 23 12:38:05 2014 +0200 @@ -25,7 +25,6 @@ import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.replacements.SnippetTemplate.*; -import java.lang.reflect.*; import java.util.*; import com.oracle.graal.api.code.*; @@ -57,7 +56,7 @@ @Override public boolean shouldInline(ResolvedJavaMethod method, ResolvedJavaMethod caller) { - if (Modifier.isNative(method.getModifiers())) { + if (method.isNative()) { return false; } if (method.getAnnotation(Fold.class) != null) {
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/GraphKit.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/GraphKit.java Wed Apr 23 12:38:05 2014 +0200 @@ -125,7 +125,7 @@ * arguments. */ public InvokeNode createInvoke(ResolvedJavaMethod method, InvokeKind invokeKind, HIRFrameStateBuilder frameStateBuilder, int bci, ValueNode... args) { - assert Modifier.isStatic(method.getModifiers()) == (invokeKind == InvokeKind.Static); + assert method.isStatic() == (invokeKind == InvokeKind.Static); Signature signature = method.getSignature(); JavaType returnType = signature.getReturnType(null); assert checkArgs(method, args); @@ -157,7 +157,7 @@ */ public boolean checkArgs(ResolvedJavaMethod method, ValueNode... args) { Signature signature = method.getSignature(); - boolean isStatic = Modifier.isStatic(method.getModifiers()); + boolean isStatic = method.isStatic(); if (signature.getParameterCount(!isStatic) != args.length) { throw new AssertionError(graph + ": wrong number of arguments to " + method); }
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/NodeIntrinsificationPhase.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/NodeIntrinsificationPhase.java Wed Apr 23 12:38:05 2014 +0200 @@ -81,7 +81,7 @@ NodeIntrinsic intrinsic = getIntrinsic(target); if (intrinsic != null) { assert target.getAnnotation(Fold.class) == null; - assert Modifier.isStatic(target.getModifiers()) : "node intrinsic must be static: " + target; + assert target.isStatic() : "node intrinsic must be static: " + target; ResolvedJavaType[] parameterTypes = resolveJavaTypes(signatureToTypes(target), declaringClass);
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java Wed Apr 23 12:38:05 2014 +0200 @@ -96,7 +96,7 @@ @Override public StructuredGraph getSnippet(ResolvedJavaMethod method, ResolvedJavaMethod recursiveEntry) { assert method.getAnnotation(Snippet.class) != null : "Snippet must be annotated with @" + Snippet.class.getSimpleName(); - assert !Modifier.isAbstract(method.getModifiers()) && !Modifier.isNative(method.getModifiers()) : "Snippet must not be abstract or native"; + assert !method.isAbstract() && !method.isNative() : "Snippet must not be abstract or native"; StructuredGraph graph = UseSnippetGraphCache ? graphs.get(method) : null; if (graph == null) { @@ -532,7 +532,7 @@ } private static boolean isInlinable(final ResolvedJavaMethod method) { - return !Modifier.isAbstract(method.getModifiers()) && !Modifier.isNative(method.getModifiers()); + return !method.isAbstract() && !method.isNative(); } private static String originalName(Method substituteMethod, String methodSubstitution) {
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/Snippet.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/Snippet.java Wed Apr 23 12:38:05 2014 +0200 @@ -23,8 +23,6 @@ package com.oracle.graal.replacements; import java.lang.annotation.*; -import java.lang.reflect.*; - import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.Node.NodeIntrinsic; import com.oracle.graal.replacements.nodes.*; @@ -89,7 +87,7 @@ @Override public boolean shouldInline(ResolvedJavaMethod method, ResolvedJavaMethod caller) { - if (Modifier.isNative(method.getModifiers())) { + if (method.isNative()) { return false; } if (method.getAnnotation(Fold.class) != null) {
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Wed Apr 23 12:38:05 2014 +0200 @@ -102,7 +102,7 @@ this.method = method; instantiationCounter = Debug.metric("SnippetInstantiationCount[%s]", method); instantiationTimer = Debug.timer("SnippetInstantiationTime[%s]", method); - assert Modifier.isStatic(method.getModifiers()) : "snippet method must be static: " + MetaUtil.format("%H.%n", method); + assert method.isStatic() : "snippet method must be static: " + MetaUtil.format("%H.%n", method); int count = method.getSignature().getParameterCount(false); constantParameters = new boolean[count]; varargsParameters = new boolean[count];
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MacroNode.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MacroNode.java Wed Apr 23 12:38:05 2014 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.replacements.nodes; -import static java.lang.reflect.Modifier.*; - import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; @@ -137,7 +135,7 @@ if (replacementGraph != null) { // Pull out the receiver null check so that a replaced // receiver can be lowered if necessary - if (!isStatic(targetMethod.getModifiers())) { + if (!targetMethod.isStatic()) { ValueNode nonNullReceiver = InliningUtil.nonNullReceiver(invoke); if (nonNullReceiver instanceof Lowerable) { ((Lowerable) nonNullReceiver).lower(tool);
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java Wed Apr 23 12:38:05 2014 +0200 @@ -25,7 +25,6 @@ import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.truffle.TruffleCompilerOptions.*; -import java.lang.reflect.*; import java.util.*; import com.oracle.graal.api.code.*; @@ -202,7 +201,7 @@ } StructuredGraph inlineGraph = replacements.getMethodSubstitution(methodCallTargetNode.targetMethod()); - if (inlineGraph == null && !Modifier.isNative(methodCallTargetNode.targetMethod().getModifiers()) && methodCallTargetNode.targetMethod().canBeInlined()) { + if (inlineGraph == null && !methodCallTargetNode.targetMethod().isNative() && methodCallTargetNode.targetMethod().canBeInlined()) { inlineGraph = parseGraph(methodCallTargetNode.targetMethod(), methodCallTargetNode.arguments(), assumptions, phaseContext, false); }
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluatorCanonicalizer.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluatorCanonicalizer.java Wed Apr 23 12:38:05 2014 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.truffle; -import java.lang.reflect.*; - import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.Node; import com.oracle.graal.nodes.*; @@ -47,7 +45,7 @@ if (node instanceof LoadFieldNode) { LoadFieldNode loadFieldNode = (LoadFieldNode) node; if (!loadFieldNode.isStatic() && loadFieldNode.object().isConstant() && !loadFieldNode.object().isNullConstant()) { - if (Modifier.isFinal(loadFieldNode.field().getModifiers()) || (loadFieldNode.getKind() == Kind.Object && loadFieldNode.field().getAnnotation(Child.class) != null) || + if (loadFieldNode.field().isFinal() || (loadFieldNode.getKind() == Kind.Object && loadFieldNode.field().getAnnotation(Child.class) != null) || loadFieldNode.field().getAnnotation(CompilerDirectives.CompilationFinal.class) != null) { Constant constant = loadFieldNode.field().readValue(loadFieldNode.object().asConstant()); assert verifyFieldValue(loadFieldNode.field(), constant);
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCacheImpl.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCacheImpl.java Wed Apr 23 12:38:05 2014 +0200 @@ -24,7 +24,6 @@ import static com.oracle.graal.compiler.common.GraalOptions.*; -import java.lang.reflect.*; import java.util.*; import java.util.Map.Entry; @@ -265,7 +264,7 @@ private boolean shouldInline(final MethodCallTargetNode methodCallTargetNode) { boolean result = (methodCallTargetNode.invokeKind() == InvokeKind.Special || methodCallTargetNode.invokeKind() == InvokeKind.Static) && methodCallTargetNode.targetMethod().canBeInlined() && - !Modifier.isNative(methodCallTargetNode.targetMethod().getModifiers()) && methodCallTargetNode.targetMethod().getAnnotation(ExplodeLoop.class) == null && + !methodCallTargetNode.targetMethod().isNative() && methodCallTargetNode.targetMethod().getAnnotation(ExplodeLoop.class) == null && methodCallTargetNode.targetMethod().getAnnotation(CompilerDirectives.SlowPath.class) == null && !methodCallTargetNode.targetMethod().getDeclaringClass().equals(stringBuilderClass); return result;
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleExpansionLogger.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleExpansionLogger.java Wed Apr 23 12:38:05 2014 +0200 @@ -23,7 +23,6 @@ package com.oracle.graal.truffle; import java.io.*; -import java.lang.reflect.*; import java.util.*; import java.util.Map.Entry; @@ -51,7 +50,7 @@ int sourceMethodBci = callTarget.invoke().bci(); ResolvedJavaMethod targetMethod = callTarget.targetMethod(); ResolvedJavaType targetReceiverType = null; - if (!Modifier.isStatic(sourceMethod.getModifiers()) && callTarget.receiver().isConstant()) { + if (!sourceMethod.isStatic() && callTarget.receiver().isConstant()) { targetReceiverType = providers.getMetaAccess().lookupJavaType(callTarget.arguments().first().asConstant()); }
--- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java Wed Apr 23 12:38:05 2014 +0200 @@ -234,7 +234,7 @@ case WRITE: case INITIALIZE: { assert arguments.size() == 3 || arguments.size() == 4; - Kind writeKind = asKind(targetMethod.getSignature().getParameterType(Modifier.isStatic(targetMethod.getModifiers()) ? 2 : 1, targetMethod.getDeclaringClass())); + Kind writeKind = asKind(targetMethod.getSignature().getParameterType(targetMethod.isStatic() ? 2 : 1, targetMethod.getDeclaringClass())); LocationNode location; if (arguments.size() == 3) { location = makeLocation(graph, arguments.get(1), writeKind, LocationIdentity.ANY_LOCATION);
--- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeVerificationPhase.java Wed Apr 23 12:36:11 2014 +0200 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeVerificationPhase.java Wed Apr 23 12:38:05 2014 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.word.phases; -import java.lang.reflect.*; - import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.common.*; @@ -110,7 +108,7 @@ if (method.getAnnotation(NodeIntrinsic.class) == null) { Invoke invoke = (Invoke) callTarget.usages().first(); NodeInputList<ValueNode> arguments = callTarget.arguments(); - boolean isStatic = Modifier.isStatic(method.getModifiers()); + boolean isStatic = method.isStatic(); int argc = 0; if (!isStatic) { ValueNode receiver = arguments.get(argc);