Issue Details (XML | Word | Printable)

Key: RVM-266
Type: Wish Wish
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Andrew John Hughes
Reporter: Ian Rogers
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
RVM

Provide preliminary support for a non-copying unsynchronised StringBuffer implementation

Created: 24/Sep/07 05:06 AM   Updated: 27/Apr/08 05:45 PM
Component/s: Runtime: Class Library
Affects Version/s: None
Fix Version/s: 2.9.3

Time Tracking:
Not Specified


 Description  « Hide
GCJ has a replacement to Classpath's StringBuffer:

http://gcc.gnu.org/ml/java-patches/2001-q4/msg00319.html
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21869

we should investigate having an optimal StringBuffer in the Jikes RVM.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Andrew John Hughes added a comment - 30/Oct/07 04:19 PM
Primarily, it is worth looking at whether GCJ's StringBuffer could be merged into Classpath allowing general access to this code.

Andrew John Hughes added a comment - 28/Feb/08 04:52 PM
Most of this work is done. We just need to create a further internal class that doesn't copy on toString() and use that throughout the codebase.

Ian Rogers added a comment - 29/Feb/08 07:20 AM
Cool, how do we do this? Is it a JikesRVMHelpers/Support call that we need? I'm not sure what the internal class will do.

Andrew John Hughes added a comment - 29/Feb/08 01:11 PM
It's an internal GNU Classpath class, not a VM thing although JikesRVM can of course make use of it internally too (and probably should). It will be in the gnu.classpath namespace.

Andrew John Hughes added a comment - 29/Feb/08 04:38 PM
This class now exists as gnu.classpath.CPStringBuffer. It can be used just like the other string buffers, but is not thread-safe and does not copy the character data on toString() or substring().

Ian Rogers added a comment - 29/Feb/08 04:45 PM
minor point, if its not thread-safe should it be called CPStringBuilder?

Andrew John Hughes added a comment - 29/Feb/08 04:52 PM
Yeah I thought that too; I'll change it because I'm typing CPStringBuilder too...

Ian Rogers added a comment - 29/Feb/08 04:55 PM
neat, are you putting this change through Classpath, it'll be great to lower the StringBuffer/Builder overhead.. another thing to look at is the default size of the buffer.. for a CPStringThingy it needed default to 16

Andrew John Hughes added a comment - 02/Mar/08 04:04 PM
The patch went into Classpath at the end of last week and I've ported this fixes over to JikesRVM, with appropriate VM interface changes today.

Revision: 13988
http://jikesrvm.svn.sourceforge.net/jikesrvm/?rev=13988&view=rev
Author: gnu_andrew
Date: 2008-03-02 09:41:13 -0800 (Sun, 02 Mar 2008)

Log Message:
-----------
Add CPStringBuilder patches from GNU Classpath and fix JikesRVM VM
interfaces to match.

Modified Paths:
--------------
rvmroot/trunk/build/components/classpath.xml
rvmroot/trunk/libraryInterface/Common/src/java/lang/reflect/Constructor.java
rvmroot/trunk/libraryInterface/Common/src/java/lang/reflect/Field.java
rvmroot/trunk/libraryInterface/Common/src/java/lang/reflect/Method.java

Added Paths:
-----------
rvmroot/trunk/build/components/patches/classpath-web.RVM-266-01.patch
rvmroot/trunk/build/components/patches/classpath-web.RVM-266-02.patch
rvmroot/trunk/build/components/patches/classpath-web.RVM-266-03.patch
rvmroot/trunk/build/components/patches/classpath-web.RVM-266-04.patch

More to follow.


Andrew John Hughes added a comment - 11/Apr/08 04:28 PM
Needs some more patches porting from CP before the release.

Andrew John Hughes added a comment - 24/Apr/08 05:42 PM
Note that, long term, we could ideally optimise the instance creation via VMCPStringBuilder. CACAO now does this.

David Grove added a comment - 25/Apr/08 07:24 AM
Andrew said on the list that this either had to be completed or the partial version that is in now backed out before the next release, so raising priority to blocker.

Andrew John Hughes added a comment - 27/Apr/08 05:42 PM
With revision 14173, this is now at a state where it can be shipped in the next release.
There are still patches to be done, but I'd rather not risk introducing bugs before the release, so I'll close this bug and add a new one for full support in 2.9.4.

Andrew John Hughes added a comment - 27/Apr/08 05:45 PM
  • CPStringBuilder and its VM counterpart, VMCPStringBuilder, are in the RVM codebase and Classpath CVS
  • All appropriate uses of StringBuilder have been replaced by calls to CPStringBuilder.