RFR: 8013395 StringBuffer.toString performance regression impacting embedded benchmarks

2013-05-10 Thread David Holmes
Short version: Cache the value returned by toString and use it to copy-construct a new String on subsequent calls to toString(). Clear the cache on any mutating operation. webrev: http://cr.openjdk.java.net/~dholmes/8013395/webrev.v2/ Testing: microbenchmark for toString performance; new

Re: RFR: 8013395 StringBuffer.toString performance regression impacting embedded benchmarks

2013-05-10 Thread David Schlosnagle
Hi David, Would it be beneficial to push the toStringCache up to AbstractStringBuilder so that StringBuilder.toString() benefits from this cache as well? It seems like this would affect both StringBuilder and StringBuffer for repeated calls to toString(), although StringBuffer would obviously

Re: i18n dev RFR JDK-8013386: (tz) Support tzdata2013c

2013-05-10 Thread Xueming Shen
On 5/9/13 9:57 PM, Masayoshi Okutsu wrote: Do we still need to keep the old javazic code in JDK8? It's a maintenance burden to maintain both, isn't it? While it's a burden, but somehow it serves as a test case pretty well. The transitions are being built the old jdk way and threeten way, if

Re: RFR (XS) CR 8014233: java.lang.Thread should be @Contended

2013-05-10 Thread Laurent Bourgès
Peter, you're absolutely right: I was thinking about thread local values (object instances) and not ThreadLocal keys ! I think ThreadLocal name is confusing as it does not correspond to values ! Several times I wonder if false sharing can happen between my thread local values (i.e. different

Re: RFR: 8013395 StringBuffer.toString performance regression impacting embedded benchmarks

2013-05-10 Thread David Schlosnagle
One other quick comment, if the toStringCache is non-null during invocation of toString(), that seems to imply that the StringBuffer/StringBuilder has not been mutated since the last invocation of toString(), is there any reason to still use the String copy constructor? This would address the

Re: RFR: 8013395 StringBuffer.toString performance regression impacting embedded benchmarks

2013-05-10 Thread David Holmes
Hi Dave, On 10/05/2013 4:25 PM, David Schlosnagle wrote: Hi David, Would it be beneficial to push the toStringCache up to AbstractStringBuilder so that StringBuilder.toString() benefits from this cache as well? It seems like this would affect both StringBuilder and StringBuffer for repeated

Re: RFR: 8013395 StringBuffer.toString performance regression impacting embedded benchmarks

2013-05-10 Thread Peter Levart
Hi David, One remote incompatibility note: the String returned from StringBuffer.toString() is retained by StringBuffer until the next call to StringBuffer mutating method. This can be observed for example if the returned String object is wrapped by a WeakReference. This is really a remotely

RFR [7021870] GzipInputStream closes underlying stream during reading

2013-05-10 Thread Ivan Gerasimov
Hello everybody! GzipInputStream uses SequenceInputStream to concatenate the underlying stream with some data that reside in memory. SequenceInputStream is implementing in such a way that it closes the stream when it reaches EOS. The solution is to wrap the underlying stream with extended

Re: RFR: 8013395 StringBuffer.toString performance regression impacting embedded benchmarks

2013-05-10 Thread Alan Bateman
On 10/05/2013 07:03, David Holmes wrote: Short version: Cache the value returned by toString and use it to copy-construct a new String on subsequent calls to toString(). Clear the cache on any mutating operation. webrev: http://cr.openjdk.java.net/~dholmes/8013395/webrev.v2/ Testing:

RFR: 8014333 : javadoc error in JAXP 1.5 patch

2013-05-10 Thread huizhe wang
Hi, This is a quick fix for a javadoc error in the JAXP 1.5 patch. http://cr.openjdk.java.net/~joehw/jdk8/8014333/webrev/ Thanks, Joe

Re: RFR: 8014333 : javadoc error in JAXP 1.5 patch

2013-05-10 Thread Lance Andersen
Looks ok Lance -- Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 lance.ander...@oracle.com Sent from my iPhone On May 10, 2013, at 5:11 AM, huizhe wang huizhe.w...@oracle.com wrote: Hi, This is a quick

Re: Please review changes for JDK-8012975: Remove rhino from jdk8

2013-05-10 Thread A. Sundararajan
Please review the updated webrev @ http://cr.openjdk.java.net/~sundar/8012975/webrev.01/ Thanks -Sundar On Friday 03 May 2013 02:56 PM, Alan Bateman wrote: On 03/05/2013 07:47, A. Sundararajan wrote: Thanks. Looks like the first one has not been removed. But second one was removed: hg stat

Re: Please review changes for JDK-8012975: Remove rhino from jdk8

2013-05-10 Thread Alan Bateman
On 10/05/2013 10:26, A. Sundararajan wrote: Please review the updated webrev @ http://cr.openjdk.java.net/~sundar/8012975/webrev.01/ Thanks -Sundar PROFILE_3_RTJAR_INCLUDE_PACKAGES needs to have com/sun/script removed. refs.allowed isn't quite right, the last line needs to be removed

Re: RFR: 8014316 : (XXS) Use Method Refs in j.u.stream.MatchOps

2013-05-10 Thread Paul Sandoz
On May 10, 2013, at 5:33 AM, David Holmes david.hol...@oracle.com wrote: Looks good to me Mike! +1 Paul.

Re: i18n dev RFR JDK-8013386: (tz) Support tzdata2013c

2013-05-10 Thread Masayoshi Okutsu
On 5/10/2013 3:30 PM, Xueming Shen wrote: On 5/9/13 9:57 PM, Masayoshi Okutsu wrote: Do we still need to keep the old javazic code in JDK8? It's a maintenance burden to maintain both, isn't it? While it's a burden, but somehow it serves as a test case pretty well. The transitions are being

Re: Please review changes for JDK-8012975: Remove rhino from jdk8

2013-05-10 Thread A. Sundararajan
com/sun/script/util is generic utility package for script engine implementations. Only com/sun/script/javascript package is being removed. Since we include javax/script for profile 3, should we also include com/sun/script/util ? On refs.allowed, I'll remove it. How should I check this?

Re: Please review changes for JDK-8012975: Remove rhino from jdk8

2013-05-10 Thread Alan Bateman
On 10/05/2013 11:23, A. Sundararajan wrote: com/sun/script/util is generic utility package for script engine implementations. Only com/sun/script/javascript package is being removed. Since we include javax/script for profile 3, should we also include com/sun/script/util ? Is

Re: RFC 7038914: VM could throw uncaught OOME in ReferenceHandler thread

2013-05-10 Thread Peter Levart
Hi David, Thomas, I think I understand you now, David. You want to minimize the possibility of vacuously passing the test. So here's my attempt at that: public class OOMEInReferenceHandler { static Object[] fillHeap() { Object[] first = null, last = null; int size = 1

Re: RFR (XS) CR 8014233: java.lang.Thread should be @Contended

2013-05-10 Thread Doug Lea
On 05/09/13 10:19, Peter Levart wrote: Hi Aleksey, Wouldn't it be even better if just threadLocalRandom* fields were annotated with @Contended(ThreadLocal) ? Some fields within the Thread object are accessed from non-local threads. I don't know how frequently, but isolating just

Re: RFR (XS) CR 8014233: java.lang.Thread should be @Contended

2013-05-10 Thread Doug Lea
On 05/10/13 02:31, Laurent Bourgès wrote: Peter, you're absolutely right: I was thinking about thread local values (object instances) and not ThreadLocal keys ! I think ThreadLocal name is confusing as it does not correspond to values ! Several times I wonder if false sharing can happen

Re: Please review changes for JDK-8012975: Remove rhino from jdk8

2013-05-10 Thread A. Sundararajan
Okay, thanks. com.sun.script.util is not supported API (no CCC done for it in the past). I'll remove it as suggested and run make profiles to check Thanks -Sundar On Friday 10 May 2013 04:09 PM, Alan Bateman wrote: On 10/05/2013 11:23, A. Sundararajan wrote: com/sun/script/util is generic

Re: RFC 7038914: VM could throw uncaught OOME in ReferenceHandler thread

2013-05-10 Thread David Holmes
Hi Peter, So it would appear that it is not in fact the new that causes the OOME but the classloading of InterruptedException ? I'm not sure I can quite get my head around this late on a Friday night :) David On 10/05/2013 9:21 PM, Peter Levart wrote: On 05/10/2013 12:52 PM, Peter Levart

Re: RFC 7038914: VM could throw uncaught OOME in ReferenceHandler thread

2013-05-10 Thread Peter Levart
Hi again, While the below patch works and keeps Reference Handler running in all scenarios, the evaluation exposed a weakness of JVM. If loading of a class fails because of OOME, this class can not be used in this incarnation of the VM even if OOME was just a transient condition. Regards,

Re: RFC 7038914: VM could throw uncaught OOME in ReferenceHandler thread

2013-05-10 Thread Peter Levart
On 05/10/2013 03:14 PM, David Holmes wrote: Hi Peter, So it would appear that it is not in fact the new that causes the OOME but the classloading of InterruptedException ? Depends on whether the InterruptedException class was already loaded or not when new is attempted. I'm not sure I

Re: RFR: 8013395 StringBuffer.toString performance regression impacting embedded benchmarks

2013-05-10 Thread David Chase
On 2013-05-10, at 2:47 AM, David Holmes david.hol...@oracle.com wrote: Right this was our first thought too, but the specification for toString states that a new String is created. So to go this path we'd also have to push through a spec change for StringBuilder/StringBuffer. Given this is an

Re: RFR (XS) CR 8014233: java.lang.Thread should be @Contended

2013-05-10 Thread Aleksey Shipilev
On 10.05.2013, at 16:17, Doug Lea d...@cs.oswego.edu wrote: On 05/09/13 10:19, Peter Levart wrote: Hi Aleksey, Wouldn't it be even better if just threadLocalRandom* fields were annotated with @Contended(ThreadLocal) ? Some fields within the Thread object are accessed from non-local

Re: RFR 8014076: Arrays parallel and serial sorting improvements

2013-05-10 Thread Chris Hegarty
Updated webrev and specdiff. http://cr.openjdk.java.net/~chegar/8014076/ver.01/specdiff/java/util/Arrays.html http://cr.openjdk.java.net/~chegar/8014076/ver.01/webrev/ I incorporated the feedback so far, and reverted the change to make MIN_ARRAY_SORT_GRAN public ( there doesn't appear to be

Re: Please review changes for JDK-8012975: Remove rhino from jdk8

2013-05-10 Thread Tim Bell
Hi Sundar Looks like you have resolved the subtleties of profiles with Alan. The rest looks good to me. Tim On 05/10/13 05:47 AM, A. Sundararajan wrote: Okay, thanks. com.sun.script.util is not supported API (no CCC done for it in the past). I'll remove it as suggested and run make

Request for Review 8014296: DivModTests should not compare pointers

2013-05-10 Thread roger riggs
Please review this minor correction to DivModTests to address this issue: http://bugs.sun.com/view_bug.do?bug_id=8014296 With autoboxing of mixed types primitive and Object, the operators == and != are interpreted as reference compare instead of value compares. The compiler is silent about

hg: jdk8/tl/langtools: 8014318: tools/javac/profiles/ProfileOptionTest.java needs modifying now that javax.script is in compact1

2013-05-10 Thread alan . bateman
Changeset: ce7e1674eb73 Author:alanb Date: 2013-05-10 16:10 +0100 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/ce7e1674eb73 8014318: tools/javac/profiles/ProfileOptionTest.java needs modifying now that javax.script is in compact1 Reviewed-by: mchung !

Re: Request for Review 8014296: DivModTests should not compare pointers

2013-05-10 Thread Joe Darcy
On 05/10/2013 08:02 AM, roger riggs wrote: Please review this minor correction to DivModTests to address this issue: http://bugs.sun.com/view_bug.do?bug_id=8014296 With autoboxing of mixed types primitive and Object, the operators == and != are interpreted as reference compare instead of

Re: Request for Review 8014296: DivModTests should not compare pointers

2013-05-10 Thread roger riggs
Thanks, the webrev now has the correct copyright change. On 5/10/2013 11:14 AM, Joe Darcy wrote: On 05/10/2013 08:02 AM, roger riggs wrote: Please review this minor correction to DivModTests to address this issue: http://bugs.sun.com/view_bug.do?bug_id=8014296 With autoboxing of mixed

Re: Request for Review 8014296: DivModTests should not compare pointers

2013-05-10 Thread Joe Darcy
Good to push. -Joe On 05/10/2013 08:25 AM, roger riggs wrote: Thanks, the webrev now has the correct copyright change. On 5/10/2013 11:14 AM, Joe Darcy wrote: On 05/10/2013 08:02 AM, roger riggs wrote: Please review this minor correction to DivModTests to address this issue:

Re: Request for Review 8014296: DivModTests should not compare pointers

2013-05-10 Thread roger riggs
Thanks, I'll need help with the push (I'm not a committer for JDK). On 5/10/2013 11:39 AM, Joe Darcy wrote: Good to push. -Joe On 05/10/2013 08:25 AM, roger riggs wrote: Thanks, the webrev now has the correct copyright change. On 5/10/2013 11:14 AM, Joe Darcy wrote: On 05/10/2013 08:02

Re: Request for Review 8014296: DivModTests should not compare pointers

2013-05-10 Thread Joe Darcy
Pushed; cheers, -Joe On 05/10/2013 08:40 AM, roger riggs wrote: Thanks, I'll need help with the push (I'm not a committer for JDK). On 5/10/2013 11:39 AM, Joe Darcy wrote: Good to push. -Joe On 05/10/2013 08:25 AM, roger riggs wrote: Thanks, the webrev now has the correct copyright

hg: jdk8/tl/jdk: 2 new changesets

2013-05-10 Thread mike . duigou
Changeset: 2490769abdfa Author:mduigou Date: 2013-05-10 09:51 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/2490769abdfa 8014316: Use Method Refs in j.u.stream.MatchOps Reviewed-by: dholmes ! src/share/classes/java/util/stream/MatchOps.java Changeset: 9891e4d7d5b3 Author:

Re: RFR: 8013395 StringBuffer.toString performance regression impacting embedded benchmarks

2013-05-10 Thread Mike Duigou
The implementation looks OK to me. I like Peter's suggestion of caching the char[] rather than string. I do wish that the cache could be in a soft reference but understand that there are tradeoffs to doing so. I am worried about leaks with this implementation. Another possibility, to go

JDK 8 code review request for JDK-8014357 Minor refactorings to sun.reflect.generics.reflectiveObjects.*

2013-05-10 Thread Joe Darcy
Hello, Please review this small refactoring of types in sun.reflect.generics.reflectiveObjects.* to use methods in java.util.Objects and the new method in JDK 8 Types.getTypeName. Webrev at http://cr.openjdk.java.net/~darcy/8014357.0/ patch below. Thanks, -Joe diff -r c26e0d29249a

Re: RFR 8012326: Deadlock occurs when Charset.availableCharsets() is called by several threads at the same time

2013-05-10 Thread Xueming Shen
Thanks for the review. I have updated the Charset.java to use the init-on-depand holder idiom. I don't think MSISO2022JP/ISO2022_JP_2 are really worth the cost of adding two more classes, so I leave them asis. Agreed that the ExtendedCahrsets change can be separated, but since we're here

Re: RFR [7021870] GzipInputStream closes underlying stream during reading

2013-05-10 Thread Mike Duigou
The fix looks reasonable to me. Mike On May 10 2013, at 01:03 , Ivan Gerasimov wrote: Hello everybody! GzipInputStream uses SequenceInputStream to concatenate the underlying stream with some data that reside in memory. SequenceInputStream is implementing in such a way that it closes the

Re: RFC 7038914: VM could throw uncaught OOME in ReferenceHandler thread

2013-05-10 Thread Dean Long
If you really want to bullet-proof ReferenceHandler (and other system threads) against OOME caused by native allocations, then don't forget about monitor inflation if there is contention for lock :-) dl On 5/10/2013 6:14 AM, David Holmes wrote: Hi Peter, So it would appear that it is not in

Re: RFR (XS) CR 8014233: java.lang.Thread should be @Contended

2013-05-10 Thread Aleksey Shipilev
On 05/10/2013 05:27 PM, Aleksey Shipilev wrote: Although I just tried what Peter had suggested, and got even more boost on my microbenchmark. This counter-intuitive for me, since no memory layout differences could explain this in my tests. I will have to untangle this today, hold on. Ok, I

Re: JDK 8 code review request for JDK-8014357 Minor refactorings to sun.reflect.generics.reflectiveObjects.*

2013-05-10 Thread Mandy Chung
On 5/10/2013 10:40 AM, Joe Darcy wrote: Hello, Please review this small refactoring of types in sun.reflect.generics.reflectiveObjects.* to use methods in java.util.Objects and the new method in JDK 8 Types.getTypeName. Webrev at http://cr.openjdk.java.net/~darcy/8014357.0/ Looks

Re: RFR: 8013395 StringBuffer.toString performance regression impacting embedded benchmarks

2013-05-10 Thread Martin Buchholz
On Fri, May 10, 2013 at 10:36 AM, Mike Duigou mike.dui...@oracle.comwrote: The implementation looks OK to me. I like Peter's suggestion of caching the char[] rather than string. I do wish that the cache could be in a soft reference but understand that there are tradeoffs to doing so. I am

Re: RFR:7184195 - java.util.logging.Logger.getGlobal().info() doesn't log without configuration

2013-05-10 Thread Jim Gish
Here's an updated webrev for this fix: http://cr.openjdk.java.net/~jgish/Bug7184195-global-logger-failure.2/ http://cr.openjdk.java.net/%7Ejgish/Bug7184195-global-logger-failure.2/ The changes from the previous one are: - breaking apart the two tests so that logger initialization in the basic

Re: JDK 8 code review request for JDK-8014357 Minor refactorings to sun.reflect.generics.reflectiveObjects.*

2013-05-10 Thread Joe Darcy
On 05/10/2013 11:18 AM, Mandy Chung wrote: On 5/10/2013 10:40 AM, Joe Darcy wrote: Hello, Please review this small refactoring of types in sun.reflect.generics.reflectiveObjects.* to use methods in java.util.Objects and the new method in JDK 8 Types.getTypeName. Webrev at

hg: jdk8/tl/jdk: 8014357: Minor refactorings to sun.reflect.generics.reflectiveObjects.*

2013-05-10 Thread joe . darcy
Changeset: f84b5498b2bb Author:darcy Date: 2013-05-10 12:25 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/f84b5498b2bb 8014357: Minor refactorings to sun.reflect.generics.reflectiveObjects.* Reviewed-by: mchung !

Re: RFC 7038914: VM could throw uncaught OOME in ReferenceHandler thread

2013-05-10 Thread Peter Levart
On 05/10/2013 08:10 PM, Dean Long wrote: If you really want to bullet-proof ReferenceHandler (and other system threads) against OOME caused by native allocations, then don't forget about monitor inflation if there is contention for lock :-) Aren't monitors C++ objects? Are they allocated

Re: RFC 7038914: VM could throw uncaught OOME in ReferenceHandler thread

2013-05-10 Thread Peter Levart
On 05/10/2013 10:08 PM, Peter Levart wrote: On 05/10/2013 08:10 PM, Dean Long wrote: If you really want to bullet-proof ReferenceHandler (and other system threads) against OOME caused by native allocations, then don't forget about monitor inflation if there is contention for lock :-)

Re: RFC 7038914: VM could throw uncaught OOME in ReferenceHandler thread

2013-05-10 Thread Dean Long
On 5/10/2013 1:22 PM, Peter Levart wrote: On 05/10/2013 10:08 PM, Peter Levart wrote: On 05/10/2013 08:10 PM, Dean Long wrote: If you really want to bullet-proof ReferenceHandler (and other system threads) against OOME caused by native allocations, then don't forget about monitor inflation

Code review request for JDK-8014365 Restore Objects.requireNonNull(T, SupplierString)

2013-05-10 Thread Joe Darcy
Hello, Please (re)review this change to introduce Objects.requireNonNull(T, SupplierString): http://cr.openjdk.java.net/~darcy/8014365.0/ The original change had to be pulled out because of a build issue (8012343: Objects.requireNonNull(Object,Supplier) breaks genstubs build); I'll be

Re: Review Request: BigInteger patch for efficient multiplication and division (#4837946)

2013-05-10 Thread Brian Burkhalter
On May 9, 2013, at 5:28 PM, Brian Burkhalter wrote: I just went ahead and filed 8014319 and 8014320 for phases 3 and 4, respectively. They will show up onhttp://bugs.sun.com/bugdatabase after some unspecified delay, probably about a day. Verbiage may be updated as needed. Indeed these

RFR: JDK-8011136 - FileInputStream.available and skip inconsistencies

2013-05-10 Thread Dan Xu
Hi, The FileInputStream.available() method can return a negative value when the file position is beyond the endof afile. This is an unspecified behaviour that has the potential to break applications that expect available to return a value of 0 or greater. The FileInputStream.skip(long)

hg: jdk8/tl/langtools: 8014365: Restore Objects.requireNonNull(T, SupplierString)

2013-05-10 Thread joe . darcy
Changeset: 1c43236f6d69 Author:darcy Date: 2013-05-10 14:31 -0700 URL: http://hg.openjdk.java.net/jdk8/tl/langtools/rev/1c43236f6d69 8014365: Restore Objects.requireNonNull(T, SupplierString) Reviewed-by: jjg ! makefiles/BuildLangtools.gmk

Re: Add getChars to CharSequence

2013-05-10 Thread Martin Buchholz
On Wed, May 8, 2013 at 5:30 PM, Mike Duigou mike.dui...@oracle.com wrote: AbstractStringBuilder:: - The impls like insert(int dstOffset, CharSequence s) makes me slightly uneasy because the private value field escapes to an unknown class. Who knows what evil (or foolishness) could result?

Re: RFR [7021870] GzipInputStream closes underlying stream during reading

2013-05-10 Thread Xueming Shen
The proposed fix does solve the issue. However it appears it does not fix the root cause that triggers this problem. The root cause, or the direct trigger of this bug is the fact that ZipInputStream .availble() is really NOT reliable to tell us whether or not there is any byte available to be

RFR: JDK-8014360-Optimize and Refactor the Normalize Process in java.io File Systems

2013-05-10 Thread Dan Xu
Hi, The normalize() implementations in UnixFileSystem.java and WinNTFileSystem.java can be improved to make it simpler, easier, and more efficient. I have refactoredthecode when working on JDK-8003992. And Iwould like to send it out for a review in this separate bug. Thanks! webrev:

Re: Add getChars to CharSequence

2013-05-10 Thread Joe Darcy
On 05/10/2013 03:03 PM, Martin Buchholz wrote: On Wed, May 8, 2013 at 5:30 PM, Mike Duigou mike.dui...@oracle.com wrote: - There's been some informal discussion of packaging commonly used test utils as jtreg @library. This could be a good candidate. ArraysCharSequence is a candidate for

Re: RFC 7038914: VM could throw uncaught OOME in ReferenceHandler thread

2013-05-10 Thread David Holmes
On 11/05/2013 6:53 AM, Dean Long wrote: On 5/10/2013 1:22 PM, Peter Levart wrote: On 05/10/2013 10:08 PM, Peter Levart wrote: On 05/10/2013 08:10 PM, Dean Long wrote: If you really want to bullet-proof ReferenceHandler (and other system threads) against OOME caused by native allocations,

Re: RFR 8014076: Arrays parallel and serial sorting improvements

2013-05-10 Thread Mike Duigou
On May 10 2013, at 07:14 , Chris Hegarty wrote: Updated webrev and specdiff. http://cr.openjdk.java.net/~chegar/8014076/ver.01/specdiff/java/util/Arrays.html Docs changes look fine to me. http://cr.openjdk.java.net/~chegar/8014076/ver.01/webrev/ ArraysParallelSortHelpers:: - It's

Re: RFR 8012326: Deadlock occurs when Charset.availableCharsets() is called by several threads at the same time

2013-05-10 Thread Mandy Chung
Sherman, The charsetForName, charsets and aliasesFor methods call init() first and then access the maps with no synchronization. While the maps are being accessed by one thread and system initialization completes, another thread calls charsetForName() that calls init() which will update the

Re: Add getChars to CharSequence

2013-05-10 Thread Martin Buchholz
On Wed, May 8, 2013 at 5:30 PM, Mike Duigou mike.dui...@oracle.com wrote: - Could use a @DataProivder for CharSequence[] seqs = { style tests. OK, so I went and learned about DataProvider. Not too painful. Added in some uses of bleeding edge lambda stuff as well to pretty up the GetChars