< prev index next >

jdk/src/java.base/share/classes/java/lang/Class.java

Print this page

        

*** 78,87 **** --- 78,89 ---- import sun.reflect.generics.repository.ConstructorRepository; import sun.reflect.generics.scope.ClassScope; import sun.security.util.SecurityConstants; import sun.reflect.annotation.*; import sun.reflect.misc.ReflectUtil; + import valhalla.shady.MinimalValueTypes_1_0; + import static valhalla.shady.MinimalValueTypes_1_0.ACC_VALUE; /** * Instances of the class {@code Class} represent classes and * interfaces in a running Java application. An enum is a kind of
*** 461,477 **** return c != null && !c.isValueClass() ? c : null; } boolean isValueClass() { Class<?> c = this; while (c.isArray()) { c = c.getComponentType(); } // For now, check if it is a subtype of __Value ! return __Value.class.isAssignableFrom(c) && c != __Value.class; } private void ensureNotValueClass() { // temporary workaround until compiler/valhalla/valuetypes/ValueTypeBenchTest.java // is updated to do reflection on VCC instead of VVT declared with __ByValue --- 463,484 ---- return c != null && !c.isValueClass() ? c : null; } boolean isValueClass() { + // ensure that system properties have been initialized. + if (VM.initLevel() < 1) + return false; + Class<?> c = this; while (c.isArray()) { c = c.getComponentType(); } // For now, check if it is a subtype of __Value ! Class<?> valueBaseClass = MinimalValueTypes_1_0.getValueClass(); ! return valueBaseClass != null && c != valueBaseClass && valueBaseClass.isAssignableFrom(c); } private void ensureNotValueClass() { // temporary workaround until compiler/valhalla/valuetypes/ValueTypeBenchTest.java // is updated to do reflection on VCC instead of VVT declared with __ByValue
< prev index next >