-
Enhancement
-
Resolution: Fixed
-
P3
-
7
-
b23
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8063461 | 8u45 | Coleen Phillimore | P3 | Resolved | Fixed | b01 |
JDK-8047195 | 8u40 | Coleen Phillimore | P3 | Resolved | Fixed | b06 |
JDK-8069896 | emb-8u47 | Coleen Phillimore | P3 | Resolved | Fixed | team |
JDK-8072198 | 7u85 | Coleen Phillimore | P3 | Resolved | Fixed | b01 |
JDK-8047196 | 7u80 | Kevin Walls | P3 | Resolved | Fixed | b03 |
presumably because of jni overhead.
Some core library code would like to use it to optimize some operations.
E.g. when using a Charset to decode a byte stream into a char array,
one might have to make a defensive copy of the output char array because
a malicious Charset might keep a reference to it, thereby
making it possible for a String to change its value in the future,
which is a big no-no. Being able to ask whether a Charset is
provided as part of the JDK, cheaply, would be a big help to optimizing this
for "builtin" classes.
boolean isTrusted(Object x) {
return System.getSecurityManager() == null ||
x.getClass().getClassLoader() == null;
}
One suspects that getClassLoader() can be trivially optimized to a field access,
just like getClass() was.
This bug is filed against compiler2, but of course we encourage a fix in compiler1 as well.
- backported by
-
JDK-8047195 Improve performance of Class.getClassLoader()
-
- Resolved
-
-
JDK-8047196 Improve performance of Class.getClassLoader()
-
- Resolved
-
-
JDK-8063461 Improve performance of Class.getClassLoader()
-
- Resolved
-
-
JDK-8069896 Improve performance of Class.getClassLoader()
-
- Resolved
-
-
JDK-8072198 Improve performance of Class.getClassLoader()
-
- Resolved
-
- relates to
-
JDK-8047735 Investigate replacing System.security field with a VolatileCallSite
-
- Open
-
-
JDK-4372672 improve performance of Object.getClass()
-
- Resolved
-
-
JDK-8130289 SecurityManager being mutable impedes the optimization of Class.getClassLoader
-
- Closed
-
-
CODETOOLS-7901068 SecurityException when trying to introspect java.lang.Class
-
- Resolved
-