Code Review Request for 7107613, 7107616, 7185471 (original) (raw)

Weijun Wang weijun.wang at oracle.com
Thu Jul 26 01:29:35 UTC 2012


On 07/26/2012 08:21 AM, Valerie (Yu-Ching) Peng wrote:

Hi, Max or Xuelei,

Either of you have cycles to review the following 3 perf related fixes? 7107613: scalability bloker in javax.crypto.CryptoPermissions 7107616: scalability bloker in javax.crypto.JceSecurityManager 7185471: Avoid key expansion when AES cipher is re-init w/ the same key Webrevs are at: http://cr.openjdk.java.net/~valeriep/7107613

Looks fine.

http://cr.openjdk.java.net/~valeriep/7107616

You have

122 CryptoPermissions appPerms = exemptCache.get(callerCodeBase); 123 // Found result in cache 124 if (appPerms != null) { 125 if (appPerms == CACHE_NULL_MARK) appPerms = null; 126 } else { 127 synchronized (this.getClass()) { 128 appPerms = getAppPermissions(callerCodeBase); 129 exemptCache.putIfAbsent(callerCodeBase, 130 (appPerms == null? CACHE_NULL_MARK:appPerms)); 131 } 132 }

This is not as optimized as before, that there is a chance getAppPermissions could be called twice, and this seems to make the synchronized block not worth syncing.

http://cr.openjdk.java.net/~valeriep/7185471

I haven't looked at this yet. Seems a lot of math there.

Thanks Max

The changes are for JDK 8. May be backported to 7u later if necessary, Thanks, Valerie



More information about the security-dev mailing list