String.java (rehash): Removed.

2004-11-23  Michael Koch  <konqueror@gmx.de>

	* java/lang/String.java (rehash): Removed.
	* java/lang/natString.cc (rehash): Made static.
	(_Jv_NewStringUtf8Const): Use static rehash method.

From-SVN: r91104
This commit is contained in:
Michael Koch 2004-11-23 21:33:01 +00:00 committed by Michael Koch
parent 5dc9b36b97
commit f8af9e2861
3 changed files with 12 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2004-11-23 Michael Koch <konqueror@gmx.de>
* java/lang/String.java (rehash): Removed.
* java/lang/natString.cc (rehash): Made static.
(_Jv_NewStringUtf8Const): Use static rehash method.
2004-11-23 Michael Koch <konqueror@gmx.de>
* Makefile.in, aclocal.m4, configure, gcj/Makefile.in,

View File

@ -1,5 +1,5 @@
/* String.java -- immutable character sequences; the object of string literals
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@ -1254,5 +1254,4 @@ public final class String implements Serializable, Comparable, CharSequence
private native void init(byte[] chars, int offset, int count, String enc)
throws UnsupportedEncodingException;
private native void init(gnu.gcj.runtime.StringBuffer buffer);
private static native void rehash();
}

View File

@ -1,6 +1,7 @@
// natString.cc - Implementation of java.lang.String native methods.
/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation
/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation
This file is part of libgcj.
@ -116,8 +117,8 @@ _Jv_StringGetSlot (jstring str)
return _Jv_StringFindSlot(data, length, hashChars (data, length));
}
void
java::lang::String::rehash()
static void
rehash ()
{
JvSynchronize sync (&StringClass);
@ -287,7 +288,7 @@ _Jv_NewStringUtf8Const (Utf8Const* str)
JvSynchronize sync (&StringClass);
if (3 * strhash_count >= 2 * strhash_size)
java::lang::String::rehash();
rehash ();
jstring* ptr = _Jv_StringFindSlot (chrs, length, hash);
if (*ptr != NULL && *ptr != DELETED_STRING)
return (jstring) UNMASK_PTR (*ptr);