Commit Graph

27 Commits

Author SHA1 Message Date
Tom Tromey 93f7aeea7a natString.cc (init): Handle case where DONT_COPY is true and OFFSET!=0.
* java/lang/natString.cc (init): Handle case where DONT_COPY is
	true and OFFSET!=0.
	* java/lang/String.java (String(char[],int,int,boolean): New
	constructor.
	* java/lang/Long.java: Imported new version from Classpath.
	* java/lang/Number.java: Likewise.
	* java/lang/Integer.java: Likewise.
	* java/lang/Long.java: Likewise.
	* java/lang/Float.java: Likewise.
	* java/lang/Boolean.java: Likewise.
	* java/lang/Double.java: Likewise.
	* java/lang/Void.java: Likewise.

From-SVN: r54595
2002-06-13 18:16:26 +00:00
Tom Tromey 5d243e08b8 * java/lang/natString.cc (unintern): Fixed typo.
From-SVN: r53265
2002-05-07 19:07:07 +00:00
Hans Boehm aa0149ff0c natString.cc: correct argument order for _Jv_AllocPtrFreeObj
* java/lang/natString.cc: correct argument order for
	_Jv_AllocPtrFreeObj

From-SVN: r47035
2001-11-15 02:22:52 +00:00
Tom Tromey 3d5aea8366 natIconv.cc (done): New methods.
2001-07-30  Tom Tromey  <tromey@redhat.com>
	    Corey Minyard  <minyard@acm.org>

	* gnu/gcj/convert/natIconv.cc (done): New methods.
	* gnu/gcj/convert/Output_iconv.java (done): New method.
	* gnu/gcj/convert/Input_iconv.java (done): New method.
	* gnu/gcj/convert/UnicodeToBytes.java (defaultEncodingClass):
	Removed.
	(getDefaultEncodingClass): Removed.
	(getDefaultEncoder): Use getEncoder.
	(done): New method.
	(defaultEncoding, CACHE_SIZE, encoderCache, currCachePos): New
	static fields.
	* gnu/gcj/convert/BytesToUnicode.java (defaultDecodingClass):
	Removed.
	(defaultEncoding, CACHE_SIZE, decoderCache, currCachePos): New
	static fields.
	(getDefaultDecodingClass): Removed.
	(getDefaultDecoder): Use getDecoder.
	(getDecoder): Look up decoder in cache.
	(done): New method.
	* java/lang/natString.cc (init): Call `done' on converter.
	(getBytes): Likewise.

Co-Authored-By: Corey Minyard <minyard@acm.org>

From-SVN: r44484
2001-07-30 20:24:18 +00:00
Tom Tromey cb894e07ec natString.cc (init): Throw ArrayIndexOutOfBoundsException.
* java/lang/natString.cc (init): Throw
	ArrayIndexOutOfBoundsException.
	(getChars): Likewise.
	(getBytes): Likewise.
	(valueOf): Likewise.

From-SVN: r42531
2001-05-24 18:06:03 +00:00
Tom Tromey 3610e0d548 [multiple changes]
2001-05-23  Tom Tromey  <tromey@redhat.com>

	* posix-threads.cc (_Jv_self_cache): Renamed from self_cache.
	* gcj/Makefile.in: Rebuilt.
	* gcj/Makefile.am (gcj_HEADERS): Added libgcj-config.h.
	* gcj/javaprims.h: Include gcj/libgcj-config.h.
	* gcj/libgcj-config.h.in: New file.
	* libgcj.spec.in (*jc1): Added @HASH_SYNC_SPEC@.
	* configure: Rebuilt.
	* configure.in: Enable hash synchronization by default on some
	platforms.
	(HASH_SYNC_SPEC): New subst.
	(AC_CONFIG_HEADER): Added gcj/libgcj-config.h.
	Correctly use `test -z' instead of `test -n' in a couple places.
	(JV_HASH_SYNCHRONIZATION): Use AC_DEFINE; don't add to
	LIBGCJ_CXXFLAGS.
	* configure.host (enable_java_net_default): Initialize.
	(enable_hash_synchronization_default): New variable.

2001-05-23  Hans Boehm <Hans_Boehm@hp.com>

	* boehm.cc (_Jv_MarkObj): Don't mark sync_info when hash
	synchronization in use.
	(_Jv_MarkArray): Likewise.
	(_Jv_AllocBytes): Don't check return result.
	(handle_out_of_memory): New function.
	(_Jv_InitGC): Set GC_oom_fn.
	(trace_one_vtable): New global.
	(_Jv_AllocTraceOne): New function.
	* configure.in: Added --enable-hash-synchronization.
	* defineclass.cc, prims.cc, resolve.cc, java/lang/natString.cc,
	java/net/natInetAddress.cc: Remove _Jv_AllocBytesChecked.
	* nogc.cc (_Jv_AllocObj): Throw out-of-memory.
	(_Jv_AllocArray): Likewise.
	(_Jv_AllocBytes): Likewise.
	(_Jv_AllocPtrFreeObject): New function.
	(_Jv_AllocTraceOne): Likewise.
	* posix-threads.cc (_Jv_ThreadRegister): Handle slow
	pthread_self().
	(self_cache): New global.
	(_Jv_ThreadSelf_out_of_line): New function.
	* prims.cc (_Jv_AllocBytesChecked): Removed.
	(_Jv_ThrowNoMemory): New function.
	(_Jv_AllocObject): Don't check for null return from allocator.
	(_Jv_NewObjectArray): Likewise.
	(_Jv_AllocPtrFreeObject): New function.
	(_Jv_NewPrimArray): Allocate pointer-free object if possible.
	* include/javaprims.h (_Jv_AllocPtrFreeObject): Declare.
	(_Jv_MonitorEnter, _Jv_MonitorExit): Don't return value.
	* include/boehm-gc.h (_Jv_AllocObj): Define.
	(_Jv_AllocPtrFreeObj): Define.
	* include/jvm.h (_Jv_AllocPtrFreeObj): Declare.
	(_Jv_ThrowNoMemory): Declare.
	(_Jv_AllocTraceOne): Declare.
	(_Jv_AllocBytesChecked): Removed.
	* include/posix-threads.h (_Jv_MutexInit, _Jv_MutexLock,
	_Jv_MutexUnlock): Handle LOCK_DEBUG.
	(_Jv_ThreadSelf): Handle case where system pthread_self() is
	slow.
	* java/lang/Class.h (Class): Declare _Jv_AllocPtrFreeObj as
	friend.
	* java/lang/Object.h (sync_info): Conditional upon presence of
	hash synchronization.
	* java/lang/natObject.cc: Much new code to handle thin locks and
	hash synchronization.
	* java/lang/natString.cc (_Jv_AllocString): Allocate pointer-free
	object if possible.

From-SVN: r42519
2001-05-24 05:40:37 +00:00
Per Bothner ef0a7b49a9 javaprims.h (_Jv_FormatInt): New declaration.
* gcj/javaprims.h (_Jv_FormatInt):  New declaration.
	* java/lang/natString.cc (_JvFormatInt):  New primitive, with logic
	taken from old Integer.toString code.
	(Integer::valueOf):  Use _Jv_FormatInt.
	* java/lang/Integer.java (toString):  Just use call String.valueOf.
	* java/lang/Long.java (toString):  Fix typo in comment.
	* java/lang/String.java (valueOf(int)):  Make native.
	* java/lang/StringBuffer.java (append(int)):  Make native.
	* java/lang/natStringBuffer.cc:  New file, for append(jint).
	* Makefile.am (ant_source_files):  Add java/lang/natStringBuffer.cc.

From-SVN: r42419
2001-05-21 21:38:37 -07:00
Per Bothner ab9fa4b5d4 natString.cc (_Jv_NewStringUtf8Const): Register finalizer.
* java/lang/natString.cc (_Jv_NewStringUtf8Const):  Register finalizer.
	Recalculate hash, since Utf8Const's hash is only 16 bits.

	* java/lang/natString.cc (_Jv_StringFindSlot, rehash):  Use high-order
	bits of hash to calculate step for chaining.

	* java/lang/natString.cc (intern, _Jv_NewStringUtf8Const):  Rehash
	when 2/3 full, rather than 3/4 full.

From-SVN: r41233
2001-04-10 15:46:11 -07:00
Per Bothner a3b63299e6 natString.cc (intern): If string's data does not point to this String, make a fresh String that does.
* java/lang/natString.cc (intern):  If string's data does not point to
	this String, make a fresh String that does.

	* java/lang/natString.cc (unintern):  Replace by static function.
	* java/lang/String.java (unintern):  Remove method.

From-SVN: r40990
2001-04-01 14:54:10 -07:00
Richard Henderson b3208f56cb exception.cc (java_eh_info): Make value type jthrowable.
* exception.cc (java_eh_info): Make value type jthrowable.
	(_Jv_type_matcher): Remove now unneeded cast.
	(_Jv_Throw): Make argument type jthrowable.  Munge name
	for SJLJ_EXCEPTIONS here ...
	* gcj/cni.h: ... not here.
	(JvThrow): Remove.
	* gcj/javaprims.h (_Jv_Throw, _Jv_Sjlj_Throw): Update declarations.

	* defineclass.cc, interpret.cc, jni.cc, posix-threads.cc,
	prims.cc, resolve.cc, gnu/gcj/runtime/natFirstThread.cc,
	gnu/gcj/xlib/natDrawable.cc, gnu/gcj/xlib/natFont.cc,
	gnu/gcj/xlib/natWMSizeHints.cc, gnu/gcj/xlib/natWindowAttributes.cc,
	gnu/gcj/xlib/natXImage.cc, java/io/natFile.cc,
	java/io/natFileDescriptorEcos.cc, java/io/natFileDescriptorPosix.cc,
	java/io/natFileDescriptorWin32.cc, java/io/natFileWin32.cc,
	java/lang/natClass.cc, java/lang/natClassLoader.cc,
	java/lang/natDouble.cc, java/lang/natObject.cc,
	java/lang/natPosixProcess.cc, java/lang/natRuntime.cc,
	java/lang/natString.cc, java/lang/natSystem.cc,
	java/lang/natThread.cc, java/lang/reflect/natArray.cc,
	java/lang/reflect/natConstructor.cc, java/lang/reflect/natField.cc,
	java/lang/reflect/natMethod.cc, java/util/zip/natDeflater.cc,
	java/util/zip/natInflater.cc:
	Use throw, not JvThrow or _Jv_Throw.

From-SVN: r40838
2001-03-25 23:05:32 -08:00
Tom Tromey 9de8be0b19 natString.cc (rehash): Don't bother with memset; _Jv_AllocBytes returns zero'd memory.
* java/lang/natString.cc (rehash): Don't bother with memset;
	_Jv_AllocBytes returns zero'd memory.  Use _Jv_AllocBytesChecked.
	Use UNMASK_PTR.
	(UNMASK_PTR): New macro.
	(intern): Unmask pointer before returning it.  Register finalizer
	for the string.
	(unintern): Handle case where
	(MASK_PTR): New macro.
	(PTR_MAKSED): Likewise.
	(_Jv_NewStringUtf8Const): Use UNMASK_PTR.

From-SVN: r40593
2001-03-18 00:57:13 +00:00
Bryce McKinlay db5e49032b natMath.cc: Declare fabsf() function.
2000-12-02  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/lang/natMath.cc: Declare fabsf() function.
	* java/lang/mprec.h: Don't include math.h.
	* java/lang/dtoa.c: Include string.h.
	* java/lang/natString.cc (toLowerCase): Initialize ch to prevent
	compiler warning.

From-SVN: r37938
2000-12-02 00:28:44 +00:00
Tom Tromey 9839499072 natString.cc: Include Locale.h.
* java/lang/natString.cc: Include Locale.h.
	(toUpperCase): Added `locale' argument.  Handle locale
	sensitivity.
	(toLowerCase): Added `locale' argument.  Handle locale
	sensitivity.
	(ESSET, CAPITAL_S, SMALL_I, CAPITAL_I_WITH_DOT, SMALL_DOTLESS_I,
	CAPITAL_I): New defines.
	* java/lang/String.java (CASE_INSENSITIVE_ORDER): Now public and
	final.
	Import Locale.
	(toUpperCase, toLowerCase): New methods.  Variants which accept
	locale now native.

	* java/lang/ExceptionInInitializerError.java (printStackTrace):
	New methods.

	* java/util/PropertyPermission.java: Re-merged from Classpath.

	* java/text/RuleBasedCollator.java (getCollationElementIterator):
	New method.
	* java/text/StringCharacterIterator.java: Reindented.
	(setText): New method.

From-SVN: r37539
2000-11-18 02:29:13 +00:00
Tom Tromey 6c80c45e30 Jumbo patch:
* Imported beans and serialization
* Updated IA-64 port
* Miscellaneous bug fixes

From-SVN: r34028
2000-05-19 17:55:34 +00:00
Tom Tromey cc309dd512 natString.cc (intern): Temporarily disable finalizer registration.
* java/lang/natString.cc (intern): Temporarily disable finalizer
	registration.

From-SVN: r33127
2000-04-12 21:17:00 +00:00
Tom Tromey 50b99cc8fe natString.cc (unintern): Added `obj' argument.
* java/lang/natString.cc (unintern): Added `obj' argument.
	(intern): Register finalizer for string.
	* java/lang/String.java (unintern): Now static; added obj
	argument.

From-SVN: r33124
2000-04-12 20:45:59 +00:00
Tom Tromey 2ba5f77454 All files: Updated copyright information.
* All files: Updated copyright information.
	* COPYING: New file.
	* COPYING.LIB: Removed.
	* LIBGCJ_LICENSE: We now use GPL + special exception.

From-SVN: r32387
2000-03-07 19:55:28 +00:00
Tom Tromey 7c734b1758 * All files: Updated copyright to reflect Cygnus purchase.
From-SVN: r31504
2000-01-19 18:39:27 +00:00
Anthony Green b11f64301a natString.cc (init): Test for overflow condition during out of bounds check.
2000-01-09  Anthony Green  <green@cygnus.com>

	* java/lang/natString.cc (init): Test for overflow condition
	during out of bounds check.
	(getChars): Throw StringIndexOutOfBoundsException, not
	ArrayIndexOutOfBoundsException.
	(getBytes): Ditto.
	(regionMatches): Obey case option during string comparison.

	* configure.host (ligcj_interpreter): New variable.  Enable
	interpreter by default on IA-32.
	* configure.in:  Examine libgcj_interpreter.
	* configure: Rebuilt.

From-SVN: r31300
2000-01-09 22:25:54 +00:00
Bryce McKinlay aa620e4294 natString.cc (equalsIgnoreCase): return false if anotherString is null.
* java/lang/natString.cc (equalsIgnoreCase): return false if
        anotherString is null.
        * java/lang/Boolean.java (valueOf): return FALSE if argument is
        null.

From-SVN: r30763
1999-12-02 19:59:30 +00:00
Tom Tromey 27e934d8ba configure: Rebuilt.
* configure: Rebuilt.
	* configure.in: Build include/Makefile.
	* Makefile.in: Rebuilt.
	* Makefile.am (SUBDIRS): Added gcj and include.
	(install-data-local): New target.
	(extra_headers): New macro.
	* include/Makefile.in: New file.
	* include/Makefile.am: New file.

	* interpret.cc: Don't include gcj/field.h or gcj/cni.h.
	* java/lang/reflect/natField.cc: Don't include gcj/field.h or
	gcj/cni.h.
	* boehm.cc: Don't include java-threads.h or gcj/field.h.
	* resolve.cc: Include config.h.
	* defineclass.cc: Include config.h.
	* include/java-interp.h: Don't include config.h.
	* include/jvm.h: Include java-threads.h, Object.h, java-gc.h,
	cni.h.

	* gcj/javaprims.h: Regenerated namespace decls.
	* classes.pl (scan): Don't put `;' after closing brace.

	* Makefile.in: Rebuilt.
	* Makefile.am (INCLUDES): Added -I for top_srcdir.
	* configure.in: Create gcj/Makefile.
	* gcj/Makefile.in: New file.
	* gcj/Makefile.am: New file.
	* java/lang/Object.h: Don't include any other headers.
	* gcj/array.h: Renamed from include/java-array.h.
	* gcj/field.h: Renamed from include/java-field.h.
	* gcj/method.h: Renamed from include/java-method.h.
	* gcj/cni.h, gcj/javaprims.h: Moved from include/.
	Updated all files to reflect new include structure.

From-SVN: r29278
1999-09-10 22:03:10 +00:00
Bryce McKinlay 41296e2a23 natString.cc (substring): optimize where substring is entire String.
1999-07-22  Bryce McKinlay  <bryce@albatross.co.nz>

	* java/lang/natString.cc (substring): optimize where substring is
	entire String.
	* java/io/File.java (getName): don't return separator with file name.
	* java/io/natFile.cc (attr): fix overflow.

From-SVN: r28246
1999-07-26 03:51:44 +01:00
Tom Tromey baa288f308 natString.cc (getBytes): Reverted earlier change and applied correct fix from Per Bothner.
* java/lang/natString.cc (getBytes): Reverted earlier change and
	applied correct fix from Per Bothner.

From-SVN: r26579
1999-04-21 13:50:39 +00:00
Tom Tromey 47e2610954 natString.cc (getBytes): Correctly size result buffer.
* java/lang/natString.cc (getBytes): Correctly size result
	buffer.  From Bryce McKinlay <bryce@albatross.co.nz>.

From-SVN: r26575
1999-04-21 11:49:39 +00:00
Per Bothner a99ce7cae5 InputStreamReader.java (<init>): Set super.in correctly.
�
	* java/io/InputStreamReader.java (<init>):  Set super.in correctly.
	* java/io/OutputStreamWriter.java (<init>):  Set super.in correctly.
	(writeChars):  Don't be quite so eager to flush.
	* java/io/PrintStream.java:  Rewrite.  Now more similar to
	OutputStreamWriter, using explicit UnicodeToBytes converter.
	Also, autoflush does not need to flush so often.
	* java/lang/natString.cc (getBytes):  More efficient algorithm.
 	(init(jbyteArray,jint,jint,jstring)):  More efficient.

From-SVN: r26508
1999-04-16 11:34:58 -07:00
Warren Levy 9a566c0926 natString.cc (init(jbyteArray,jint,jint,jstring)): Set count to 0 when InputStreamReader returns -1 for EOF.
* java/lang/natString.cc (init(jbyteArray,jint,jint,jstring)):
	Set count to 0 when InputStreamReader returns -1 for EOF.

From-SVN: r26273
1999-04-07 19:31:01 +00:00
Tom Tromey ee9dd3721b Initial revision
From-SVN: r26263
1999-04-07 14:42:40 +00:00