mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8346567: Make Class.getModifiers() non-native
Reviewed-by: alanb, vlivanov, yzheng, dlong
This commit is contained in:
parent
5589892262
commit
c9cadbd23f
31 changed files with 90 additions and 146 deletions
|
@ -236,11 +236,12 @@ public final class Class<T> implements java.io.Serializable,
|
|||
* This constructor is not used and prevents the default constructor being
|
||||
* generated.
|
||||
*/
|
||||
private Class(ClassLoader loader, Class<?> arrayComponentType) {
|
||||
private Class(ClassLoader loader, Class<?> arrayComponentType, int mods) {
|
||||
// Initialize final field for classLoader. The initialization value of non-null
|
||||
// prevents future JIT optimizations from assuming this final field is null.
|
||||
classLoader = loader;
|
||||
componentType = arrayComponentType;
|
||||
modifiers = mods;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1000,6 +1001,7 @@ public final class Class<T> implements java.io.Serializable,
|
|||
|
||||
private transient Object classData; // Set by VM
|
||||
private transient Object[] signers; // Read by VM, mutable
|
||||
private final transient int modifiers; // Set by the VM
|
||||
|
||||
// package-private
|
||||
Object getClassData() {
|
||||
|
@ -1344,8 +1346,7 @@ public final class Class<T> implements java.io.Serializable,
|
|||
* @jls 9.1.1 Interface Modifiers
|
||||
* @jvms 4.1 The {@code ClassFile} Structure
|
||||
*/
|
||||
@IntrinsicCandidate
|
||||
public native int getModifiers();
|
||||
public int getModifiers() { return modifiers; }
|
||||
|
||||
/**
|
||||
* {@return an unmodifiable set of the {@linkplain AccessFlag access
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue