提交 8a19ace4 编写于 作者: D dfuchs

8012243: about 30% regression on specjvm2008.serial on 7u25 comparing 7u21

Reviewed-by: alanb, skoivu, smarks, mchung
上级 3ecdf18d
...@@ -266,9 +266,11 @@ public class ObjectStreamClass implements Serializable { ...@@ -266,9 +266,11 @@ public class ObjectStreamClass implements Serializable {
if (cl == null) { if (cl == null) {
return null; return null;
} }
Class<?> caller = Reflection.getCallerClass(); if (System.getSecurityManager() != null) {
if (ReflectUtil.needsPackageAccessCheck(caller.getClassLoader(), cl.getClassLoader())) { Class<?> caller = Reflection.getCallerClass();
ReflectUtil.checkPackageAccess(cl); if (ReflectUtil.needsPackageAccessCheck(caller.getClassLoader(), cl.getClassLoader())) {
ReflectUtil.checkPackageAccess(cl);
}
} }
return cl; return cl;
} }
......
...@@ -162,9 +162,11 @@ public class ObjectStreamField ...@@ -162,9 +162,11 @@ public class ObjectStreamField
*/ */
@CallerSensitive @CallerSensitive
public Class<?> getType() { public Class<?> getType() {
Class<?> caller = Reflection.getCallerClass(); if (System.getSecurityManager() != null) {
if (ReflectUtil.needsPackageAccessCheck(caller.getClassLoader(), type.getClassLoader())) { Class<?> caller = Reflection.getCallerClass();
ReflectUtil.checkPackageAccess(type); if (ReflectUtil.needsPackageAccessCheck(caller.getClassLoader(), type.getClassLoader())) {
ReflectUtil.checkPackageAccess(type);
}
} }
return type; return type;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册