RVM

Provide preliminary support for a non-copying unsynchronised StringBuffer implementation

Details

  • Type: Wish Wish
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 2.9.3
  • Component/s: Runtime: Class Library
  • Labels:
    None
  • Number of attachments :
    0

Description

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.

Activity

Hide
Andrew John Hughes added a comment -

Primarily, it is worth looking at whether GCJ's StringBuffer could be merged into Classpath allowing general access to this code.

Show
Andrew John Hughes added a comment - Primarily, it is worth looking at whether GCJ's StringBuffer could be merged into Classpath allowing general access to this code.
Hide
Andrew John Hughes added a comment -

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.

Show
Andrew John Hughes added a comment - 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.
Hide
Ian Rogers added a comment -

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.

Show
Ian Rogers added a comment - 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.
Hide
Andrew John Hughes added a comment -

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.

Show
Andrew John Hughes added a comment - 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.
Hide
Andrew John Hughes added a comment -

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().

Show
Andrew John Hughes added a comment - 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().
Hide
Ian Rogers added a comment -

minor point, if its not thread-safe should it be called CPStringBuilder?

Show
Ian Rogers added a comment - minor point, if its not thread-safe should it be called CPStringBuilder?
Hide
Andrew John Hughes added a comment -

Yeah I thought that too; I'll change it because I'm typing CPStringBuilder too...

Show
Andrew John Hughes added a comment - Yeah I thought that too; I'll change it because I'm typing CPStringBuilder too...
Hide
Ian Rogers added a comment -

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

Show
Ian Rogers added a comment - 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
Hide
Andrew John Hughes added a comment -

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.

Show
Andrew John Hughes added a comment - 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.
Hide
Andrew John Hughes added a comment -

Needs some more patches porting from CP before the release.

Show
Andrew John Hughes added a comment - Needs some more patches porting from CP before the release.
Hide
Andrew John Hughes added a comment -

Note that, long term, we could ideally optimise the instance creation via VMCPStringBuilder. CACAO now does this.

Show
Andrew John Hughes added a comment - Note that, long term, we could ideally optimise the instance creation via VMCPStringBuilder. CACAO now does this.
Hide
David Grove added a comment -

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.

Show
David Grove added a comment - 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.
Hide
Andrew John Hughes added a comment -

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.

Show
Andrew John Hughes added a comment - 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.
Hide
Andrew John Hughes added a comment -
  • 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.
Show
Andrew John Hughes added a comment -
  • 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.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: